/* ============================================================
   STONE HOUSE — responsive additions
   The original static design hid the nav links on mobile with no
   replacement. This file adds an accessible hamburger + slate drawer
   in the brand palette, plus a few WordPress-content responsive rules.
   Loaded after main.css so these rules win where needed.
   ============================================================ */

/* --- Hamburger button (hidden on desktop) --- */
.nav-toggle{
  display:none; align-items:center; justify-content:center;
  width:46px; height:46px; padding:0; margin-left:var(--s-4);
  background:transparent; border:1px solid var(--on-slate-line); border-radius:var(--radius);
  cursor:pointer; color:var(--on-slate); transition:border-color .3s var(--ease);
}
.nav-toggle:hover{ border-color:var(--gold-soft); }
.nav-toggle .bars{ display:block; position:relative; width:20px; height:2px; background:currentColor; transition:background .2s var(--ease); }
.nav-toggle .bars::before,
.nav-toggle .bars::after{ content:""; position:absolute; left:0; width:20px; height:2px; background:currentColor; transition:transform .3s var(--ease); }
.nav-toggle .bars::before{ top:-6px; }
.nav-toggle .bars::after{ top:6px; }
body.nav-open .nav-toggle .bars{ background:transparent; }
body.nav-open .nav-toggle .bars::before{ transform:translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle .bars::after{ transform:translateY(-6px) rotate(-45deg); }

/* --- Mobile drawer --- */
.mobile-nav{
  position:fixed; inset:0 0 0 auto; z-index:99; width:min(86vw,360px);
  background:#1b1e20; border-left:1px solid var(--on-slate-line);
  padding:96px var(--s-8) var(--s-12); transform:translateX(105%);
  transition:transform .42s var(--ease); overflow-y:auto;
  box-shadow:-24px 0 60px rgba(16,18,19,.4);
}
body.nav-open .mobile-nav{ transform:translateX(0); }
.mobile-nav ul{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:var(--s-2); }
.mobile-nav a{
  display:block; padding:var(--s-4) 0; color:var(--on-slate-soft); text-decoration:none;
  font-family:var(--display); font-size:1.4rem; border-bottom:1px solid var(--on-slate-line);
  transition:color .3s var(--ease);
}
.mobile-nav a:hover{ color:var(--gold-soft); }
.mobile-nav .btn{ margin-top:var(--s-8); width:100%; justify-content:center; }
.mobile-nav-backdrop{
  position:fixed; inset:0; z-index:98; background:rgba(16,18,19,.55);
  opacity:0; pointer-events:none; transition:opacity .42s var(--ease);
}
body.nav-open .mobile-nav-backdrop{ opacity:1; pointer-events:auto; }
body.nav-open{ overflow:hidden; }

@media(max-width:900px){
  .nav-toggle{ display:inline-flex; }
  /* keep the desktop links hidden on small screens for ALL nav variants */
  .nav .nav-links{ display:none; }
}
@media(min-width:901px){
  .mobile-nav, .mobile-nav-backdrop{ display:none; }
}

/* --- WordPress editor content responsiveness --- */
.entry-content img{ max-width:100%; height:auto; }
.entry-content{ max-width:var(--measure); }

/* --- Generic single / archive niceties --- */
.page-hero{ background:var(--slate); color:var(--on-slate); }
.page-hero .wrap{ padding-top:var(--s-32); padding-bottom:var(--s-16); }

@media(max-width:760px){
  .foot-grid{ grid-template-columns:1fr 1fr; gap:var(--s-8); }
}
@media(max-width:520px){
  .foot-grid{ grid-template-columns:1fr; }
}

/* ============================================================
   THEME COMPONENTS (added for the WordPress build)
   ============================================================ */

/* Inner-page hero copy column (reuses .ahero base from the design system) */
.ahero-copy{ display:flex; flex-direction:column; }

/* Pricing cards */
.sh-pcard-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:var(--s-8); margin-top:var(--s-16); }
.sh-pcard{ display:flex; flex-direction:column; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; background:var(--paper); }
.sh-pcard .plate{ aspect-ratio:4/3; }
.sh-pcard-body{ padding:var(--s-8); display:flex; flex-direction:column; gap:var(--s-3); flex:1; }
.sh-pcard-price{ margin:0; }
.sh-pcard-price .lab{ font-size:var(--t-label); text-transform:uppercase; letter-spacing:.12em; color:var(--ink-muted); }
.sh-pcard-price .amt{ font-family:var(--display); font-weight:500; font-size:1.5rem; color:var(--gold-deep); margin-left:6px; }
.sh-pcard-desc{ color:var(--ink-soft); font-size:var(--t-small); }
.sh-pcard-feats{ list-style:none; margin:var(--s-2) 0; padding:0; display:flex; flex-direction:column; gap:var(--s-2); }
.sh-pcard-feats li{ position:relative; padding-left:var(--s-6); font-size:var(--t-small); color:var(--ink-soft); }
.sh-pcard-feats li::before{ content:"—"; position:absolute; left:0; color:var(--gold-deep); }
.sh-pcard-body .link-cta{ margin-top:auto; }
@media(max-width:900px){ .sh-pcard-grid{ grid-template-columns:repeat(2,1fr); } }
@media(max-width:600px){ .sh-pcard-grid{ grid-template-columns:1fr; } }

