:root {
    --primary: #5e8cff;
    --accent: #ff3b5c;
    --dark: #0a0a12;
    --darker: #05050a;
    --card-bg: #111118;
    --text: #e8e8f0;
    --text-muted: #a0a0b8;
}

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

body {
    background: var(--dark);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.68;
    overflow-x: hidden;
}

a { text-decoration: none; }

/* ==================== NAV ==================== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 18, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(94, 140, 255, 0.15);
    z-index: 1000;
    padding: 18px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--primary);
}

.logo:hover {
    color: #7aa8ff;
}

/* ==================== DESTACADO ==================== */
.featured {
    position: relative;
    min-height: 78vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.featured-bg {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    background-image: url('../images/79733fab-e4f3-4c4d-8167-e0a03805ee26.png');
    background-size: cover;
    background-position: center;
    filter: brightness(0.55) contrast(1.1);
    z-index: 1;
    transition: transform 0.1s ease-out;
}

.featured-overlay-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10,10,18,0.5) 0%, rgba(10,10,18,0.7) 55%, rgba(5,5,10,0.94) 100%);
    z-index: 2;
}

.featured-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    margin: 0 auto;
    padding: 90px 5% 40px;
    width: 100%;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.featured-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s ease;
    cursor: pointer;
    display: block;
}

.featured-card:hover { transform: translateY(-8px); }

.featured-card img {
    width: 100%;
    height: 460px;
    object-fit: cover;
}

.featured-overlay {
    padding: 45px 50px;
    background: linear-gradient(to top, rgba(5,5,10,0.95), transparent 50%);
}

.featured-category {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 14px;
}

.featured-title {
    font-size: 30px;
    line-height: 1.3;
    font-weight: 800;
    margin-bottom: 14px;
}

.featured-title a { color: inherit; }

.featured-meta {
    color: var(--text-muted);
    font-size: 14px;
}

/* ==================== ÚLTIMAS PUBLICACIONES CON PARALLAX ==================== */
.latest-section {
    position: relative;
    padding: 140px 0 160px;
    overflow: hidden;
}

.latest-bg {
    position: absolute;
    top: -30%;
    left: -20%;
    width: 140%;
    height: 160%;
    background-image: url('../images/d4959075-f0aa-423f-91df-5b768f01191a.png');
    background-size: cover;
    background-position: center;
    filter: brightness(0.45) contrast(1.15);
    z-index: 1;
    transition: transform 0.15s ease-out;
}

.latest-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10,10,18,0.92) 0%, rgba(10,10,18,0.85) 40%, rgba(5,5,10,0.95) 100%);
    z-index: 2;
}

.latest-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 34px;
}

/* Cards completamente clickeables */
.article-card {
    background: var(--card-bg);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(94, 140, 255, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.article-card:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 45px rgba(94, 140, 255, 0.18);
    transform: translateY(-10px);
}

.article-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: #1a1a24;
}

.article-content {
    padding: 34px 32px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-category {
    color: var(--accent);
    font-size: 12.8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 14px;
}

.article-title {
    font-size: 20px;
    line-height: 1.35;
    font-weight: 700;
    margin-bottom: 18px;
    flex: 1;
}

.article-excerpt {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.68;
    margin-bottom: 26px;
    flex: 1;
}

.article-meta {
    font-size: 13.8px;
    color: #777;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
}

.grid-status {
    color: var(--text-muted);
    font-size: 15px;
    padding: 20px 0;
}

.grid-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin-top: 46px;
}

.page-btn {
    background: rgba(94, 140, 255, 0.1);
    border: 1px solid rgba(94, 140, 255, 0.28);
    color: var(--primary);
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-indicator {
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Footer */
footer {
    background: var(--darker);
    padding: 80px 5% 50px;
    text-align: center;
    border-top: 1px solid rgba(94, 140, 255, 0.1);
    position: relative;
    z-index: 3;
}

footer p {
    color: #666;
    font-size: 14px;
}

/* Responsivo */
@media (max-width: 640px) {
    nav {
        padding: 14px 5%;
        height: auto;
    }
    .featured-content { padding-top: 70px; }
    .featured { min-height: 60vh; }
    .grid { grid-template-columns: 1fr; gap: 28px; }
    .article-content { padding: 28px 24px 26px; }
    .grid-pagination { gap: 14px; }
}

/* ====================================================================
   MODAL LECTOR A4 — renderiza una edición completa (portada, editorial,
   artículos, anuncios y colofón) leída dinámicamente desde su
   edicion-NNNN.json, en formato de páginas A4 apiladas y desplazables.
   ==================================================================== */

.a4-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 2, 6, 0.92);
    backdrop-filter: blur(4px);
    z-index: 5000;
    display: none;
    overflow-y: auto;
    padding: 40px 0 80px;
}

.a4-modal-overlay.open {
    display: block;
}

.a4-modal-close {
    position: fixed;
    top: 22px;
    right: 30px;
    z-index: 5100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.a4-modal-close:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.08);
}

.a4-modal-status {
    position: fixed;
    top: 5px;
    left: 5px;
    z-index: 5100;
    color: var(--text-muted);
    font-size: 10.5px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(0,0,0,0.55);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
}

.a4-pages {
    max-width: 21cm;
    margin: 0 auto;
}

