/* ── Canonical Site Header — alexdryclean.net ────────────────── */

/* Canvas behind/above the page (iOS overscroll bounce, safe-area gaps)
   carries the same horizontal gradient as the header, so pulling down
   on mobile shows gradient — not a mismatched solid. Body backgrounds
   paint over this for the actual page area. theme-color stays solid
   #0f172a (platform limitation — meta tags can't take gradients). */
html {
  background: linear-gradient(90deg, #0f172a 0%, #1a3c5a 45%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  /* Canonical ADV header gradient (bible: brand_colors.adv_header_gradient).
     Deep navy at the left edge → lighter ADV navy by 45%, light-dominant.
     Explicit hex (not var(--navy)) so every page renders identically. */
  background: linear-gradient(90deg, #0f172a 0%, #1a3c5a 45%);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  /* Typography pinned here so header text never inherits page body styles
     (body line-height differs per page and shifted the brand tagline). */
  font-family: 'Montserrat', system-ui, sans-serif;
  line-height: 1.65;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-group:hover { text-decoration: none; }

.logo-group img {
  display: block;
  height: 44px;
  width: auto;
}

.brand-name {
  display: flex;
  flex-direction: column;
}

.brand-main {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.brand-sub {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

/* ── Desktop nav ──────────────────────────────────────────────── */
.header-nav {
  display: flex;
  gap: 0.2rem;
}

.nav-link {
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

/* ── Right-side actions ───────────────────────────────────────── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ── Phone button + popover ───────────────────────────────────── */
.phone-wrap {
  position: relative;
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.header-phone:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

.phone-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 148px;
  overflow: hidden;
  z-index: 300;
}

.phone-popover[hidden] { display: none; }

.phone-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  color: #0f172a;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s;
  font-family: inherit;
}

.phone-option:hover {
  background: #f4f0ea;
  text-decoration: none;
}

.phone-option + .phone-option {
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* ── CTA buttons ──────────────────────────────────────────────── */
.btn-header-solid {
  background: #fff;
  color: var(--navy, #0f172a);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.btn-header-solid:hover {
  opacity: 0.88;
  text-decoration: none;
}

.btn-header-outline {
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.btn-header-outline:hover {
  opacity: 0.85;
  text-decoration: none;
}

/* ── Hamburger button (mobile only) ───────────────────────────── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.hamburger-btn:hover { background: rgba(255,255,255,0.1); }

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.22s, opacity 0.15s;
}

.hamburger-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile nav drawer ────────────────────────────────────────── */
.mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0f172a;
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 199;
}

.mobile-nav[hidden] { display: none; }

.mobile-nav-link {
  display: block;
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 14px 24px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s, color 0.15s;
}

.mobile-nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  text-decoration: none;
}

.mobile-nav-link[aria-current="page"] { color: #c9a84c; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .header-nav { display: none; }
  .hamburger-btn { display: flex; }
  /* Tablet range (641-900px) must fit on one row without overflow:
     logo ~88 + phone icon ~30 + Pricing ~70 + Schedule ~115 + hamburger 34
     + gaps/padding ≈ 425px. The tagline (~230px) and phone number text
     (~90px) don't fit alongside both CTA buttons — collapse them here,
     not just at ≤640px. */
  .brand-sub { display: none; }
  .phone-num-text { display: none; }
  .header-phone { padding: 0.4rem 0.5rem; }
}

@media (max-width: 640px) {
  /* Must fit a 360px viewport: logo 68 + phone 28 + Pricing ~52 + Schedule ~100
     + hamburger 30 + gaps/padding ≈ 320px total */
  .site-header { padding: 0.6rem 0.65rem; gap: 0.3rem; }
  .logo-group { gap: 0; }
  .logo-group img { height: 34px; }
  .brand-sub { display: none; }
  /* Phone: icon only — number text hidden to save space for Pricing button */
  .phone-num-text { display: none; }
  .header-phone { padding: 0.3rem 0.35rem; }
  .header-actions { gap: 0.35rem; }
  .btn-header-solid { font-size: 0.7rem; padding: 0.35rem 0.5rem; }
  .btn-header-outline { font-size: 0.7rem; padding: 0.35rem 0.5rem; }
  .hamburger-btn { width: 30px; height: 30px; gap: 4px; }
  .hamburger-btn span { width: 16px; }
  .hamburger-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .hamburger-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* ── iOS notch / landscape safe-area ──────────────────────────────
   Pages use viewport-fit=cover so backgrounds bleed edge-to-edge
   (no letterbox "box"); header keeps its content inside the safe zone. */
@supports (padding: max(0px)) {
  .site-header {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    /* Extend the header's gradient up behind the status bar / notch
       (viewport-fit=cover): background fills the inset, content clears it. */
    padding-top: calc(0.85rem + env(safe-area-inset-top));
  }
  .mobile-nav-link {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }
  @media (max-width: 640px) {
    .site-header {
      padding-left: max(0.65rem, env(safe-area-inset-left));
      padding-right: max(0.65rem, env(safe-area-inset-right));
      padding-top: calc(0.6rem + env(safe-area-inset-top));
    }
  }
}
