/* ========================================
   CSS VARIABLES - Kentucky Courts Style
   Inspired by kycourts.gov
   ======================================== */
:root {
    --primary: #1e3a5f;
    --primary-dark: #142c4a;
    --primary-light: #2a5080;
    --nav-bg: #1a3352;
    --nav-hover: #264a73;
    --link-color: #1a5c97;
    --link-hover: #0e3d6b;
    --text-dark: #333333;
    --text-body: #4a4a4a;
    --text-light: #6c6c6c;
    --text-muted: #999999;
    --bg-light: #f4f6f8;
    --bg-white: #ffffff;
    --bg-banner: #e8f0f8;
    --bg-hero: #1e3a5f;
    --border: #d6dce4;
    --border-light: #e8ecf0;
    --accent: #c8902e;
    --accent-light: #f5e6cc;
    --success: #2e7d32;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 4px;
    --max-width: 1200px;
    --content-width: 800px;
    --font-sans: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: Georgia, 'Times New Roman', serif;
}

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

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-body);
    background-color: var(--bg-white);
}

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

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

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

.content-section img {
    display: block;
    max-width: 75%;
    margin: 20px auto;
    height: auto;
    border-radius: var(--radius);
}

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

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

/* ========================================
   HEADER - KY Courts Inspired
   ======================================== */
