/* ══════════════════════════════════════════════════════════════════
   R365 GLOBAL MEDIA - EL MUNDO STYLED NEWSPAPER DESIGN SYSTEM
   Inspired by the layout, typography, borders, and grid of elmundo.es
   ══════════════════════════════════════════════════════════════════ */

:root {
    --elmundo-red: #D00000;
    --elmundo-black: #111111;
    --elmundo-dark-grey: #333333;
    --elmundo-grey: #666666;
    --elmundo-light-grey: #E5E5E5;
    --elmundo-bg-grey: #F4F4F4;
    --elmundo-border: #D8D8D8;
    
    --bg-page: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-main: #111111;
    --text-muted: #666666;
    
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', Arial, sans-serif;
}

[data-theme="dark"] {
    --bg-page: #0D1117;
    --bg-card: #161B22;
    --text-main: #E6EDF3;
    --text-muted: #8B949E;
    --elmundo-border: #30363D;
    --elmundo-light-grey: #21262D;
    --elmundo-bg-grey: #161B22;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 1. TOP BAR (TRENDING KEYWORDS & DATE) */
.elmundo-topbar {
    border-bottom: 1px solid var(--elmundo-border);
    padding: 6px 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    background-color: var(--bg-page);
}

.elmundo-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.topbar-topics {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.topbar-topics::-webkit-scrollbar {
    display: none;
}

.topbar-label {
    font-weight: 700;
    color: var(--elmundo-red);
    text-transform: uppercase;
}

.topbar-topic-link {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.topbar-topic-link:hover {
    color: var(--elmundo-red);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    white-space: nowrap;
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 2. MASTHEAD LOGO (EL MUNDO STYLE) */
.elmundo-masthead {
    padding: 20px 0 15px;
    text-align: center;
    border-bottom: 1px solid var(--elmundo-border);
}

.masthead-title {
    font-family: var(--font-serif);
    font-size: 3.4rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    text-transform: uppercase;
    color: var(--text-main);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.masthead-globe {
    color: #0055A5;
    font-size: 2.6rem;
    margin: 0 2px;
}

.masthead-tagline {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 600;
}

/* 3. SUB-NAVIGATION BAR */
.elmundo-nav {
    border-bottom: 2px solid var(--elmundo-black);
    background-color: var(--bg-page);
    position: sticky;
    top: 0;
    z-index: 100;
}

[data-theme="dark"] .elmundo-nav {
    border-bottom-color: var(--elmundo-red);
}

.elmundo-nav-list {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    gap: 22px;
    padding: 8px 0;
    overflow-x: auto;
    white-space: nowrap;
}

.elmundo-nav-list a {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    transition: color 0.2s ease;
    padding: 4px 0;
}

.elmundo-nav-list a:hover,
.elmundo-nav-list a.active {
    color: var(--elmundo-red);
    border-bottom: 2px solid var(--elmundo-red);
}

/* 4. DIRECTO / LIVE TICKER STRIP */
.elmundo-directo-strip {
    border-bottom: 1px solid var(--elmundo-border);
    padding: 8px 0;
    font-size: 0.82rem;
    background-color: var(--bg-page);
}

.directo-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    overflow-x: auto;
    white-space: nowrap;
}

.directo-badge {
    color: var(--elmundo-red);
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
}

.directo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

.directo-item:hover {
    color: var(--elmundo-red);
}

/* 5. JUEGOS & ESPECIALES STRIP */
.elmundo-juegos-strip {
    margin: 16px 0;
    border: 1px solid var(--elmundo-border);
    border-radius: 4px;
    padding: 12px 16px;
    background-color: var(--elmundo-bg-grey);
}

.juegos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.juegos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.juego-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-card);
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--elmundo-border);
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.juego-card:hover {
    transform: translateY(-2px);
    border-color: var(--elmundo-red);
}

.juego-icon {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #FFF;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* 6. MAIN SECTION HEADER (ESPAÑA EN LLAMAS / CATEGORIA) */
.section-banner-title {
    text-align: center;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-main);
    margin: 24px 0 20px;
    padding: 6px 0;
    border-top: 1px solid var(--elmundo-black);
    border-bottom: 1px solid var(--elmundo-black);
}

[data-theme="dark"] .section-banner-title {
    border-top-color: var(--elmundo-red);
    border-bottom-color: var(--elmundo-red);
}

/* 7. THREE-COLUMN EL MUNDO FRONT PAGE GRID */
.elmundo-front-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

/* Left Column: Lead Text & Sub-headlines */
.left-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-right: 1px solid var(--elmundo-border);
    padding-right: 20px;
}

.lead-badge {
    color: var(--elmundo-red);
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lead-headline {
    font-family: var(--font-serif);
    font-size: 1.85rem;
    font-weight: 900;
    line-height: 1.2;
    color: var(--text-main);
    cursor: pointer;
    transition: color 0.2s ease;
}

.lead-headline:hover {
    color: var(--elmundo-red);
}

.author-byline {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.divider-line {
    height: 1px;
    background-color: var(--elmundo-border);
    margin: 12px 0;
}

.sub-headline-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-main);
    cursor: pointer;
    transition: color 0.2s ease;
}

.sub-headline-title:hover {
    color: var(--elmundo-red);
}

.sub-headline-title span.prefix {
    font-weight: 900;
    color: #0055A5;
}

.comment-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
}

/* Center Column: Big Lead Photo / Map */
.center-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.main-lead-photo-wrap {
    width: 100%;
    border-radius: 2px;
    overflow: hidden;
    background-color: #1E293B;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.main-lead-photo-wrap img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.photo-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Right Column: Stacked News Items */
.right-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-left: 1px solid var(--elmundo-border);
    padding-left: 20px;
}

.stack-item {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
}

.stack-item:hover .stack-title,
.stack-item:hover .sub-headline-title {
    color: var(--elmundo-red);
}

.stack-thumb {
    width: 95px;
    height: 70px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.stack-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.more-card {
    background-color: var(--bg-card);
    border: 1px solid var(--elmundo-border);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.more-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--elmundo-red);
}

.more-card-img-wrap {
    width: 100%;
    height: 170px;
    overflow: hidden;
    background-color: #1E293B;
}

.more-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.more-card:hover .more-card-img-wrap img {
    transform: scale(1.05);
}

.more-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.more-card-cat {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--elmundo-red);
    text-transform: uppercase;
}

.more-card-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text-main);
}

.stack-title span.prefix {
    color: #0055A5;
    font-weight: 900;
}

/* MODAL READER */
.elmundo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.elmundo-modal-box {
    background: var(--bg-card);
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 4px;
    padding: 36px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-main);
}

/* FOOTER */
.elmundo-footer {
    border-top: 3px solid var(--elmundo-black);
    padding: 40px 0 20px;
    background-color: var(--bg-page);
    font-size: 0.85rem;
    color: var(--text-muted);
}

[data-theme="dark"] .elmundo-footer {
    border-top-color: var(--elmundo-red);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .elmundo-front-grid {
        grid-template-columns: 1fr;
    }
    .left-col, .right-col {
        border: none;
        padding: 0;
    }
    .juegos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .masthead-title {
        font-size: 2.4rem;
    }
}
