/* === TOKENS ===
   Ozark Stone (warm grey-tan, karst limestone bluffs): background/neutral
   Weathered Cedar (warm reddish-brown, named decking material): primary accent
   Hardwood Canopy (deep forest green, Ozarks oak-hickory cover): header/nav
   Freeze Slate (cool blue-charcoal, winter freeze-thaw + composite tones): text
*/
:root {
  --stone:      #efe9dd;
  --stone-line: #cfc3ab;
  --cedar:      #a3491f;
  --cedar-dark: #7e3717;
  --canopy:     #2c4234;
  --canopy-lt:  #3c5a48;
  --slate:      #262c30;
  --text:       #262c30;
  --bg:         #f7f4ed;
  --card-bg:    #ffffff;
  --max-w:      880px;
  --radius:     4px;
  --font-display: 'Archivo', sans-serif;
  --font-body:    'Public Sans', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg); color: var(--text); line-height: 1.7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cedar); }
a:hover { color: var(--cedar-dark); }

/* === TYPOGRAPHY === */
h1, h2, h3 {
  font-family: var(--font-display); font-weight: 800;
  line-height: 1.2; color: var(--canopy);
}
h1 { font-size: clamp(1.8rem, 5vw, 2.7rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.4rem; color: var(--canopy); }
p  { margin-bottom: 1rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.35rem; }
strong { font-weight: 700; }
.mono { font-family: var(--font-mono); }

/* === LAYOUT === */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.content-area { max-width: var(--max-w); margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }

/* === SIGNATURE DEVICE: baluster-line section divider ===
   Vertical picket lines, evenly spaced, echoing the guardrail baluster
   spacing content that's a real differentiator across the permit pages. */
.section-divider {
  border: none; height: 22px; margin: 2.5rem 0 2rem;
  background-image: repeating-linear-gradient(
    to right,
    var(--cedar) 0, var(--cedar) 3px,
    transparent 3px, transparent 22px
  );
  background-position: center;
  background-repeat: repeat-x;
  background-size: auto 100%;
  opacity: 0.55;
}

/* === HEADER === */
.site-header { background: var(--canopy); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.25rem; max-width: var(--max-w); margin: 0 auto;
}
.logo {
  color: white; font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 800; text-decoration: none; line-height: 1.2;
}
.logo span { display: block; font-size: 0.68rem; font-weight: 400; opacity: .75; letter-spacing: .05em; font-family: var(--font-body); }
.header-phone { color: #e8c9a8; font-weight: 700; font-size: 1.02rem; text-decoration: none; font-family: var(--font-mono); }
.header-phone:hover { color: white; }
.nav-toggle { display: none; background: none; border: none; color: white; font-size: 1.6rem; cursor: pointer; line-height: 1; padding: 0 0.25rem; }

/* === NAV === */
.site-nav { background: rgba(0,0,0,.2); }
.nav-list { display: flex; list-style: none; max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; flex-wrap: wrap; }
.nav-list > li > a { display: block; padding: 0.55rem 0.85rem; color: rgba(255,255,255,.85); text-decoration: none; font-size: 0.85rem; white-space: nowrap; }
.nav-list > li > a:hover { color: white; }
.nav-cta > a { background: var(--cedar); color: white !important; border-radius: var(--radius); margin: 0.3rem 0.4rem; padding: 0.4rem 1rem !important; }
.nav-cta > a:hover { background: var(--cedar-dark) !important; }

/* === HERO === */
.hero { position: relative; height: 440px; overflow: hidden; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(44,66,52,.92) 0%, rgba(44,66,52,.6) 55%, rgba(44,66,52,.2) 100%);
  display: flex; align-items: center;
}
.hero-content { padding: 0 1.25rem; max-width: 640px; margin: 0 auto; width: 100%; }
.hero h1 { color: white; margin-bottom: 0.75rem; max-width: 640px; }
.hero-sub { color: rgba(255,255,255,.85); margin-bottom: 1.25rem; font-size: 1.05rem; max-width: 560px; }
.btn-cta {
  display: inline-block; background: var(--cedar); color: white;
  padding: 0.8rem 1.75rem; border-radius: var(--radius);
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 700;
  text-decoration: none;
}
.btn-cta:hover { background: var(--cedar-dark); color: white; }

/* === SUPPORTING PAGE IMAGE === */
.page-image { width: 100%; height: 320px; object-fit: cover; border-radius: 6px; margin: 1.25rem 0; }
@media (max-width: 640px) {
  .hero { height: 360px; }
  .hero-content { padding: 0 1.25rem; }
  .page-image { height: 220px; }
}

/* === PAGE HEADER (non-home) === */
.page-header { background: var(--canopy); padding: 2.5rem 1.25rem 2rem; }
.page-header h1 { color: white; max-width: var(--max-w); margin: 0 auto; }

/* === SECTION SUBHEAD === */
p.subhead { font-weight: 700; color: var(--canopy); margin-bottom: 0.25rem; font-size: 1rem; }

/* === TABLE === */
.table-wrap { overflow-x: auto; margin-bottom: 1.5rem; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th { background: var(--canopy); color: white; padding: 0.6rem 0.85rem; text-align: left; font-family: var(--font-display); font-size: 0.9rem; }
td { padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--stone-line); font-family: var(--font-mono); font-size: 0.92rem; }
td:first-child { font-family: var(--font-body); }
tr:nth-child(even) td { background: var(--stone); }

/* === FAQ ACCORDION === */
.faq-section { margin-top: 0.5rem; }
.faq-item { border-bottom: 1px solid var(--stone-line); }
.faq-item summary {
  padding: 1rem 0; cursor: pointer; font-weight: 700; color: var(--canopy);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; font-family: var(--font-display); font-size: 0.98rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.4rem; color: var(--cedar); flex-shrink: 0; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { padding: 0 0 1rem; }

/* === SERVICE LINK CARDS === */
.service-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.9rem; margin: 1.5rem 0; }
.service-link-card {
  display: block; background: var(--card-bg); border: 1px solid var(--stone-line); border-radius: 6px;
  padding: 1rem 1.1rem; text-decoration: none; color: var(--text);
}
.service-link-card:hover { border-color: var(--cedar); }
.service-link-card strong { display: block; font-family: var(--font-display); color: var(--canopy); margin-bottom: 0.25rem; font-size: 1rem; }
.service-link-card span { font-size: 0.85rem; color: var(--text); opacity: 0.8; }

/* === DECK COST ESTIMATOR === */
.estimator-wrapper { background: var(--card-bg); border: 1px solid var(--stone-line); border-radius: 8px; padding: 1.75rem; margin: 1.5rem 0; }
.estimator-controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; margin-bottom: 1.25rem; }
.estimator-field label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--canopy); margin-bottom: 0.35rem; }
.estimator-field select { width: 100%; padding: 0.55rem; border: 1px solid var(--stone-line); border-radius: var(--radius); font-family: var(--font-body); background: white; }
.estimator-checkbox { display: flex; align-items: center; gap: 0.5rem; grid-column: 1 / -1; }
.estimator-checkbox label { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.estimator-result { text-align: center; padding: 1.25rem 0.5rem; border-top: 1px solid var(--stone-line); border-bottom: 1px solid var(--stone-line); margin-bottom: 1rem; }
.estimator-range { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; color: var(--cedar); }
.estimator-range-label { font-size: 0.8rem; color: var(--text); opacity: 0.7; margin-top: 0.15rem; }
.estimator-note {
  border-left: 4px solid var(--cedar); padding: 0.75rem 1rem;
  background: var(--stone); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.92rem;
}
.estimator-cta { text-align: center; margin-top: 1.25rem; }

/* === QUOTE FORM === */
.quote-form { background: var(--card-bg); border: 1px solid var(--stone-line); border-radius: 6px; padding: 2rem; margin-top: 1.5rem; }
.quote-form .form-title { font-family: var(--font-display); font-size: 1.3rem; color: var(--canopy); margin-bottom: 1.25rem; }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 700; font-size: 0.875rem; margin-bottom: 0.3rem; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 0.6rem 0.75rem;
  border: 1px solid var(--stone-line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 1rem; background: white;
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-submit {
  width: 100%; padding: 0.8rem; border: none; border-radius: var(--radius); cursor: pointer;
  background: var(--cedar); color: white;
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 700;
}
.form-submit:hover { background: var(--cedar-dark); }
.form-submit:disabled { opacity: .65; cursor: not-allowed; }
.form-msg { margin-top: 0.85rem; padding: 0.75rem; border-radius: var(--radius); display: none; font-size: 0.95rem; }
.form-msg.success { background: #d9ead9; color: #1e4620; display: block; }
.form-msg.error   { background: #f5d9d3; color: #7a2a17; display: block; }

/* === FOOTER === */
.site-footer { background: var(--canopy); color: rgba(255,255,255,.8); padding: 3rem 1.25rem 1rem; margin-top: 3rem; }
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 2rem; max-width: var(--max-w); margin: 0 auto 2rem;
}
.footer-col strong { color: white; display: block; margin-bottom: 0.6rem; font-family: var(--font-display); font-size: 1rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.3rem; }
.footer-col a { color: rgba(255,255,255,.7); text-decoration: none; font-size: 0.875rem; }
.footer-col a:hover { color: white; }
.footer-col p { font-size: 0.875rem; margin-bottom: 0.4rem; }
.footer-phone { color: #e8c9a8 !important; font-weight: 700 !important; font-size: 1rem !important; font-family: var(--font-mono); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15); padding-top: 1.1rem;
  text-align: center; font-size: 0.8rem; color: rgba(255,255,255,.45);
  max-width: var(--max-w); margin: 0 auto;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .nav-list { flex-direction: column; padding: 0.5rem 0; }
  .nav-list > li > a { padding: 0.7rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-cta > a { margin: 0.5rem 1.5rem; display: block; text-align: center; }
  .estimator-controls { grid-template-columns: 1fr; }
}

/* === DARK MODE === */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1f22; --text: #e6e2d8; --card-bg: #24292d;
    --stone: #2c3236; --stone-line: #3d444a;
  }
  .quote-form, .estimator-wrapper, .service-link-card { background: var(--card-bg); border-color: var(--stone-line); }
  .estimator-field label { color: #d7b896; }
  .form-row input, .form-row select, .form-row textarea, .estimator-field select { background: #1b1f22; border-color: var(--stone-line); color: var(--text); }
  td { border-color: var(--stone-line); }
  tr:nth-child(even) td { background: #22262a; }
  .faq-item { border-color: var(--stone-line); }
  .estimator-note { background: #22262a; }
  h2, h3, .service-link-card strong { color: #9fc2ab; }
  .page-header h1, .hero h1, .footer-col strong { color: white; }
  .quote-form .form-title { color: white; }
  .faq-item summary { color: #9fc2ab; }
  .hero { background: linear-gradient(135deg, #1b2b21 0%, #2c4234 55%, #3d444a 140%); }
}
