/* ===================================================================
   AGEWELL ALLIANCE — LAYOUT
   Site chrome (header + nav + dropdowns + mobile toggle), page-hero
   blocks for inner pages, footer, section dividers, scroll indicator,
   container/section helpers, the responsive breakpoint cascade, and
   prefers-reduced-motion respect rules.

   Load order: AFTER tokens.css, BEFORE components.css. Many
   components rely on the responsive breakpoints being in scope first
   for their own @media-query overrides to win at equal specificity.
   =================================================================== */

/* ===== HEADER + NAV + LAYOUT HELPERS ===== */
/* ===== HEADER ===== */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.25rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background: transparent;
}
#site-header.scrolled {
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  padding: 0.75rem 3rem;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 4px 30px rgba(0,0,0,0.3);
}
#site-header.header-solid {
  background: rgba(10, 22, 40, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  z-index: 10;
}
.logo-shield { width: 42px; height: 42px; }
.logo-shield svg { width: 100%; height: 100%; }
.logo-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}
.logo-text span { color: var(--gold); }

.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a {
  color: rgba(255,255,255,0.75);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.3s;
  letter-spacing: 0.01em;
  position: relative;
}
.nav a:hover { color: var(--gold); }
.nav a.active { color: var(--gold); }
.nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: -1rem;
  padding-top: 0.75rem;
  min-width: 220px;
  z-index: 100;
}
.nav-dropdown:hover .nav-dropdown-content { display: block; }
.nav-dropdown-inner {
  background: var(--navy-mid);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  box-shadow: var(--shadow-xl);
}
.nav-dropdown-inner a {
  display: block !important;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  color: rgba(255,255,255,0.85) !important;
  min-height: auto !important;
}
.nav-dropdown-inner a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--gold) !important;
}
.nav-dropdown-inner a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.nav-cta {
  background: var(--gold) !important;
  color: var(--navy) !important;
  padding: 0.6rem 1.35rem !important;
  border-radius: var(--radius-sm);
  font-weight: 600 !important;
  transition: all 0.3s !important;
  white-space: nowrap;
}
.nav-cta:hover {
  background: var(--gold-light) !important;
  transform: translateY(-1px);
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  z-index: 10;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all 0.3s;
  display: block;
}
.mobile-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== LAYOUT HELPERS ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 2rem; }
.container-lg { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }

.section { padding: 7rem 0; }
.section-sm { padding: 4rem 0; }
.section-lg { padding: 10rem 0; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 1rem;
}
.section-label-light { color: var(--gold); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.section-title-white { color: var(--white); }
.section-title em { font-style: normal; color: var(--gold-text); }
.section-title-white em { color: var(--gold); }
.section-title .red { color: var(--red); }
.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 600px;
}
.section-subtitle-light { color: rgba(255,255,255,0.7); }
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }


/* ===== PAGE HERO (inner pages) ===== */
/* ===== PAGE HERO (for inner pages) ===== */
.page-hero {
  background: var(--navy);
  padding: 10rem 0 5rem;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 168, 76, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.2);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}
.page-hero h1 em { font-style: normal; color: var(--gold); }
.page-hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.75);
  max-width: 600px;
  line-height: 1.7;
}
.page-hero .breadcrumb {
  margin-bottom: 2rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
}
.page-hero .breadcrumb a { color: rgba(255,255,255,0.75); transition: color 0.3s; }
.page-hero .breadcrumb a:hover { color: var(--gold); }
.page-hero .breadcrumb span { margin: 0 0.5rem; }


/* ===== FOOTER + SECTION DIVIDERS + SCROLL INDICATOR + NAV HOVER GLOW ===== */
/* ===== FOOTER ===== */
#site-footer {
  background: #060e1a;
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-grid {
  display: grid;
  /* SEO link-pyramid footer: brand + 5 keyword-anchored nav columns */
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
@media (max-width: 1180px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; max-width: 600px; }
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.footer-logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}
.footer-logo-text span { color: var(--gold); }
.footer-brand p { color: rgba(255,255,255,0.65); font-size: 0.85rem; line-height: 1.6; max-width: 300px; }
.footer-col h4, .footer-heading {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}
.footer-col a {
  display: block;
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
  transition: color 0.3s;
}
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-bottom p { font-size: 0.75rem; color: rgba(255,255,255,0.55); line-height: 1.6; }
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { font-size: 0.75rem; color: rgba(255,255,255,0.55); transition: color 0.3s; }
.footer-legal a:hover { color: var(--gold); }

