/**
 * Camino Companions — Astra Site Builder Header
 * File:    assets/css/astra-site-header.css
 * Enqueued by: camino-companions.php → wp_enqueue_scripts + enqueue_block_editor_assets
 * Owner:   Astra Pro Site Builder Header — NOT frontend.css
 * Version: 3.5.35
 *
 * Confirmed Astra Site Builder wrapper structure (from staging DevTools):
 *
 *   <header class="ast-custom-header">
 *     <div class="astra-advanced-hook-6056">
 *       <header class="wp-block-group alignfull cc-astra-site-header">
 *         ...
 *       </header>
 *     </div>
 *   </header>
 *
 * Background state — confirmed on staging (v3.5.28–v3.5.31)
 * ────────────────────────────────────────────────────────────
 * astra-site-header.js writes background-color directly to .cc-astra-site-header
 * via element.style.setProperty('background-color', 'rgba(22,25,36,progress)', 'important').
 * The "important" priority flag guarantees the inline style wins any author
 * stylesheet regardless of specificity or source order (including Astra Pro
 * dynamic CSS). CSS carries only the static rules below; the scroll-linked
 * fade is owned entirely by JavaScript.
 * Background is painted on .cc-astra-site-header only; outer wrappers are
 * kept transparent on the homepage so no layer compounds the fade.
 *
 * Homepage overlay — position only
 * ─────────────────────────────────
 * The header is in normal document flow; it reserves a row above the hero.
 * body.home .ast-custom-header { position: absolute } removes it from flow
 * on the homepage, overlaying the hero behind it.
 *
 * Inner pages
 * ───────────
 * No body.home class → no position override → header in flow → navy via Astra.
 *
 * Three-zone desktop layout
 * ──────────────────────────
 *   CSS Grid: 1fr [logo] | auto [nav] | 1fr [cta]
 *   The nav column is auto-sized and centred; logo and CTA each fill one equal
 *   fraction. The CTA right-aligns within its cell; the logo left-aligns within
 *   its cell. Navigation is visually centred in the header regardless of the
 *   width difference between logo and CTA.
 */

/* ─────────────────────────────────────────────────────────────────
   FONT IMPORT
───────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ─────────────────────────────────────────────────────────────────
   BRAND TOKENS
───────────────────────────────────────────────────────────────── */
:root {
  --cc-ah-navy:       #161924;
  --cc-ah-gold:       #ECBC86;
  --cc-ah-white:      #ffffff;
  --cc-ah-white-dim:  rgba(255, 255, 255, 0.82);
  --cc-ah-gold-hover: rgba(236, 188, 134, 0.12);
  --cc-ah-transition: 0.28s ease;
}

/* ─────────────────────────────────────────────────────────────────
   BASE — inner pages always navy
   Paints #161924 on the innermost block only. Outer Astra wrappers
   (.ast-custom-header, .astra-advanced-hook-6056) carry no background
   from us — they remain at the browser default (transparent).
   On the homepage this rule is overridden by the progress rule below.
───────────────────────────────────────────────────────────────── */
.cc-astra-site-header {
  background-color: #161924;
}

/* ─────────────────────────────────────────────────────────────────
   LEGACY OVERLAY — position (no !important)
   On the accepted legacy Homepage, Astra Header Builder has overlay
   mode ENABLED. Astra's own CSS sets position:absolute initially and
   its sticky JS writes position:fixed inline when the user scrolls.
   Our rule confirms the initial absolute state; Astra's inline sticky
   JS overrides it on scroll because we carry no !important here.
   Do not add !important — it would block Astra's sticky mechanism.
───────────────────────────────────────────────────────────────── */
body.home .ast-custom-header,
body.page-id-6074 .ast-custom-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
}

/* ─────────────────────────────────────────────────────────────────
   SEMANTIC OVERLAY — position:fixed (persistent across all scroll)
   On pages carrying body.cc-overlay-header, Astra Header Builder
   does NOT have overlay mode enabled, so Astra applies no sticky
   or overlay treatment of its own. position:fixed is required here
   because:
   1. It removes the header from document flow → Hero begins at y:0
      behind the transparent header (no reserved header-height gap).
   2. It keeps the header at the top of the viewport at ALL scroll
      positions → header never disappears when scrolling.
   3. It requires no cooperation from Astra's sticky JS.
   !important is required: Astra's dynamic CSS (generated inline in
   the page head) may use ID specificity or !important on position
   for pages where overlay mode is not configured. Without it, Astra
   wins and the header stays in flow → navy strip above the Hero.
   The JS background animation (transparent → navy as the user
   scrolls) is purely cosmetic and does not interact with position.
───────────────────────────────────────────────────────────────── */
body.cc-overlay-header .ast-custom-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 100 !important;
}

