/* style.css */

/* --- CSS Variables --- */
:root {
    --font-family-sans: 'Inter', sans-serif;
    --color-primary: #0ea5e9; /* sky-600 */
    --color-primary-dark: #0284c7; /* sky-700 */
    --color-primary-light: #e0f2fe; /* sky-100 */
    --color-secondary: #f59e0b; /* amber-500 */
    --color-secondary-light: #fef3c7; /* amber-200 */
    --color-secondary-dark-text: #78350f; /* amber-800 */
    
    --text-color-base: #1e293b; /* slate-800 */
    --text-color-muted: #64748b; /* slate-600 */
    --text-color-subtle: #94a3b8; /* slate-400 */
    --text-color-headings: #0369a1; /* sky-700 (for main titles) */

    --background-color-body: #f0f2f5; /* Custom light gray */
    --background-color-card: #ffffff; /* white */
    --background-color-filter-section: #ffffff; /* white */

    --border-color: #cbd5e1; /* slate-300 */
    --border-radius: 0.375rem; /* rounded-md */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
}

/* --- Base & Typography --- */
body {
    font-family: var(--font-family-sans);
    background-color: var(--background-color-body);
    color: var(--text-color-base);
    margin: 0;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: var(--spacing-2);
    font-weight: 600; /* semibold */
}

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

p {
    margin-bottom: var(--spacing-4);
}

/* --- Container --- */
.container {
    width: 90%;
    max-width: 1280px; /* Corresponds to Tailwind's lg breakpoint for container */
    margin-left: auto;
    margin-right: auto;
    padding: var(--spacing-4);
}
@media (min-width: 640px) { /* sm breakpoint */
    .container {
        padding: var(--spacing-6);
    }
}
@media (min-width: 1024px) { /* lg breakpoint */
    .container {
        padding: var(--spacing-8);
    }
}

/* --- Header --- */
.site-header {
    margin-bottom: var(--spacing-8);
    text-align: center;
}

.site-title {
    font-size: 2.25rem; /* text-4xl */
    font-weight: 700; /* bold */
    color: var(--text-color-headings);
    margin-bottom: var(--spacing-2);
}
@media (min-width: 640px) { /* sm breakpoint */
    .site-title {
        font-size: 3rem; /* sm:text-5xl */
    }
}

.site-subtitle {
    font-size: 1.125rem; /* text-lg */
    color: var(--text-color-muted);
    margin-top: var(--spacing-2);
}

/* --- NEW: Site Update Info (for last updated notification) --- */
.site-update-info {
    font-size: 0.9em;
    color: var(--text-color-subtle); /* Using subtle text color for a softer look */
    margin-top: 10px;
    text-align: center;
}
/* You might want to adjust header padding if needed */
.site-header {
    padding: 20px; /* Example, adjust as needed */
}

/* --- Filter Section --- */
.filter-section {
    margin-bottom: var(--spacing-6);
    padding: var(--spacing-4);
    background-color: var(--background-color-filter-section);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    align-items: center;
}
@media (min-width: 640px) { /* sm breakpoint */
    .filter-section {
        flex-direction: row;
    }
}

.filter-group {
    width: 100%;
}
@media (min-width: 640px) { /* sm breakpoint */
    .filter-group {
        width: 50%;
    }
}

.filter-group label {
    display: block;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* medium */
    color: var(--text-color-base); /* slate-700 was used, this is base */
    margin-bottom: var(--spacing-1);
}

.filter-group select {
    width: 100%;
    padding: var(--spacing-2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    background-color: #fff; /* Ensure select background is white */
}
.filter-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.3); /* Focus ring like Tailwind */
}


/* --- Loading Indicator --- */
.loading-indicator-container {
    text-align: center;
    padding: var(--spacing-8) 0; /* Similar to py-10 */
}
.loader {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid var(--color-primary); /* Blue */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-4); /* margin-bottom: 20px */
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-indicator-container p {
    color: var(--text-color-muted);
}

