/* ==========================================================================
   BABRI STONE — LAYOUT: HEADER, NAV, FOOTER
   ========================================================================== */

/* ---- Top utility bar ---- */
.topbar {
  position: relative;
  background: var(--ink);
  color: var(--stone-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
/* A slim brass edge along the very top of the page — the first thing
   painted, and a quiet, immediate signal of the brand before any other
   content has even loaded. A static pseudo-element background costs
   nothing extra to render. */
.topbar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-brass);
}
.topbar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.topbar a { color: var(--stone-soft); transition: color 0.25s var(--ease); }
.topbar a:hover { color: var(--brass-light); }
.topbar-links { display: flex; gap: var(--space-md); align-items: center; min-width: 0; }
.topbar-links a { white-space: nowrap; }
/* Below ~620px the email cannot fit beside the phone number and would render
   as clipped text ("info@babristone.c…"). Drop it rather than truncate; the
   phone stays as the primary contact and the footer still carries the email. */
@media (max-width: 620px) {
  .topbar-links a[href^="mailto"] { display: none; }
}
.topbar-phone { display: inline-flex; align-items: center; gap: 0.4rem; }
.topbar-phone svg { width: 12px; height: 12px; fill: var(--brass-light); flex-shrink: 0; }
.topbar-social { display: flex; gap: var(--space-sm); align-items: center; flex-shrink: 0; }
.topbar-social svg { width: 14px; height: 14px; fill: currentColor; }
.topbar-social a { display: flex; }

/* ---- Site header / nav ----------------------------------------------------
   Logo left · primary links centred · Request a Quote as the single
   highlighted action on the right. Sticky at all breakpoints.
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--stone-soft);
  transition: box-shadow 0.3s var(--ease);
  /* Scroll progress hairline lives here — see .scroll-progress below */
}
/* The blurred glass background lives on a ::before instead of directly on
   .site-header. `backdrop-filter`/`filter` on an element establishes a new
   containing block for any `position: fixed` descendant — and .main-nav
   (the mobile off-canvas panel) is exactly that. With the filter on
   .site-header itself, the fixed panel was being positioned relative to the
   header instead of the viewport, pushing its translated-off box past the
   right edge of the *document* and creating a permanent, invisible
   horizontal scroll track on every page at mobile widths. Isolating the
   filter to a non-positioned pseudo-element keeps the glass effect without
   turning the header into a containing block. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(247, 243, 234, 0.94);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  transition: background 0.3s var(--ease);
}
.site-header.is-scrolled {
  box-shadow: 0 1px 0 rgba(28,26,23,0.04), 0 10px 30px rgba(28,26,23,0.07);
}
.site-header.is-scrolled::before {
  background: rgba(247, 243, 234, 0.97);
}

/* ---- Scroll progress hairline ---- */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0%;
  background: var(--gradient-brass);
  transition: width 0.1s linear;
  pointer-events: none;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* keep .wrap's horizontal padding — a bare `0.75rem 0` shorthand would zero it
     and pin the logo to the very edge of the screen */
  padding: 0.75rem var(--space-md);
  gap: var(--space-md);
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.25s var(--ease);
}
.brand:hover { opacity: 0.78; }
/* Transparent PNG — intrinsic ratio 720x293, never stretched */
.brand img {
  height: 40px;
  width: auto;
  max-width: none;
  transition: height 0.3s var(--ease);
}

.main-nav {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}
.main-nav > ul {
  display: flex;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  gap: clamp(0.85rem, 1.6vw, 1.6rem);
  position: relative;
}
.main-nav a {
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  position: relative;
  display: block;
  padding: 0.5rem 0.15rem;
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0.1rem;
  height: 1px;
  background: var(--brass);
  transition: right 0.32s var(--ease);
}
.main-nav a:hover { color: var(--brass-dark); }
.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after { right: 0; }
.main-nav a[aria-current="page"] { color: var(--brass-dark); }

/* Soft indicator that glides beneath whichever link is hovered — tracked in
   JS (main.js) via each link's offsetLeft/offsetWidth. Sits under the text,
   above the static underline, so hovering feels alive without competing
   with the persistent "current page" mark. */
.nav-indicator {
  position: absolute;
  bottom: -1px;
  height: 28px;
  border-radius: 3px;
  background: var(--ivory-deep);
  opacity: 0;
  transform: translateY(2px);
  transition: transform 0.4s var(--ease), opacity 0.25s var(--ease), left 0.35s var(--ease), width 0.35s var(--ease);
  pointer-events: none;
  z-index: -1;
}
.main-nav > ul:hover .nav-indicator { opacity: 1; transform: translateY(0); }
@media (max-width: 1040px) { .nav-indicator { display: none; } }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
  margin-left: var(--space-md);
}
.nav-actions .btn {
  padding: 0.72rem 1.4rem;
  font-size: 0.85rem;
  box-shadow: 0 1px 2px rgba(28,26,23,0.10);
}
.nav-actions .btn-primary:hover { transform: translateY(-1px); }

/* ---- Hamburger ---- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  margin-right: -0.5rem;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.32s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Scrim behind the mobile panel */
.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(28,26,23,0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
  z-index: 98;
}
body.nav-open .nav-scrim { opacity: 1; visibility: visible; }

