/* 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; }
.brand img { height: 56px; width: auto; }
.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);
  color: #fff;
  border: 0;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.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); }

.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: 60px; margin-bottom: 16px; filter: brightness(0) invert(1); }
.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;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  h1 { font-size: 2.1rem; }
  .hero h1 { font-size: 2.4rem; }
  .hero .tagline { font-size: 1.2rem; }
  .two-col { grid-template-columns: 1fr; gap: 30px; }
  .cards { grid-template-columns: 1fr; }
  .testimonials { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .site-footer .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .topbar .container { justify-content: center; }
  .topbar ul { gap: 14px; justify-content: center; font-size: .8rem; }

  .nav-toggle { display: inline-block; }
  .main-nav {
    position: absolute; top: 100%; right: 0; left: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 24px;
    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; }
  .header-cta { display: none; }
}
@media (max-width: 520px) {
  .gallery { grid-template-columns: 1fr; }
  .hero { min-height: 420px; }
}
