/* ═══════════════════════════════════════════════════════════════
   Core 30 Website Factory — Premium, Conversion-Focused Design
   Theme-aware: color_themes.py overrides :root via inline <style>
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Defaults — overridden by per-site theme CSS */
    --primary: #2D6A4F;
    --primary-dark: #1B4332;
    --primary-light: #52B788;
    --accent: #D4A843;
    --accent-hover: #C09630;
    --accent-light: #FEF9E7;
    --text: #1a1a1a;
    --text-light: #555;
    --text-muted: #888;
    --bg: #ffffff;
    --bg-alt: #f8f9fa;
    --bg-dark: #1B4332;
    --section-alt: #f8f9fa;
    --section-dark: #1B4332;
    --hero-gradient: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
    --hero-overlay: rgba(27, 67, 50, 0.75);
    --card-border: #2D6A4F;
    --nav-bg: #1B4332;
    --border: #e0e0e0;
    --shadow: 0 2px 16px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --radius: 10px;
    --radius-lg: 16px;
    --max-width: 1200px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ── HEADER ─────────────────────────────────────────────────── */
.site-header {
    background: var(--nav-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.site-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    letter-spacing: -0.3px;
}
.site-logo span { color: var(--accent); }

/* Nav */
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    border-radius: var(--radius);
    transition: all var(--transition);
}
.main-nav a:hover, .main-nav a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.nav-cta {
    background: var(--accent) !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
    border-radius: var(--radius) !important;
}
.nav-cta:hover { background: var(--accent-hover) !important; transform: translateY(-1px); }

/* Mobile nav */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
    padding: 8px;
}

@media (max-width: 900px) {
    .mobile-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        flex-direction: column;
        padding: 16px;
        border-top: 1px solid rgba(255,255,255,0.1);
        box-shadow: var(--shadow);
    }
    .main-nav.open { display: flex; }
    .main-nav a { width: 100%; padding: 12px 16px; }
}

/* ── HERO ───────────────────────────────────────────────────── */
.hero {
    background: var(--hero-gradient);
    color: #fff;
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Hero with background image (added by site_builder when images available) */
.hero--img {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.hero--img::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hero-overlay);
    z-index: 1;
}
.hero--img > .container { position: relative; z-index: 2; }

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero .subheadline {
    font-size: 1.2rem;
    opacity: 0.92;
    max-width: 700px;
    margin: 0 auto 20px;
}

.hero .opening {
    font-size: 1.05rem;
    opacity: 0.85;
    max-width: 650px;
    margin: 0 auto 32px;
    line-height: 1.8;
}

.cta-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 16px 36px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-transform: none;
    letter-spacing: 0.3px;
}
.cta-btn:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.cta-btn-outline {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    margin-left: 12px;
}
.cta-btn-outline:hover {
    background: #fff;
    color: var(--primary-dark);
}

@media (max-width: 600px) {
    .hero { padding: 48px 0 36px; }
    .hero h1 { font-size: 1.8rem; }
    .hero .subheadline { font-size: 1rem; }
    .cta-btn { padding: 14px 28px; font-size: 1rem; }
}

/* ── SECTIONS ───────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section-alt { background: var(--section-alt); }
.section-dark { background: var(--section-dark); color: #fff; }

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-dark);
}
.section-dark .section-title { color: #fff; }

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    max-width: 600px;
    margin: -24px auto 40px;
    font-size: 1.05rem;
}

/* ── PROCESS STEPS ──────────────────────────────────────────── */
.process-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.process-step {
    text-align: center;
    padding: 32px 20px;
}

.step-number {
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 auto 16px;
}

.process-step h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.process-step p { color: var(--text-light); font-size: 0.95rem; }

@media (max-width: 700px) {
    .process-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ── SERVICE CARDS ──────────────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: all var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
    border-color: var(--card-border);
}

/* Card with image */
.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.card-body {
    padding: 28px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Backwards compat: cards without .card-body get inline padding */
.card > h3 { padding: 28px 24px 0; }
.card > p { padding: 0 24px; }
.card > .card-links { padding: 0 24px; }
.card > .card-cta { padding: 0 24px 24px; }

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--primary-dark);
}
.card h3 a { color: var(--primary-dark); }
.card h3 a:hover { color: var(--primary); }

.card p { color: var(--text-light); font-size: 0.95rem; margin-bottom: 16px; }

.card-links { list-style: none; padding: 0; }
.card-links li { padding: 4px 0; }
.card-links li::before {
    content: "▸ ";
    color: var(--accent);
    font-weight: 700;
}
.card-links a { font-size: 0.9rem; }

.card-cta {
    display: inline-block;
    margin-top: auto;
    padding-top: 16px;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}
.card-cta::after { content: " →"; }

