/* ==========================================================================
   PERIÓDICO ESCOLAR MELVIN JONES ("LA VOZ MELVINISTA") - ESTILOS V2.1.0
   Maquetación Facsímil, Grid Responsivo, Modal Interactivo y Soporte de Impresión
   ========================================================================== */

#periodico-melvin-jones-wrapper {
    max-width: 1920px;
    width: 100%;
    margin: 20px auto;
    padding: 24px 32px;
    background: #ffffff;
    color: #1a1a1a;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #dcdcdc;
    font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
    line-height: 1.6;
    box-sizing: border-box;
    font-size: 16px;
}

#periodico-melvin-jones-wrapper * {
    box-sizing: border-box;
}

/* 1. BARRA SUPERIOR DE CONTROL */
.pmj-top-control-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #0f172a;
    color: #f8fafc;
    padding: 10px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
}

.pmj-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pmj-badge-tag {
    background: #b45309;
    color: #fef3c7;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pmj-badge-date {
    color: #fcd34d;
    font-weight: 700;
    font-size: 12px;
}

.pmj-search-box input {
    background: #1e293b;
    border: 1px solid #475569;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    width: 260px;
    outline: none;
    transition: all 0.2s ease;
}

.pmj-search-box input:focus {
    border-color: #fbbf24;
    background: #0f172a;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.pmj-btn-print {
    background: #f59e0b;
    color: #0f172a;
    font-weight: 800;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
}

.pmj-btn-print:hover {
    background: #d97706;
    transform: translateY(-1px);
}

/* 2. SUMARIO DE SECCIONES (FILTROS) */
.pmj-sections-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.pmj-nav-title {
    font-weight: 800;
    font-size: 11px;
    color: #0f172a;
    margin-right: 6px;
    letter-spacing: 0.5px;
}

.pmj-filter-btn {
    background: #ffffff;
    color: #1e3a8a;
    border: 1px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pmj-filter-btn:hover {
    background: #e0e7ff;
    color: #1e1b4b;
    border-color: #93c5fd;
}

.pmj-filter-btn.active {
    background: #0d3b66;
    color: #fef3c7;
    border-color: #0d3b66;
    font-weight: 700;
}

/* 3. CABECERA PRINCIPAL (MASTHEAD) */
.pmj-masthead {
    border-bottom: 4px solid #000000;
    padding-bottom: 12px;
    margin-bottom: 25px;
}

.pmj-masthead-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}

.pmj-logo-wrap {
    flex-shrink: 0;
    max-width: 140px;
}

.pmj-official-logo {
    max-height: 90px;
    width: auto;
    object-fit: contain;
}

.pmj-masthead-center {
    text-align: center;
    flex: 1;
}

.pmj-inst-name {
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #0d3b66;
    text-transform: uppercase;
}

.pmj-newspaper-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 52px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
    margin: 4px 0;
    color: #000000;
    line-height: 1.05;
}

.pmj-newspaper-subtitle {
    font-style: italic;
    font-size: 15px;
    color: #4b5563;
    margin: 0;
}

.pmj-motto-box {
    flex-shrink: 0;
    border: 2px solid #0d3b66;
    padding: 8px 14px;
    text-align: center;
    border-radius: 6px;
    background: #f8fafc;
    max-width: 190px;
}

.pmj-motto-label {
    display: block;
    font-size: 9px;
    font-family: 'Plus Jakarta Sans', monospace;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.5px;
}

.pmj-motto-text {
    display: block;
    font-family: 'Cinzel', serif;
    font-weight: 800;
    color: #b45309;
    font-size: 14px;
    line-height: 1.2;
    margin: 2px 0;
}

.pmj-submotto {
    display: block;
    font-size: 10px;
    font-style: italic;
    color: #334155;
}

/* Cintillo de Datos */
.pmj-dateline {
    border-top: 2px solid #000000;
    border-bottom: 2px solid #000000;
    padding: 6px 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 11px;
    text-transform: uppercase;
    color: #1e293b;
    background: #fafafa;
}

/* 4. DIAGRAMACIÓN MULTICOLUMNA & ARTÍCULOS */
.pmj-grid-layout {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 28px;
}

.pmj-article {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 24px;
    margin-bottom: 12px;
    scroll-margin-top: 50px;
    transition: background 0.3s ease;
}

.pmj-article.headline {
    grid-column: span 12;
    border-bottom: 3px solid #000000;
    padding-bottom: 30px;
}

.pmj-article.column_left,
.pmj-article.column_right {
    grid-column: span 6;
}

.pmj-article.rector_column,
.pmj-article.advisor_column,
.pmj-article.inside_section {
    grid-column: span 6;
}

