/* ============================================================================
   MassFOIA News — Professional, Clean Design
   ============================================================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background-color: #f8f9fa;
}

/* Typography */
a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0052a3;
    text-decoration: underline;
}

h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

/* Header */
.site-header {
    background-color: #fff;
    border-bottom: 2px solid #e8eaed;
    padding: 2rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
}

.header-nav {
    flex-shrink: 0;
    padding-top: 0.25rem;
}

.staff-link {
    font-size: 0.8rem;
    color: #888;
    text-decoration: none;
    white-space: nowrap;
}

.staff-link:hover {
    color: #0066cc;
    text-decoration: underline;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.site-title a {
    color: #1a1a1a;
}

.site-title a:hover {
    color: #0066cc;
}

.site-tagline {
    font-size: 1rem;
    color: #666;
    margin: 0;
    font-weight: 400;
}

/* Main Content */
.site-main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.stories-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 2rem;
}

.stories-container h2 {
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

/* Stories Table */
.stories-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.stories-table thead {
    background-color: #f0f2f5;
    border-bottom: 2px solid #d9d9d9;
}

.stories-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    position: relative;
}

.stories-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.stories-table th.sortable::after {
    content: " ▼";
    opacity: 0.3;
    font-size: 0.75rem;
    margin-left: 0.25rem;
    transition: opacity 0.2s ease;
}

.stories-table th.sortable:hover::after {
    opacity: 0.7;
}

.stories-table th.sortable.sort-asc::after {
    content: " ▲";
    opacity: 1;
}

.stories-table th.sortable.sort-desc::after {
    content: " ▼";
    opacity: 1;
}

.stories-table tbody tr {
    border-bottom: 1px solid #e8eaed;
    transition: background-color 0.15s ease;
}

.stories-table tbody tr:hover {
    background-color: #f8f9fa;
}

.stories-table td {
    padding: 1rem;
    vertical-align: top;
}

/* Table Columns */
.date-cell {
    width: 120px;
    color: #666;
    font-size: 0.9rem;
}

.source-cell {
    width: 150px;
    color: #555;
    font-weight: 500;
}

.entities-cell {
    width: 200px;
    color: #666;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.headline-cell {
    flex: 1;
    min-width: 250px;
}

.headline-cell a {
    color: #0066cc;
    font-weight: 500;
    word-break: break-word;
}

.headline-cell a:hover {
    color: #0052a3;
}

/* Empty State */
.no-stories {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-style: italic;
}

/* Footer */
.site-footer {
    background-color: #f0f2f5;
    border-top: 1px solid #e8eaed;
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 3rem;
}

.site-footer p {
    margin: 0.5rem 0;
}

.site-footer a {
    color: #0066cc;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .site-header {
        padding: 1.5rem 1rem;
    }

    .site-title {
        font-size: 1.5rem;
    }

    .site-tagline {
        font-size: 0.9rem;
    }

    .site-main {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }

    .stories-section {
        padding: 1rem;
    }

    .stories-table {
        font-size: 0.85rem;
    }

    .stories-table th,
    .stories-table td {
        padding: 0.75rem 0.5rem;
    }

    .date-cell {
        width: 90px;
    }

    .source-cell {
        width: 100px;
    }

    .entities-cell {
        width: 150px;
    }

    .headline-cell {
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.25rem;
    }

    .site-tagline {
        font-size: 0.8rem;
    }

    .stories-table th,
    .stories-table td {
        padding: 0.5rem 0.3rem;
        font-size: 0.8rem;
    }

    .stories-table th.sortable::after {
        display: none;
    }

    .date-cell {
        width: 70px;
    }

    .source-cell {
        width: 80px;
    }

    .entities-cell {
        width: 120px;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer {
        display: none;
    }

    .stories-section {
        box-shadow: none;
        page-break-inside: avoid;
    }

    .stories-table thead {
        display: table-header-group;
    }

    .stories-table tr {
        page-break-inside: avoid;
    }
}