/* ─────────────────────────────────────────────────────────────────
   ADMIN TOOLBAR OFFSET — logged-in users only
   WordPress admin bar is position:fixed; height:32px on desktop
   (≥783 px) and position:absolute; height:46px on mobile (≤782 px).
   On desktop our fixed header must sit below the admin bar (top:32px).
   On mobile the admin bar scrolls away, so top:0 is correct there.
   Scoped to body.admin-bar (added by WordPress when logged in with
   the toolbar enabled). Ordinary logged-out frontend: unaffected.
───────────────────────────────────────────────────────────────── */
body.admin-bar.cc-overlay-header .ast-custom-header {
  top: 32px !important;
}

@media screen and (max-width: 782px) {
  body.admin-bar.cc-overlay-header .ast-custom-header {
    top: 0 !important;
  }
}

/* ─────────────────────────────────────────────────────────────────
   OVERLAY — outer wrappers stay transparent
   Prevents outer layers from adding a background on top of the inner
   progress-driven layer; without this, any Astra-supplied background
   on .ast-custom-header or .astra-advanced-hook-6056 would bleed
   through behind the scroll-linked fade on .cc-astra-site-header.
───────────────────────────────────────────────────────────────── */
body.home .ast-custom-header,
body.home .astra-advanced-hook-6056,
body.page-id-6074 .ast-custom-header,
body.page-id-6074 .astra-advanced-hook-6056,
body.cc-overlay-header .ast-custom-header,
body.cc-overlay-header .astra-advanced-hook-6056 {
  background-color: transparent !important;
  box-shadow: none !important;
}

/* ─────────────────────────────────────────────────────────────────
   OVERLAY — inner header block initial transparency
   The base rule .cc-astra-site-header { background-color:#161924 }
   applies to ALL pages. On the legacy Homepage, Astra Pro's own
   overlay-header configuration pre-clears the background before any
   CSS from this plugin loads. On semantic overlay pages (body.cc-
   overlay-header) Astra applies no such treatment, so the navy base
   rule fires and persists until JavaScript sets rgba(22,25,36,0) via
   setProperty on DOMContentLoaded.
   This rule provides the correct CSS initial state so the inner block
   is transparent from the first paint. JavaScript then builds the
   scroll-linked rgba animation on top of this transparent base.
   !important is required to beat the unscoped base rule.
───────────────────────────────────────────────────────────────── */
body.cc-overlay-header .cc-astra-site-header {
  background-color: transparent !important;
}