.pmj-article-meta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.pmj-section-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: #0d3b66;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.pmj-tag-editorial { background: #1e3a8a; }
.pmj-tag-actualidad { background: #b45309; }
.pmj-tag-servicio { background: #047857; }
.pmj-tag-cultura { background: #7c2d12; }
.pmj-tag-ciencia { background: #4338ca; }
.pmj-tag-deportes { background: #0f766e; }
.pmj-tag-voces { background: #475569; }

.pmj-read-time {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.pmj-volanta {
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 12px;
    font-weight: 800;
    color: #b91c1c;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.pmj-article-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 8px 0;
    color: #0f172a;
}

.pmj-article.headline .pmj-article-title {
    font-size: 40px;
    line-height: 1.15;
}

.pmj-article-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

.pmj-article-title a:hover {
    color: #0d3b66;
    text-decoration: underline;
}

.pmj-article-subtitle {
    font-style: italic;
    font-size: 16px;
    color: #4b5563;
    margin-bottom: 12px;
    line-height: 1.45;
}

.pmj-byline {
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 14px;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 8px;
}

.pmj-figure {
    margin: 14px 0 18px 0;
}

.pmj-article-image {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.pmj-article-image:hover {
    opacity: 0.95;
    transform: scale(1.005);
}

.pmj-figcaption {
    font-size: 12px;
    font-style: italic;
    color: #64748b;
    margin-top: 6px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 4px;
}

/* Capitular (Dropcap) */
.pmj-dropcap-lead::first-letter {
    float: left;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 3.8rem;
    line-height: 0.8;
    padding-top: 4px;
    padding-right: 12px;
    font-weight: 800;
    color: #0d3b66;
}

.pmj-article-content p {
    margin-bottom: 12px;
    text-align: justify;
    font-size: 16px;
    line-height: 1.65;
}

.pmj-pullquote {
    border-top: 2px solid #000000;
    border-bottom: 2px solid #000000;
    padding: 14px 22px;
    margin: 20px 0;
    text-align: center;
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 700;
    font-size: 18px;
    font-style: italic;
    color: #0f172a;
    background: #fbfbfa;
}

.pmj-pullquote cite {
    display: block;
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 11px;
    font-style: normal;
    text-transform: uppercase;
    color: #64748b;
    margin-top: 8px;
}

/* Footer de artículo */
.pmj-article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.pmj-btn-like {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pmj-btn-like:hover, .pmj-btn-like.liked {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.pmj-btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0d3b66;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pmj-btn-read-more:hover {
    background: #082845;
    transform: translateY(-1px);
}

/* 5. MODAL DE LECTURA INMERSIVA & AUDIO */
.pmj-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pmj-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 850px;
    max-height: 90vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid #e2e8f0;
}

.pmj-modal-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    gap: 10px;
}

.pmj-modal-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pmj-btn-audio {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pmj-btn-audio:hover { background: #1d4ed8; }
.pmj-btn-audio.speaking { background: #dc2626; }

.pmj-theme-switch, .pmj-font-controls {
    display: flex;
    gap: 3px;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 6px;
}

.pmj-theme-btn, .pmj-font-btn, .pmj-toolbar-btn {
    background: transparent;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.pmj-theme-btn.active {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.pmj-close-btn {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 900;
}

.pmj-modal-content {
    padding: 28px 36px;
    overflow-y: auto;
    font-size: 17px;
    line-height: 1.7;
}

/* Modal Themes */
.pmj-modal-content.theme-sepia {
    background: #fbf0d9;
    color: #433422;
}
.pmj-modal-content.theme-dark {
    background: #18181b;
    color: #f4f4f5;
}
.pmj-modal-content.theme-dark .pmj-modal-headline,
.pmj-modal-content.theme-dark .pmj-pullquote {
    color: #ffffff;
}

.pmj-modal-headline {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 32px;
    font-weight: 900;
    margin: 8px 0 12px 0;
    line-height: 1.2;
}

/* Audio Player Animated Bar */
.pmj-audio-player-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 10px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: #1e40af;
}

.pmj-audio-anim {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}
.pmj-audio-anim span {
    width: 3px;
    background: #2563eb;
    animation: pmjWave 1s infinite ease-in-out;
}
.pmj-audio-anim span:nth-child(2) { animation-delay: 0.2s; }
.pmj-audio-anim span:nth-child(3) { animation-delay: 0.4s; }
.pmj-audio-anim span:nth-child(4) { animation-delay: 0.1s; }
.pmj-audio-anim span:nth-child(5) { animation-delay: 0.3s; }

@keyframes pmjWave {
    0%, 100% { height: 4px; }
    50% { height: 16px; }
}

.pmj-audio-stop {
    margin-left: auto;
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

/* Social Share Bar */
.pmj-share-bar {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
}

.pmj-share-btn {
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
}
.pmj-share-btn.wa { background: #25d366; }
.pmj-share-btn.fb { background: #1877f2; }
.pmj-share-btn.copy { background: #475569; }

/* 6. PIE DE IMPRENTA INSTITUCIONAL */
.pmj-footer {
    border-top: 3px solid #000000;
    margin-top: 35px;
    padding-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 12px;
    color: #475569;
}

.pmj-footer-logo-title {
    font-weight: 900;
    color: #0f172a;
    font-size: 13px;
    margin-bottom: 6px;
}

.pmj-footer p {
    margin: 4px 0;
    line-height: 1.5;
}

.pmj-footer a {
    color: #0d3b66;
    text-decoration: none;
    font-weight: 700;
}
.pmj-footer a:hover {
    text-decoration: underline;
}

/* 7. RESPONSIVE BREAKPOINTS */
@media (max-width: 900px) {
    .pmj-newspaper-title {
        font-size: 38px;
    }
    .pmj-article.column_left,
    .pmj-article.column_right,
    .pmj-article.rector_column,
    .pmj-article.advisor_column,
    .pmj-article.inside_section {
        grid-column: span 12;
    }
    .pmj-masthead-top {
        flex-direction: column;
        text-align: center;
    }
    .pmj-motto-box {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    #periodico-melvin-jones-wrapper {
        padding: 14px;
    }
    .pmj-top-control-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .pmj-search-box input {
        width: 100%;
    }
    .pmj-newspaper-title {
        font-size: 28px;
    }
}

/* 8. ESTILOS DE IMPRESIÓN OFICIAL */
@media print {
    body * {
        visibility: hidden !important;
    }
    #periodico-melvin-jones-wrapper,
    #periodico-melvin-jones-wrapper * {
        visibility: visible !important;
    }
    #periodico-melvin-jones-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }
    .no-print, .pmj-modal-overlay {
        display: none !important;
    }
    .pmj-article {
        page-break-inside: avoid;
    }
}
