/*
Theme Name: Charter Oak Roofing
Theme URI: https://charteroakroofing.com
Author: Charter Oak Roofing
Description: Custom high-performance theme for Charter Oak Roofing — roof replacement in Milford, CT. Built for SEO, AI search, and conversion.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: charter-oak-roofing
*/

/* ============ Design tokens ============ */
:root {
  --navy: #2c3a1f;
  --navy-2: #3b4d2a;
  --slate: #5c6a4d;
  --amber: #a99245;
  --amber-dark: #8f7a35;
  --cream: #faf7f2;
  --white: #ffffff;
  --line: #e6e1d8;
  --text: #232f3b;
  --muted: #5c6b7a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(32, 42, 20, .10);
  --shadow-lg: 0 24px 60px rgba(32, 42, 20, .18);
  --max: 1180px;
}

/* Hide any page-builder header/footer injected by leftover plugins */
.elementor-location-header, .elementor-location-footer { display: none !important; }

/* ============ Reset / base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  font-size: 17px;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--amber-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: inherit; color: var(--navy); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1.1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 22px; }
.section { padding: 84px 0; }
.section--alt { background: var(--cream); }
.section--dark { background: var(--navy); color: #d7dee6; }
.section--dark h2, .section--dark h3 { color: var(--white); }
.kicker {
  display: inline-block; text-transform: uppercase; letter-spacing: .14em;
  font-size: .78rem; font-weight: 700; color: var(--amber-dark); margin-bottom: 10px;
}
.section--dark .kicker { color: var(--amber); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 720px; }
.section--dark .lead { color: #aebac6; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ============ Buttons ============ */
.btn {
  display: inline-block; padding: 15px 30px; border-radius: 999px;
  font-weight: 700; font-size: 1rem; line-height: 1.2; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none !important;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--amber); color: #fff !important; box-shadow: 0 8px 24px rgba(169, 146, 69, .40); }
