/* Castle Peak Roofing — static site */
:root {
  --brand-dark: #1d2a3a;
  --brand-darker: #0f1822;
  --brand-accent: #c8a35a;
  --brand-red: #b3261e;
  --text: #2a2a2a;
  --muted: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --border: #e5e7eb;
  --shadow: 0 6px 18px rgba(0,0,0,.08);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand-accent); }
h1, h2, h3, h4 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: var(--brand-darker);
  margin: 0 0 .5em 0;
  line-height: 1.2;
  letter-spacing: .3px;
}
h1 { font-size: 2.6rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 700; }
h4 { font-size: 1.15rem; font-weight: 700; }
p  { margin: 0 0 1em 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--brand-darker);
  color: #d8dde6;
  font-size: .9rem;
  padding: 8px 0;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; gap: 22px; flex-wrap: wrap;
}
.topbar li { display: flex; align-items: center; gap: 6px; }
.topbar a { color: #d8dde6; }
.topbar a:hover { color: var(--brand-accent); }
.topbar .icon { color: var(--brand-accent); }

/* ---------- Header ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; padding-bottom: 14px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand img { height: 90px; width: auto; max-width: none; }
.brand .brand-text { line-height: 1.1; }
.brand .brand-text strong {
  font-size: 1.05rem; color: var(--brand-darker); letter-spacing: 1px;
}
.brand .brand-text span {
  display: block; font-size: .8rem; color: var(--muted); letter-spacing: 2px;
}

.nav-toggle {
  display: none;
  background: var(--brand-dark);
  border: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
}
.nav-toggle span {
  display: block;
  position: absolute;
  left: 11px;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .15s ease, top .25s ease;
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-toggle.open span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 26px; align-items: center;
}
.main-nav a {
  color: var(--brand-darker);
  font-weight: 600;
  padding: 6px 0;
  position: relative;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--brand-accent);
}
.main-nav a.active::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -4px;
  height: 2px; background: var(--brand-accent);
}
.btn {
  display: inline-block;
  padding: 11px 22px;
  background: var(--brand-red);
  color: #fff !important;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: .5px;
  border: 0; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: #962019; color: #fff; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--brand-darker) !important;
  border: 2px solid var(--brand-darker);
}
.btn-outline:hover { background: var(--brand-darker); color: #fff !important; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 540px;
  background: linear-gradient(rgba(15,24,34,.55), rgba(15,24,34,.55)),
              url('../images/IMG_0575-1-scaled.jpeg') center/cover no-repeat;
  display: flex; align-items: center;
  color: #fff;
}
.hero .container { padding-top: 90px; padding-bottom: 90px; }
.hero h1 {
  color: #fff;
  font-size: 3.4rem;
  text-shadow: 0 2px 14px rgba(0,0,0,.6);
  margin-bottom: .25em;
}
.hero .tagline {
  color: var(--brand-accent);
  font-size: 1.6rem; font-weight: 600;
  text-shadow: 0 2px 10px rgba(0,0,0,.6);
  margin-bottom: 1.5em;
  letter-spacing: 1.5px;
}
.hero .hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .hero-actions .btn-outline {
  color: #fff !important; border-color: #fff;
}
.hero .hero-actions .btn-outline:hover {
  background: #fff; color: var(--brand-darker) !important;
}

/* ---------- Sections ---------- */
section { padding: 70px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--brand-darker); color: #e7ebf1; }
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }

.eyebrow {
  display: inline-block;
  color: var(--brand-accent);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}
.two-col img { border-radius: 8px; box-shadow: var(--shadow); }

.image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.image-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 30px;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.12); }
.card h4 { color: var(--brand-darker); margin-bottom: 10px; }
.card p { color: var(--muted); margin-bottom: 0; }

