/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    --primary: #1B2A4A;
    --primary-dark: #111D33;
    --primary-light: #2D4A7A;
    --accent: #E8853D;
    --accent-dark: #D4742F;
    --accent-light: #F5A623;
    --link-color: #2973B2;
    --link-hover: #1B5A8C;
    --text-dark: #1A1A2E;
    --text-body: #3D3D4E;
    --text-light: #6B7280;
    --text-muted: #9CA3AF;
    --bg-page: #F3F4F6;
    --bg-white: #FFFFFF;
    --bg-light: #F9FAFB;
    --bg-blue-tint: #EEF2F7;
    --border: #D1D5DB;
    --border-light: #E5E7EB;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 6px;
    --radius-lg: 10px;
    --max-width: 1140px;
    --content-width: 820px;
    --header-height: 64px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-body);
    background-color: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    margin: 0 0 15px 24px;
}

li {
    margin-bottom: 6px;
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    background-color: var(--primary);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo:hover {
    text-decoration: none;
    opacity: 0.9;
}

.logo img {
    height: 36px;
    width: auto;
}

/* ========================================
   NAVIGATION
   ======================================== */
.nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav a {
    padding: 8px 18px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
    letter-spacing: 0.01em;
    position: relative;
}

.nav a:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
    text-decoration: none;
}

.nav a.active {
    color: #fff;
    background-color: rgba(255,255,255,0.15);
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background-color: var(--accent);
    border-radius: 1px;
}

/* Hamburger toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #fff;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumbs {
    padding: 14px 0;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    background-color: var(--bg-white);
}

.breadcrumbs a {
    color: var(--text-light);
    font-weight: 500;
}

.breadcrumbs a:hover {
    color: var(--link-color);
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 8px;
    color: var(--border);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main {
    padding: 28px 0 48px;
}

.content-section {
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.content-section h1 {
    font-family: var(--font-sans);
    font-size: 1.9em;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.content-section h2 {
    font-family: var(--font-sans);
    font-size: 1.35em;
    font-weight: 650;
    color: var(--text-dark);
    margin: 28px 0 14px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.content-section h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.content-section h3 {
    font-family: var(--font-sans);
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-dark);
    margin: 22px 0 10px;
}

.content-section p {
    margin-bottom: 16px;
    color: var(--text-body);
    line-height: 1.7;
}

.content-section p:last-child {
    margin-bottom: 0;
}

.content-section img {
    display: block;
    max-width: 80%;
    margin: 24px auto;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.content-section ul,
.content-section ol {
    margin: 10px 0 16px 24px;
}

.content-section li {
    margin-bottom: 6px;
    line-height: 1.6;
}

/* ========================================
   STATS BOX
   ======================================== */
.stats-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin: 20px 0;
    box-shadow: var(--shadow-md);
}

.stats-box h3 {
    font-family: var(--font-sans);
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 18px;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
}

.stat-item {
    text-align: center;
    padding: 18px 14px;
    background-color: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    backdrop-filter: blur(4px);
}