.btn--primary:hover { background: var(--amber-dark); }
.btn--ghost { border-color: rgba(255,255,255,.5); color: #fff !important; }
.btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn--dark { background: var(--navy); color: #fff !important; }
.btn--dark:hover { background: var(--navy-2); }
.btn--lg { padding: 18px 38px; font-size: 1.08rem; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: #26311a;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 22px; max-width: var(--max); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none !important; }
.brand img { height: 46px; width: auto; }
.brand-name { color: #fff; font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; }
.brand-name small { display: block; color: var(--amber); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.main-nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.main-nav a { color: #cfd8e0; font-weight: 600; font-size: .95rem; }
.main-nav a:hover { color: #fff; text-decoration: none; }
.header-cta { display: flex; align-items: center; gap: 12px; }
.header-phone { color: #fff; font-weight: 800; font-size: 1.02rem; white-space: nowrap; }
.header-phone:hover { color: var(--amber); text-decoration: none; }
.btn--header { padding: 11px 22px; font-size: .92rem; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 26px; height: 3px; background: #fff; margin: 5px 0; border-radius: 2px; transition: .2s; }

/* ============ Hero ============ */
.hero { position: relative; min-height: 88vh; display: flex; align-items: center; overflow: hidden; background: var(--navy); }
.hero-media { position: absolute; inset: 0; }
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(21, 28, 12, .88) 0%, rgba(21, 28, 12, .60) 48%, rgba(21, 28, 12, .26) 100%); }
.hero-content { position: relative; z-index: 2; max-width: var(--max); margin: 0 auto; padding: 110px 22px; width: 100%; }
.hero-content h1 { color: #fff; max-width: 15ch; }
.hero-content .accent { color: var(--amber); }
.hero-sub { color: #d5dde5; font-size: 1.2rem; max-width: 560px; margin-bottom: 30px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px 26px; color: #b9c4cf; font-size: .92rem; font-weight: 600; }
.hero-badges span { display: inline-flex; align-items: center; gap: 8px; }
.hero-badges strong { color: #fff; }
.star { color: #d9b95c; }

/* ============ Trust bar ============ */
.trustbar { background: var(--amber); }
.trustbar-inner { max-width: var(--max); margin: 0 auto; padding: 16px 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 44px; color: #fff; font-weight: 700; font-size: .95rem; }

/* ============ Cards / grids ============ */
.grid { display: grid; gap: 26px; margin-top: 44px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 28px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card h3 { margin-top: 4px; }
.card p { color: var(--muted); font-size: .98rem; margin-bottom: 18px; }
.card .card-link { font-weight: 700; }
.card-icon { width: 52px; height: 52px; border-radius: 12px; background: rgba(169,146,69,.16); display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 16px; }

/* ============ Gallery ============ */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px; }
.gallery-grid--2 { grid-template-columns: repeat(2, 1fr); }
.gallery-item { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 3; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 14px;
  background: linear-gradient(transparent, rgba(21,28,12,.85)); color: #fff; font-weight: 700; font-size: .95rem;
}
.gallery-caption small { display: block; font-weight: 500; color: #cfd8e0; font-size: .8rem; }

/* ============ Steps ============ */
.step { position: relative; padding-left: 0; }
.step-num { font-size: 2.6rem; font-weight: 800; color: var(--amber); line-height: 1; margin-bottom: 12px; }

/* ============ Reviews ============ */
.review-card { background: var(--white); border-radius: var(--radius); padding: 30px 28px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.review-stars { color: #c7a94e; font-size: 1.1rem; letter-spacing: 2px; margin-bottom: 12px; }
.review-card p { font-size: .98rem; color: var(--text); }
.review-name { font-weight: 700; color: var(--navy); font-size: .92rem; }
.review-name small { color: var(--muted); font-weight: 500; }

/* ============ FAQ ============ */
.faq-list { max-width: 820px; margin: 44px auto 0; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); margin-bottom: 14px; overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 20px 54px 20px 24px; font-size: 1.05rem; font-weight: 700; color: var(--navy);
  position: relative; font-family: inherit;
}
.faq-q::after { content: '+'; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--amber); font-weight: 400; transition: transform .2s; }
.faq-item.open .faq-q::after { content: '−'; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 24px 22px; color: var(--muted); }

/* ============ Forms ============ */
.form-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 38px 34px; border: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--navy); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(169,146,69,.20); }
.form-note { font-size: .84rem; color: var(--muted); margin-top: 12px; }
.form-success { background: #e8f7ee; border: 1px solid #9adbb4; color: #16613a; border-radius: 10px; padding: 14px 18px; font-weight: 600; margin-bottom: 18px; }
.hp-field { position: absolute !important; left: -9999px !important; }

/* ============ Split layout ============ */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; margin-top: 20px; }
.split-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.checklist { list-style: none; padding: 0; margin: 20px 0; }
.checklist li { padding: 8px 0 8px 34px; position: relative; font-weight: 500; }
.checklist li::before { content: '✓'; position: absolute; left: 0; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(169,146,69,.18); color: var(--amber-dark); font-weight: 800; font-size: .85rem; display: flex; align-items: center; justify-content: center; }

/* ============ CTA banner ============ */
.cta-banner { background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%); border-radius: 22px; padding: 64px 48px; text-align: center; color: #d7dee6; box-shadow: var(--shadow-lg); }
.cta-banner h2 { color: #fff; }
.cta-banner .btn { margin: 6px; }

/* ============ Areas ============ */
.areas-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.area-chip { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 9px 20px; font-weight: 600; font-size: .92rem; color: var(--navy); }

/* ============ Page hero (inner pages) ============ */
.page-hero { background: var(--navy); padding: 90px 0 70px; position: relative; overflow: hidden; }
.page-hero h1 { color: #fff; }
.page-hero .lead { color: #aebac6; }
.breadcrumbs { font-size: .85rem; color: #8ba0b5; margin-bottom: 18px; }
.breadcrumbs a { color: #b9c9d8; }

/* ============ Footer ============ */
.site-footer { background: var(--navy); color: #9fb0c0; padding: 70px 0 0; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 44px; max-width: var(--max); margin: 0 auto; padding: 0 22px 50px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: #9fb0c0; }
.site-footer a:hover { color: #fff; }
.footer-phone { font-size: 1.3rem; font-weight: 800; color: #fff !important; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 22px; text-align: center; font-size: .84rem; color: #6d8095; }
.footer-logo { height: 54px; width: auto; margin-bottom: 16px; }

/* ============ Sticky mobile call bar ============ */
.mobile-callbar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 999; background: var(--amber); text-align: center; padding: 14px; box-shadow: 0 -6px 20px rgba(0,0,0,.2); }
.mobile-callbar a { color: #fff !important; font-weight: 800; font-size: 1.05rem; text-decoration: none; }

/* ============ Content pages ============ */
.entry-content { max-width: 780px; }
.entry-content h2 { margin-top: 1.6em; }

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 34px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .main-nav { position: fixed; top: 74px; left: 0; right: 0; bottom: 0; background: #26311a; padding: 30px 26px; transform: translateX(100%); transition: transform .25s ease; z-index: 2000; overflow-y: auto; }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: 6px; }
  .main-nav a { display: block; padding: 14px 6px; font-size: 1.15rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-toggle { display: block; }
  .header-cta .btn--header { display: none; }
}
@media (max-width: 640px) {
  .section { padding: 60px 0; }
  .grid--2, .grid--3, .grid--4, .form-row { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: 78vh; }
  .hero-content { padding: 80px 22px 90px; }
  .header-phone { display: none; }
  .mobile-callbar { display: block; }
  body { padding-bottom: 58px; }
  .cta-banner { padding: 48px 26px; }
}