/* ---------- Testimonials ---------- */
.testimonials {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 30px;
}
.testimonial {
  background: rgba(255,255,255,.06);
  border-left: 4px solid var(--brand-accent);
  padding: 22px 26px;
  border-radius: 6px;
}
.testimonial p { font-style: italic; margin-bottom: 12px; }
.testimonial h4 { color: var(--brand-accent); margin: 0; font-size: 1rem; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery a {
  display: block; overflow: hidden; border-radius: 8px;
  box-shadow: var(--shadow); aspect-ratio: 4 / 3;
}
.gallery img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.gallery a:hover img { transform: scale(1.06); }

/* ---------- FAQ accordion ---------- */
.faq {
  max-width: 820px; margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-q {
  width: 100%;
  background: none; border: 0;
  text-align: left;
  padding: 20px 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-darker);
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-q::after { content: '+'; color: var(--brand-accent); font-size: 1.6rem; transition: transform .2s; }
.faq-item.open .faq-q::after { content: '−'; }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease;
}
.faq-a div { padding: 0 0 22px 0; color: var(--muted); }
.faq-item.open .faq-a { max-height: 600px; }

/* ---------- Forms ---------- */
.form-wrap {
  background: #fff;
  padding: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: 720px; margin: 0 auto;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--brand-darker);
  font-size: .95rem;
}
.field .req { color: var(--brand-red); }
.field .hint { font-size: .85rem; color: var(--muted); margin: 4px 0 0; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--brand-accent);
  outline-offset: 1px;
  border-color: var(--brand-accent);
}
.field textarea { min-height: 110px; resize: vertical; }

