/* Heritage Roofing Co — warm, traditional, family-owned trust & craftsmanship theme */

:root {
  --ink: #2b2018;
  --forest: #2f4a34;
  --forest-dark: #223626;
  --burgundy: #7a2e2e;
  --cream: #f6efe4;
  --card: #fffaf1;
  --tan: #e8ddc7;
  --line: #ddd0b8;
  --muted: #6e6252;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

h1, h2, h3 { font-family: 'Lora', Georgia, serif; font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; color: var(--ink); }

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
a { color: var(--forest); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.75rem; border-radius: 999px; background: var(--forest); color: #fff;
  text-decoration: none; font-weight: 600; border: none; cursor: pointer; font-size: 1rem;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--forest-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--forest); border: 1.5px solid var(--forest); }
.btn-outline:hover { background: var(--forest); color: #fff; }
.btn-lg { padding: 1.05rem 2.25rem; font-size: 1.05rem; }
.btn-full { width: 100%; }

/* ---------- header ---------- */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1140px; margin: 0 auto; padding: 1rem 1.5rem; }
.logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.logo-text { font-family: 'Lora', serif; font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.logo-sub { display: block; font-family: 'Inter', sans-serif; font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--burgundy); font-weight: 600; }
.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav ul { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.main-nav ul a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.94rem; }
.main-nav ul a:hover { color: var(--forest); }
.nav-cta-row { display: flex; align-items: center; gap: 1.25rem; }
.phone-link { display: flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; font-weight: 600; }

