/* Header bar height — Layout.css offsets page content by the same value. */
:root {
  --header-h: 88px;
}

@media (max-width: 767px) {
  :root {
    --header-h: 72px;
  }
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: none;
  background: transparent;
  box-shadow: none;
}

.site-header__inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  max-width: 1600px;
  margin: 0 auto;
  padding-block: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

/* 60px in an 88px bar: 14px clear above and below, so the crown never meets the screen edge. */
.brand-link__logo {
  height: 60px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform var(--motion-base) var(--ease-out-quart);
}

.brand-link:hover .brand-link__logo {
  transform: scale(1.06);
}

.brand-link__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 14px;
  line-height: 1.3;
}

.brand-link__name {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--ink-navy);
}

.brand-link__sub {
  font-weight: 500;
  letter-spacing: 0.14em;
  color: #000000;
}

.nav-desktop {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: clamp(22px, 2.4vw, 40px);
  min-width: 0;
}

.nav-link {
  position: relative;
  flex-shrink: 0;
  white-space: nowrap;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  transition: color var(--motion-base) var(--ease-out-quart);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: all var(--motion-base) var(--ease-out-quart);
}

.nav-link:hover {
  color: var(--gold-dark);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.is-active {
  color: var(--gold-dark);
}

.nav-link.is-active::after {
  width: 100%;
}

.header-actions {
  display: none;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
}

.menu-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--foreground);
}

.mobile-panel {
  display: grid;
  grid-template-rows: 0fr;
  border-top: 1px solid transparent;
  background: var(--card);
  opacity: 0;
  transition: grid-template-rows var(--motion-base) var(--ease-out-quart),
    opacity var(--motion-fast) var(--ease-out-quart),
    border-color var(--motion-base) var(--ease-out-quart);
}

.mobile-panel.is-open {
  grid-template-rows: 1fr;
  border-top-color: var(--border-color-light);
  opacity: 1;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
  padding-block: 12px;
}

.mobile-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 500;
  color: var(--foreground);
  transition: var(--transition-smooth);
  transform: translateY(0);
}

.mobile-panel:not(.is-open) .mobile-nav-link,
.mobile-panel:not(.is-open) .mobile-cta {
  transform: translateY(-6px);
}

.mobile-nav-link:hover,
.mobile-nav-link.is-active {
  background: var(--gold-light);
  color: var(--gold-dark);
}

.mobile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  min-height: 50px;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--gold-heritage), var(--gold-text));
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #fffaf1;
  transition: var(--transition-smooth);
}

.mobile-cta:hover {
  filter: brightness(1.08);
}

.nav-link:focus-visible,
.mobile-nav-link:focus-visible,
.mobile-cta:focus-visible,
.header-donate:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .mobile-panel {
    transition: opacity var(--motion-fast) linear, grid-template-rows 0s;
  }

  .mobile-panel:not(.is-open) .mobile-nav-link,
  .mobile-panel:not(.is-open) .mobile-cta {
    transform: none;
  }
}

@media (max-width: 1279px) {
  .site-header__inner {
    gap: 12px;
  }

  .brand-link {
    flex-shrink: 1;
    min-width: 0;
  }

  .brand-link__text {
    min-width: 0;
  }

  .brand-link__name {
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  .menu-toggle {
    flex-shrink: 0;
  }
}

@media (max-width: 767px) {
  .brand-link__logo {
    height: 50px;
  }
}

@media (max-width: 400px) {
  .brand-link__text {
    font-size: 11px;
  }

  .brand-link__logo {
    height: 42px;
  }
}

@media (min-width: 1280px) {
  .nav-desktop,
  .header-actions {
    display: flex;
  }

  .nav-link {
    font-size: 17px;
  }

  .menu-toggle,
  .mobile-panel {
    display: none;
  }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  .nav-desktop {
    gap: 22px;
  }

  .nav-link {
    font-size: 16px;
  }
}
