/* =======================================================================
   LAYOUT.CSS — page shell, header, sections, containers
   Uses theme CSS variables:
     --bg --surface --card --text --muted --border --accent
   ======================================================================= */

/* Hooks if you need dark-specific tweaks later (safe to keep empty) */
html[data-theme="dark"] .site-header {}
body.dark-mode .site-header {}

/* ---------------------------------------
   Page/container width
---------------------------------------- */
.container{
  max-width:1200px;
  margin-inline:auto;
  padding-inline:1rem;
}

/* ---------------------------------------
   HEADER: logo | nav | actions
---------------------------------------- */
.site-header{
  background:var(--bg);
  color:var(--text);
  border-bottom:1px solid var(--border);
  position:relative;
  z-index:1000;
}

/* Header row (works on all pages; beats stray flex rules) */
.site-header .container.header-bar,
.container.header-bar.gs-header{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) max-content minmax(0,1fr);
  align-items:center;
  gap:24px;
  min-height:84px;
  padding:12px 20px;
}

/* Brand / nav / actions placement */
.site-header .brand{ justify-self:start; display:flex; align-items:center; min-width:0; line-height:0; }
.site-header .header-nav{ justify-self:center; max-width:100%; position:static !important; transform:none !important; flex:initial !important; margin:0 !important; }
.site-header .header-actions{ justify-self:end; display:flex; align-items:center; gap:12px; position:relative; z-index:1001; }

/* Bigger logo without changing header height */
:root{ --logo-h: 98px; --logo-scale: 1.28; --logo-y: -2px; }
.site-header .brand img.custom-logo,
.site-header .brand .brand_logo{
  height: var(--logo-h);
  max-height: var(--logo-h);
  width: auto;
  display: block;
  transform-origin: left center;
  transform: translateY(var(--logo-y)) scale(var(--logo-scale));
}
@media (max-width:900px){
  :root{ --logo-scale: 1.14; --logo-y: -1px; }
}

/* Menu row */
.site-header .header-nav .menu{
  display:flex; align-items:center; gap:28px;
  margin:0; padding:0; list-style:none;
}
.site-header .header-nav .menu > li{ margin:0; padding:0; }
.site-header .header-nav a{
  color:var(--text);
  text-decoration:none;
  padding:10px 8px;
  line-height:1;
  border-radius:8px;
  transition:background-color .15s ease,color .15s ease;
}
.site-header .header-nav a:hover{
  background: color-mix(in srgb, var(--text) 10%, transparent);
}
.site-header .header-nav a[aria-current="page"]{ color:var(--accent); font-weight:600; }

