/* =======================
   Base / Utilities
   ======================= */

/* Hide elements quickly */
.hidden { display: none !important; }

/* Theme variables */
:root{
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --brand: #1a2a4e;
  --border: #e5e7eb;
  --radius: 14px;
  --maxw: 1100px;
  --pad-x: clamp(16px, 4vw, 40px);
  --gap: clamp(12px, 2.5vw, 24px);
  --radius: 16px;
}

/* Normalize box sizing for predictable layout */
*, *::before, *::after { box-sizing: border-box; }

/* Containers and global text */
body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  /* Guard against tiny overflow from viewport units or snap carousels */
  overflow-x: hidden;
}
a{ color: inherit; text-decoration: none; }
.container{ width: min(1200px, 92%); margin-inline: auto; }

/* =======================
   Header / Navbar
   ======================= */

header{
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  box-shadow: 0 10px 10px rgba(0,0,0,.08);
}
.nav{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding: 16px 0; }

/* Brand / logo */
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.2px; }
.logo{ display:block; height: 60px; width: auto; }
@media (min-width: 900px){ .logo{ height: 80px; } }

/* Primary nav */
.nav-links{ display:flex; align-items:center; gap: 18px; }
.nav-links a{ color: var(--muted); padding: 8px 6px; border-radius: 10px; }
.nav-links a:hover, .nav-links a:focus-visible{ color: var(--text); background: #dddddd; outline: none; }
/* visual separators between links (desktop) */
.nav-links a:not(:last-child)::after{
  content: " | ";
  color: #cbd5e1;
  pointer-events: none;
  margin-left: 10px;
}

/* Actions (desktop) */
.actions{ display:flex; align-items:center; gap: 10px; }
.btn{ display:inline-block; padding: 10px 14px; border-radius: 12px; font-weight: 650; border: 1px solid var(--border); }
.btn.primary{ background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost{ background: transparent; color: var(--text); }
.btn:focus-visible{ outline: 3px solid #93c5fd; outline-offset: 2px; }

/* Mobile menu button (hidden on desktop) */
.menu-btn{ display:none; background:transparent; color:var(--text); border:1px solid var(--border); padding:8px 12px; border-radius: 10px; }

/* ===== Responsive header behavior ===== */
@media (min-width: 900px){
  .menu-btn{ display:none; }
  .nav-links, .actions{ display:flex; }
  #mobile-sheet{ display: none !important; } /* ensure hidden on desktop */
}
@media (max-width: 899.98px){
  .menu-btn{ display:inline-flex; align-items:center; gap:8px; }
  .nav-links, .actions{ display:none; }     /* hide big nav + actions on phones */
  /* Mobile navigation sheet */
  #mobile-sheet{ display:block; }
  .sheet{
    position: fixed; inset: 64px 4% auto 4%;
    background: var(--surface);
    border:1px solid var(--border);
    border-radius: 14px;
    padding: 14px; display: grid; gap: 8px;
  }
  .sheet a{ padding: 12px; border-radius: 10px; color: var(--text); }
}

/* =======================
   Hero band + intro
   ======================= */

main{ padding: 0 0 clamp(20px, 4vw, 60px); } /* flush to header at the top */

.hero-band{
  /* Use percentage width to avoid 100vw + scrollbar overflow issues */
  width: 100%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  padding-block: clamp(16px, 4vw, 28px);
  box-shadow: 0 6px 20px rgba(0,0,0,.10);
}
.hero-band h1{
  margin: 0; text-align: center;
  letter-spacing: .02em; font-weight: 800;
  font-size: clamp(22px, 4vw, 40px);
}
.hero-intro{ padding-block: clamp(16px, 3vw, 28px); }
.hero-intro p{
  margin: 0;
  text-align: justify; text-justify: inter-word; hyphens: auto;
  max-width: min(200ch, 92vw); margin-inline: auto; color: var(--text);
}

/* =======================
   Services
   ======================= */
.spacer-24 { height: 24px; }
.services{ padding: 40px 0; border-top: 1px solid var(--border); text-align: center; }
.services > .container:first-child { 
  text-align: center;
}

/* Title with a background paint-stroke image behind it */
.section-title{
  position: relative;
  display: inline-block;                 /* shrink-wrap to text */
  margin: 0 auto 16px;                   /* center in the container */
  padding: clamp(8px, 1.6vw, 12px) clamp(16px, 3vw, 28px);
  color: #fff;                           /* white text on top of stroke */
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);/* improves contrast on busy strokes */
}

/* The paint stroke itself (your PNG with transparency) */
.section-title::before{
  content: "";
  position: absolute;
  inset: -30% -12%;                      /* grow the image around the text */
  background: url("/assets/ui/paint-stroke.png") center / 100% 100% no-repeat; /* root-relative */
  z-index: -1;                           /* place behind the text */
  pointer-events: none;                  /* don’t block clicks */
}

/* Desktop/tablet: 3 columns */
.services-track{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Card as full-bleed photo background + glass label */
.service-card{
  position: relative; display: block;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  aspect-ratio: 4 / 3;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

/* Per-card images */
.service-card--commercial  { background-image: url("assets/services/commercial.jpg"); }
.service-card--residential { background-image: url("assets/services/residential.jpg"); }
.service-card--renovate    { background-image: url("assets/services/renovate.jpg"); }

/* Label (single-line, translucent “glass”) */
.service-card .label{
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  background: rgba(255,255,255,.18);
  -webkit-backdrop-filter: saturate(1.2) blur(6px);
  backdrop-filter: saturate(1.2) blur(6px);
  color: #0f172a; border: 1px solid rgba(255,255,255,.35);
  border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.10);
  padding: 6px 10px; font-weight: 700; font-size: clamp(14px, 3.8vw, 18px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 88%;
}

/* Hover/focus polish (desktop) */
.service-card:hover, .service-card:focus-visible{
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  border-color: #d1d5db; outline: none;
}

/* Phone: horizontal snap-to-center carousel */
@media (max-width: 899.98px){
  .services-track{
    display: flex !important; flex-direction: row; flex-wrap: nowrap !important;
    gap: 12px; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; touch-action: pan-x;
    scroll-snap-type: x mandatory; scroll-padding-inline: 7.5%;
    padding-inline: 7.5%; padding-bottom: 8px;
  }
  .services-track > .service-card{
    flex: 0 0 85% !important; max-width: 85% !important; width: auto !important;
    scroll-snap-align: center; scroll-snap-stop: always; border-radius: 14px;
  }
  .services-track::-webkit-scrollbar{ height: 6px; }
  .services-track::-webkit-scrollbar-thumb{ background: #ffffff; border-radius: 6px; }
}

/* =======================
   WHY US (blue background + glass cards)
   ======================= */

.whyus{ background: var(--brand); padding: 32px 0 48px; }
.whyus-title{
  margin: 0 auto 16px; text-align: center; color: #fff;
  letter-spacing: .12em; font-weight: 800; font-size: clamp(18px, 3.2vw, 24px);
}
.whyus-grid{
  display: grid; gap: 16px; grid-template-columns: 1fr;
}
@media (min-width: 700px){ .whyus-grid{ grid-template-columns: repeat(3, 1fr); } }

/* Glass cards */
.whyus-card{
  text-align: center; position: relative;
  background: rgba(255,255,255,.18);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--radius); padding: 18px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.whyus-card:hover, .whyus-card:focus-within{
  transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,0,0,.12);
  border-color: rgba(255,255,255,.5);
}
.whyus-card h3{ margin: 0 0 6px; font-size: clamp(16px, 2vw, 18px); font-weight: 800; color: #fff; }
.whyus-card p{ margin: 0; color: #e8f0ff; line-height: 1.45; margin-inline: auto; max-width: 36ch; }

/* Blurb under WHY US cards */
.whyus-blurb{ margin-top: 16px; color: #fff; }
.whyus-blurb p{
  text-align: center; hyphens: auto;
  margin-inline: auto; max-width: min(130ch, 92vw);
  font-size: clamp(14px, 1.9vw, 17px); line-height: 1.6; opacity: .98;
}

/* Optional subtle container glow so cards pop */
.whyus .container{ background: linear-gradient(180deg, #ffffff14, #0000); border-radius: 12px; padding-block: 8px; }


/* =======================
   Paint box
   ======================= */
.paint{ background: var(--brand); padding: 32px 0 48px; }
.paint-title{
  margin: 0 auto 16px; text-align: center; color: #fff;
  letter-spacing: .12em; font-weight: 800; font-size: clamp(18px, 3.2vw, 24px);
}

/* =======================
   Split box
   ======================= */
:root{
  --maxw: 1100px;         /* content width on desktop */
  --pad-x: clamp(16px, 4vw, 40px);  /* side padding */
  --gap: clamp(16px, 3vw, 40px);    /* gap between text & image */
  --radius: 18px;
}

/* --- Section wrapper --- */
.split{
  background: transparent;            /* adjust or remove */
  padding: clamp(32px, 6vw, 80px) 0;
  color: #000000;
}

.split__container{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);

  /* Mobile-first: stack with text first, image second */
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* --- Text column --- */
.split__text{
  display: flex;
  flex-direction: column;
  align-items: center;     /* centers the text block horizontally */
  justify-content: center; /* vertical centering within its own box */
  text-align: center;      /* center text lines */
  row-gap: 12px;
  min-height: 260px;       /* gives it some presence; adjust as needed */
}

.split__title{
  margin: 0;
  font-size: clamp(22px, 3.2vw, 36px);
  font-weight: 800;
  letter-spacing: 0.2px;
}

.split__body{
  margin: 0;
  max-width: 55ch;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.55;
  opacity: 0.9;
}

.split__cta{
  display: inline-block;
  margin-top: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #1a2a4e;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  transition: transform .15s ease;
}
.split__cta:hover{ transform: translateY(-1px); }

/* --- Image column --- */
.split__media{
  position: relative;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;

  /* Give the box a stable height on all screens */
  aspect-ratio: 16 / 10;         /* adjust if you want taller/shorter */
  
  /* Soft, modern shadow */
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
}

/* Make the image fill the box and stay perfectly centered */
.split__media img{
  position: absolute;
  inset: 0;                      /* top:0; right:0; bottom:0; left:0 */
  width: 100%;
  height: 100%;
  object-fit: cover;             /* fills the frame, no empty bars */
  object-position: center;       /* keeps the subject centered */
  display: block;
}

/* --- Desktop layout: two columns, text left / image right --- */
@media (min-width: 900px){
  .split__container{
    flex-direction: row;
    align-items: stretch;   /* same height columns */
  }

  .split__text,
  .split__media{
    flex: 1 1 50%;
  }

  .split__text{
    padding-right: calc(var(--gap)/2);
  }

  .split__media{
    padding-left: calc(var(--gap)/2);
  }

  /* Keep text vertically centered in its half */
  .split__text{ min-height: 420px; } /* adjust or remove */
}

.success {
  min-height: 50vh;
  display: grid;
  place-items: center;
  padding: 40px 0;
}
.success-card {
  text-align: center;
  display: grid;
  gap: 10px;
}
.success-card .check {
  color: #16a34a; /* green */
  margin-inline: auto;
}
.success-card h3 {
  margin: 8px 0 0;
  font-weight: 800;
}
.success-card p {
  color: var(--muted);
  margin: 0;
}

/* =======================
   Appointment
   ======================= */
/* ===== Booking layout (split on desktop, stacked on mobile) ===== */
.booking { padding: 40px 0; border-top: 1px solid var(--border); }
/* Self-centering title block */
.booking .section-title{
  display: block;
  width: max-content;           /* shrink to title width */
  margin-inline: auto;          /* center itself */
  margin-block-end: 16px;
  text-align: center;           /* center multi-line text if it wraps */
}
.booking-grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;              /* phones: stacked */
}
/* ---------- Inline validation styles ---------- */
.is-invalid{
  border-color: #dc2626 !important;                    /* red */
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);        /* soft red glow */
}
.form-row.has-error .label{ color: #dc2626; }          /* optional: red label */

.error{
  display: none;
  color: #dc2626;
  font-size: 13px;
  margin-top: 4px;
}
.form-row.has-error .error{ display: block; }

.has-error .label{ color:#dc2626; }
.has-error .error{ display:block; }

/* textarea style to match inputs */
.textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  resize: vertical;
  min-height: 110px;
}
@media (min-width: 900px){
  .booking-grid { grid-template-columns: 1fr 1fr; align-items: start; } /* desktop: split */
}

/* Calendar card */
.booking-cal{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}
.cal-header{
  display: grid; grid-template-columns: 40px 1fr 40px; align-items: center;
  margin-bottom: 8px;
}
.cal-title{
  text-align: center; font-weight: 800; letter-spacing: .02em;
}
.cal-nav{
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer;
}
.cal-nav:hover{ background: #f8fafc; }

/* Calendar grid (7 columns) */
.cal-grid{ display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekday{ text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0; }
.cal-day{
  display: grid; place-items: center;
  height: 40px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; cursor: pointer;
}
.cal-day[disabled]{ color:#94a3b8; background:#f8fafc; cursor:not-allowed; opacity:.8; }
.cal-day.is-today{ border-color:#cbd5e1; }
.cal-day.is-selected{ background: var(--brand); color:#fff; border-color: var(--brand); }

/* Booking form card (right side) */
.booking-form{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}
.form-row{ display: grid; gap: 6px; margin-bottom: 12px; }
.two-col{ grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 899.98px){ .two-col{ grid-template-columns: 1fr; } }
.label{ font-weight: 800; }
.pill{
  display:inline-block; padding:6px 10px; border-radius:999px;
  background:#f1f5f9; border:1px solid var(--border);
}
.select, .input{
  width:100%; padding:10px 12px; border-radius:10px;
  border:1px solid var(--border); background:#fff; color:var(--text);
}
.help{ color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.no-availability{ margin:0; color:#b91c1c; font-weight:700; } /* red message */
.hidden{ display:none !important; }



/* =======================
   Works
   ======================= */
  /* --- Works wrapper (inherits your page background/color) --- */
.works{ padding: 40px 0; border-top: 1px solid var(--border); text-align: center;}

.works .section-title{
  display: block;               /* was inline/inline-block */
  width: fit-content;           /* shrink to content */
  margin: 0 auto 16px;          /* <- centers it */
  text-align: center;           /* centers its own lines */
}

.works__container{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* MOBILE: horizontal scroll with centered “magnetic” snap */
.works__gallery{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 80%;            /* visible width of each card on mobile */
  gap: var(--gap);
  overflow-x: auto;
  padding-bottom: 8px;

  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;

  /* Center snap target (compensate for container side padding) */
  scroll-padding-left:  calc(50% - var(--pad-x));
  scroll-padding-right: calc(50% - var(--pad-x));

  /* Optional: hide scrollbar (WebKit) */
  scrollbar-width: none;          /* Firefox */
}
.works__gallery::-webkit-scrollbar{ display: none; }

.works__item{
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,.22);

  /* Snap each card to CENTER of the viewport */
  scroll-snap-align: center;
  scroll-snap-stop: always;        /* helps avoid stopping between items */
}

.works__item img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* DESKTOP: 3x2 grid, disable scroll snapping */
@media (min-width: 900px){
   .works__gallery{
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: initial;
    gap: var(--gap);
    overflow: visible;
    scroll-snap-type: none;
  }

  /* 3 x 2 */
  .works--3x2 .works__gallery{
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, minmax(220px, 1fr));
  }

  /* 3 x 3 */
  .works--3x3 .works__gallery{
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, minmax(220px, 1fr));
  }
}

/* --- Text after gallery --- */
.works__text{
  margin-top: clamp(16px, 3vw, 32px);
  max-width: 70ch;
  margin-inline: auto;
  text-align: center;
  line-height: 1.55;
  opacity: .95;
}

/* =======================
   Lightbox
   ======================= */
/* Lightbox overlay */
.lightbox{
  position: fixed;
  inset: 0;
  display: none;                 /* hidden by default */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.8);
  z-index: 9999;
}
.lightbox.is-open{ display: flex; }

.lightbox__img{
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  user-select: none;
}

/* Close button */
.lightbox__close{
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 22px;
  line-height: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,.92);
  cursor: pointer;
}

/* Prevent background scroll when lightbox is open */
body.lightbox-open{ overflow: hidden; }

/* =======================
   Mobile FABs (phones only)
   ======================= */

.fab{
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  width: 56px; height: 56px;
  border-radius: 9999px;
  display: none; align-items: center; justify-content: center;
  background: var(--brand); color: #fff;
  box-shadow: 0 10px 20px rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.3);
  z-index: 1000; text-decoration: none;
  transition: transform .25s ease, opacity .25s ease, box-shadow .12s ease, filter .12s ease;
}
.fab svg{ display:block; width:24px; height:24px; }
.fab-left{ left: 16px; }
.fab-right{ right: 16px; }
.fab:active{ transform: translateY(1px); }
.fab:focus-visible{ outline: 3px solid #93c5fd; outline-offset: 2px; }

/* Show FABs on phones */
@media (max-width: 899.98px){ .fab{ display:flex; } }

/* ===== Footer ===== */
.site-footer{
  background: #0f172a;             /* deep slate */
  color: #e5e7eb;                  /* light gray text */
  padding-top: 28px;
}

/* Grid: stacks on mobile, 4 cols on desktop */
.footer-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
@media (min-width: 700px){
  .footer-grid{ grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* Brand column (left) */
.footer-brand .footer-logo .logo{ height: 120px; }
.footer-name{
  margin: 10px 0 4px;
  font-weight: 800;
  letter-spacing: .05em;
  color: #fff;
  font-size: clamp(16px, 2vw, 18px);
}
.footer-tag{ margin: 0 0 6px; color: #cbd5e1; }

/* Column headings */
.footer-title{
  margin: 2px 0 8px;
  color: #ffffff;
  font-weight: 800;
  font-size: clamp(14px, 1.8vw, 16px);
}

/* Lists */
.footer-list,
.footer-links{
  list-style: none;
  padding: 0; margin: 0;
  display: grid; gap: 8px;
}
.footer-links a,
.footer-list a{
  color: #e5e7eb;
  text-decoration: none;
  border-radius: 8px;
  padding: 2px 0;
  transition: color .15s ease, background-color .15s ease;
}
.footer-links a:hover,
.footer-list a:hover{
  color: #ffffff;
  background: rgba(255,255,255,.06);
}

/* Bottom bar */
.footer-bottom{
  margin-top: 20px;
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 12px 0 18px;
  color: #cbd5e1;
}
.footer-bottom small{ display: block; text-align: center; }
.footer-bottom .sep{ opacity: .6; margin: 0 .35em; }

/* Make the footer feel cohesive with the site */
.site-footer a:focus-visible{
  outline: 3px solid #93c5fd; outline-offset: 2px;
}

/* Optional: slightly brighter on hover for emojis/inline icons */
.site-footer li{ line-height: 1.5; }