.captcha-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.captcha-row span { font-weight: 600; }
.captcha-icons { display: flex; gap: 8px; }
.captcha-icons button {
  width: 60px; height: 60px;
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 8px; cursor: pointer;
  font-size: 1.6rem;
  transition: border-color .15s ease;
}
.captcha-icons button:hover { border-color: var(--brand-accent); }
.captcha-icons button.selected { border-color: var(--brand-accent); background: #fff8e8; }

.form-msg {
  margin-top: 14px; padding: 10px 14px; border-radius: 6px;
  display: none;
}
.form-msg.success { background: #e9f7ee; color: #1b6e2f; display: block; }
.form-msg.error   { background: #fde8e7; color: #8a1f1a; display: block; }

/* ---------- Page header (subpages) ---------- */
.page-head {
  background: linear-gradient(rgba(15,24,34,.62), rgba(15,24,34,.62)),
              url('../images/IMG_0575-1-scaled.jpeg') center/cover no-repeat;
  color: #fff;
  text-align: center;
  padding: 80px 0 60px;
}
.page-head h1 { color: #fff; font-size: 3rem; }
.page-head .crumbs { color: var(--brand-accent); letter-spacing: 2px; text-transform: uppercase; font-size: .85rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brand-darker);
  color: #b9c1cc;
  padding: 50px 0 0;
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.site-footer h4 { color: #fff; margin-bottom: 18px; font-size: 1.05rem; letter-spacing: 1px; text-transform: uppercase; }
.site-footer a { color: #b9c1cc; }
.site-footer a:hover { color: var(--brand-accent); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { padding: 6px 0; }
.site-footer .footer-brand img { height: 90px; margin-bottom: 16px; filter: brightness(0) invert(1); max-width: none; }
.site-footer .footer-bottom {
  border-top: 1px solid #25313f;
  padding: 18px 0;
  text-align: center;
  font-size: .85rem;
}

/* ---------- Lightbox ---------- */
.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; max-width: 100%; border-radius: 6px; }
.lightbox button {
  position: absolute; top: 24px; right: 24px;
  width: 44px; height: 44px;
  background: #fff; border: 0; border-radius: 50%;
  font-size: 1.5rem; cursor: pointer;
}

/* Card layout modifiers */
.cards.cards-2col { grid-template-columns: repeat(2, 1fr); }
.card.card-wide { grid-column: span 2; }

/* ---------- Responsive: tablet ---------- */
@media (max-width: 1024px) {
  section { padding: 56px 0; }
  .hero { min-height: 480px; }
  .hero h1 { font-size: 2.8rem; }
  .two-col { gap: 36px; }
  .cards, .cards.cards-2col { grid-template-columns: repeat(2, 1fr); }
  .card.card-wide { grid-column: auto; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Responsive: mobile ---------- */
@media (max-width: 900px) {
  body { font-size: 15px; }
  section { padding: 44px 0; }
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  h4 { font-size: 1.05rem; }

  .container { padding: 0 18px; }

  /* Topbar — compact, no Free estimate button (CTA still in dark bar text-link form) */
  .topbar { padding: 6px 0; font-size: .8rem; }
  .topbar .container {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  .topbar ul {
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
  }
  .topbar .btn {
    padding: 7px 14px;
    font-size: .8rem;
  }
  /* Hide the address on small screens — it's already in the footer */
  .topbar li:nth-child(3) { display: none; }

  /* Header — tighter, sticky */
  .site-header .container {
    padding-top: 10px; padding-bottom: 10px;
    position: relative;
  }
  .brand img { height: 64px; }
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; top: 100%; right: 0; left: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    padding: 6px 18px;
    gap: 0;
  }
  .main-nav li { border-bottom: 1px solid var(--border); }
  .main-nav li:last-child { border-bottom: 0; }
  .main-nav a { display: block; padding: 14px 0; min-height: 44px; }
  .main-nav a.active::after { display: none; }
  .main-nav a.active { color: var(--brand-accent); }
  .header-cta { display: none; }

  /* Hero — tighter and more legible on small screens */
  .hero { min-height: 420px; }
  .hero .container { padding-top: 60px; padding-bottom: 60px; }
  .hero h1 { font-size: 2rem; letter-spacing: 1px; }
  .hero .tagline { font-size: 1.1rem; margin-bottom: 1.2em; letter-spacing: 1px; }
  .hero .hero-actions { flex-direction: column; align-items: stretch; }
  .hero .hero-actions .btn { text-align: center; padding: 13px 18px; }

  /* Page head (subpages) */
  .page-head { padding: 50px 0 36px; }
  .page-head h1 { font-size: 2rem; }
  .page-head .crumbs { font-size: .75rem; letter-spacing: 1.5px; }

  /* Layout grids → 1 col */
  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .cards, .cards.cards-2col { grid-template-columns: 1fr; gap: 16px; }
  .card.card-wide { grid-column: auto; }
  .card { padding: 22px 20px; }
  .testimonials { grid-template-columns: 1fr; gap: 16px; }
  .testimonial { padding: 18px 20px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .form-row { grid-template-columns: 1fr; }

  /* Forms — tap-friendly, no iOS zoom on focus (16px input) */
  .form-wrap { padding: 22px 18px; }
  .field input, .field select, .field textarea {
    font-size: 16px;
    padding: 12px 12px;
  }
  .captcha-icons { flex-wrap: wrap; gap: 10px; }
  .captcha-icons button { width: 56px; height: 56px; }

  /* Buttons get a comfortable tap target */
  .btn { padding: 13px 22px; }

  /* Footer */
  .site-footer { padding: 36px 0 0; }
  .site-footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 28px;
  }
  .site-footer .footer-brand img { height: 70px; margin-bottom: 12px; }

  /* FAQ */
  .faq-q { font-size: 1rem; padding: 16px 0; }

  /* Lightbox close button */
  .lightbox button { top: 16px; right: 16px; }
}

/* ---------- Responsive: small phones ---------- */
@media (max-width: 520px) {
  .hero { min-height: 380px; }
  .hero h1 { font-size: 1.7rem; }
  .hero .tagline { font-size: 1rem; }
  .gallery { grid-template-columns: 1fr; gap: 12px; }
  .gallery a { aspect-ratio: 16 / 10; }
  .topbar ul { gap: 10px; font-size: .75rem; }
  .topbar li:nth-child(2) { /* keep email visible */ }
  .page-head { padding: 40px 0 28px; }
  .page-head h1 { font-size: 1.7rem; }
  .container { padding: 0 14px; }
}
