/* Rooyesh 1Mag Header — scoped to masthead + plugin chrome only. No global body text colors. */

:root {
  --r1m-accent: #c62828;
  --r1m-ink: #1a1a1a;
  --r1m-meta-bg: #111111;
  --r1m-muted: #6b7280;
  --r1m-surface: #ffffff;
  --r1m-nav: #1a1a1a;
  --r1m-gap: 1rem;
  --r1m-radius: 6px;
  --r1m-ease: 200ms ease;
}

/* —— Meta bar —— */
.rooyesh-1mag-meta {
  background: var(--r1m-meta-bg);
  color: #e5e7eb;
  font-size: 0.8125rem;
  line-height: 1.4;
  position: relative;
  z-index: 1002;
}
.rooyesh-1mag-meta__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 42px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.rooyesh-1mag-meta__date time {
  color: #e5e7eb;
  font-weight: 500;
  letter-spacing: 0;
}
.rooyesh-1mag-search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  min-width: 44px;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-radius: var(--r1m-radius);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background var(--r1m-ease), color var(--r1m-ease);
}
.rooyesh-1mag-search-toggle:hover,
.rooyesh-1mag-search-toggle[aria-expanded="true"] {
  background: var(--r1m-accent);
  color: #fff;
}
.rooyesh-1mag-search-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.rooyesh-1mag-search-panel {
  background: #0a0a0a;
  border-top: 1px solid #2a2a2a;
  padding: 0.75rem 1rem 1rem;
}
.rooyesh-1mag-search-panel[hidden] {
  display: none !important;
}
.rooyesh-1mag-search-form {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.rooyesh-1mag-search-form input[type="search"] {
  flex: 1;
  min-height: 44px;
  border: 1px solid #333;
  border-radius: var(--r1m-radius);
  padding: 0.5rem 0.85rem;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.95rem;
}
.rooyesh-1mag-search-form input[type="search"]::placeholder {
  color: #9ca3af;
}
.rooyesh-1mag-search-form button {
  min-height: 44px;
  min-width: 88px;
  padding: 0 1rem;
  border: 0;
  border-radius: var(--r1m-radius);
  background: var(--r1m-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--r1m-ease);
}
.rooyesh-1mag-search-form button:hover {
  filter: brightness(1.08);
}

/* —— Brand row (existing ColorMag markup) —— */
body.wp-theme-colormag-pro #cm-masthead.cm-header {
  background: var(--r1m-surface);
  border-bottom: 0;
  box-shadow: none;
}
body.wp-theme-colormag-pro #cm-masthead .cm-main-header {
  display: flex;
  flex-direction: column;
}
body.wp-theme-colormag-pro #cm-header-1 {
  padding-block: 0.65rem;
  background: var(--r1m-surface);
}
body.wp-theme-colormag-pro #cm-header-1 .cm-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
body.wp-theme-colormag-pro #cm-header-1 .cm-header-col-1 {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  margin: 0;
  float: none !important;
  width: auto !important;
}
body.wp-theme-colormag-pro #cm-header-1 .cm-header-col-2 {
  display: none;
}
body.wp-theme-colormag-pro #cm-site-branding {
  margin: 0 !important;
  flex: 0 0 auto;
}
body.wp-theme-colormag-pro #cm-site-branding .custom-logo-link img,
body.wp-theme-colormag-pro #cm-site-branding .custom-logo {
  max-height: 56px;
  width: auto;
  height: auto;
  display: block;
}
body.wp-theme-colormag-pro #cm-site-info {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.1rem;
  margin: 0 !important;
  line-height: 1.2;
}
body.wp-theme-colormag-pro #cm-site-info .cm-site-title,
body.wp-theme-colormag-pro #cm-site-info .cm-site-title a,
body.wp-theme-colormag-pro .cm-header .cm-site-title,
body.wp-theme-colormag-pro .cm-header .cm-site-title a {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 1.65rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  color: var(--r1m-ink) !important;
  text-decoration: none !important;
  white-space: nowrap;
}
body.wp-theme-colormag-pro #cm-site-info .cm-site-title a:hover,
body.wp-theme-colormag-pro .cm-header .cm-site-title a:hover {
  color: var(--r1m-accent) !important;
}
body.wp-theme-colormag-pro #cm-site-info .cm-site-description,
body.wp-theme-colormag-pro .cm-header .cm-site-description {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: var(--r1m-muted) !important;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* —— Primary nav —— */
body.wp-theme-colormag-pro #cm-header-2,
body.wp-theme-colormag-pro #cm-primary-nav {
  background: var(--r1m-nav) !important;
}
body.wp-theme-colormag-pro #cm-primary-nav {
  position: sticky;
  top: 0;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