/* ─────────────────────────────────────────────────────────────────
   OVERLAY-HEADER PAGES — clear Astra content-area top offset
   Astra may still apply padding-top equal to the header height on
   content-area wrappers even when the header is position:fixed (out
   of flow). This pushes the first block down and creates a visible
   gap above the Hero. All known Astra content wrappers are targeted.
   Scoped to body.cc-overlay-header — ordinary inner pages unchanged.
───────────────────────────────────────────────────────────────── */
body.cc-overlay-header .site-content,
body.cc-overlay-header #content,
body.cc-overlay-header .ast-site-content-wrap,
body.cc-overlay-header #primary.content-area,
body.cc-overlay-header .site-main,
body.cc-overlay-header .ast-container {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* ─────────────────────────────────────────────────────────────────
   HOMEPAGE FULL-WIDTH — confirmed by live DOM audit 2026-07-31
   Viewport: 740px. Body classes present: cc-home-page (true),
   cc-overlay-header (true), home (false).

   Ancestor chain rendered widths (outermost → innermost):
     body                                          740px
     #page.hfeed.site                              740px
     #content.site-content                         740px
     .ast-container          padding:20px/20px      740px
     #primary.content-area                         700px
     main#main.site-main                           700px
     article#post-5985                             700px
     .entry-content.clear    padding:0px/0px        700px
     .wp-block-group.cc-home-page
       margin:-20px/-20px, padding:50px/50px        740px
     .wp-block-cover.cc-hero-section               640px ◄ CONSTRAINED

   What the chain shows:
   .ast-container (padding:20px/20px) reduces #primary to 700px.
   The cc-home-page outer group compensates with margin:-20px/-20px,
   correctly reaching 740px (full viewport). Our max-width/margin
   rules on .ast-container are applied and working; .entry-content
   padding is already 0.

   The ACTUAL constraint is the outer group's own padding:50px/50px.
   Child alignfull blocks should break out via Gutenberg's
   is-layout-flow rule:
     .is-layout-flow > .alignfull {
       margin-left: calc(var(--wp--style--root--padding-left) * -1)
     }
   But --wp--style--root--padding-left is 0px (the group padding is a
   computed CSS value, not a CSS custom property), so the breakout
   resolves to 0 and the hero stays at 740 - 50 - 50 = 640px.

   CONFIRMED MINIMUM FIX: zero the outer group horizontal padding.
   Every child section is alignfull and manages its own internal
   horizontal padding. No section relies on the outer 50px.

   Scoped to body.cc-home-page and body.home (legacy homepage).
   Does NOT affect Tours or any other overlay-header page.
───────────────────────────────────────────────────────────────── */

/* Retained: guard against max-width / margin on .ast-container
   in other Astra configurations or viewport breakpoints. */
body.cc-home-page .ast-container,
body.home .ast-container {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.cc-home-page .entry-content,
body.home .entry-content {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* CONFIRMED FIX — live DOM audit 2026-07-31:
   .wp-block-group.cc-home-page (is-layout-flow) padding:50px all sides.
   L/R: constrains child alignfull blocks to 640px — zeroed in v3.5.36.
   Top: outer group rect.top 46px + pTop 50px = hero rect.top 96px,
        leaving 50px of transparent header over navy background (dark strip).
        Zeroing removes the strip. Bottom not measured — left unchanged. */
body.cc-home-page .wp-block-group.cc-home-page,
body.home .wp-block-group.cc-home-page {
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ─────────────────────────────────────────────────────────────────
   TOURS PAGE FULL-WIDTH — mirrors Homepage architecture (v3.5.39)
   Same three-rule pattern as body.cc-home-page above.
   Removes Astra ancestor constraints so the outer cc-tours-page
   group and its alignfull children reach full viewport width
   natively, without calc() negative-margin tricks.
───────────────────────────────────────────────────────────────── */
body.cc-tours-page .ast-container {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.cc-tours-page .entry-content {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.cc-tours-page .wp-block-group.cc-tours-page {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ─────────────────────────────────────────────────────────────────
   HOMEPAGE FADE — owned by JavaScript
   astra-site-header.js sets background-color on .cc-astra-site-header
   directly via style.setProperty(..., 'important'), overriding any
   author stylesheet. No CSS rule is needed here for the fade; one
   would be redundant and risk re-introducing cascade conflicts.
───────────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────────
   INNER NAV BAR — CSS Grid three-zone layout
   Column 1: logo  (1fr, left-aligned)
   Column 2: nav   (auto, visually centred regardless of logo/CTA width)
   Column 3: cta   (1fr, right-aligned)
───────────────────────────────────────────────────────────────── */
.cc-astra-site-header__inner {
  max-width: 1400px;
  margin-left:  auto;
  margin-right: auto;
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  padding: 0.75rem clamp(2rem, 4vw, 3.5rem);
}

/* ─────────────────────────────────────────────────────────────────
   LOGO — compact circular emblem
───────────────────────────────────────────────────────────────── */
.cc-astra-site-header__logo {
  justify-self: start;
  margin: 0 !important;
}

.cc-astra-site-header__logo img {
  height: 50px !important;
  width: auto !important;
  display: block !important;
}

.cc-astra-site-header__logo a {
  display: block;
  line-height: 0;
}

/* ─────────────────────────────────────────────────────────────────
   NAVIGATION — wp:navigation block
───────────────────────────────────────────────────────────────── */
.cc-astra-site-header__nav {
  justify-self: center;
  display: flex !important;
  justify-content: center !important;
}

.cc-astra-site-header__nav .wp-block-navigation {
  justify-content: center !important;
}

.cc-astra-site-header__nav .wp-block-navigation__container {
  gap: 0 !important;
  justify-content: center !important;
}

/* Individual nav links */
.cc-astra-site-header__nav .wp-block-navigation-item__content {
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--cc-ah-white-dim) !important;
  padding: 0.4rem 0.875rem !important;
  text-decoration: none !important;
  transition: color var(--cc-ah-transition) !important;
  white-space: nowrap;
}

.cc-astra-site-header__nav .wp-block-navigation-item__content:hover {
  color: var(--cc-ah-gold) !important;
}

/* Active / current page */
.cc-astra-site-header__nav .wp-block-navigation-item.current-menu-item > a,
.cc-astra-site-header__nav .wp-block-navigation-item.current-page-ancestor > a {
  color: var(--cc-ah-gold) !important;
}

/* ─── Hamburger toggle button ─── */
.cc-astra-site-header__nav .wp-block-navigation__responsive-container-open,
.cc-astra-site-header__nav .wp-block-navigation__responsive-container-close {
  color: var(--cc-ah-gold) !important;
}

.cc-astra-site-header__nav .wp-block-navigation__responsive-container-open svg,
.cc-astra-site-header__nav .wp-block-navigation__responsive-container-close svg {
  fill:   var(--cc-ah-gold) !important;
  stroke: var(--cc-ah-gold) !important;
}

/* ─── Mobile overlay panel ─── */
.cc-astra-site-header__nav .wp-block-navigation__responsive-container.is-menu-open {
  background-color: var(--cc-ah-navy) !important;
}

.cc-astra-site-header__nav
  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item__content {
  font-family: 'Poppins', sans-serif !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--cc-ah-white-dim) !important;
  padding: 0.85rem 1.5rem !important;
}

.cc-astra-site-header__nav
  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item__content:hover {
  color: var(--cc-ah-gold) !important;
}

/* ─────────────────────────────────────────────────────────────────
   CTA BUTTON
───────────────────────────────────────────────────────────────── */
.cc-astra-site-header__cta {
  justify-self: end;
}

.cc-astra-site-header__cta.wp-block-buttons {
  margin: 0 !important;
}

/* ghost pill */
.cc-astra-header-cta-btn .wp-block-button__link,
.cc-astra-site-header__cta .wp-block-button__link {
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.6rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
  color: var(--cc-ah-gold) !important;
  background-color: transparent !important;
  border: 1px solid var(--cc-ah-gold) !important;
  border-radius: 9999px !important;
  padding: 0.55rem 1.35rem !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition:
    background-color var(--cc-ah-transition),
    color            var(--cc-ah-transition) !important;
}

.cc-astra-header-cta-btn .wp-block-button__link:hover,
.cc-astra-site-header__cta .wp-block-button__link:hover {
  background-color: var(--cc-ah-gold) !important;
  color: var(--cc-ah-navy) !important;
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────────────── */

/* Tablet — compress grid padding */
@media (max-width: 1024px) {
  .cc-astra-site-header__inner {
    padding: 0.75rem clamp(1.25rem, 3vw, 2rem);
  }

  .cc-astra-site-header__logo img {
    height: 44px !important;
  }

  .cc-astra-site-header__nav .wp-block-navigation-item__content {
    padding: 0.4rem 0.5rem !important;
  }
}

/* Mobile — collapse to logo + hamburger row */
@media (max-width: 640px) {
  .cc-astra-site-header__inner {
    grid-template-columns: auto 1fr auto !important;
    padding: 0.75rem 1.25rem;
  }

  .cc-astra-site-header__logo img {
    height: 40px !important;
  }

  .cc-astra-site-header__cta .wp-block-button__link {
    font-size: 0.55rem !important;
    padding: 0.45rem 0.9rem !important;
    letter-spacing: 0.12em !important;
  }
}

/* TABLET HAMBURGER (staging fix A, 2026-11-05): core wp:navigation switches to full nav at >=600px; keep the hamburger up to 1024px. Revert = delete this block. */@media (min-width: 600px) and (max-width: 1024px) {  .cc-astra-site-header__nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }  .cc-astra-site-header__nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }}
