/* ==========================================================================
   Brazoria Driveway & Drainage  //  angletonculverts.com
   OOCSS objects (.media, .box, object+skin pairs) + Flexbox holy-grail.
   System font stack stands in for Spectral (headings) / Source Sans 3 (body)
   to keep this a single-request, self-hosted, zero-webfont page.
   ========================================================================== */

:root {
  --ivory: #f7f3ec;
  --ivory-dim: #efe8da;
  --hunter: #1f3a3d;
  --hunter-dim: #16292b;
  --clay: #e8846b;
  --clay-dim: #d76e54;
  --teal: #6fa8a0;
  --ink: #2b2118;
  --rule: #d8cdb8;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 68rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.6;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 4.25rem; /* room for sticky mobile bar */
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--hunter); line-height: 1.22; margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
a { color: var(--hunter); }
a:hover { color: var(--clay-dim); }
ul, ol { padding-left: 1.3em; }
hr.rule { border: none; border-top: 1px solid var(--rule); margin: 2rem 0; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.center { text-align: center; }
.muted { color: #5b5044; }
.small { font-size: 0.88rem; }
.tag { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.76rem; color: var(--teal-dim, #4f847c); font-weight: 700; }

/* ---------- Skip link ---------- */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--hunter); color: #fff; padding: 0.6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Top utility bar ---------- */
.topbar { background: var(--hunter); color: var(--ivory); }
.topbar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.25rem 1rem; padding-top: 0.4rem; padding-bottom: 0.4rem; font-size: 0.82rem; }
.topbar a { color: var(--ivory); text-decoration: none; }
.topbar .phone-cta { font-weight: 700; font-size: 1.15rem; display: inline-flex; align-items: center; min-height: 44px; padding: 0.35rem 0.1rem; }

/* ---------- Masthead: centered classic ---------- */
.masthead { background: var(--ivory); }
.masthead .container { padding-top: 1.4rem; padding-bottom: 0.9rem; text-align: center; }
.brand-link { text-decoration: none; }
.brand-name { font-family: var(--serif); font-size: 1.85rem; margin: 0; color: var(--hunter); letter-spacing: 0.01em; }
.brand-tag { margin: 0.3rem 0 0; font-size: 0.92rem; color: var(--ink); font-style: italic; }
.masthead hr.rule--brand { max-width: 22rem; margin: 0.9rem auto 0; border: none; border-top: 3px double var(--hunter); }
nav.mainnav { border-bottom: 1px solid var(--rule); background: var(--ivory-dim); position: relative; }
nav.mainnav .navBar { display: flex; align-items: center; }

/* Desktop/tablet: flat row, grouped by small-caps label dividers */
nav.mainnav ul.navList { list-style: none; margin: 0; padding: 0.6rem 0; display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.3rem 1.1rem; }
nav.mainnav ul.navList a { text-decoration: none; color: var(--hunter); font-weight: 600; font-size: 0.9rem; padding: 0.2rem 0.1rem; border-bottom: 2px solid transparent; display: inline-block; }
nav.mainnav ul.navList a:hover, nav.mainnav ul.navList a[aria-current="page"] { border-bottom-color: var(--clay); color: var(--hunter-dim); }
nav.mainnav li.navLabel { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--teal-dim, #4f847c); font-weight: 700; padding-left: 0.85rem; margin-left: 0.1rem; border-left: 1px solid var(--rule); }

/* ---------- Mobile nav toggle (checkbox hack, no JS/framework) ---------- */
.navToggle { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.navToggleBtn {
  display: none; align-items: center; gap: 0.55rem; cursor: pointer;
  font-weight: 700; color: var(--hunter); font-size: 0.98rem;
  padding: 0.75rem 0.15rem; min-height: 44px;
}
.navToggleBars { display: flex; flex-direction: column; gap: 5px; width: 25px; flex-shrink: 0; }
.navToggleBars span { display: block; height: 3px; border-radius: 2px; background: var(--hunter); transition: transform 0.2s ease, opacity 0.2s ease; }
#navToggle:focus-visible ~ .navBar .navToggleBtn { outline: 2px solid var(--clay); outline-offset: 3px; }
#navToggle:checked ~ .navBar .navToggleBtn .navToggleBars span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#navToggle:checked ~ .navBar .navToggleBtn .navToggleBars span:nth-child(2) { opacity: 0; }
#navToggle:checked ~ .navBar .navToggleBtn .navToggleBars span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile slide-down panel, grouped by section */
.mobileNav { display: none; }

@media (max-width: 767px) {
  nav.mainnav ul.navList { display: none; }
  .navToggleBtn { display: flex; }

  .mobileNav {
    display: block; position: absolute; top: 100%; left: 0; right: 0;
    max-height: 0; overflow: hidden; background: var(--ivory);
    border-bottom: 1px solid var(--rule); box-shadow: 0 10px 20px rgba(0,0,0,0.16);
    transition: max-height 0.28s ease; z-index: 70;
  }
  #navToggle:checked ~ .mobileNav { max-height: 80vh; overflow-y: auto; }
  .mobileNavList { list-style: none; margin: 0; padding: 0.3rem 0; }
  .mobileNavList > li:not(.mobileNavGroup) { border-bottom: 1px solid var(--rule); }
  .mobileNavList > li > a {
    display: block; padding: 0.9rem 1.25rem; min-height: 44px; box-sizing: border-box;
    font-size: 1.02rem; font-weight: 600; text-decoration: none; color: var(--hunter);
  }
  .mobileNavList > li > a:hover, .mobileNavList > li > a[aria-current="page"] { color: var(--clay-dim); background: var(--ivory-dim); }
  .mobileNavGroup { border-bottom: 1px solid var(--rule); }
  .mobileNavGroupLabel {
    display: block; padding: 0.85rem 1.25rem 0.3rem; font-size: 0.74rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-dim, #4f847c);
  }
  .mobileNavGroup ul { list-style: none; margin: 0; padding: 0 0 0.4rem; }
  .mobileNavGroup ul li a {
    display: block; padding: 0.8rem 1.25rem 0.8rem 2.1rem; min-height: 44px; box-sizing: border-box;
    font-size: 1rem; text-decoration: none; color: var(--hunter);
  }
  .mobileNavGroup ul li a:hover, .mobileNavGroup ul li a[aria-current="page"] { color: var(--clay-dim); background: var(--ivory-dim); }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: 0.8rem; color: #5b5044; padding: 0.7rem 0 0; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.breadcrumbs li + li::before { content: "\203A"; margin-right: 0.35rem; color: var(--teal); }
.breadcrumbs a { color: var(--hunter); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero { padding: 1.6rem 0 1.1rem; }
.hero-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.hero-copy { flex: 1 1 20rem; }
.hero-copy h1 { font-size: 1.5rem; }
.hero .differentiator { font-size: 1rem; color: var(--hunter-dim); font-weight: 600; }
.hero-media { flex: 1 1 20rem; max-width: 26rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1rem; }

/* ---------- Hero photo (real image, palette-tinted overlay) ---------- */
.hero-photo { position: relative; border: 1px solid var(--rule); padding: 0.4rem; background: #fff; border-radius: 0.2rem; overflow: hidden; }
.hero-photo img { width: 100%; height: auto; display: block; border-radius: 0.1rem; }
.hero-photo::after {
  content: ""; position: absolute; inset: 0.4rem;
  background: linear-gradient(160deg, rgba(31,58,61,0.32) 0%, rgba(31,58,61,0.05) 45%, rgba(232,132,107,0.16) 100%);
  border-radius: 0.1rem; pointer-events: none;
}
@media (max-width: 47.9375em) {
  .hero-media { max-width: none; flex-basis: 100%; }
  .hero-photo img { max-height: 40vh; width: 100%; object-fit: cover; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-block; padding: 0.7rem 1.3rem; border-radius: 0.2rem; font-weight: 700; text-decoration: none; font-size: 0.98rem; border: 2px solid transparent; }
.btn--clay { background: var(--clay); color: #fff; }
.btn--clay:hover { background: var(--clay-dim); color: #fff; }
.btn--outline { background: transparent; border-color: var(--hunter); color: var(--hunter); }
.btn--outline:hover { background: var(--hunter); color: var(--ivory); }
.btn--outline-light { background: transparent; border-color: var(--ivory); color: var(--ivory); }
.btn--outline-light:hover { background: var(--ivory); color: var(--hunter); }
.btn--block { display: block; width: 100%; text-align: center; }

/* ---------- Trust bar ---------- */
.trustbar { background: var(--ivory-dim); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.trustbar ul { list-style: none; margin: 0; padding: 0.8rem 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.6rem; text-align: center; }
.trustbar li { font-size: 0.86rem; color: var(--hunter-dim); font-weight: 600; max-width: 13rem; }
.trustbar li span.dot { color: var(--clay); margin-right: 0.35em; }

/* ---------- Framed media object (photo/icon substitute, honesty-safe) ---------- */
.frame { border: 1px solid var(--rule); padding: 0.4rem; background: #fff; }
.frame-inner { border: 1px solid var(--hunter); padding: 1rem; text-align: center; background: var(--ivory-dim); }
.frame-inner svg { width: 100%; height: auto; max-width: 8rem; margin: 0 auto; color: var(--hunter); }
.frame-cap { font-size: 0.78rem; color: #5b5044; text-align: center; margin-top: 0.45rem; font-style: italic; }

/* ---------- Two-column brochure spread ---------- */
.spread { display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; padding: 1.8rem 0; }
.spread + .spread { border-top: 1px solid var(--rule); }
.spread.reverse { flex-direction: row-reverse; }
.spread-col { flex: 1 1 18rem; }

/* ---------- Boxes (pricing, cards) ---------- */
.box { border: 1px solid var(--rule); background: #fff; padding: 1.15rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); gap: 1.2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); gap: 1.2rem; }
.price-box h3 { margin-bottom: 0.15rem; }
.price-box .price { font-family: var(--serif); font-size: 1.4rem; color: var(--clay-dim); margin: 0.15rem 0 0.55rem; }
.badge { display: inline-block; background: var(--teal); color: #fff; font-size: 0.7rem; padding: 0.15rem 0.55rem; border-radius: 1rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.5rem; }

/* ---------- Steps / numbered process ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.1rem 2.5rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 1.75rem; height: 1.75rem; background: var(--hunter); color: var(--ivory); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--serif); font-size: 0.92rem; }
.steps li strong { color: var(--hunter-dim); }

/* ---------- Section shells ---------- */
section.section { padding: 1.85rem 0; }
section.section.alt { background: var(--ivory-dim); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
section.section.hunter { background: var(--hunter); color: var(--ivory); }
section.section.hunter h2, section.section.hunter h3 { color: var(--ivory); }
section.section.hunter a:not(.btn) { color: var(--ivory); }

/* ---------- Failure-mode list ---------- */
.fail-list { list-style: none; margin: 0; padding: 0; }
.fail-list li { padding: 0.6rem 0 0.6rem 1.9rem; border-bottom: 1px solid var(--rule); position: relative; }
.fail-list li:last-child { border-bottom: none; }
.fail-list li::before { content: "\26A0"; position: absolute; left: 0; top: 0.6rem; color: var(--clay-dim); }
.fail-list strong { color: var(--hunter-dim); }

/* ---------- Table ---------- */
table.price-table { width: 100%; border-collapse: collapse; background: #fff; }
table.price-table th, table.price-table td { border: 1px solid var(--rule); padding: 0.65rem 0.75rem; text-align: left; font-size: 0.92rem; vertical-align: top; }
table.price-table th { background: var(--hunter); color: var(--ivory); font-family: var(--serif); font-weight: 700; }
table.price-table tr:nth-child(even) td { background: var(--ivory-dim); }
.table-wrap { overflow-x: auto; }

/* ---------- FAQ ---------- */
details.faq { border-bottom: 1px solid var(--rule); padding: 0.8rem 0; }
details.faq summary { cursor: pointer; font-weight: 700; color: var(--hunter-dim); font-family: var(--serif); font-size: 1.02rem; }
details.faq summary::marker { color: var(--clay); }
details.faq p { margin-top: 0.55rem; }

/* ---------- Form ---------- */
.formwrap { max-width: 32rem; margin: 0 auto; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.3rem; font-size: 0.9rem; color: var(--hunter-dim); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.62rem 0.72rem; border: 1px solid var(--rule); border-radius: 0.2rem;
  font-size: 1rem; font-family: var(--sans); background: #fff; color: var(--ink);
}
.field textarea { min-height: 6rem; resize: vertical; }
.field .optional { font-weight: 400; color: #5b5044; font-size: 0.8rem; }
section.section.hunter .field label { color: var(--ivory); }

/* ---------- Coverage list ---------- */
.coverage-list { columns: 2; column-gap: 2rem; }
.coverage-list li { break-inside: avoid; margin-bottom: 0.35rem; }

/* ---------- Footer ---------- */
footer.sitefoot { background: var(--hunter); color: var(--ivory-dim); margin-top: 2rem; }
footer.sitefoot .container { padding: 2.1rem 1.25rem 1.4rem; }
footer.sitefoot h4 { color: var(--ivory); font-size: 0.98rem; }
footer.sitefoot a { color: var(--ivory-dim); text-decoration: none; }
footer.sitefoot a:hover { color: #fff; text-decoration: underline; }
.footgrid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.footgrid > div { flex: 1 1 12.5rem; }
.footgrid ul { list-style: none; padding: 0; margin: 0; }
.footgrid li { margin-bottom: 0.32rem; font-size: 0.9rem; }
.finePrint { text-align: center; font-size: 0.76rem; color: #a9bcbb; margin-top: 1.6rem; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 0.95rem; }

/* ---------- Sticky mobile CTA bar ---------- */
.mobile-cta { position: fixed; bottom: 0; left: 0; right: 0; display: flex; z-index: 40; box-shadow: 0 -2px 8px rgba(0,0,0,0.18); }
.mobile-cta a { flex: 1 1 50%; text-align: center; padding: 0.85rem 0.5rem; font-weight: 700; font-size: 0.98rem; text-decoration: none; min-height: 48px; display: flex; align-items: center; justify-content: center; }
.mobile-cta .call { background: var(--clay); color: #fff; }
.mobile-cta .quote { background: var(--hunter); color: var(--ivory); border-left: 1px solid rgba(255,255,255,0.25); }

@media (min-width: 56.25em) { /* 900px */
  .mobile-cta { display: none; }
  body { padding-bottom: 0; }
}

@media (min-width: 42em) {
  h1 { font-size: 2rem; }
  .hero-copy h1 { font-size: 1.85rem; }
  h2 { font-size: 1.65rem; }
  .brand-name { font-size: 2.1rem; }
}

@media (max-width: 30em) {
  .coverage-list { columns: 1; }
}

@media (prefers-color-scheme: dark) {
  body { background: #17221f; color: #ece5d6; }
  .masthead, nav.mainnav, .mobileNav, section.section, .trustbar, .box, .frame, .frame-inner, .hero-photo, table.price-table td, .field input, .field select, .field textarea { background: #1c2a26; color: #ece5d6; }
  table.price-table tr:nth-child(even) td { background: #223330; }
  .frame-inner { background: #223330; }
  h1, h2, h3, h4 { color: #cfe4de; }
  hr.rule, hr.rule--brand, .spread + .spread, .fail-list li, details.faq, .box, .frame, .hero-photo, table.price-table th, table.price-table td, nav.mainnav, .mobileNav, .mobileNavGroup, .mobileNavList > li, section.section.alt, .trustbar, li.navLabel { border-color: #33453f; }
  a { color: #9fd0c6; }
  .price-box .price { color: #f0a58e; }
  .muted { color: #b7ac97; }
  .navToggleBars span { background: #cfe4de; }
  .navToggleBtn { color: #cfe4de; }
  nav.mainnav ul.navList a { color: #cfe4de; }
  .mobileNavList > li > a, .mobileNavGroup ul li a { color: #ece5d6; }
}
:root[data-theme="dark"] body { background: #17221f; color: #ece5d6; }
:root[data-theme="dark"] .masthead, :root[data-theme="dark"] nav.mainnav, :root[data-theme="dark"] .mobileNav, :root[data-theme="dark"] section.section, :root[data-theme="dark"] .trustbar, :root[data-theme="dark"] .box, :root[data-theme="dark"] .frame, :root[data-theme="dark"] .frame-inner, :root[data-theme="dark"] .hero-photo, :root[data-theme="dark"] .field input, :root[data-theme="dark"] .field select, :root[data-theme="dark"] .field textarea { background: #1c2a26; color: #ece5d6; }
:root[data-theme="dark"] h1, :root[data-theme="dark"] h2, :root[data-theme="dark"] h3, :root[data-theme="dark"] h4 { color: #cfe4de; }
:root[data-theme="dark"] a { color: #9fd0c6; }
:root[data-theme="light"] body { background: var(--ivory); color: var(--ink); }


/* Mobile table fit - prevent right-edge cutoff on phones (added 2026-07-08) */
@media (max-width: 40rem) {
  table { min-width: 0 !important; width: 100% !important; font-size: 0.82rem !important; display: table !important; }
  table th, table td { padding: 0.45rem 0.4rem !important; white-space: normal !important; word-break: break-word; overflow-wrap: anywhere; }
  .tableScroll, .table-wrap, .table-scroll, [class*="table"] { overflow-x: visible !important; }
}
/* Consent row: visible failure state (see scripts/fix_consent_row.py). */
.consent-row input[name="consent"]:user-invalid { outline: 2px solid #c0392b; outline-offset: 2px; }
.consent-row input[name="consent"]:user-invalid ~ span { color: #c0392b; }
.consent-row input[name="consent"]:user-invalid ~ span::after {
  content: " Please check this box so we can call you back.";
  display: block; font-weight: 600; margin-top: 4px;
}

/* hero-band: replaces removed AI photo */
.hero-photo{
  background:
    linear-gradient(135deg, color-mix(in srgb, currentColor 14%, transparent) 0%,
                            color-mix(in srgb, currentColor 4%, transparent) 60%,
                            transparent 100%),
    repeating-linear-gradient(135deg,
      color-mix(in srgb, currentColor 7%, transparent) 0 14px,
      transparent 14px 28px);
  border-radius:10px;
  min-height:180px;
}
@media (min-width:900px){ .hero-photo{ min-height:280px; } }
