/* Parallel Press — Newspaper Style */

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

html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    background-color: #d6d0c4;
    color: #1a1a1a;
    overflow-x: hidden;
    max-width: 100vw;
}

.page-layout {
    display: flex;
    max-width: 1440px;
    margin: 30px auto;
    padding: 0 20px;
    gap: 24px;
    align-items: flex-start;
}

.main-container {
    flex: 1;
    min-width: 0;
    max-width: 960px;
    padding: 0 20px 40px;
    background: #fff;
    box-shadow: 0 2px 24px rgba(0,0,0,0.18);
}

/* ── Feed Sidebar ───────────────────────────────────────────── */
.feed-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 60px);
    position: sticky;
    top: 30px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.feed-sidebar.sticky-active {
    opacity: 1;
    transform: translateY(0);
}

.feed-sidebar.sticky-inactive {
    opacity: 0.95;
    transform: translateY(-4px);
}

.feed-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.feed-header h2 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1em;
    color: #1a1a1a;
}

.feed-content {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

.feed-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.feed-item:hover {
    background: #fafaf5;
}

.feed-item-title {
    font-weight: 700;
    font-size: 0.88em;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.feed-item-divergence {
    font-size: 0.78em;
    color: #666;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.feed-item-meta {
    font-size: 0.72em;
    color: #999;
}

.feed-footer {
    padding: 10px 16px;
    border-top: 1px solid #eee;
    text-align: center;
}

.feed-refresh {
    font-size: 0.8em;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.feed-refresh:hover {
    color: #1a1a1a;
}

.feed-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
}

.feed-load-more {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: #f5f5f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 600;
    color: #1a1a1a;
    transition: background 0.2s;
    user-select: none;
}

.feed-load-more:hover:not(:disabled) {
    background: #eaeae5;
}

.feed-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feed-empty {
    padding: 24px 16px;
    text-align: center;
    color: #999;
    font-size: 0.85em;
    font-style: italic;
}

/* ── App header ───────────────────────────────────────────────── */
header {
    text-align: center;
    padding: 32px 0 24px;
    border-bottom: 3px double #1a1a1a;
    margin-bottom: 32px;
}

header h1 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 2.6em;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

header .subtitle {
    font-style: italic;
    color: #555;
    font-size: 1em;
    margin-top: 6px;
}

/* ── Form ─────────────────────────────────────────────────────── */
.form-section {
    background: #fafaf8;
    padding: 24px;
    border: 1px solid #ddd;
    margin-bottom: 32px;
    border-radius: 3px;
}

.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1000px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1em;
    font-family: 'Georgia', serif;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 4px rgba(0,0,0,0.12);
}

button[type="submit"] {
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    padding: 14px 40px;
    font-size: 1em;
    font-family: 'Georgia', serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button[type="submit"]:hover { background-color: #333; }
button[type="submit"]:disabled { opacity: 0.65; cursor: not-allowed; }

.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner--dark {
    display: inline-block;
    border-color: rgba(26,26,26,0.2);
    border-top-color: #1a1a1a;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Timeline section ────────────────────────────────────────── */
.timeline-section {
    margin-top: 32px;
    border: 1px solid #c8c2b4;
    background: #f5f0e6;
    border-radius: 3px;
    overflow: hidden;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #1a1a1a;
    color: #fff;
}

.timeline-scroll {
    box-sizing: border-box;
    height: clamp(280px, 48vh, 520px);
    overflow-y: auto;
    overflow-x: hidden;
    overflow-anchor: none;
    padding: 24px;
    scroll-behavior: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.timeline-track {
    position: relative;
    padding-left: 32px;
}

.timeline-track::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #b8b0a0;
}

/* ── Timeline entries ────────────────────────────────────────── */
.tl-entry {
    position: relative;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Solo los entries estáticos del HTML se animan al cargar */
.tl-entry--animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tl-entry--animate.tl-entry--visible {
    opacity: 1;
    transform: translateY(0);
}

/* Los entries dinámicos (placeholders/reemplazados) nacen visibles */
.tl-entry--visible {
    /* sin animación, siempre visible */
}

.tl-entry--instant {
    transition: none;
}

.tl-entry:hover {
    border-color: #888;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tl-entry--active {
    border-color: #1a1a1a;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    background: #fffdf5;
}

.tl-entry--error {
    opacity: 0.6;
    border-left: 3px solid #c44;
}

.tl-entry--error .tl-headline {
    color: #c44;
    font-style: italic;
}

/* ── Placeholder entries (loading state) ─────────────────────── */
.tl-entry--placeholder {
    opacity: 1;
    transform: none;
    pointer-events: none;
    transition: none;
}

.tl-entry--placeholder .tl-year {
    color: #aaa;
}

.tl-entry--placeholder .tl-headline,
.tl-entry--placeholder .tl-summary {
    background: linear-gradient(
        90deg,
        #f0ece4 25%,
        #e8e4dc 50%,
        #f0ece4 75%
    );
    background-size: 400% 100%;
    animation: shimmer 4s ease-in-out infinite;
    border-radius: 3px;
    display: block;
    min-height: 1em;
}

.tl-entry--placeholder .tl-headline {
    min-height: 1.4em;
    margin-bottom: 6px;
}

.tl-entry--placeholder .tl-summary {
    min-height: 1em;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* When replacing placeholder with real entry, fade in */
.tl-entry--fadein {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tl-year-marker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.tl-dot {
    position: absolute;
    left: -29px;
    top: 18px;
    width: 12px;
    height: 12px;
    background: #1a1a1a;
    border-radius: 50%;
    border: 2px solid #f5f0e6;
}

.tl-year {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.4em;
    font-weight: 900;
    color: #1a1a1a;
    letter-spacing: 1px;
}

.tl-content {
    padding-left: 0;
}

.tl-headline {
    font-family: 'Georgia', serif;
    font-size: 1.05em;
    font-weight: 700;
    line-height: 1.35;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.tl-summary {
    font-size: 0.88em;
    color: #555;
    line-height: 1.5;
}

.tl-typing::after {
    content: '▌';
    display: inline;
    color: #b38600;
    font-weight: 400;
    animation: cursorBlink 0.6s steps(1) infinite;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ── Loading newspaper spinner ───────────────────────────────── */
.loading-newspaper-section {
    margin-top: 24px;
    padding: 32px;
    text-align: center;
    border: 1px dashed #ccc;
    background: #fafaf8;
    border-radius: 3px;
}

.loading-newspaper-inner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1em;
    color: #555;
    font-style: italic;
}

/* ── Result section wrapper ───────────────────────────────────── */
.result-section {
    margin-top: 32px;
    padding-top: 36px;
    border-top: 3px double #1a1a1a;
}

/* Contenedor raíz del periódico */
.np-newspaper {
    /* Sin transiciones — plantilla única fija */
}

/* ═══════════════════════════════════════════════════════════
   PLANTILLA ÚNICA — Estilo editorial de prensa de calidad
   ═══════════════════════════════════════════════════════════ */

/* ── Contenedor principal ────────────────────────────────── */
#newspaperContainer {
    background: #fefcf8;
    border: 3px double #1a1a1a;
    box-shadow:
        0 0 0 1px #d6d0c4,
        0 1px 12px rgba(0,0,0,0.06),
        inset 0 0 0 1px rgba(0,0,0,0.03);
    padding: 40px 48px;
    position: relative;
}

/* Marco ornamental interior sutil */
#newspaperContainer::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(26,26,26,0.08);
    pointer-events: none;
}

/* ── Masthead ────────────────────────────────────────────── */
.np-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}

.np-masthead {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 3.2em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 6px;
    line-height: 1.1;
    color: #1a1a1a;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.04);
}

.np-meta {
    font-size: 0.82em;
    color: #555;
    font-style: italic;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

.np-rule-dot { margin: 0 8px; }

/* Línea triple decorativa bajo el masthead */
.np-header-rule {
    border: none;
    margin-top: 16px;
    height: 0;
}

.np-header-rule::before,
.np-header-rule::after {
    content: '';
    display: block;
    height: 1px;
    background: #1a1a1a;
}

.np-header-rule::before {
    margin-bottom: 3px;
}

.np-header-rule::after {
    margin-top: 3px;
}

/* Ornamento central entre las líneas */
.np-header-rule .np-rule-ornament {
    display: block;
    text-align: center;
    font-size: 0.7em;
    color: #1a1a1a;
    line-height: 1;
    padding: 4px 0;
    letter-spacing: 8px;
}

/* ── Headline block ──────────────────────────────────────── */
.np-headline-block {
    text-align: center;
    padding: 24px 0 20px;
    border-bottom: 1px solid #1a1a1a;
    margin-bottom: 0;
    position: relative;
}

.np-headline {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 2.6em;
    font-weight: 900;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a1a1a;
}

.np-subheadline {
    font-size: 1.05em;
    color: #444;
    font-style: italic;
    font-weight: 500;
    margin-top: 10px;
}

/* Ornamento separador headline → cuerpo */
.np-headline-block::after {
    content: '✦';
    display: block;
    text-align: center;
    font-size: 0.85em;
    color: #1a1a1a;
    margin-top: 16px;
    letter-spacing: 12px;
}

/* ── Imagen central (marco tipo polaroid) ────────────────── */
.np-hero {
    text-align: center;
    margin: 12px 0 24px;
    max-width: 100%;
    padding: 0;
    width: 100%;
}

.np-image-placeholder {
    margin: 0;
    width: 100%;
    min-height: 320px;
    background: #1a1a1a;
    border: 2px solid #1a1a1a;
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
    /* max-width eliminado para full width */
}

.np-image-caption {
    font-size: 0.72em;
    color: #666;
    font-style: italic;
    margin-top: 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0 12px;
}

/* ── Cuerpo principal ────────────────────────────────────── */
.np-body {
    padding: 16px 0 24px;
    border-bottom: 1px solid #1a1a1a;
}

.np-main-text {
    font-size: 0.95em;
    line-height: 1.75;
    text-align: justify;
    column-count: 2;
    column-gap: 32px;
    column-rule: 1px solid #e0dace;
}

/* Capitular (drop cap) en la primera letra */
.np-main-text p:first-of-type::first-letter {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 3.5em;
    font-weight: 900;
    float: left;
    line-height: 0.8;
    margin: 4px 10px 0 0;
    color: #1a1a1a;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.06);
}

.np-main-text p {
    margin-bottom: 0.85em;
    text-indent: 1.5em;
}

.np-main-text p:first-of-type {
    text-indent: 0;
}

/* ── Separador ornamental ────────────────────────────────── */
.np-divider {
    border: none;
    text-align: center;
    height: 24px;
    line-height: 24px;
    margin: 0;
    position: relative;
}

.np-divider::before,
.np-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 20px);
    height: 1px;
    background: #1a1a1a;
}

.np-divider::before { left: 0; }
.np-divider::after { right: 0; }

.np-divider::after {
    content: '◆';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.6em;
    color: #1a1a1a;
    background: #fefcf8;
    padding: 0 10px;
}

/* ── Noticias secundarias ────────────────────────────────── */
.np-secondary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 24px 0 8px;
    gap: 0;
}

.np-secondary-col {
    padding: 0 20px;
    position: relative;
}

.np-secondary-col:first-child { padding-left: 0; }
.np-secondary-col:last-child  { padding-right: 0; }

.np-secondary-col--border {
    border-right: 1px solid #1a1a1a;
}

.np-sec-title {
    font-family: 'Georgia', serif;
    font-size: 1.05em;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #1a1a1a;
    color: #1a1a1a;
}

.np-sec-summary {
    font-size: 0.88em;
    line-height: 1.65;
    text-align: justify;
    color: #222;
}

/* ── Secondary articles grid (responsive fallback) ─────────── */
/* Nota: las columnas se manejan en la nueva plantilla arriba.
   Este bloque es un fallback para compatibilidad con streaming. */

/* ── Streaming placeholders ──────────────────────────────────── */
.np-streaming-placeholder {
    color: #bbb;
    animation: streamPulse 1.2s ease-in-out infinite;
}

@keyframes streamPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ── Error section ───────────────────────────────────────────── */
.error-section {
    margin-top: 20px;
    padding: 18px 20px;
    background: #fff5f5;
    border: 1px solid #f5c6c6;
    border-radius: 3px;
    color: #c62828;
    font-size: 0.95em;
}

.error-section.hidden { display: none; }

/* ── Print button ─────────────────────────────────────────────── */
.print-btn {
    display: block;
    margin: 28px auto 0;
    padding: 12px 30px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    font-family: 'Georgia', serif;
    font-size: 0.95em;
    cursor: pointer;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: background 0.25s;
}

.print-btn:hover { background: #333; }

/* ── Utility ──────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
    text-align: center;
    margin-top: 48px;
    padding-top: 18px;
    border-top: 1px solid #ddd;
    color: #777;
    font-size: 0.85em;
    font-style: italic;
}

/* ── Print styles ─────────────────────────────────────────────── */
@media print {
    body { background: #fff; }

    .container {
        box-shadow: none;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    header, .form-section, .print-btn, footer,
    .timeline-section, .loading-newspaper-section { display: none !important; }

    .result-section {
        border: none;
        padding: 0;
        margin: 0;
    }

    #newspaperContainer {
        border: none;
        padding: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Tablet y inferior (≤720px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 720px) {

    /* ── Layout de página: columna única, centrado ───────── */
    .page-layout {
        flex-direction: column;
        max-width: 100%;
        margin: 0 auto;
        padding: 12px;
        gap: 0;
    }

    .main-container {
        max-width: 100%;
        width: 100%;
        padding: 20px 16px 32px;
        min-width: 0;
    }

    /* ── Feed sidebar: debajo del contenido, mismo ancho ─── */
    .feed-sidebar {
        width: 100%;
        max-height: none;
        position: static;
        border: none;
        border-top: 2px solid #1a1a1a;
        box-shadow: none;
        order: 2;
    }

    .feed-content {
        max-height: 400px;
    }

    /* ── Header compacto ─────────────────────────────────── */
    header {
        padding: 20px 0 16px;
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 1.8em;
        letter-spacing: 1px;
    }

    header .subtitle {
        font-size: 0.9em;
    }

    /* ── Formulario compacto ─────────────────────────────── */
    .form-section {
        padding: 16px;
        margin-bottom: 20px;
    }

    .form-group label {
        font-size: 0.78em;
    }

    .form-group input {
        padding: 10px 12px;
        min-height: 44px; /* touch target */
    }

    button[type="submit"] {
        padding: 12px 24px;
        min-height: 48px; /* touch target */
    }

    /* ── Timeline compacto ───────────────────────────────── */
    .timeline-section {
        margin-top: 20px;
    }

    .timeline-header {
        padding: 12px 16px;
    }

    .timeline-scroll {
        height: clamp(260px, 42vh, 440px);
        padding: 16px;
    }

    .timeline-track {
        padding-left: 24px;
    }

    .tl-entry {
        padding: 12px 14px;
        margin-bottom: 14px;
    }

    .tl-year {
        font-size: 1.15em;
    }

    .tl-headline {
        font-size: 0.95em;
    }

    .tl-summary {
        font-size: 0.82em;
    }

    .tl-dot {
        left: -25px;
        width: 10px;
        height: 10px;
    }

    /* ── Periódico compacto ──────────────────────────────── */
    #newspaperContainer {
        padding: 24px 20px;
    }

    #newspaperContainer::before {
        top: 4px;
        left: 4px;
        right: 4px;
        bottom: 4px;
    }

    .np-header {
        margin-bottom: 18px;
    }

    .np-masthead {
        font-size: 2em;
        letter-spacing: 3px;
    }

    .np-meta {
        font-size: 0.75em;
    }

    .np-headline-block {
        padding: 18px 0 14px;
    }

    .np-headline {
        font-size: 1.7em;
    }

    .np-subheadline {
        font-size: 0.95em;
    }

    .np-headline-block::after {
        font-size: 0.75em;
        letter-spacing: 8px;
        margin-top: 12px;
    }

    .np-hero {
        max-width: 100%;
        margin: 8px auto 18px;
    }

    .np-image-placeholder {
        min-height: 180px;
        max-width: 100%;
    }

    .np-image-caption {
        font-size: 0.68em;
        padding: 0 8px;
    }

    .np-body {
        padding: 12px 0 18px;
    }

    .np-main-text {
        column-count: 1;
        font-size: 0.92em;
    }

    .np-main-text p:first-of-type::first-letter {
        font-size: 3em;
        margin: 4px 8px 0 0;
    }

    .np-divider {
        height: 18px;
    }

    .np-secondary-grid {
        grid-template-columns: 1fr;
        padding: 16px 0 8px;
    }

    .np-secondary-col,
    .np-secondary-col:first-child,
    .np-secondary-col:last-child {
        padding: 0;
        border-right: none;
        border-bottom: 1px solid #ccc;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    .np-secondary-col:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .np-sec-title {
        font-size: 1em;
        padding-bottom: 5px;
    }

    .np-sec-summary {
        font-size: 0.85em;
    }

    /* ── Botón imprimir ──────────────────────────────────── */
    .print-btn {
        padding: 10px 24px;
        font-size: 0.9em;
        min-height: 44px;
    }

    /* ── Loading newspaper ───────────────────────────────── */
    .loading-newspaper-section {
        padding: 24px 16px;
    }

    /* ── Footer ──────────────────────────────────────────── */
    footer {
        margin-top: 32px;
        padding: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Móvil pequeño (≤480px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

    /* ── Header ultra compacto ───────────────────────────── */
    header {
        padding: 16px 0 12px;
        margin-bottom: 16px;
    }

    header h1 {
        font-size: 1.4em;
        letter-spacing: 0;
    }

    header .subtitle {
        font-size: 0.82em;
        margin-top: 4px;
    }

    /* ── Formulario mínimo ───────────────────────────────── */
    .form-section {
        padding: 12px;
        margin-bottom: 16px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-group label {
        font-size: 0.72em;
        margin-bottom: 4px;
    }

    .form-group input {
        padding: 10px;
        font-size: 16px; /* previene zoom en iOS */
    }

    button[type="submit"] {
        padding: 12px;
        font-size: 0.92em;
        letter-spacing: 1px;
    }

    /* ── Periódico ultra compacto ─────────────────────────── */
    #newspaperContainer {
        padding: 16px 12px;
    }

    #newspaperContainer::before {
        top: 3px;
        left: 3px;
        right: 3px;
        bottom: 3px;
    }

    .np-header {
        margin-bottom: 14px;
    }

    .np-masthead {
        font-size: 1.5em;
        letter-spacing: 2px;
    }

    .np-meta {
        font-size: 0.68em;
    }

    .np-headline-block {
        padding: 14px 0 10px;
    }

    .np-headline {
        font-size: 1.4em;
    }

    .np-subheadline {
        font-size: 0.88em;
    }

    .np-headline-block::after {
        font-size: 0.65em;
        letter-spacing: 6px;
        margin-top: 8px;
    }

    .np-hero {
        margin: 4px auto 12px;
    }

    .np-image-placeholder {
        min-height: 140px;
    }

    .np-image-caption {
        font-size: 0.62em;
        padding: 0 6px;
    }

    .np-body {
        padding: 10px 0 14px;
    }

    .np-main-text {
        font-size: 0.88em;
        line-height: 1.65;
    }

    .np-main-text p:first-of-type::first-letter {
        font-size: 2.5em;
        margin: 3px 6px 0 0;
    }

    .np-divider {
        height: 14px;
    }

    .np-secondary-grid {
        padding: 12px 0 4px;
    }

    .np-sec-title {
        font-size: 0.95em;
        padding-bottom: 4px;
    }

    .np-sec-summary {
        font-size: 0.82em;
    }

    /* ── Timeline ultra compacto ─────────────────────────── */
    .timeline-scroll {
        height: clamp(240px, 38vh, 360px);
        padding: 12px;
    }

    .timeline-track {
        padding-left: 20px;
    }

    .tl-entry {
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .tl-year-marker {
        gap: 8px;
    }

    .tl-dot {
        left: -21px;
        width: 8px;
        height: 8px;
    }

    .tl-year {
        font-size: 1.05em;
    }

    .tl-headline {
        font-size: 0.9em;
    }

    .tl-summary {
        font-size: 0.78em;
    }

    /* ── Feed sidebar compacto ───────────────────────────── */
    .feed-header {
        padding: 12px;
    }

    .feed-header h2 {
        font-size: 0.95em;
    }

    .feed-item {
        padding: 10px 12px;
    }

    .feed-item-title {
        font-size: 0.82em;
    }

    .feed-item-divergence {
        font-size: 0.72em;
    }

    .feed-item-meta {
        font-size: 0.68em;
    }

    .feed-footer {
        padding: 8px 12px;
    }

    .feed-refresh,
    .feed-load-more {
        font-size: 0.78em;
        padding: 8px 12px;
    }

    /* ── Error ───────────────────────────────────────────── */
    .error-section {
        padding: 14px 12px;
        font-size: 0.88em;
    }

    /* ── Loading ─────────────────────────────────────────── */
    .loading-newspaper-section {
        padding: 20px 12px;
    }

    .loading-newspaper-inner {
        font-size: 0.9em;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Touch improvements (todos los tamaños)
   ═══════════════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
    /* Aumentar áreas táctiles en dispositivos touch */
    .feed-item {
        padding: 14px 16px;
    }

    .tl-entry {
        padding: 14px 18px;
    }

    .feed-load-more,
    .feed-refresh,
    .print-btn,
    button[type="submit"] {
        min-height: 48px;
    }

    /* Eliminar hover effects en touch */
    .feed-item:hover {
        background: transparent;
    }

    .tl-entry:hover {
        border-color: #ddd;
        box-shadow: none;
    }

    .tl-entry--active:hover {
        border-color: #1a1a1a;
        box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    }
}

/* ═══════════════════════════════════════════════════════════
   SECCIONES TEMÁTICAS — Grid de secciones temáticas del periódico
   ═══════════════════════════════════════════════════════════ */

.np-divider--subtle {
    opacity: 0.6;
}

.np-tematic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 24px 0 8px;
}

.np-tematic-col {
    padding: 0 16px;
    position: relative;
    border-right: 1px solid rgba(26,26,26,0.15);
}

.np-tematic-col:first-child {
    padding-left: 0;
}

.np-tematic-col:last-child {
    padding-right: 0;
    border-right: none;
}

.np-tematic-label {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 0.72em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(26,26,26,0.1);
}

.np-tematic-headline {
    font-family: 'Georgia', serif;
    font-size: 0.92em;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.np-tematic-summary {
    font-size: 0.82em;
    line-height: 1.6;
    text-align: justify;
    color: #444;
    margin: 0;
}

/* Responsive: apilar columnas en pantallas pequeñas */
@media (max-width: 720px) {
    .np-tematic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .np-tematic-col {
        border-right: none;
        border-bottom: 1px solid rgba(26,26,26,0.1);
        padding: 12px 0;
    }

    .np-tematic-col:nth-child(2n) {
        border-right: none;
    }

    .np-tematic-col:nth-child(n+3) {
        border-top: none;
    }
}

@media (max-width: 480px) {
    .np-tematic-grid {
        grid-template-columns: 1fr;
    }

    .np-tematic-col {
        border-right: none;
        padding: 12px 0;
    }

    .np-tematic-col:not(:last-child) {
        border-bottom: 1px solid rgba(26,26,26,0.1);
    }
}
