/* High Country Roofing — shared styles.
   Most layout lives in inline styles on each page (carried over from the approved design);
   this file holds the base, the header/nav, form controls and responsive rules. */

:root {
  --red: #CC0000;
  --red-text: #B80000;
  --red-dark: #8A0000;
  --ink: #1E1E20;
  --charcoal: #58585A;
  --ground: #F1F1F1;
  --line: #DCDCDC;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Barlow, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-size: 18px;
  line-height: 1.55;
}
img { max-width: 100%; }
a { color: var(--red-text); }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid #1D6FE0; outline-offset: 2px; }
h1, h2, h3, h4 { text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Skip link */
.skip { position: absolute; left: 12px; top: -60px; background: #fff; color: var(--ink); padding: 10px 14px; border-radius: 6px; z-index: 100; font-weight: 700; }
.skip:focus { top: 12px; }

/* Header + nav */
.site-nav { background: var(--charcoal); border-bottom: 4px solid var(--red); }
.site-nav .wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; gap: 0 4px; font-weight: 600; font-size: 16px; letter-spacing: .5px; }
.site-nav a { color: #fff; text-decoration: none; padding: 12px 18px; }
.site-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.site-nav a[aria-current="page"] { background: var(--red); }
.menu-btn { display: none; }

/* Choice chips built on real radio inputs */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; min-height: 48px; padding: 10px 18px;
  border-radius: 999px; border: 2px solid #BDBDBF; background: #fff; color: var(--ink);
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.chip input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid #1D6FE0; outline-offset: 2px; }
.chips.dark .chip span { background: #2F2F31; border-color: #6A6A6C; color: #fff; }
.chips.dark .chip input:checked + span { background: var(--red); border-color: var(--red); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 15px; font-weight: 600; }
.field input, .field select, .field textarea {
  min-height: 48px; padding: 0 14px; border: 1px solid #A0A0A2; border-radius: 6px;
  font: inherit; font-size: 17px; background: #fff; color: var(--ink);
}
.field textarea { padding: 12px 14px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px;
  border-radius: 6px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 2px solid transparent;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); color: #fff; }
.btn-line { background: #fff; color: var(--ink); border-color: var(--ink); }
.form-error { color: var(--red-text); font-weight: 600; margin: 0; }

/* Before/after slider */
.ba { position: relative; width: 100%; aspect-ratio: 1039 / 550; overflow: hidden; border-radius: 10px; background: #2F2F31; touch-action: pan-y; }
.ba > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-before { position: absolute; top: 0; left: 0; bottom: 0; width: 50%; overflow: hidden; border-right: 3px solid #fff; }
.ba-before img { position: absolute; top: 0; left: 0; height: 100%; max-width: none; object-fit: cover; }

/* Mobile call/book bar */
.mbar { display: none; }

@media (max-width: 760px) {
  body { font-size: 17px; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px;
    background: none; border: 0; color: #fff; font: inherit; font-weight: 700; letter-spacing: 1px; cursor: pointer;
  }
  .site-nav .wrap { padding: 0 8px; }
  .site-nav .links { display: none; width: 100%; flex-direction: column; padding-bottom: 8px; }
  .site-nav.open .links { display: flex; }
  .site-nav .links a { padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.15); }
  .hide-sm { display: none !important; }
  h1 { font-size: 46px !important; }
  h2 { font-size: 38px !important; }
  section > div { padding-left: 16px !important; padding-right: 16px !important; }
  .mbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff;
    border-top: 1px solid var(--line); padding: 10px 12px; gap: 10px;
  }
  body { padding-bottom: 76px; }
}
@media (min-width: 761px) {
  .site-nav .links { display: flex; flex-wrap: wrap; gap: 0 4px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