.header {
    background-color: var(--primary);
    padding: 0;
    position: relative;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

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


/* ========================================
   NAVIGATION - Dropdown Style
   ======================================== */
.nav-bar {
    background-color: var(--nav-bg);
}

.nav {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav > li {
    position: relative;
}

.nav > li > a {
    display: block;
    padding: 12px 20px;
    color: var(--bg-white);
    font-weight: 400;
    font-size: 15px;
    text-decoration: none;
    transition: background-color 0.2s;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.nav > li > a:hover,
.nav > li:hover > a {
    background-color: var(--nav-hover);
    text-decoration: none;
    color: var(--bg-white);
}

.nav > li > a.active {
    background-color: var(--nav-hover);
    border-bottom: 3px solid var(--accent);
}

/* Dropdown caret */
.nav > li > a .caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-top: 4px solid rgba(255, 255, 255, 0.6);
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    min-width: 240px;
    background-color: var(--bg-white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    box-shadow: var(--shadow-hover);
    list-style: none;
    padding: 6px 0;
}

.nav > li:hover > .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 9px 20px;
    color: var(--text-dark);
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.15s;
}

.dropdown-menu li a:hover {
    background-color: var(--bg-light);
    color: var(--primary);
    text-decoration: none;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 10px 14px;
    color: var(--bg-white);
    background-color: var(--nav-bg);
    border-radius: var(--radius);
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--bg-white);
    margin: 5px 0;
    transition: 0.3s;
}

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

.breadcrumbs a {
    color: var(--link-color);
    font-size: 13px;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

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


/* ========================================
   MAIN CONTENT
   ======================================== */
.main {
    padding: 30px 0 45px;
    background-color: var(--bg-white);
}

.content-section {
    background-color: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}

.content-section h1 {
    font-family: var(--font-serif);
    font-size: 2em;
    font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 18px;
    line-height: 1.3;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 14px;
}

.content-section h2 {
    font-family: var(--font-serif);
    font-size: 1.45em;
    font-weight: 400;
    color: var(--text-dark);
    margin: 28px 0 14px;
    padding-top: 22px;
    border-top: 1px solid var(--border-light);
}

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

.content-section h3 {
    font-family: var(--font-serif);
    font-size: 1.2em;
    font-weight: 400;
    color: var(--text-dark);
    margin: 18px 0 10px;
}

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

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

.content-section ul,
.content-section ol {
    margin: 12px 0 15px 25px;
    color: var(--text-body);
}

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

/* ========================================
   STATS BOX
   ======================================== */
.stats-box {
    background-color: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 28px;
    margin: 22px 0;
}

.stats-box h3 {
    font-family: var(--font-serif);
    font-size: 1.2em;
    font-weight: 400;
    margin-bottom: 16px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

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

.stat-item {
    text-align: center;
    padding: 16px;
    background-color: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: box-shadow 0.2s;
}

.stat-item:hover {
    box-shadow: var(--shadow);
}

.stat-number {
    font-family: var(--font-serif);
    font-size: 1.9em;
    font-weight: 400;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.info-table th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
    width: 35%;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.info-table td {
    color: var(--text-body);
}

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

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

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

.link-card:hover {
    text-decoration: none;
    background-color: var(--bg-light);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.link-card::before {
    content: "\203A";
    color: var(--primary);
    font-size: 18px;
    font-weight: bold;
    margin-right: 8px;
    line-height: 1;
}

.link-card-title {
    font-weight: 400;
    color: var(--link-color);
    font-size: 15px;
}

.link-card:hover .link-card-title {
    color: var(--primary);
    text-decoration: underline;
}

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

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

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-block;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    text-align: center;
    border-radius: var(--radius);
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
}

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

.btn-primary {
    background-color: var(--primary);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--bg-white);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
    background-color: var(--border-light);
    box-shadow: var(--shadow);
}

.btn-accent {
    background-color: var(--accent);
    color: var(--bg-white);
}

.btn-accent:hover {
    background-color: #b5801f;
    color: var(--bg-white);
}

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

/* ========================================
   FOOTER - Multi-Row KY Courts Style
   ======================================== */
.footer {
    background-color: var(--primary-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 0;
    margin-top: 40px;
}

.footer-main {
    padding: 35px 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    color: var(--bg-white);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-col a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--bg-white);
    text-decoration: underline;
}

.footer-col p {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 18px 0;
    text-align: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-copyright {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}



/* ========================================
   SEARCH FORM COMPONENT
   ======================================== */
.search-form {
    max-width: 500px;
    margin: 0 auto;
}

.search-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.search-form-row.stacked {
    flex-direction: column;
}

.search-form input[type="text"],
.search-form select {
    flex: 1;
    padding: 10px 12px;
    font-size: 15px;
    font-family: var(--font-sans);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-white);
}

.search-form input[type="text"]:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.search-form button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-sans);
    background-color: var(--primary);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-form button:hover {
    background-color: var(--primary-dark);
}

/* Sidebar version */
.search-form-sidebar {
    max-width: 300px;
}

.search-form-sidebar .search-form-row {
    flex-direction: column;
}

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

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

.search-widget .search-input,
.search-widget .search-select,
.search-widget .search-button {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: var(--font-sans);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-white);
    box-sizing: border-box;
}

.search-widget .search-button {
    background-color: var(--accent);
    color: var(--bg-white);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-widget .search-input:focus,
.search-widget .search-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.search-widget .search-button:hover {
    background-color: #b5801f;
}

/* Search Embed Box */
.search-embed {
    background-color: var(--bg-banner);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius);
    padding: 30px;
    padding-bottom: 75px;
    margin: 25px 0;
    position: relative;
}

.search-embed h3 {
    font-family: var(--font-serif);
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.25em;
    font-weight: 400;
    color: var(--text-dark);
}

/* Sponsored Results - Light gray, bottom left corner */
.search-embed p.search-form-note {
    position: absolute;
    left: 25px;
    bottom: 15px;
    font-size: 14px;
    color: #ccc;
    margin: 0;
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-light);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
    .footer-main {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    /* Header */
    .header-top {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    /* Nav toggle visible */
    .nav-toggle {
        display: block;
    }

    .nav-bar {
        position: relative;
    }

    .nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--nav-bg);
    }

    .nav.open {
        display: flex;
    }

    .nav > li > a {
        padding: 12px 20px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .nav > li > a.active {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-left: 3px solid var(--accent);
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-top: none;
        background-color: rgba(0, 0, 0, 0.15);
        padding: 0;
    }

    .dropdown-menu li a {
        color: rgba(255, 255, 255, 0.8);
        padding: 10px 20px 10px 36px;
    }

    .dropdown-menu li a:hover {
        background-color: rgba(255, 255, 255, 0.05);
        color: var(--bg-white);
    }

    .nav > li:hover > .dropdown-menu {
        display: none;
    }

    .nav > li.open > .dropdown-menu {
        display: block;
    }

    /* Content */
    .content-section {
        padding: 20px;
    }

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

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

    /* Footer */
    .footer-main {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .footer-bottom {
        text-align: center;
    }

    .search-form-row {
        flex-direction: column;
    }

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

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

}

/* Mobile - Search Widget Stacks Vertically */
@media (max-width: 700px) {
    .search-widget .search-form {
        grid-template-columns: 1fr;
    }

    .search-embed {
        padding: 25px 20px;
        padding-bottom: 45px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .container {
        padding: 0 15px;
    }

    .logo img {
        height: 32px;
    }

    .logo-text .site-name {
        font-size: 16px;
    }

    .content-section {
        padding: 15px;
        margin-bottom: 15px;
    }

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

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

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

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

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

}