/* FAQ (native <details>, brand-styled — distinct from the JS accordion) */
.sh-faq{ max-width:880px; margin-top:var(--s-16); border-top:1px solid var(--line); }
.sh-faq-item{ border-bottom:1px solid var(--line); }
.sh-faq-q{ list-style:none; cursor:pointer; padding:var(--s-6) 0; font-family:var(--display); font-weight:500;
  font-size:1.25rem; color:var(--ink); display:flex; align-items:center; justify-content:space-between; gap:var(--s-4); }
.sh-faq-q::-webkit-details-marker{ display:none; }
.sh-faq-q::after{ content:"+"; font-size:1.5rem; color:var(--gold-deep); transition:transform var(--dur) var(--ease); }
.sh-faq-item[open] .sh-faq-q::after{ transform:rotate(45deg); }
.sh-faq-a{ padding:0 0 var(--s-8); color:var(--ink-soft); font-size:var(--t-body); max-width:70ch; }

/* Single entry layout */
.single-layout{ display:grid; grid-template-columns:.9fr 1.1fr; gap:var(--s-16); align-items:start; }
.single-figure .plate{ aspect-ratio:4/5; }
.single-body .entry-content{ max-width:none; }
@media(max-width:860px){ .single-layout{ grid-template-columns:1fr; } }

/* Archive / blog list */
.archive-list{ display:grid; gap:var(--s-12); margin-top:var(--s-8); max-width:820px; }
.archive-item{ padding-bottom:var(--s-8); border-bottom:1px solid var(--line); }
.archive-item h2{ margin:0 0 var(--s-2); }
.archive-item a{ color:inherit; text-decoration:none; }
.archive-item a:hover{ color:var(--gold-deep); }
.archive-nav{ margin-top:var(--s-16); display:flex; gap:var(--s-3); }
.archive-nav .page-numbers{ padding:8px 14px; border:1px solid var(--line); border-radius:var(--radius);
  text-decoration:none; color:var(--ink); }
.archive-nav .page-numbers.current{ background:var(--slate); color:var(--stone); border-color:var(--slate); }

/* Contact page */
.contact-grid{ display:grid; grid-template-columns:1.2fr .8fr; gap:var(--s-16); margin-top:var(--s-8); align-items:start; }
.contact-band .trust3{ padding-left:0; padding-right:0; }
@media(max-width:860px){ .contact-grid{ grid-template-columns:1fr; } }

/* Page hero (default page / single / archive) */
.page-hero{ background:var(--slate); color:var(--on-slate); }
.page-hero .display-l, .page-hero .display-xl{ color:var(--on-slate); margin-top:var(--s-3); }
.page-hero .eyebrow{ color:var(--gold-soft); }

/* Footer extra widget strip */
.footer-extra-wrap{ padding:var(--s-12) 0; }


/* ============================================================
   MOBILE HEADER FIT - 2026-07-22
   Root cause of the mobile layout blowout: at narrow widths the
   sticky header row (brand lockup + full CTA + hamburger) could
   not shrink below ~536px, which expanded the layout viewport;
   every 100%-wide section then covered only ~2/3 of the screen
   and a blank strip appeared on the right. This fixes the header
   itself so no page exceeds the real viewport. No overflow
   masking is used.
   ============================================================ */
@media(max-width:900px){
  .nav-inner{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto auto;
    align-items:center;
    width:100%;
    min-width:0;
    gap:var(--s-3);
    padding:0 var(--s-4);
  }
  .nav-inner .brand{ min-width:0; }
  .nav-over .brand-lockup{ transform:none; }
  .nav .btn-gold{ padding:10px 14px; font-size:.8125rem; white-space:nowrap; }
  .nav-toggle{ margin-left:0; }
}
@media(max-width:480px){
  .brand-text .tagline{ display:none; }
  .brand-lockup .mono{ font-size:1.3rem; }
  .brand-lockup .word{ font-size:.92rem; letter-spacing:.12em; }
}
@media(max-width:430px){
  .nav .btn-gold{ padding:9px 11px; font-size:.75rem; }
  .brand-lockup .word{ font-size:.85rem; }
}
@media(max-width:375px){
  /* Very small screens: the header CTA is hidden; the same CTA
     remains inside the mobile menu and the contact dock. */
  .nav .btn-gold{ display:none; }
}
/* Media never wider than the viewport (root-cause safety, not masking) */
main img, main video, main iframe{ max-width:100%; height:auto; }