body.wp-theme-colormag-pro #cm-primary-nav .cm-container,
body.wp-theme-colormag-pro #cm-primary-nav .cm-row {
  max-width: 1200px;
  margin: 0 auto;
}
body.wp-theme-colormag-pro #cm-primary-nav .cm-row {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.5rem 0 1rem;
}
body.wp-theme-colormag-pro #cm-primary-nav .cm-menu-primary-container > ul,
body.wp-theme-colormag-pro #cm-primary-nav .menu {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
body.wp-theme-colormag-pro #cm-primary-nav .menu > li > a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 1rem;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: background var(--r1m-ease), border-color var(--r1m-ease), color var(--r1m-ease);
}
body.wp-theme-colormag-pro #cm-primary-nav .menu > li > a:hover,
body.wp-theme-colormag-pro #cm-primary-nav .menu > li > a:focus-visible {
  background: rgba(198, 40, 40, 0.92);
  border-bottom-color: #fff;
  color: #fff !important;
  outline: none;
}
body.wp-theme-colormag-pro #cm-primary-nav .menu > li.current-menu-item > a,
body.wp-theme-colormag-pro #cm-primary-nav .menu > li.current_page_item > a {
  background: var(--r1m-accent);
  border-bottom-color: #fff;
}
body.wp-theme-colormag-pro #cm-primary-nav .cm-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0.35rem;
  cursor: pointer;
  color: #fff;
}
body.wp-theme-colormag-pro #cm-primary-nav .cm-menu-toggle svg {
  fill: #fff;
  width: 22px;
  height: 22px;
}

/* —— Ticker —— */
.rooyesh-1mag-ticker {
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  z-index: 50;
}
.rooyesh-1mag-ticker__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 40px;
}
.rooyesh-1mag-ticker__badge {
  flex: 0 0 auto;
  background: var(--r1m-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 3px;
  letter-spacing: 0;
  white-space: nowrap;
}
.rooyesh-1mag-ticker__track-wrap {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  min-width: 0;
}
.rooyesh-1mag-ticker__track {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
  width: max-content;
  animation: rooyesh1magTicker 40s linear infinite;
}
.rooyesh-1mag-ticker__track a {
  color: var(--r1m-ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color var(--r1m-ease);
}
.rooyesh-1mag-ticker__track a:hover,
.rooyesh-1mag-ticker__track a:focus-visible {
  color: var(--r1m-accent);
}
.rooyesh-1mag-ticker:hover .rooyesh-1mag-ticker__track {
  animation-play-state: paused;
}

@keyframes rooyesh1magTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

/* RTL: ticker moves toward the logical start */
html[dir="rtl"] .rooyesh-1mag-ticker__track {
  animation-name: rooyesh1magTickerRtl;
}
@keyframes rooyesh1magTickerRtl {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .rooyesh-1mag-ticker__track {
    animation: none !important;
    flex-wrap: wrap;
    white-space: normal;
    width: auto;
    gap: 0.75rem 1.25rem;
  }
  .rooyesh-1mag-search-toggle,
  .rooyesh-1mag-search-form button,
  body.wp-theme-colormag-pro #cm-primary-nav .menu > li > a {
    transition: none;
  }
}

/* —— Mobile —— */
@media (max-width: 768px) {
  .rooyesh-1mag-meta__inner {
    min-height: 40px;
  }
  .rooyesh-1mag-search-toggle__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  body.wp-theme-colormag-pro #cm-header-1 {
    padding-block: 0.5rem;
  }
  body.wp-theme-colormag-pro #cm-site-branding .custom-logo-link img,
  body.wp-theme-colormag-pro #cm-site-branding .custom-logo {
    max-height: 44px;
  }
  body.wp-theme-colormag-pro #cm-site-info .cm-site-title {
    font-size: 1.25rem !important;
  }
  body.wp-theme-colormag-pro #cm-primary-nav .cm-menu-toggle {
    display: inline-flex !important;
  }
  body.wp-theme-colormag-pro #cm-primary-nav .cm-menu-primary-container {
    width: 100%;
  }
  body.wp-theme-colormag-pro #cm-primary-nav .menu > li > a {
    min-height: 44px;
    padding: 0 0.85rem;
    font-size: 0.9rem;
  }
  .rooyesh-1mag-ticker__inner {
    padding: 0.4rem 0.75rem;
  }
  .rooyesh-1mag-ticker__badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
}
