/* =========================================================
   Apex Estates — site styles (mobile first)
   Brand red #e34f4f is kept as the accent. Buttons use a
   deeper red (#c93434) so white text on them passes contrast
   rules and is easy to read outdoors on a phone.
   ========================================================= */
:root {
  --red: #e34f4f;          /* brand accent */
  --red-btn: #c93434;      /* buttons / links (readable) */
  --red-dark: #a82a2a;     /* button hover */
  --ink: #15191a;          /* near-black headings, header */
  --ink-2: #232a2b;
  --text: #2f3637;
  --muted: #5c6667;
  --line: #e3e0da;
  --paper: #ffffff;
  --sand: #f6f3ee;         /* warm off-white section background */
  --green: #2f4a3a;        /* deep forest accent for tree content */
  --radius: 10px;
  --shadow: 0 10px 30px rgba(21, 25, 26, .10);
  --max: 1160px;
  --head: "Archivo", "Arial Narrow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 17px/1.6 var(--body);
  padding-bottom: 72px; /* room for mobile call bar */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-btn); }
a:hover { color: var(--red-dark); }
h1, h2, h3, h4 { font-family: var(--head); color: var(--ink); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.eyebrow { display: inline-block; font: 700 .8rem/1 var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--red-btn); margin-bottom: .8rem; }
.lead { font-size: 1.15rem; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 50px; padding: 0 22px; border-radius: 8px; border: 2px solid transparent;
  font: 700 1rem/1 var(--head); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red-btn); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-outline { border-color: currentColor; color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-light { border-color: #fff; color: #fff; }
.btn-light:hover { background: #fff; color: var(--ink); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row .btn { flex: 1 1 220px; }
@media (min-width: 700px) { .btn-row .btn { flex: 0 0 auto; } }

/* ---------- Top bar + header ---------- */
.topbar { display: none; background: var(--ink); color: #cfd4d4; font-size: .85rem; }
@media (min-width: 700px) { .topbar { display: block; } }
.topbar .container { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; padding-bottom: 6px; }
.topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.topbar .hide-sm { display: none; }
@media (min-width: 700px) { .topbar .hide-sm { display: inline; } }

.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
/* LOGO PLACEHOLDER: when you have a logo file, it replaces this text mark (see header in each page). */
.logo-mark { width: 40px; height: 40px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; }
.logo-mark svg { width: 26px; height: 26px; }
.logo-text { white-space: nowrap; font: 800 1.05rem/1 var(--head); letter-spacing: .04em; text-transform: uppercase; }
@media (min-width: 400px) { .logo-text { font-size: 1.2rem; } }
.logo-text small { display: block; font: 600 .62rem/1.4 var(--body); letter-spacing: .16em; color: var(--muted); }
.header-cta { display: flex; align-items: center; gap: 8px; }
.header-cta .btn { min-height: 42px; padding: 0 14px; font-size: .9rem; white-space: nowrap; }
.header-phone { display: none; font: 700 1.05rem/1 var(--head); color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav-toggle { background: none; border: 0; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.nav-toggle svg { width: 28px; height: 28px; }

.main-nav { display: none; border-top: 1px solid var(--line); background: #fff; }
.main-nav.open { display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 8px 0 16px; }
.main-nav a { white-space: nowrap; display: block; padding: 12px 16px; color: var(--ink); text-decoration: none; font: 600 1.05rem/1.2 var(--head); }
.main-nav a[aria-current="page"] { color: var(--red-btn); }

@media (min-width: 1200px) {
  .site-header .container { min-height: 78px; }
  .header-phone { display: inline; }
  .nav-toggle { display: none; }
  .main-nav { display: block !important; border: 0; }
  .main-nav ul { display: flex; gap: 2px; padding: 0; }
  .main-nav a { padding: 10px 9px; font-size: .95rem; }
  .main-nav a:hover { color: var(--red-btn); }
  .header-wrap { display: flex; align-items: center; gap: 18px; }
}

/* ---------- Sticky mobile call bar ---------- */
.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--ink); box-shadow: 0 -6px 20px rgba(0,0,0,.18);
  padding-bottom: env(safe-area-inset-bottom);
}
.callbar a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 60px; color: #fff; text-decoration: none; font: 800 1.05rem/1 var(--head); letter-spacing: .02em; }
.callbar .call { background: var(--red-btn); }
.callbar svg { width: 22px; height: 22px; }
@media (min-width: 1200px) { .callbar { display: none; } body { padding-bottom: 0; } }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; }
.hero .photo-ph { position: absolute; inset: 0; border: 0; border-radius: 0; opacity: .35; aspect-ratio: auto; place-items: end; font-size: .75rem; }
.hero .photo-ph > div { max-width: 260px; text-align: right; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(21,25,26,.55), rgba(21,25,26,.9)); }
.hero .container { position: relative; z-index: 1; padding-top: 56px; padding-bottom: 56px; }
.hero h1 { color: #fff; max-width: 15ch; }
.hero h1 span { color: var(--red); }
.hero .lead { color: #dfe3e3; max-width: 46ch; }
.hero .eyebrow { color: #ff9a9a; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 26px 0 0; padding: 0; list-style: none; font-size: .92rem; color: #e9ecec; }
.trust-row li { display: flex; align-items: center; gap: 6px; }
.trust-row svg { width: 18px; height: 18px; color: var(--red); flex: none; }
@media (min-width: 900px) { .hero .container { padding-top: 110px; padding-bottom: 110px; } }

.page-hero { background: var(--ink); color: #fff; }
.page-hero .container { padding-top: 40px; padding-bottom: 40px; }
.page-hero h1 { color: #fff; font-size: clamp(1.9rem, 6vw, 2.9rem); }
.page-hero p { color: #d6dbdb; max-width: 60ch; margin-bottom: 1.2em; }
.crumbs { font-size: .85rem; color: #aab2b2; margin-bottom: 10px; }
.crumbs a { color: #d6dbdb; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--sand); }
.section.dark { background: var(--ink); color: #d6dbdb; }
.section.dark h2, .section.dark h3 { color: #fff; }
.section-head { max-width: 680px; margin-bottom: 28px; }
@media (min-width: 900px) { .section { padding: 88px 0; } }

.grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.split { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.card .icon { width: 46px; height: 46px; border-radius: 10px; background: #fdeaea; color: var(--red-btn); display: grid; place-items: center; margin-bottom: 14px; }
.card .icon svg { width: 26px; height: 26px; }
.card.link { text-decoration: none; color: inherit; display: block; transition: box-shadow .15s, transform .15s; }
.card.link:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .more { font-weight: 700; color: var(--red-btn); }
.service-card { padding: 0; overflow: hidden; }
.service-card .photo-ph { border-radius: 0; border-width: 0 0 2px; aspect-ratio: 16/10; }
.service-card .body { padding: 22px; }

.checks { list-style: none; padding: 0; margin: 0 0 1em; }
.checks li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.checks li::before { content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px; border-radius: 50%; background: var(--red-btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat; }
.section.dark .checks li { color: #e3e7e7; }

/* ---------- Photo placeholders ---------- */
/* PHOTO PLACEHOLDER boxes: each one is swapped for a real <img> later. */
.photo-ph {
  display: grid; place-items: center; text-align: center; aspect-ratio: 4/3; padding: 16px;
  border: 2px dashed #b9b3a8; border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #ece8e1 0 12px, #f4f1ec 12px 24px);
  color: #6b6458; font: 600 .85rem/1.35 var(--body);
}
.photo-ph strong { display: block; font: 800 .75rem/1 var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--red-btn); margin-bottom: 6px; }
.photo-ph.tall { aspect-ratio: 3/4; }
.photo-ph.wide { aspect-ratio: 16/9; }

/* ---------- Stats / trust strip ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats div { background: #fff; padding: 18px 14px; text-align: center; }
.stats b { display: block; font: 800 1.5rem/1.1 var(--head); color: var(--ink); }
.stats span { font-size: .85rem; color: var(--muted); }
@media (min-width: 800px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Steps ---------- */
.steps { counter-reset: s; display: grid; gap: 16px; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 20px 20px 20px 72px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before { content: counter(s); position: absolute; left: 20px; top: 18px; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 800 1.1rem/1 var(--head); }
.steps h3 { margin-bottom: .2em; font-size: 1.1rem; }
.steps p { margin: 0; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Towns ---------- */
.towns { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.towns li { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: .92rem; }
.section.dark .towns li { background: var(--ink-2); border-color: #3a4344; color: #e3e7e7; }

/* ---------- Emergency band ---------- */
.emergency { background: var(--red-btn); color: #fff; }
.emergency .container { display: grid; gap: 16px; padding-top: 30px; padding-bottom: 30px; align-items: center; }
.emergency h2 { color: #fff; margin: 0 0 .2em; font-size: clamp(1.4rem, 4.5vw, 2rem); }
.emergency p { margin: 0; color: #ffe3e3; }
.emergency .btn { background: #fff; color: var(--red-dark); }
.emergency .btn:hover { background: var(--ink); color: #fff; }
@media (min-width: 800px) { .emergency .container { grid-template-columns: 1fr auto; } }

/* ---------- CTA band ---------- */
.cta-band { background: var(--ink); color: #d6dbdb; text-align: center; }
.cta-band .container { padding-top: 56px; padding-bottom: 56px; max-width: 760px; }
.cta-band h2 { color: #fff; }
.cta-band .btn-row { justify-content: center; }

/* ---------- Reviews ---------- */
.review { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.review .stars { color: #e8a317; letter-spacing: 2px; font-size: 1.1rem; }
.review blockquote { margin: 10px 0 12px; font-size: 1.02rem; }
.review cite { font-style: normal; font-weight: 700; color: var(--ink); font-size: .92rem; }
.review.placeholder { border: 2px dashed #b9b3a8; background: var(--sand); }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; }
.faq h2 { margin-top: 1.4em; font-size: 1.5rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative; font: 700 1.08rem/1.35 var(--head); color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font: 400 1.8rem/1 var(--body); color: var(--red-btn); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 0 18px; }

/* ---------- Fence styles ---------- */
.style-card .photo-ph { aspect-ratio: 4/3; margin-bottom: 14px; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; background: var(--sand); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; margin: 0 4px 6px 0; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 800px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.gallery figure { margin: 0; }
.gallery figcaption { font-size: .85rem; color: var(--muted); padding-top: 6px; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 16px; font: 600 .92rem/1 var(--body); cursor: pointer; }
.filter button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Estimate page / Jobber form ---------- */
.estimate-layout { display: grid; gap: 22px; }
@media (min-width: 960px) { .estimate-layout { grid-template-columns: 1fr 340px; align-items: start; } .estimate-aside { position: sticky; top: 100px; } }
.call-card { background: var(--ink); color: #d6dbdb; border-radius: var(--radius); padding: 22px; }
.call-card h2 { color: #fff; font-size: 1.35rem; margin-bottom: .3em; }
.call-card .big-phone { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--red-btn); color: #fff; text-decoration: none; border-radius: 8px; min-height: 58px; font: 800 1.35rem/1 var(--head); margin: 14px 0 10px; }
.call-card .big-phone:hover { background: var(--red-dark); color: #fff; }
.call-card .big-phone svg { width: 24px; height: 24px; }
.call-card small { color: #aab2b2; }
.call-card a { color: #fff; }
.form-shell { background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--red-btn); border-radius: var(--radius); padding: 18px 12px; box-shadow: var(--shadow); min-height: 420px; }
@media (min-width: 600px) { .form-shell { padding: 26px; } }
.form-shell > h2 { font-size: 1.5rem; margin-bottom: .2em; }
.form-shell > p { color: var(--muted); font-size: .95rem; }
.form-fallback { font-size: .9rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 16px; }
/* Jobber injects its form into this container. We can only style the container,
   not the fields inside (they live on Jobber's servers in a separate frame). */
.jobber-embed { width: 100%; }
.jobber-embed iframe { width: 100% !important; max-width: 100% !important; border: 0 !important; }

/* ---------- Placeholder notes (remove when filled in) ---------- */
.todo { background: #fff6d6; border: 1px dashed #d7a900; color: #5c4a00; border-radius: 6px; padding: 2px 6px; font-size: .9em; }

/* ---------- Footer ---------- */
.site-footer { background: #0e1112; color: #aab2b2; font-size: .93rem; }
.site-footer .container { padding-top: 48px; padding-bottom: 28px; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; } }
.site-footer h3 { color: #fff; font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #e3e7e7; text-decoration: none; }
.site-footer a:hover { color: var(--red); }
.site-footer .logo { color: #fff; margin-bottom: 14px; }
.site-footer .logo-mark { background: var(--red-btn); }
.footer-bottom { border-top: 1px solid #263031; margin-top: 32px; padding-top: 18px; font-size: .82rem; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.foot-phone { font: 800 1.3rem/1 var(--head); color: #fff !important; }

/* ---------- Header fit fixes ---------- */
.site-header .container { gap: 8px; }
.nav-toggle { margin-right: -8px; }
@media (max-width: 399px) {
  /* Smallest phones: the bottom call bar already has Free Estimate */
  .header-cta .btn { display: none; }
}
@media (min-width: 1200px) {
  .main-nav li:first-child { display: none; }   /* logo already links Home */
  .header-phone { display: none; }               /* phone is in the top bar */
}
@media (min-width: 1440px) { .header-phone { display: inline; } }

/* ---------- Jobber form: never wider than the screen ---------- */
/* Grid columns grow to fit wide content unless told not to; this stops the
   Jobber form from stretching the whole page sideways on phones. */
.estimate-layout > * { min-width: 0; }
.form-shell, .jobber-embed { max-width: 100%; overflow-x: hidden; }
.jobber-embed > *, .jobber-embed iframe, .jobber-embed form { max-width: 100% !important; min-width: 0 !important; box-sizing: border-box; }
/* Safety net: no page can scroll sideways */
html, body { overflow-x: clip; }
@media (max-width: 599px) { .form-shell { padding-left: 8px; padding-right: 8px; } }

/* ---------- Real logo + logo-matched red ---------- */
:root { --red-btn: #cf102d; --red-dark: #a50c23; }   /* exact red from the Apex Estates logo */
.logo-img { height: 52px; width: auto; display: block; }
.logo-tag { font: 700 .68rem/1.3 var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-left: 2px solid var(--line); padding-left: 10px; white-space: nowrap; }
@media (max-width: 359px) { .logo-tag { display: none; } }
@media (min-width: 1200px) { .logo-img { height: 60px; } }
.site-footer .footer-logo { height: 80px; margin-bottom: 4px; }
.card .icon { background: #fde7ea; }
/* Phones: keep the Free Estimate button; show tagline only when there's room */
@media (max-width: 429px) { .logo-tag { display: none !important; } }
@media (min-width: 360px) and (max-width: 399px) { .header-cta .btn { display: inline-flex; } }