/* ============================================================
   MOBILE GRID COLLAPSES - 2026-07-22 (root-cause fixes)
   Shared grids below had no narrow-viewport rules (or were
   overridden by Customizer CSS with !important) and forced
   multi-column layouts wider than small screens.
   ============================================================ */
/* Homepage "why families": Customizer Additional CSS forces
   repeat(4,1fr)!important, defeating the theme's own <=980px
   collapse. body-prefixed selector out-specifies it. */
@media(max-width:980px){
  body .why-grid{ grid-template-columns:1fr !important; }
}
/* Homepage families columns (3 fixed columns, no mobile rule) */
@media(max-width:900px){
  .fam-cols{ grid-template-columns:1fr; }
}
/* Granite color cards: 3 columns overflow below ~390px */
@media(max-width:480px){
  .mats-grid{ grid-template-columns:repeat(2,1fr); }
}
/* Contact channel cards: 4 fixed columns, no mobile rule */
@media(max-width:900px){
  .channels-grid{ grid-template-columns:repeat(2,1fr); }
}
@media(max-width:520px){
  .channels-grid{ grid-template-columns:1fr; }
}
/* Decorative hero watermark bleeds right by design; .hero/.chero/
   .mhero already clip it - make the remaining heroes match. */
@media(max-width:900px){
  .khero,.ahero{ overflow:hidden; }
}

/* Long CTA labels: .btn is nowrap by design; on phones let buttons
   wrap instead of widening the page (header CTA stays nowrap). */
@media(max-width:600px){
  main .btn{ white-space:normal; text-align:center; }
}
/* Service-area columns: tighten min column width on small phones */
@media(max-width:480px){
  .area-wrap{ grid-template-columns:1fr; }
  .areas .area-wrap > *{ min-width:0; }
}

/* Homepage pricing preview: two fixed columns, no mobile rule */
@media(max-width:860px){
  .pricing-grid{ grid-template-columns:1fr; }
  .pricing-grid > *{ min-width:0; }
}

/* Homepage service areas: 3 fixed columns, no mobile rule */
@media(max-width:760px){
  .areas-grid{ grid-template-columns:1fr; }
}
@media(min-width:481px) and (max-width:760px){
  .areas-grid{ grid-template-columns:1fr 1fr; }
}


/* ============================================================
   HOMEPAGE HERO FIT - 2026-07-23
   .hero-content is a flex item of .hero-bleed-inner; flexbox's
   default min-width:auto computes an automatic minimum (~357px)
   larger than the available content box on small screens, so the
   column refuses to shrink and .hero-bleed's overflow:hidden clips
   the eyebrow/heading/copy on the right. min-width:0 restores
   normal shrinking; width/max-width let the column fill the box.
   Mobile-only; desktop unchanged.
   ============================================================ */
@media(max-width:900px){
  .hero-bleed-inner{ min-width:0; }
  .hero-content{ width:100%; max-width:100%; min-width:0; }
  .hero-lead{ max-width:100%; }
}
/* Homepage gallery cards: two columns cannot fit below ~380px
   (card min-content ~133px) - stack to a single column. */
@media(max-width:380px){
  .gal-grid{ grid-template-columns:1fr; }
}

/* ============================================================
   MOBILE CONTACT DOCK - 2026-07-23
   Fixed bottom bar (Call | Message | Send a Note). Markup is
   injected by assets/js/contact-dock.js from the same window.SH
   data as the desktop contact rail. Shown exactly where the
   desktop rail hides (<=860px) so the two never coexist.
   ============================================================ */
.sh-mdock{ display:none; }
@media(max-width:860px){
  .sh-mdock{ position:fixed; z-index:97; left:0; right:0; bottom:0;
    display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
    width:100%; max-width:100%; background:#232629;
    border-top:1px solid #3A3E41; padding-bottom:env(safe-area-inset-bottom); }
  .sh-mdock__item{ min-width:0; min-height:64px; display:flex; flex-direction:column;
    align-items:center; justify-content:center; gap:5px; padding:8px 4px;
    color:#E9E9E7; text-align:center; text-decoration:none;
    font-family:'Inter',system-ui,sans-serif; }
  .sh-mdock__item + .sh-mdock__item{ border-left:1px solid #3A3E41; }
  .sh-mdock__icon{ width:20px; height:20px; color:#C9A24C; display:flex; }
  .sh-mdock__icon svg{ width:20px; height:20px; stroke:currentColor; fill:none;
    stroke-width:1.4; stroke-linecap:round; stroke-linejoin:round; }
  .sh-mdock__label{ font-size:11px; line-height:1.2; letter-spacing:.04em; white-space:nowrap; }
  .sh-mdock__item:focus-visible{ outline:2px solid #C9A24C; outline-offset:-3px; }
  .sh-mdock__item:active{ background:rgba(233,233,231,.08); }
  body.nav-open .sh-mdock{ visibility:hidden; pointer-events:none; }
  .foot{ padding-bottom:calc(64px + env(safe-area-inset-bottom)); }
}