/* --- Message Area --- */
.message-area-container { /* Renamed for clarity */
    text-align: center;
    padding: var(--spacing-8) 0; /* Similar to py-10 */
    /* Initially hidden, JS will remove this class */
}
.message-area-container.hidden { 
    display: none;
}
.message-text {
    color: var(--text-color-muted);
    font-size: 1.125rem; /* text-lg */
}

/* --- News Grid --- */
.news-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 column by default */
    gap: var(--spacing-6);
}
@media (min-width: 768px) { /* md breakpoint */
    .news-grid {
        grid-template-columns: repeat(2, 1fr); /* md:grid-cols-2 */
    }
}
@media (min-width: 1024px) { /* lg breakpoint */
    .news-grid {
        grid-template-columns: repeat(3, 1fr); /* lg:grid-cols-3 */
    }
}
.news-grid.hidden {
    display: none;
}

/* --- News Card --- */
.news-card {
    background-color: var(--background-color-card);
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    padding: var(--spacing-5);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Duplicates for specificity */
}

.news-card-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* semibold */
    color: var(--text-color-headings);
    margin-bottom: var(--spacing-2);
}

.news-card-meta {
    font-size: 0.875rem; /* text-sm */
    color: var(--text-color-muted);
    margin-bottom: var(--spacing-1);
}

.news-card-category {
    font-size: 0.875rem; /* text-sm */
    color: var(--text-color-subtle);
    margin-bottom: var(--spacing-3);
}
.news-card-category .category-name {
    font-weight: 500; /* medium */
    color: var(--text-color-muted);
}
.news-card-category .original-category-name {
    font-style: italic;
    font-size: 0.75rem; /* text-xs */
}

.news-card-locations {
    margin-bottom: var(--spacing-3);
    display: flex;
    flex-wrap: wrap;
}
.location-tag {
    background-color: var(--color-secondary-light);
    color: var(--color-secondary-dark-text);
    font-size: 0.75rem; /* text-xs */
    font-weight: 600; /* semibold */
    margin-right: var(--spacing-2);
    margin-bottom: var(--spacing-1); /* for wrapping */
    padding: var(--spacing-1) var(--spacing-2); /* px-2.5 py-0.5 */
    border-radius: var(--border-radius);
    display: inline-block;
}
.location-tag.statewide {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}


.news-card-description {
    color: var(--text-color-muted);
    font-size: 0.875rem; /* text-sm */
    margin-bottom: var(--spacing-4);
    flex-grow: 1; /* Allows description to take available space */
}

.news-card-button {
    display: inline-block;
    margin-top: auto; /* Pushes button to bottom of flex container */
    background-color: var(--color-primary);
    color: #ffffff;
    font-weight: 500; /* medium */
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.875rem; /* text-sm */
    transition: background-color 0.2s ease-in-out;
    border: none; /* Reset button border */
    cursor: pointer;
}
.news-card-button:hover {
    background-color: var(--color-primary-dark);
    color: #ffffff; /* Ensure text color remains white on hover */
    text-decoration: none; /* Remove underline from link acting as button */
}


/* --- Modal (Message Box) Styles --- */
.message-box-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.message-box-overlay.hidden {
    display: none;
}

.message-box-content {
    background-color: var(--background-color-card);
    padding: var(--spacing-5);
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 400px;
}
.message-box-content p {
    margin-bottom: var(--spacing-3); /* Ensure p inside has margin */
}

.message-box-button {
    background-color: var(--color-primary);
    color: #ffffff;
    padding: var(--spacing-2) var(--spacing-5); /* 10px 20px */
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-top: var(--spacing-3);
    font-weight: 500;
}
.message-box-button:hover {
    background-color: var(--color-primary-dark);
}


/* --- Custom Scrollbar (Webkit) --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Utility class for hidden elements (if needed by JS beyond specific components) */
.u-hidden {
    display: none !important;
}