.stat-number {
    font-family: var(--font-sans);
    font-size: 1.75em;
    font-weight: 700;
    color: #fff;
    display: block;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* ========================================
   INFO TABLE
   ======================================== */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.info-table th,
.info-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.info-table th {
    background-color: var(--bg-blue-tint);
    font-weight: 600;
    color: var(--text-dark);
    width: 38%;
    font-size: 14px;
}

.info-table td {
    color: var(--text-body);
    font-size: 15px;
}

.info-table tr:last-child th,
.info-table tr:last-child td {
    border-bottom: none;
}

.info-table tr:hover td {
    background-color: var(--bg-light);
}

/* ========================================
   LINK GRID (Counties, Cities)
   ======================================== */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px 16px;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.link-card:hover {
    text-decoration: none;
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.link-card::before {
    content: "\2192";
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.link-card:hover::before {
    transform: translateX(3px);
}

.link-card-title {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.link-card:hover .link-card-title {
    color: var(--accent-dark);
}

/* Compact grid for large lists */
.link-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.link-grid-compact .link-card {
    padding: 10px 14px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius);
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-dark);
    color: #fff;
}

.btn-secondary {
    background-color: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--bg-light);
    border-color: var(--text-light);
    color: var(--text-dark);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ========================================
   SEARCH WIDGET (JS-generated form)
   ======================================== */
.search-widget {
    width: 100%;
}

.search-widget .search-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.search-widget .search-input,
.search-widget .search-select {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    font-family: var(--font-sans);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background-color: var(--bg-white);
    color: var(--text-dark);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-widget .search-input::placeholder {
    color: var(--text-muted);
}

.search-widget .search-input:focus,
.search-widget .search-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232, 133, 61, 0.15);
}

.search-widget .search-button {
    padding: 13px 28px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.search-widget .search-button:hover {
    background-color: var(--accent-dark);
    box-shadow: var(--shadow);
}

/* Search Embed Box */
.search-embed {
    background: linear-gradient(135deg, var(--bg-blue-tint) 0%, #E3EAF3 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    padding-bottom: 52px;
    margin: 24px 0;
    position: relative;
}

.search-embed h3 {
    font-family: var(--font-sans);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.search-embed p.search-form-note {
    position: absolute;
    left: 32px;
    bottom: 14px;
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    font-weight: 400;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background-color: var(--primary);
    color: rgba(255,255,255,0.7);
    padding: 48px 0 0;
    margin-top: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.55);
    max-width: 360px;
    margin: 0;
}

.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.footer-brand .footer-logo img {
    height: 30px;
    width: auto;
    opacity: 0.9;
}

.footer-heading {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 16px;
}

.footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-nav li {
    margin-bottom: 8px;
}

.footer-nav a {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

.footer-disclaimer {
    max-width: 600px;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    line-height: 1.5;
}

/* Fallback for old footer structure */
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 25px;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-copyright {
    width: 100%;
    text-align: center;
    padding-top: 20px;
    margin-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    padding-bottom: 20px;
}

/* ========================================
   ALERT / NOTICE BOXES
   ======================================== */
.notice {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.6;
}

.notice-info {
    background-color: var(--bg-blue-tint);
    border-left: 4px solid var(--primary-light);
    color: var(--text-dark);
}

.notice-warning {
    background-color: #FFF8ED;
    border-left: 4px solid var(--accent);
    color: #92400E;
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

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

/* ========================================
   RESPONSIVE: TABLET
   ======================================== */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--primary-dark);
        padding: 8px 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        gap: 0;
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        padding: 12px 24px;
        font-size: 15px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .nav a:last-child {
        border-bottom: none;
    }

    .nav a.active::after {
        display: none;
    }

    .header {
        position: sticky;
    }

    .header .container {
        position: relative;
    }

    .content-section {
        padding: 24px 20px;
    }

    .content-section h1 {
        font-size: 1.5em;
    }

    .content-section h2 {
        font-size: 1.2em;
    }

    .link-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-box {
        padding: 22px 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .search-embed {
        padding: 24px 20px;
        padding-bottom: 48px;
    }

    .search-embed p.search-form-note {
        left: 20px;
    }
}

/* ========================================
   RESPONSIVE: SEARCH WIDGET MOBILE
   ======================================== */
@media (max-width: 640px) {
    .search-widget .search-form {
        grid-template-columns: 1fr;
    }

    .search-widget .search-button {
        padding: 14px 28px;
    }
}

/* ========================================
   RESPONSIVE: SMALL MOBILE
   ======================================== */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .container {
        padding: 0 16px;
    }

    .logo img {
        height: 30px;
    }

    .content-section {
        padding: 20px 16px;
        margin-bottom: 14px;
        border-radius: var(--radius);
    }

    .content-section h1 {
        font-size: 1.35em;
    }

    .content-section img {
        max-width: 100%;
    }

    .link-grid {
        grid-template-columns: 1fr;
    }

    .link-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-table th,
    .info-table td {
        padding: 10px 12px;
        font-size: 14px;
    }

    .info-table th {
        width: 42%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-item {
        padding: 14px 10px;
    }

    .stat-number {
        font-size: 1.4em;
    }

    .footer {
        padding: 32px 0 0;
    }
}

/* ========================================
   PRINT
   ======================================== */
@media print {
    .header, .footer, .search-embed, .nav-toggle {
        display: none;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

    .content-section {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}