/* ===== APPLE-STYLE SECTION DIVIDERS ===== */
.section-gradient-divider {
  height: 120px;
  background: linear-gradient(to bottom, var(--cream), var(--white));
}
.section-gradient-divider-dark {
  height: 120px;
  background: linear-gradient(to bottom, var(--navy), #060e1a);
}

/* ===== APPLE-STYLE SMOOTH SCROLL INDICATOR ===== */
@keyframes scroll-hint {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(10px); opacity: 1; }
}
.scroll-indicator {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: scroll-hint 2.5s ease-in-out infinite;
}
.scroll-indicator span {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.scroll-indicator svg {
  width: 20px;
  height: 20px;
  color: rgba(255,255,255,0.6);
}

/* ===== APPLE-STYLE HOVER GLOW FOR LINKS ===== */
.nav a::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.nav a:hover::before {
  width: 100%;
  left: 0;
}
.nav a.active::before { display: none; }


/* ===== PAGE-HERO PHOTO VARIANT ===== */
/* ===== PAGE-HERO PHOTO VARIANT =====
   Full-bleed photo background with navy gradient overlay.
   Apply by adding .has-photo to .page-hero, then including:
     <picture class="hero-bg" aria-hidden="true">...</picture>
     <div class="hero-overlay" aria-hidden="true"></div>
   inside the section, before .container. */
.page-hero.has-photo {
  position: relative;
  overflow: hidden;
  padding: 11rem 0 5rem;
  /* Tall enough that object-fit:cover doesn't aggressively crop
     the mosaics — viewers see most/all of the people tiles. */
  min-height: clamp(640px, 82vh, 980px);
  display: flex;
  align-items: center;
  background: var(--navy);
}
.page-hero.has-photo::before { display: none !important; }
.page-hero.has-photo .hero-bg {
  position: absolute; inset: 0; z-index: 1; margin: 0;
  background: var(--navy);
}
.page-hero.has-photo .hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.page-hero.has-photo .hero-overlay {
  position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(90deg, rgba(10,22,40,0.92) 0%, rgba(10,22,40,0.78) 45%, rgba(10,22,40,0.55) 100%),
    linear-gradient(180deg, rgba(10,22,40,0.25) 0%, rgba(10,22,40,0.55) 100%);
}
.page-hero.has-photo .container { position: relative; z-index: 3; }
.page-hero.has-photo .container > * { max-width: 720px; }
@media (max-width: 768px) {
  .page-hero.has-photo .hero-overlay {
    background: linear-gradient(180deg, rgba(10,22,40,0.78) 0%, rgba(10,22,40,0.92) 100%);
  }
}


/* ===== RESPONSIVE + REDUCED MOTION ===== */
/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2-1, .grid-1-2, .grid-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .comp-header div, .comp-row div { padding: 0.7rem 0.85rem; font-size: 0.78rem; }
}
@media (max-width: 768px) {
  #site-header { padding: 1rem 1.5rem; }
  #site-header.scrolled { padding: 0.75rem 1.5rem; }
  .nav { display: none; }
  .mobile-toggle { display: flex; }
  .nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 22, 40, 0.98);
    padding: 5rem 2rem 2rem;
    gap: 0.75rem;
    backdrop-filter: blur(20px);
    z-index: 5;
  }
  .nav.mobile-open a { font-size: 1.1rem; padding: 0.5rem 0; }
  .nav.mobile-open .nav-dropdown-content {
    display: block;
    position: static;
    padding-top: 0;
  }
  .nav.mobile-open .nav-dropdown-inner {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 0 1rem;
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 4rem 0; }
  .section-lg { padding: 6rem 0; }
  .page-hero { padding: 8rem 0 3rem; }
  .container { padding: 0 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .cta-banner { padding: 2.5rem 1.5rem; }
  .policy-card.featured { transform: none; }
  .policy-card.featured:hover { transform: translateY(-6px); }
  .nav a::before { display: none; }
  .trust-compare { grid-template-columns: 1fr !important; gap: 1rem !important; }
  .trust-compare > div:nth-child(2) { display: none; }
  .mission-grid { grid-template-columns: 1fr !important; gap: 2rem !important; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.1s !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-3d, .reveal-clip {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }
  .sonar-ring { animation: none !important; opacity: 0.3; transform: scale(1) !important; }
}

