/* ============================================
   NY Septic Service Network — Shared Stylesheet
   Applies to: rochestersepticservice.com
               nysepticservice.com
               eriecountyseptic.com
   ============================================ */

/* --- Variables --- */
:root {
    --primary: #001f3f;
    --accent-red: #d62222;
    --accent-blue: #2b4cb7;
    --text-dark: #333;
    --bg-light: #f4f6f8;
    --gold: #cba135;
    --green: #1e3f20;
    color-scheme: light;
}

/* --- Force Light Mode --- */
@media (prefers-color-scheme: dark) {
    html { background: #fff !important; color: #333 !important; }
    body { background: #fff !important; color: #333 !important; }
    p, li, ul, ol, td, th { color: #333 !important; }
    h1, h2, h3, h4 { color: inherit !important; }

    /* Preserve intentional dark elements */
    .top-bar { background: var(--primary) !important; color: #fff !important; }
    .top-bar span { color: #fff !important; }
    header { background: #fff !important; }
    .hero { background: var(--primary) !important; }
    .hero h1 { color: #fff !important; }
    .hero-sub { color: #a0b4c8 !important; }
    footer { background: var(--primary) !important; color: #a0aec0 !important; }

    /* Cards and boxes */
    .town-card { background: #fdfdfd !important; color: #333 !important; }
    .section-card { background: #fff !important; color: #333 !important; }
    .term-card { background: #f4f6f8 !important; color: #333 !important; }
    .term-card .definition { color: #555 !important; }
    .toc { background: #f4f6f8 !important; color: #333 !important; }
    .friction-box { background: #fffaf0 !important; color: #333 !important; }
    .alert-box { background: #fff5f5 !important; color: #333 !important; }
    .info-box { background: #f0f7ff !important; color: #333 !important; }
    .highlight-box { background: #f0fff4 !important; color: #333 !important; }
    .fund-box { background: #fffbeb !important; color: #333 !important; }
    .warning-box { background: #fffaf0 !important; color: #333 !important; }
    .pass-box { background: #f0fff4 !important; color: #333 !important; }
    .fail-box { background: #fff5f5 !important; color: #333 !important; }
    .county-nav { background: #f4f6f8 !important; }
    .county-nav-link { background: #fff !important; color: #001f3f !important; }
    .lead-form { background: #f4f6f8 !important; }
    .form-group input,
    .form-group textarea,
    .form-group select { background: #fff !important; color: #333 !important; }
    .sidebar-links { background: #f4f6f8 !important; }
}

/* --- Base --- */
* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-dark);
    background: #fff;
    line-height: 1.6;
}

.container {
    max-width: 1140px;
    margin: auto;
    padding: 0 20px;
}

/* --- Top Bar --- */
.top-bar {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar a {
    color: var(--gold);
    text-decoration: none;
    font-weight: bold;
}
.top-bar a:hover { color: #fff; }

/* --- Header --- */
header {
    background: #fff;
    border-bottom: 1px solid #e1e8ed;
    padding: 20px 0;
}
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}
.logo span { color: var(--accent-red); }
.breadcrumb { font-size: 0.85rem; color: #777; }
.breadcrumb a { color: var(--accent-blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* --- Hero --- */
.hero {
    background: var(--primary);
    color: #fff;
    padding: 50px 0;
    border-bottom: 4px solid var(--gold);
}
.hero h1 {
    font-size: 2.25rem;
    margin: 0 0 12px 0;
    line-height: 1.2;
    color: #fff;
}
.hero-sub {
    font-size: 1.1rem;
    color: #a0b4c8;
    max-width: 680px;
    margin: 0;
    line-height: 1.6;
}

/* --- Typography --- */
h2 {
    color: var(--primary);
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 8px;
    margin-top: 35px;
    font-size: 1.4rem;
}
h2:first-child { margin-top: 0; }
h3 {
    color: var(--accent-blue);
    margin-top: 25px;
    font-size: 1.1rem;
}
p { margin: 0 0 15px 0; }

/* --- Page Grid (2-col with sidebar) --- */
.page-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin: 40px 0 60px;
}

/* --- Town Grid --- */
.county-block { margin: 40px 0; }
.county-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    background: var(--primary);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 3px;
    margin-bottom: 15px;
}
.town-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
}
.town-card {
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--gold);
    padding: 20px;
    text-decoration: none;
    color: var(--text-dark);
    background: #fdfdfd;
    transition: border-color 0.15s, box-shadow 0.15s;
    display: block;
}
.town-card:hover {
    border-top-color: var(--accent-red);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: var(--text-dark);
}
.town-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}
.town-card-constraint {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}
.town-card-cta {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-red);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Info Boxes --- */
.friction-box {
    background: #fffaf0;
    border-left: 4px solid var(--gold);
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 4px 4px 0;
}
.alert-box {
    background: #fff5f5;
    border-left: 4px solid var(--accent-red);
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 4px 4px 0;
}
.alert-box strong { color: var(--accent-red); display: block; margin-bottom: 5px; }
.info-box {
    background: #f0f7ff;
    border-left: 4px solid var(--accent-blue);
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 4px 4px 0;
}
.info-box strong { color: var(--accent-blue); display: block; margin-bottom: 5px; }
.highlight-box {
    background: #f0fff4;
    border-left: 4px solid #38a169;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 4px 4px 0;
}
.highlight-box strong { color: #276749; display: block; margin-bottom: 5px; }
.warning-box {
    background: #fffaf0;
    border-left: 4px solid var(--gold);
    padding: 16px 20px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}
.warning-box strong { color: #7a5200; display: block; margin-bottom: 4px; }
.pass-box {
    background: #f0fff4;
    border-left: 4px solid #38a169;
    padding: 16px 20px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}
.pass-box strong { color: #276749; display: block; margin-bottom: 4px; }
.fail-box {
    background: #fff5f5;
    border-left: 4px solid var(--accent-red);
    padding: 16px 20px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}
.fail-box strong { color: var(--accent-red); display: block; margin-bottom: 4px; }
.fund-box {
    background: #fffbeb;
    border: 2px solid var(--gold);
    border-radius: 6px;
    padding: 24px;
    margin: 25px 0;
}
.fund-box h3 { color: var(--green); margin-top: 0; font-size: 1.15rem; }

/* --- Section Cards --- */
.section-card {
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--gold);
    padding: 24px;
    margin: 25px 0;
    border-radius: 0 0 4px 4px;
    background: #fff;
}
.section-card h3 { margin-top: 0; color: var(--primary); font-size: 1.1rem; }

/* --- TOC --- */
.toc {
    background: var(--bg-light);
    border-left: 4px solid var(--gold);
    padding: 20px 24px;
    margin: 30px 0;
    border-radius: 0 4px 4px 0;
}
.toc h3 { margin-top: 0; color: var(--primary); font-size: 1rem; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { padding: 4px 0; font-size: 0.92rem; }
.toc a { color: var(--accent-blue); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* --- Term Grid --- */
.term-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}
.term-card {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 4px;
    border-top: 2px solid var(--accent-blue);
}
.term-card .term {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.92rem;
    margin-bottom: 6px;
}
.term-card .definition {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.5;
}

/* --- Resource List --- */
.resource-list { list-style: none; padding: 0; margin: 0; }
.resource-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.92rem;
}
.resource-list li:last-child { border-bottom: none; }
.resource-list a { color: var(--accent-blue); font-weight: 600; text-decoration: none; }
.resource-list a:hover { text-decoration: underline; }
.resource-list .resource-desc {
    color: #666;
    font-size: 0.84rem;
    display: block;
    margin-top: 3px;
}

/* --- Map Embed --- */
.map-embed {
    margin: 20px 0;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.map-embed iframe { width: 100%; height: 300px; border: 0; display: block; }
.map-caption {
    font-size: 0.8rem;
    color: #777;
    padding: 8px 10px;
    background: var(--bg-light);
}

/* --- Sidebar --- */
.sidebar-sticky {
    position: sticky;
    top: 20px;
    align-self: start;
}
.lead-form {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    border-top: 4px solid var(--accent-red);
    margin-bottom: 20px;
}
.lead-form h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.1rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 15px;
}
.sidebar-links {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.sidebar-links h3 { margin-top: 0; color: var(--primary); font-size: 1rem; margin-bottom: 12px; }
.sidebar-links a {
    display: block;
    color: var(--accent-blue);
    font-size: 0.9rem;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
    text-decoration: none;
}
.sidebar-links a:last-child { border-bottom: none; }
.sidebar-links a:hover { text-decoration: underline; }

/* --- Forms --- */
.form-group { margin-bottom: 15px; }
.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9rem;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
    font-family: inherit;
    background: #fff;
    color: #333;
}
.submit-btn {
    background: var(--accent-red);
    color: white;
    padding: 13px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: bold;
    width: 100%;
    transition: background 0.2s;
}
.submit-btn:hover { background: #b01c1c; }

/* --- County Nav Bar --- */
.county-nav {
    background: var(--bg-light);
    border-top: 1px solid #e2e8f0;
    padding: 25px 0;
}
.county-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.county-nav-link {
    display: block;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--gold);
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    transition: border-top-color 0.15s;
}
.county-nav-link:hover { border-top-color: var(--accent-red); }
.county-nav-link.active { border-top-color: var(--accent-red); background: #fff8f8; }

/* --- Form Section (hub pages) --- */
.form-section {
    background: var(--bg-light);
    border-top: 4px solid var(--accent-red);
    padding: 50px 0;
    margin-top: 60px;
}
.form-wrap { max-width: 560px; }

/* --- Phone Link --- */
.phone-link {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    font-size: 1.1rem;
    background: var(--accent-red);
    padding: 5px 15px;
    border-radius: 4px;
}
.phone-link:hover { background: #b01c1c; }

/* --- Footer --- */
footer {
    background: var(--primary);
    color: #a0aec0;
    padding: 30px 0;
    font-size: 0.85rem;
    border-top: 4px solid var(--accent-red);
}
footer p { margin: 0 0 10px 0; }

/* --- Mobile --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.75rem; }
    .top-bar { flex-direction: column; gap: 10px; text-align: center; }
    .town-grid { grid-template-columns: 1fr; }
    .term-grid { grid-template-columns: 1fr; }

    /* Fix sidebar white space on mobile */
    .page-grid { grid-template-columns: 1fr; }
    .sidebar-sticky {
        position: static;
        top: auto;
    }
}