/* ---------------------------------------
   DARK-MODE TOGGLE (SVG layered, no emoji flash)
---------------------------------------- */
.dark-toggle{
  position:relative; z-index:1002;
  width:64px; height:34px; padding:0;
  border:1px solid var(--border); border-radius:999px;
  background: color-mix(in srgb, var(--text) 12%, transparent); /* track */
  cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
  font-size:0 !important; line-height:0 !important; color:transparent !important; overflow:hidden;
}
.dark-toggle .thumb{
  position:absolute; top:2px; left:2px;
  width:30px; height:30px; border-radius:50%;
  background:#fff; /* white behind sun */
  box-shadow:0 1px 2px rgba(0,0,0,.12);
  transition:transform .22s ease, background-color .22s ease;
  display:grid; place-items:center; overflow:hidden; z-index:1;
}
.dark-toggle .ico{
  position:absolute; inset:0; margin:auto;
  width:18px; height:18px; pointer-events:none;
  transition:opacity .18s ease; color:var(--text) !important; z-index:2;
}
.dark-toggle .ico.moon{ opacity:0; }
.dark-toggle[aria-pressed="true"] .thumb{ transform:translateX(30px); background:#3a3a3a; }
.dark-toggle[aria-pressed="true"] .ico.sun{  opacity:0; }
.dark-toggle[aria-pressed="true"] .ico.moon{ opacity:1; }
html[data-theme="dark"] .dark-toggle .thumb{ transform:translateX(30px); background:#3a3a3a; }
html[data-theme="dark"] .dark-toggle .ico.sun{ opacity:0; }
html[data-theme="dark"] .dark-toggle .ico.moon{ opacity:1; }
@media (prefers-reduced-motion:reduce){
  .dark-toggle .thumb,.dark-toggle .ico{ transition:none; }
}

/* ---------------------------------------
   Generic nav + mobile drawer (non-header use)
---------------------------------------- */
.nav{ display:flex; justify-content:center; align-items:center; gap:28px; }
.nav a{
  padding:10px 8px; line-height:1; border-radius:8px;
  color:var(--text); text-decoration:none;
}
.nav a:hover{ background: color-mix(in srgb, var(--text) 8%, transparent); }
body.dark-mode .nav a:hover{ background: color-mix(in srgb, #fff 10%, transparent); }
.nav a[aria-current="page"]{ color:var(--accent); font-weight:600; }
.nav ul{ list-style:none; margin:0; padding:0; display:flex; gap:2rem; }
.nav ul li{ margin:0; padding:0; }
.nav ul li a{ text-decoration:none; }

/* Drawer trigger */
.menu-toggle{
  display:inline-grid; width:40px; height:40px;
  border:0; background:transparent; cursor:pointer;
  border-radius:999px; font-size:18px;
}

@media (max-width:900px){
  .nav{
    position:fixed; top:0; right:0; bottom:0;
    width:80vw; max-width:360px; padding:56px 20px 20px;
    background:var(--card); border-left:1px solid var(--border);
    box-shadow:-8px 0 24px rgba(0,0,0,.12);
    flex-direction:column; align-items:flex-start; gap:8px;
    transform:translateX(100%); transition:transform .22s ease; z-index:1001;
  }
  .nav.is-open{ transform:translateX(0); }
  .nav a{ padding:10px 6px; font-size:1.05rem; }

  .nav__close{
    position:absolute; top:10px; right:12px;
    display:inline-grid; place-items:center;
    width:36px; height:36px; border-radius:8px;
    border:1px solid transparent; background:transparent;
  }
  .nav__close:hover{ background:rgba(0,0,0,.05); border-color:var(--border); color:var(--accent); }

  .nav-backdrop{
    position:fixed; inset:0; background:rgba(0,0,0,.45);
    opacity:0; pointer-events:none; transition:opacity .2s; z-index:1000;
  }
  .nav-backdrop.show{ opacity:1; pointer-events:auto; }
}
@media (min-width:901px){
  .menu-toggle{ display:none; }
  .nav{
    position:static; transform:none; box-shadow:none; padding:0; width:auto;
    background:transparent; border:0; flex-direction:row;
  }
  .nav__close, .nav-backdrop{ display:none !important; }
}

/* ---------------------------------------
   Sections (shared shell)
---------------------------------------- */
.section{
  padding:32px 0;
  background:var(--surface);
  color:var(--text);
  content-visibility:auto;
  contain-intrinsic-size:700px;
}
.section--flush-top{ padding-top:0 !important; }
.section--flush-bottom{ padding-bottom:0 !important; }

/* Image / Hero */
.section--image{ position:relative; background-position:center; background-size:cover; background-repeat:no-repeat; overflow:clip; }
.section--image .section__overlay{ position:absolute; inset:0; background:rgba(0,0,0,.28); pointer-events:none; }
.section--image .section__content{ position:relative; z-index:1; }
.section--parallax{ background-attachment:fixed; }
@media (prefers-reduced-motion:reduce){ .section--parallax{ background-attachment:scroll; } }

/* Header offset for hero */
:root{ --header-h:84px; }

/* Home hero sample */
.section--hero-home{
  position:relative;
  background-image:url("../img/window_install_header.webp");
  background-size:cover; background-position:center; background-attachment:fixed;
  min-height:calc(100vh - var(--header-h));
  display:grid; place-items:center; color:#fff; text-align:center;
  text-shadow:0 2px 6px rgba(0,0,0,.75), 0 0 8px rgba(0,0,0,.5);
}
.section--hero-home > .container{ width:100%; height:100%; display:grid; place-items:center; }
.section__actions{ display:inline-flex; gap:12px; margin-top:18px; }
@media (max-width:900px), (prefers-reduced-motion:reduce){
  .section--hero-home{ background-attachment:scroll; }
}

/* ---------------------------------------
   Review / Newsletter
---------------------------------------- */
.section--review{
  contain-intrinsic-size:auto;
  background-image:url("../img/review-banner.webp");
  background-position:center; background-size:cover; background-repeat:no-repeat;
  background-color:transparent; text-shadow:0 2px 6px rgba(0,0,0,.6);
  text-align:center; padding:3rem 1rem; margin:0; position:relative; color:#fff;
}
.section--review::before{ content:""; position:absolute; inset:0; background:rgba(0,0,0,.10); z-index:0; }
body.dark-mode .section--review::before{ background:rgba(0,0,0,.22); }
.section--review .container > *{ position:relative; z-index:1; }
.section--review-text{
  display:inline-block; background:rgba(0,0,0,.6); min-width:240px;
  color:#fff; padding:6px 12px; border-radius:6px;
}

.section--newsletter{
  contain-intrinsic-size:auto;
  background-image:url("../img/skyscraper_install.webp");
  background-position:center; background-size:cover; background-repeat:no-repeat;
  background-color:transparent; text-shadow:0 2px 6px rgba(0,0,0,.75), 0 0 8px rgba(0,0,0,.5);
  text-align:center; padding:3rem 1rem; margin:0; position:relative; color:#fff;
}
.section--newsletter::before{ content:""; position:absolute; inset:0; background:rgba(0,0,0,.10); z-index:0; }
body.dark-mode .section--newsletter::before{ background:rgba(0,0,0,.22); }
.section--newsletter .container > *{ position:relative; z-index:1; }
.section--newsletter form{ margin:40px auto 0; display:flex; gap:8px; max-width:520px; }
.section--newsletter input[type="email"]{
  flex:1; padding:12px; border:none; border-radius:8px;
  background:rgba(255,255,255,.92); color:#111;
}
.section--newsletter .btn{ border:none; border-radius:8px; }

/* ---------------------------------------
   Contact grid & cards
---------------------------------------- */
.contact-us{ background:var(--bg); padding:60px 20px; }
.section-title{ margin:0 0 8px; text-align:center; color:var(--text); }

/* Default two-column, with clamped right column */
.contact-grid{
  display:grid; grid-template-columns:1.05fr minmax(360px,480px);
  gap:24px; max-width:1100px; margin:28px auto 0;
}
@media (max-width:900px){ .contact-grid{ grid-template-columns:1fr; } }

/* Single-column centered variant */
.contact-grid--single{ grid-template-columns:minmax(320px,780px); justify-content:center; }
.contact-grid--single > .contact-card{ width:100%; max-width:780px; margin:0 auto; }

/* ================================
   ONE SOURCE OF TRUTH FOR QUOTE UI
   ================================ */

/* --- Card foundation (safe if you already have something similar) --- */
.contact-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

/* ================================
   HOME: two-column layout
   (section .section--home-quote)
   ================================ */
.section--home-quote .container{
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;

  display: flex;               /* flex is simpler & sturdier here */
  gap: 32px;
  align-items: flex-start;     /* tops align perfectly */
  justify-content: center;     /* center the pair on wide screens */
}

/* Left info and right form: balanced, never too skinny */
.section--home-quote .contact-card--info{
  flex: 0 1 600px;  /* target width */
  min-width: 520px;
  max-width: 640px;
}

.section--home-quote .contact-card--quote{
  flex: 0 1 580px;  /* a hair narrower than the left */
  min-width: 520px;
  max-width: 620px;
}

/* Stack on tablet/phone, keep centered */
@media (max-width: 1080px){
  .section--home-quote .container{
    flex-direction: column;
  }
  .section--home-quote .contact-card--info,
  .section--home-quote .contact-card--quote{
    min-width: 0;
    max-width: 720px;
    margin-inline: auto;
  }
}

/* ================================
   CF7 skin inside the quote card
   ================================ */
.contact-card--quote > *:first-child{ margin-top: 0 !important; } /* kill “notch” */
.contact-card--quote h2{ margin: 0 0 12px; text-align: center; }

/* CF7 often adds <p> with margins; normalize */
.contact-card--quote .wpcf7,
.contact-card--quote .wpcf7-form{ margin:0; padding:0; border:0; background:transparent; }
.contact-card--quote .wpcf7 p{ margin: 0 0 12px !important; }
.contact-card--quote .wpcf7 p:first-child{ margin-top: 0 !important; }

/* Inputs */
.contact-card--quote input[type="text"],
.contact-card--quote input[type="email"],
.contact-card--quote input[type="tel"],
.contact-card--quote input[type="number"],
.contact-card--quote input[type="url"],
.contact-card--quote input[type="file"],
.contact-card--quote textarea,
.contact-card--quote select{
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  color: var(--text);
}

.contact-card--quote textarea{
  min-height: 160px;
  resize: vertical;
}

/* File input compactness is fine */
.contact-card--quote input[type="file"]{ padding: 8px; }

/* Let the submit sit naturally at the bottom if the card grows */
.contact-card--quote .wpcf7-form{ display:flex; flex-direction:column; gap:12px; }
.contact-card--quote .wpcf7-submit{ margin-top:auto; min-width:180px; }

/* CF7 messages spacing */
.contact-card--quote .wpcf7-response-output{
  margin-top: 12px !important;
  border-radius: 10px;
}

/* ================================
   /QUOTES page (standalone form)
   Center the same card & reuse styles
   ================================ */
body.page-slug-quotes .contact-card--quote,
body.page-template-page-quotes .contact-card--quote,
body.page-slug-quotes .contact-card,           /* fallback if different class there */
body.page-template-page-quotes .contact-card{
  max-width: 620px;
  margin-inline: auto;
}

/* Keep the form from “touching” edges on very wide screens */
.contact-card--quote .wpcf7 form{
  max-width: 600px;
  margin-inline: auto;
}
/* Kill CF7’s default <p> margins and control spacing */
.wpcf7 form { 
  display: flex;                /* lets us use gap instead of margins */
  flex-direction: column; 
  row-gap: 12px;                /* your desired spacing between fields */
}

.wpcf7 form p {
  margin: 0 4px;         /* remove top/bottom margin from all CF7 <p> */
}

/* keep things tight at the edges */
.wpcf7 form p:first-child { margin-top: 0 !important; }
.wpcf7 form p:last-child  { margin-bottom: 0 !important; }

/* response/validation box spacing */
.wpcf7 form .wpcf7-response-output { 
  margin: 12px 0 0 !important; 
}

/* acceptance row & checkbox label */
.wpcf7-acceptance,
.wpcf7-acceptance .wpcf7-list-item { 
  margin: 0 !important; 
}
.section--home-quote .contact-card--quote .wpcf7 form { display:flex; flex-direction:column; row-gap:12px; }
.section--home-quote .contact-card--quote .wpcf7 form p { margin:0 !important; }
.section--home-quote .contact-card--quote .wpcf7 form .wpcf7-response-output { margin:12px 0 0 !important; }


/* ==== FOOTER (force-on, wins over earlier rules) ==== */
footer.site-footer,
.site-footer {
  position: relative;                /* sit above any section overlays */
  z-index: 1;
  padding: 48px 16px;
  background: var(--bg) !important;  /* beat any .section background */
  color: var(--muted) !important;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
}

.site-footer .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px;
}

.site-footer p { margin: 0.35rem 0; }

.site-footer a {
  color: color-mix(in srgb, var(--text) 65%, var(--accent) 35%);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* If your footer has a small meta row */
.site-footer .meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  opacity: .9;
}

/* Safety: do NOT let generic .section rules bleed into footer */
.site-footer.section { background: var(--bg) !important; padding-top: 48px; padding-bottom: 48px; }
/* Lock page scroll when drawer is open */
body.no-scroll { overflow: hidden; }

/* Backdrop toggling */
.nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1000; }
.nav-backdrop.show { opacity: 1; pointer-events: auto; }

/* Mobile drawer animation (your CSS has similar; this reinforces it) */
@media (max-width: 900px){
  .nav { transform: translateX(100%); transition: transform .22s ease; }
  .nav.is-open { transform: translateX(0); }
}


/* === Tessellated background scoped to a container ================= */
:root{
  --tess-url: url("../img/patterns/logo-tessellation.svg"); /* or .png */
  --tess-size: clamp(160px, 18vw, 260px);
  --tess-opacity: .06;
}

/* Turn on tessellation for *only* the containers you choose */
.container--tess{
  position: relative;           /* create a stacking context */
  z-index: 0;
}
.container--tess::before{
  content: "";
  position: absolute;
  inset: 0;                     /* fill the container */
  background-image: var(--tess-url);
  background-repeat: repeat;
  background-size: var(--tess-size);
  opacity: var(--tess-opacity);
  pointer-events: none;
  z-index: 0;                   /* sits behind the content */
}
/* keep the actual content above the pattern */
.container--tess > *{
  position: relative;
  z-index: 1;
}

/* Dark mode: slightly softer */
html[data-theme="dark"] .container--tess::before{ opacity: .04; }

/* Easy “no tess” opt-out on a specific container */
.container--no-tess::before{ display: none !important; }

:root{
  --tess-url: url("../img/patterns/AWRP-Tessellation.png"); /* or .png/.webp */
  --tess-size: clamp(160px, 18vw, 260px);
  --tess-opacity: .06;
}

/* Opt-in pattern layer that DOES NOT change .section itself */
.section--tess{
  position: relative;            /* create stacking context */
  z-index: 0;
  --tess-opacity: .06;
  --tess-size: clamp(180px, 14vw, 240px);
}
.section--tess::before{
  content: "";
  position: absolute;
  inset: 0;                      /* cover the whole section */
  background-image: var(--tess-url);
  background-repeat: repeat;
  background-size: var(--tess-size);
  opacity: var(--tess-opacity);
  pointer-events: none;
  z-index: 0;                    /* sits above the section background */
  filter: saturate(.5) contrast(.85);
}
.section--tess--fade::before{
  -webkit-mask: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    #000 64px,
    #000 calc(100% - 64px),
    rgba(0,0,0,0) 100%
  );
          mask: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    #000 64px,
    #000 calc(100% - 64px),
    rgba(0,0,0,0) 100%
  );
}
/* Keep your real content above the pattern */
.section--tess > *{
  position: relative;
  z-index: 1;
}

/* Optional: a softer masked variant */
.section--tess--soft::before{
  -webkit-mask: linear-gradient(180deg,#000 12%,#000C 40%,#000C 60%,#000 88%);
          mask: linear-gradient(180deg,#000 12%,#000C 40%,#000C 60%,#000 88%);
}

/* A subtle background behind headings inside tess sections */
.section--tess :is(h1,h2){
  position: relative;
  padding: .2em .5em;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface, #fff) 90%, transparent);
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

/* if your heading is centered via a wrapper, keep it centered */
.section--tess .section--gallery-text{ text-align:center; }

/* if you’d rather keep headings full-width but still soften the area: */
.section--tess :is(h1,h2).wash-full{
  display:block;
  margin-inline:auto;
  max-width: 1200px;
}

/* keep tessellation + wash elsewhere, but NOT inside cards */
.section--tess .contact-card :is(h1, h2){
  background: none;
  box-shadow: none;
  padding: 0;
}



/* Dark mode tweak */
html[data-theme="dark"] .section--tess::before{ opacity:.04; }