/* ---- Tablet: tighten the link row before collapsing ---- */
@media (max-width: 1140px) and (min-width: 1041px) {
  .main-nav > ul { gap: 0.8rem; }
  .main-nav a { font-size: 0.82rem; }
  .nav-actions .btn { padding: 0.68rem 1.15rem; font-size: 0.8rem; }
}

/* ---- Mobile / small tablet: slide-in panel ---- */
@media (max-width: 1040px) {
  .topbar-links span.topbar-hours { display: none; }
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(400px, 88vw);
    background: var(--ivory);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: calc(var(--space-lg) + 1.2rem) var(--space-lg) var(--space-lg);
    transform: translateX(101%);
    transition: transform 0.38s var(--ease), visibility 0.38s var(--ease);
    /* hidden while closed: keeps the panel out of the tab order and stops the
       off-canvas box from extending the page's scrollable area */
    visibility: hidden;
    z-index: 99;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -20px 0 60px rgba(28,26,23,0.16);
    overscroll-behavior: contain;
  }
  .main-nav.is-open { transform: translateX(0); visibility: visible; }

  .main-nav > ul {
    flex-direction: column;
    gap: 0;
    margin: 0;
    width: 100%;
  }
  .main-nav > ul li { border-bottom: 1px solid var(--stone-soft); }
  .main-nav > ul li:first-child { border-top: 1px solid var(--stone-soft); }
  .main-nav a {
    display: block;
    padding: 1.05rem 0;
    font-family: var(--font-display);
    font-size: 1.28rem;
    white-space: normal;
  }
  .main-nav a::after { display: none; }
  .main-nav a[aria-current="page"] { color: var(--brass); }

  /* Staggered entrance for the panel links — short and fast */
  .main-nav.is-open > ul li {
    animation: navItemIn 0.34s var(--ease) both;
  }
  .main-nav.is-open > ul li:nth-child(1) { animation-delay: 0.04s; }
  .main-nav.is-open > ul li:nth-child(2) { animation-delay: 0.07s; }
  .main-nav.is-open > ul li:nth-child(3) { animation-delay: 0.10s; }
  .main-nav.is-open > ul li:nth-child(4) { animation-delay: 0.13s; }
  .main-nav.is-open > ul li:nth-child(5) { animation-delay: 0.16s; }
  .main-nav.is-open > ul li:nth-child(6) { animation-delay: 0.19s; }
  .main-nav.is-open > ul li:nth-child(7) { animation-delay: 0.22s; }
  .main-nav.is-open > ul li:nth-child(8) { animation-delay: 0.25s; }
  @keyframes navItemIn {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: translateX(0); }
  }

  .main-nav .nav-actions {
    flex-direction: column;
    align-items: stretch;
    margin: var(--space-lg) 0 0;
    gap: var(--space-sm);
  }
  .main-nav .nav-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
  }
  .nav-phone {
    justify-content: center;
    padding: 0.6rem 0;
    font-size: 0.95rem;
  }
  /* the base .nav-phone rule is declared later in this file, so it wins on
     source order; re-assert the panel layout here with matching specificity */
  .main-nav .nav-actions .nav-phone {
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
  }

  .nav-toggle { display: flex; }
  body.nav-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .main-nav.is-open > ul li { animation: none; }
}

.main-nav .nav-phone {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.main-nav .nav-phone svg { width: 15px; height: 15px; fill: var(--brass); flex-shrink: 0; }

/* ---- Footer ---- */
.site-footer {
  background: var(--ink);
  color: var(--stone-soft);
  padding: var(--space-2xl) 0 var(--space-lg);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.15fr;
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(203, 192, 172, 0.18);
}
/* Light logo variant — a real transparent PNG, no filter hacks */
.footer-brand img { height: 38px; width: auto; max-width: none; margin-bottom: var(--space-md); }
.footer-brand p { color: var(--stone-soft); max-width: 32ch; font-size: 0.93rem; }
.footer-social { display: flex; gap: var(--space-sm); margin-top: var(--space-md); }
.footer-social a {
  width: 38px; height: 38px;
  border: 1px solid rgba(203, 192, 172, 0.35);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.footer-social a:hover { background: var(--gradient-brass); border-color: var(--brass); transform: translateY(-2px); box-shadow: var(--shadow-gold); }
.footer-social svg { width: 16px; height: 16px; fill: var(--ivory); }

.footer-col h4 {
  color: var(--brass-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: var(--space-md);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col li { color: var(--stone-soft); font-size: 0.93rem; }
.footer-col a, .footer-col address { font-size: 0.93rem; color: var(--stone-soft); font-style: normal; transition: color 0.25s var(--ease); }
.footer-col a:hover { color: var(--brass-light); }
.footer-col .hours-row { display: flex; justify-content: space-between; gap: var(--space-sm); font-size: 0.88rem; }
.footer-col .hours-row span:first-child { color: var(--ivory); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
  font-size: 0.82rem;
  color: var(--taupe);
}
.footer-bottom p { color: var(--taupe); margin: 0; }
.footer-bottom-links { display: flex; gap: var(--space-md); list-style: none; padding: 0; margin: 0; }
.footer-bottom-links a { color: var(--taupe); }
.footer-bottom-links a:hover { color: var(--brass-light); }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-lg) var(--space-md); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}


.inner-page .scroll-progress { display: none; }