.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 34px; height: 34px; background: none; border: none; cursor: pointer; padding: 0; }
.hamburger span { display: block; height: 2px; width: 100%; background: var(--ink); transition: transform 0.2s ease, opacity 0.2s ease; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { padding: 4.5rem 0 5rem; }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.eyebrow { color: var(--burgundy); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.82rem; }
.hero h1 { font-size: 2.7rem; margin-top: 0.5rem; }
.hero-sub { color: var(--muted); font-size: 1.08rem; max-width: 460px; margin-top: 1rem; }
.hero-actions { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-media { position: relative; }
.hero-media-inner { overflow: hidden; border-radius: var(--radius); box-shadow: 0 24px 50px -18px rgba(43,32,24,0.35); }
.hero-media-inner img {
  width: 100%; display: block;
  animation: obtKenBurns 18s ease-in-out infinite alternate;
}
@keyframes obtKenBurns { from { transform: scale(1); } to { transform: scale(1.07); } }

.hero-badge {
  position: absolute; bottom: -1.5rem; left: -1.5rem; z-index: 2;
  display: flex; align-items: center; gap: 0.9rem;
  background: linear-gradient(160deg, #fffdf9 0%, var(--card) 100%);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 1.1rem 1.4rem; max-width: 270px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.7) inset,
    0 3px 6px rgba(43,32,24,0.08),
    0 10px 20px rgba(43,32,24,0.12),
    0 24px 44px -16px rgba(43,32,24,0.4);
  animation: obtBadgePop 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.3s both;
}
@keyframes obtBadgePop { from { transform: scale(0.6) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.hero-badge-icon {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(150deg, var(--forest), var(--forest-dark));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px -4px rgba(47,74,52,0.55);
}
.hero-badge-copy strong { display: block; font-family: 'Lora', serif; color: var(--ink); font-size: 1.05rem; line-height: 1.2; margin-bottom: 0.2rem; }
.hero-badge-copy span { font-size: 0.8rem; color: var(--muted); line-height: 1.35; display: block; }

/* ---------- our story ---------- */
.story { background: var(--card); padding: 5rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.story-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.story p { color: var(--muted); }
.badge-row { display: flex; flex-direction: column; gap: 1rem; }
.badge-item {
  display: flex; align-items: center; gap: 0.85rem; background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.9rem 1.1rem; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.badge-item:hover { transform: translateY(-3px); box-shadow: 0 12px 26px -12px rgba(43,32,24,0.3); border-color: var(--burgundy); }
.badge-item svg { color: var(--burgundy); flex-shrink: 0; }
.badge-item span { font-weight: 600; font-size: 0.95rem; }

/* section title underline draw-in */
.title-underline { display: block; height: 3px; width: 0; background: var(--burgundy); margin: 0.75rem auto 0; transition: width 0.7s ease 0.15s; }
.reveal.is-visible .title-underline { width: 60px; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-visible { animation: obtReveal 0.6s ease forwards; animation-delay: var(--reveal-delay, 0s); }
@keyframes obtReveal { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .hero-media img { animation: none; }
  .hero-badge { animation: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- services ---------- */
.services { padding: 5rem 0; }
.section-title { font-size: 2.1rem; text-align: center; }
.section-sub-eyebrow { text-align: center; display: block; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
.service-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; }
.service-card h3 { font-size: 1.1rem; }
.service-card p { color: var(--muted); font-size: 0.94rem; margin: 0; }

/* ---------- gallery ---------- */
.gallery { background: var(--card); padding: 5rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2.5rem; }
.gallery-item { border-radius: var(--radius); overflow: hidden; box-shadow: 0 14px 34px -14px rgba(43,32,24,0.3); }
.gallery-item img { width: 100%; height: 260px; object-fit: cover; display: block; }
.gallery-item figcaption { padding: 0.85rem 1rem; font-weight: 600; font-size: 0.9rem; background: var(--tan); }

/* ---------- quote ---------- */
.quote { padding: 5rem 0; }
.quote-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.quote-sub { color: var(--muted); }
.quote-contact-cards { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1.5rem; }
.contact-card { display: flex; align-items: center; gap: 0.75rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1.1rem; text-decoration: none; color: var(--ink); font-weight: 600; }
.contact-card svg { color: var(--burgundy); flex-shrink: 0; }
.map-frame { margin-top: 1.5rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }

.quote-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; }
.form-row { margin-bottom: 1.25rem; }
.form-row--split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; }
input[type=text], input[type=tel], input[type=email], select, textarea {
  width: 100%; padding: 0.7rem 0.85rem; border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); }
fieldset { border: none; padding: 0; margin: 0; }
legend { font-weight: 600; margin-bottom: 0.5rem; padding: 0; }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.checkbox-item { font-weight: 400; display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--forest); color: rgba(255,255,255,0.75); padding: 3rem 0 1.5rem; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.15); }
.footer-brand .logo-text { color: #fff; }
.footer-brand .logo-sub { color: rgba(255,255,255,0.6); }
.footer-col h4 { color: #fff; font-family: 'Lora', serif; font-size: 1rem; margin-bottom: 0.75rem; }
.footer-col p { margin: 0 0 0.5rem; }
.footer-col a { color: rgba(255,255,255,0.75); text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-bottom { padding-top: 1.5rem; font-size: 0.85rem; text-align: center; }

/* ---------- responsive ---------- */
.nav-close { display: none; }
.nav-backdrop { display: none; }
@media (max-width: 900px) {
  .hero-inner, .story-inner, .quote-inner { grid-template-columns: 1fr; }
  .services-grid, .gallery-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .main-nav ul, .nav-cta-row .phone-link span { display: none; }
  .hamburger { display: flex; }
  .main-nav {
    position: fixed; top: 0; right: -100%; height: 100vh; width: 78%; max-width: 320px;
    background: var(--card); flex-direction: column; align-items: flex-start; padding: 5rem 2rem 2rem;
    transition: right 0.25s ease; z-index: 70;
  }
  .main-nav.open { right: 0; }
  .main-nav.open ul { display: flex; flex-direction: column; gap: 1.25rem; }
  .hero-badge { position: static; margin-top: 1.5rem; }

  .nav-close {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 1.25rem; right: 1.25rem;
    width: 2.25rem; height: 2.25rem; border-radius: 50%;
    background: var(--tan); border: none; color: var(--ink);
    font-size: 1.5rem; line-height: 1; cursor: pointer;
  }
  .nav-close:hover { background: var(--line); }

  .nav-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(43,32,24,0.5);
    z-index: 65; opacity: 0; visibility: hidden; transition: opacity 0.25s ease;
  }
  .nav-backdrop.open { opacity: 1; visibility: visible; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 2.1rem; }
  .services-grid, .gallery-grid { grid-template-columns: 1fr; }
  .form-row--split, .checkbox-grid { grid-template-columns: 1fr; }
}

/* Editor mode: keep the mobile nav drawer clear of the fixed toolbar, and give
   each service card room for its floating +Add/Remove toggle button. */
body.is-editable .main-nav.open { top: 44px; }
body.is-editable .service-card { position: relative; padding-top: 2.5rem; }
body.is-editable .obt-service-toggle { position: absolute; top: 0.85rem; right: 0.85rem; z-index: 2; }