/* ── USP / WHY US ───────────────────────────────────────────── */
.usp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.usp-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.usp-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.usp-text { font-size: 0.95rem; color: var(--text); }

/* ── SERVICE AREAS ──────────────────────────────────────────── */
.areas-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

.area-tag {
    padding: 8px 18px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text);
}
.section-dark .area-tag {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

/* ── FAQ ────────────────────────────────────────────────────── */
.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 18px 24px;
    background: var(--bg);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition);
}
.faq-question:hover { background: var(--bg-alt); }
.faq-question::after { content: "+"; font-size: 1.3rem; color: var(--primary); }
.faq-item.open .faq-question::after { content: "−"; }

.faq-answer {
    display: none;
    padding: 0 24px 18px;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}
.faq-item.open .faq-answer { display: block; }

/* ── CTA BLOCK ──────────────────────────────────────────────── */
.cta-block {
    background: var(--hero-gradient);
    color: #fff;
    text-align: center;
    padding: 72px 32px;
    border-radius: var(--radius-lg);
    margin: 48px 0;
    position: relative;
    overflow: hidden;
}
.cta-block::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.cta-block h2 { font-size: 1.8rem; margin-bottom: 16px; }
.cta-block p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 28px; }
.cta-block .phone-display {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: block;
}
.cta-block .phone-display a { color: var(--accent); }

/* ── REVIEWS PLACEHOLDER ────────────────────────────────────── */
.reviews-placeholder {
    background: var(--bg-alt);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    color: var(--text-muted);
}
.reviews-placeholder p { font-size: 0.95rem; }

/* ── MAP PLACEHOLDER ────────────────────────────────────────── */
.map-placeholder {
    background: var(--bg-alt);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 100px 48px;
    text-align: center;
    color: var(--text-muted);
}

/* ── BREADCRUMB ─────────────────────────────────────────────── */
.breadcrumb {
    padding: 16px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }

/* ── CONTACT PAGE ───────────────────────────────────────────── */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; }
}

.contact-info { }
.contact-info h3 { font-size: 1.1rem; margin: 24px 0 8px; color: var(--primary-dark); }
.contact-info p { color: var(--text-light); }
.contact-info a { font-size: 1.2rem; font-weight: 600; }

.contact-form { }
.contact-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: var(--text);
}
.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 16px;
    transition: border-color var(--transition);
}
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.contact-form button:hover { background: var(--primary-dark); }

/* Hours table */
.hours-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.hours-table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
.hours-table td:first-child { font-weight: 600; color: var(--text); }
.hours-table td:last-child { text-align: right; color: var(--text-light); }

/* ── BENEFITS LIST ──────────────────────────────────────────── */
.benefits-list {
    list-style: none;
    padding: 0;
}
.benefits-list li {
    padding: 10px 0 10px 32px;
    position: relative;
    font-size: 1rem;
    color: var(--text);
}
.benefits-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

/* ── CHILD LIST (on parent pages) ───────────────────────────── */
.child-list { list-style: none; padding: 0; }
.child-list li {
    border-bottom: 1px solid var(--border);
}
.child-list li:last-child { border-bottom: none; }
.child-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 4px;
    color: var(--text);
    font-weight: 500;
    transition: all var(--transition);
}
.child-list a:hover { color: var(--primary); padding-left: 8px; }
.child-list a::after { content: "→"; color: var(--primary); font-size: 1.1rem; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
    background: var(--nav-bg);
    color: rgba(255,255,255,0.8);
    padding: 56px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand { }
.footer-brand .site-logo { font-size: 1.2rem; color: #fff; margin-bottom: 12px; display: block; }
.footer-brand p { font-size: 0.9rem; line-height: 1.6; opacity: 0.8; }

.footer-col h4 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ── SCHEMA / SEO hidden ────────────────────────────────────── */
.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;
}

/* ── IMAGE SECTION BACKGROUNDS ──────────────────────────────── */
.section-img-bg {
    position: relative;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
.section-img-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hero-overlay);
}
.section-img-bg > .container { position: relative; z-index: 2; }
.section-img-bg .section-title { color: #fff; }

/* ── ACCENT DIVIDER ─────────────────────────────────────────── */
.accent-divider {
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    margin: 0 auto 32px;
}

/* ── PEXELS ATTRIBUTION ─────────────────────────────────────── */
.img-credit {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
    opacity: 0.6;
}

/* ── STEP NUMBER THEME ──────────────────────────────────────── */
.step-number {
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ── AREA TAG THEME ─────────────────────────────────────────── */
.area-tag {
    border-color: var(--card-border);
    color: var(--primary-dark);
    font-weight: 500;
}
.area-tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── SMOOTH ANIMATIONS ──────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .card, .usp-item, .process-step, .faq-item {
        animation: fadeInUp 0.5s ease both;
    }
    @keyframes fadeInUp {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }
}
