:root {
    --primary: #1a4480;
    --primary-dark: #162e51;
    --primary-light: #2b6cb0;
    --accent: #d83933;
    --text: #1b1b1b;
    --text-light: #565c65;
    --bg: #f7f7f7;
    --white: #ffffff;
    --border: #dfe1e2;
    --success: #00a91c;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

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

a:hover, a:focus {
    text-decoration: underline;
}

.site-header {
    background: var(--primary-dark);
    color: var(--white);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--white);
    margin: 4px 0;
    border-radius: 2px;
    transition: 0.3s;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-links a,
.dropdown-toggle {
    color: var(--white);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: background 0.2s;
}

.nav-links a:hover,
.nav-links a:focus,
.dropdown-toggle:hover,
.dropdown-toggle:focus {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 200px;
    list-style: none;
    display: none;
    z-index: 1000;
    max-height: 60vh;
    overflow-y: auto;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--bg);
}

.states-menu {
    columns: 2;
    min-width: 320px;
}

.states-menu li {
    break-inside: avoid;
}

.hero {
    text-align: center;
    padding: 48px 16px 32px;
    background: var(--white);
    margin: 0 -16px 32px;
}

.hero h1 {
    font-size: 1.75rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.hero-subtitle {
    color: var(--text-light);
    margin-bottom: 24px;
}

.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 24px;
}

#search-input {
    width: 100%;
    padding: 14px 40px 14px 16px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn:focus {
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.category-section {
    margin-bottom: 40px;
}

.category-section h2 {
    font-size: 1.35rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.category-description {
    color: var(--text-light);
    margin-bottom: 16px;
}

.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    justify-content: center;
}

.resource-tile {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

.resource-tile h3 {
    font-size: 1rem;
    color: var(--primary-dark);
    margin-bottom: auto;
    padding-bottom: 10px;
    line-height: 1.3;
    text-align: center;
}

.tile-summary {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 12px;
}

.tile-actions {
    display: flex;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover,
.btn:focus {
    text-decoration: none;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
}

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

.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--border);
}

.btn-link {
    background: none;
    color: var(--primary);
    padding: 10px 0;
}

.btn-link:hover,
.btn-link:focus {
    text-decoration: underline;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

.no-results {
    text-align: center;
    padding: 48px 16px;
    background: var(--white);
    border-radius: var(--radius);
}

.breadcrumbs {
    padding: 16px 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

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

.breadcrumbs span {
    margin: 0 8px;
}

.site-guide {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.guide-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg);
}

.guide-header h1 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.official-url a {
    word-break: break-all;
}

.guide-section {
    margin-bottom: 24px;
}

.guide-section h2 {
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.guide-section ul,
.guide-section ol {
    padding-left: 24px;
}

.guide-section li {
    margin-bottom: 8px;
}

.toddler-steps li {
    padding: 8px 0;
    border-bottom: 1px solid var(--bg);
}

.toddler-steps li:last-child {
    border-bottom: none;
}

.section-intro {
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 12px;
}

.start-here-list {
    list-style: none;
    padding-left: 0;
}

.start-here-list li {
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.start-here-list li strong {
    color: var(--primary-dark);
}

.start-here-arrow {
    color: var(--primary);
    font-weight: bold;
}

.start-here-section {
    background: #f0f7ff;
    padding: 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.gotchas-section {
    background: #fff8e6;
    padding: 16px;
    border-radius: var(--radius);
    border-left: 4px solid #ffb300;
}

.gotchas-section h2 {
    color: #8b6914;
}

.guide-cta {
    text-align: center;
    padding-top: 16px;
    border-top: 2px solid var(--bg);
}

.category-page,
.state-page,
.about-page {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin: 16px 0 32px;
    box-shadow: var(--shadow);
}

.category-header,
.state-header,
.about-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg);
}

.category-header h1,
.state-header h1,
.about-header h1 {
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.state-code {
    font-size: 1rem;
    color: var(--text-light);
}

.coming-soon {
    text-align: center;
    padding: 32px 16px;
}

.coming-soon h2 {
    color: var(--primary);
    margin-bottom: 16px;
}

.coming-soon p {
    margin-bottom: 12px;
    color: var(--text-light);
}

.coming-soon .btn {
    margin-top: 16px;
}

.about-section {
    margin-bottom: 32px;
}

.about-section h2 {
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.about-section ul {
    padding-left: 24px;
}

.about-section li {
    margin-bottom: 8px;
}

.contact-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.success-message {
    color: var(--success);
    padding: 16px;
    background: #e6f7e9;
    border-radius: var(--radius);
    margin-top: 16px;
}

.contact-status {
    padding: 16px;
    border-radius: var(--radius);
    margin-top: 16px;
}

.contact-status.success {
    color: var(--success);
    background: #e6f7e9;
}

.contact-status.error {
    color: var(--accent);
    background: #fde8e8;
}

.site-footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: 24px 16px;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.disclaimer {
    font-size: 0.9rem;
    margin-bottom: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
}

.copyright {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        background: var(--primary-dark);
        padding: 16px 0;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a,
    .dropdown-toggle {
        display: block;
        width: 100%;
        text-align: left;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: rgba(255,255,255,0.05);
        border-radius: 0;
    }
    
    .dropdown-menu a {
        color: var(--white);
        border-color: rgba(255,255,255,0.1);
        padding-left: 32px;
    }
    
    .states-menu {
        columns: 1;
        min-width: auto;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .filter-btn {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .tiles-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.start-here-note {
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.start-here-image-container {
    text-align: center;
    margin: 1rem 0;
}

.start-here-image {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    object-fit: contain;
}

.start-here-image:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow);
}

.image-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

.start-here-explanation {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.start-here-explanation p {
    margin-bottom: 0.75rem;
}

.start-here-explanation p:last-child {
    margin-bottom: 0;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox.show {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--accent);
}