.a4-page {
    width: 21cm;
    max-width: 92vw;
    min-height: 29.7cm;
    margin: 0 auto 25px;
    padding: 1.8cm;
    background: linear-gradient(135deg, #0a0a15 0%, #000008 100%);
    border: 1px solid #000044;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
    color: #fff;
    font-family: 'Calibri', 'Arial', sans-serif;
}

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

.a4-page .featured-image {
    width: 100%;
    max-height: 10cm;
    object-fit: cover;
    margin: 1cm 0 1.2cm 0;
    border-radius: 6px;
}

/* Portada */
.a4-page.portada {
    position: relative;
    text-align: center;
    background-image: linear-gradient(rgba(5,5,10,0.55), rgba(5,5,10,0.8)), url('../images/NL_Bkg.jpg');
    background-size: cover;
    background-position: center;
}
.portada-logo-img { width: 70px; height: auto; position: absolute; top: 10px; left: 10px; }
.portada-logo-text {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
}
.portada-topright {
    position: absolute;
    top: 10px;
    right: 10px;
    text-align: right;
}
.portada-numero { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; color: #bbb; }
.portada-fecha { font-size: 0.85rem; font-weight: 600; color: var(--accent); margin-top: 4px; }
.portada-center {
    position: absolute;
    top: 33%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 88%;
}
.portada-titulo { font-size: 3.6rem; font-weight: 900; line-height: 1.05; letter-spacing: -1.5px; margin-bottom: 0.35cm; color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,0.65); }
.portada-subtitulo { font-size: 1.15rem; letter-spacing: 3px; text-transform: uppercase; color: #e6e6ee; margin-bottom: 0.9cm; }
.portada-descripcion { font-size: 1.05rem; line-height: 1.6; color: #ccc; max-width: 14cm; margin: 0 auto; }

/* Editorial */
.a4-page.editorial-page { display: flex; flex-direction: column; }
.editorial-label {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 3px;
    color: var(--accent); margin-bottom: 1cm; border-left: 4px solid var(--accent); padding-left: 0.5cm;
}
.editorial-content { font-size: 1.05rem; line-height: 1.8; color: #ccc; }
.editorial-content p { margin-bottom: 0.8cm; }

/* Artículo */
.a4-page .header { display: flex; flex-direction: column; margin-bottom: 0.8cm; }
.a4-page .doc-category { color: var(--accent); font-size: 0.8rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 0.3cm; }
.a4-page .doc-title { font-size: 1.9rem; font-weight: 800; line-height: 1.25; margin-bottom: 0.4cm; }
.a4-page .doc-meta { color: #888; font-size: 0.85rem; display: flex; gap: 16px; }
.a4-page .article-body { font-size: 1rem; line-height: 1.75; color: #ddd; }
.a4-page .article-body h2 { font-size: 1.3rem; margin: 0.9cm 0 0.4cm; color: #fff; }
.a4-page .article-body h3 { font-size: 1.1rem; margin: 0.7cm 0 0.35cm; color: #eee; }
.a4-page .article-body p { margin-bottom: 0.5cm; }
.a4-page .article-body ul { margin: 0 0 0.5cm 1.2em; }
.a4-page .article-body blockquote {
    border-left: 3px solid var(--primary); padding-left: 0.6cm; margin: 0.6cm 0;
    color: #aeb8ff; font-style: italic;
}
.a4-page .tags-section { margin-top: 0.8cm; }
.a4-page .tag {
    display: inline-block; background: rgba(94,140,255,0.12); color: var(--primary);
    font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; margin-right: 6px;
}
.a4-page .footer { position: absolute; bottom: 1cm; left: 1.8cm; font-size: 0.75rem; color: #555; }

/* Anuncio */
.a4-page.ad-page { padding: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.a4-page.ad-page .ad-image { width: 100%; height: 100%; object-fit: cover; }
.a4-page.ad-page .ad-label {
    position: absolute; top: 0.5cm; right: 0.5cm; background: rgba(255,255,255,0.9); color: #000;
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; padding: 4px 10px; border-radius: 3px;
}

/* Colofón */
.a4-page.colofon-page { padding: 2cm 2.2cm; }
.colophon-header { text-align: center; margin-bottom: 1.4cm; padding-bottom: 0.8cm; border-bottom: 2px solid #1a1a2e; }
.colophon-title { font-size: 32px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 4px; margin-bottom: 0.3cm; }
.colophon-subtitle { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 3px; }
.colophon-section { margin-bottom: 1.2cm; }
.colophon-section h2 { font-size: 14px; color: var(--primary); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 0.6cm; padding-bottom: 0.3cm; border-bottom: 1px solid #1a1a2e; }
.colophon-section p, .colophon-section ul { font-size: 14.5px; line-height: 1.75; color: #b0b0b0; }
.colophon-section ul { list-style: none; padding-left: 0; }
.colophon-section li { margin-bottom: 0.35cm; padding-left: 1.3em; position: relative; }
.colophon-section li::before { content: "▸"; position: absolute; left: 0; color: var(--primary); }
.staff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9cm 2.2cm; }
.staff-role { font-size: 12px; color: var(--primary); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 5px; }
.staff-name { font-size: 15.5px; font-weight: 600; color: #e0e0e0; }
.legal-text { white-space: pre-line; font-size: 13.5px; line-height: 1.7; color: #999; }
.colophon-footer { text-align: center; padding-top: 0.8cm; border-top: 1px solid #1a1a2e; font-size: 11px; color: #666; margin-top: 1cm; }

@media (max-width: 640px) {
    .a4-page { max-width: 100vw; padding: 1cm; }
    .staff-grid { grid-template-columns: 1fr; }
}
