:root {
    /* Colors - Diario Pais: Traditional & Formal */
    --primary-color: #1e3a8a;
    /* Navy Blue */
    --secondary-color: #64748b;
    /* Slate Gray */
    --accent-color: #b91c1c;
    /* Flag Red for alerts */
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --border-color: #cbd5e1;

    /* Typography - Traditional News */
    --font-heading: 'Merriweather', serif;
    --font-body: 'Lora', serif;
    /* More paper-like feel */
}

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

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.8;
}

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

/* Accessibility: Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent-color);
    color: white;
    padding: 1rem 2rem;
    z-index: 9999;
    text-decoration: none;
    font-weight: 700;
    transition: top 0.2s;
}

.skip-link:focus-visible {
    top: 0;
}

/* Improved Focus States */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

header {
    background: var(--surface-color);
    border-bottom: 3px double var(--primary-color);
    padding: 2rem 0;
    text-align: center;
}

.site-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.top-nav {
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: -2px;
    margin: 1rem 0;
    display: block;
}

.header-search {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.35rem 0.5rem 0.35rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-color);
}

.header-search input {
    border: 0;
    min-width: 220px;
    background: transparent;
    font: inherit;
}

.header-search button {
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
}

.nav-bar {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-top: 1rem;
    padding: 0.5rem 0;
}

.nav-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Sidebar Toggle for massive list */
.hamburger {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2005;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Drawer */
.nav-menu-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 350px;
    max-width: 90%;
    height: 100vh;
    background: var(--surface-color);
    transform: translateX(-100%);
    transition: 0.4s;
    z-index: 2010;
    border-right: 1px solid var(--border-color);
}

.nav-menu-container.active {
    transform: translateX(0);
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 23, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 2000;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.nav-menu-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 4rem 2rem;
}

/* Main Grid - Traditional Newspaper Layout */
.news-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.column h2 {
    border-bottom: 1px solid black;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.main-story h1 {
    font-size: clamp(2rem, 3.4vw, 2.8rem);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.main-story p {
    font-size: 1.2rem;
}

.story-card {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.story-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.hero-image,
.story-thumb,
.related-image,
.article-featured-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 0;
    padding: 0;
}

.article-container {
    max-width: 900px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.article-category {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.article-title {
    font-family: var(--font-heading);
    font-size: clamp(1.9rem, 3vw, 2.45rem);
    margin: 1rem 0;
    line-height: 1.16;
}

.article-dek {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    font-size: 0.9rem;
    color: #666;
}

.article-featured-image {
    margin: 0 0 2rem;
}

.article-body {
    font-size: 1.1rem;
}

.article-tags {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.article-tags h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.related-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--primary-color);
}

.related-section h3 {
    font-family: var(--font-heading);
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    background: #f1f5f9;
    border-top: 1px solid var(--border-color);
    padding: 5rem 0;
    margin-top: 5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
}

@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .logo {
        font-size: 2.5rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .main-story h1 {
        font-size: 2rem;
    }

    .container {
        padding: 0 1rem;
    }

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

    .header-search {
        width: min(100%, 360px);
    }

    .header-search input {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.8rem;
        letter-spacing: -1px;
    }

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

    .hamburger {
        top: 1rem;
        left: 1rem;
        width: 40px;
        height: 40px;
    }
}
