.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  background: transparent;
  transition: background 0.3s;
}
/* Catch-all: every link inside header is white */
.site-header a {
  color: #fff !important;
}
/* Override Drupal menu.css "ul.menu a.is-active { color: #000 }" */
.site-header ul.menu a.is-active,
.site-header .main-menu a.is-active,
.site-header .main-menu__link.is-active {
  color: #fff !important;
}


/* Front page: dark gradient vignette so white logo/nav are always readable */
.path-frontpage .site-header {
  background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 100%);
}

/* Light background on inner pages (Figma: #CAC7C7) */
body:not(.path-frontpage) .site-header {
  background: #CAC7C7;
}

/* Dark links on inner pages (override catch-all white) */
body:not(.path-frontpage) .site-header a,
body:not(.path-frontpage) .site-header .main-menu__link {
  color: #1a1a1a !important;
}
body:not(.path-frontpage) .site-header .site-name a,
body:not(.path-frontpage) .site-header__brand .site-name a {
  color: #1a1a1a !important;
}
body:not(.path-frontpage) .site-header ul.menu a.is-active,
body:not(.path-frontpage) .site-header .main-menu a.is-active,
body:not(.path-frontpage) .site-header .main-menu__link.is-active {
  color: #1a1a1a !important;
}
body:not(.path-frontpage) .site-header .main-menu__link:hover {
  background: rgba(0, 0, 0, 0.08);
}
/* Logo: white SVG → dark on light header */
body:not(.path-frontpage) .site-header .site-logo img,
body:not(.path-frontpage) .site-header__brand img {
  filter: brightness(0);
}

.site-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 50px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Убираем лишние отступы блока Drupal внутри шапки */
.site-header__brand .block {
  margin: 0;
  padding: 0;
}

/* Логотип */
.site-header__brand .site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.site-header__brand .site-logo img {
  height: 46px;
  width: auto;
}

.site-header__brand .site-name {
  margin: 0;
  line-height: 1;
}

.site-header__brand .site-name a {
  font-family: var(--font-primary);
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  color: #fff !important;
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Главное меню */
.main-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-menu__item {
  margin: 0;
}

.main-menu__link {
  display: block;
  padding: 8px 22px;
  font-family: var(--font-primary);
  font-size: 25px;
  font-weight: 500;
  color: #fff !important;
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.main-menu__link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.main-menu__link--active {
  background: var(--color-accent);
  color: var(--color-black);
  font-weight: var(--font-weight-bold);
}

/* Основной контент — отступ под фиксированную шапку */
.layout-container > main {
  padding-top: 90px;
}

/* Explicit white overrides for front page header elements */
.path-frontpage .site-header .main-menu__link {
  color: #fff;
}
.path-frontpage .site-header .main-menu__link:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.path-frontpage .site-header .site-name a {
  color: #fff;
}

/* Logo white on front page (filter ensures any SVG color becomes white) */
.path-frontpage .site-header .site-logo img,
.path-frontpage .site-header .site-header__logo img,
.path-frontpage .site-header__brand img {
  filter: brightness(0) invert(1);
}

/* Nav links white on front page with maximum specificity */
.path-frontpage .site-header nav a,
.path-frontpage .site-header .main-menu .main-menu__link,
.path-frontpage .site-header .main-menu a.is-active {
  color: #ffffff !important;
}

/* ── DRUPAL ADMIN TOOLBAR OFFSET ───────────────────────────── */
body.toolbar-horizontal .site-header { top: 39px; }
body.toolbar-horizontal.toolbar-tray-open .site-header { top: 79px; }

/* ── OVERLAY HEADER (transparent, floats over hero) ──────────── */
/* Must override fixed position and #CAC7C7 bg from inner-pages rule above */
.site-header--overlay {
  position: absolute !important;
  background: transparent !important;
}
body:not(.path-frontpage) .site-header--overlay {
  background: transparent !important;
}
body:not(.path-frontpage) .site-header--overlay a,
body:not(.path-frontpage) .site-header--overlay .main-menu__link {
  color: #fff !important;
}
body:not(.path-frontpage) .site-header--overlay .main-menu__link--active,
body:not(.path-frontpage) .site-header--overlay .main-menu__link.is-active {
  background: var(--color-accent, #7BE800);
  color: #000 !important;
}
body:not(.path-frontpage) .site-header--overlay .site-header__brand img {
  filter: brightness(0) invert(1);
}
body:not(.path-frontpage) .site-header--overlay .site-name a {
  color: #fff !important;
}
/* Remove main padding-top for overlay header pages (hero starts at top) */
.layout-container:has(.site-header--overlay) > main {
  padding-top: 0;
}
