/* ==========================================================================
   Sala de Prensa del inicio (#actualidad en index.html)
   --------------------------------------------------------------------------
   Composición editorial en tres zonas: portada · entradas · eventos y aviso.
   El contenido lo pintan assets/js/news.js (renderHome, layout 'editorial')
   y el script de eventos de index.html; aquí solo hay presentación.
   Prefijo `pr-`. Reutiliza tokens de styles.css y botones de ui.css.
   La sección es transparente: el color y los nodos los pone el fondo global
   (data-background.css); las tarjetas blancas lo tapan.
   ========================================================================== */

:root {
    --pr-line: #E4EAF0;
    --pr-text: #1B2E4B;
    --pr-muted: #506680;
    --pr-green-dark: #3F7A1E;
    --pr-green-soft: rgba(141, 198, 63, 0.10);
    --pr-blue-soft: rgba(0, 75, 135, 0.08);
    --pr-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --pr-shadow: 0 1px 2px rgba(10, 25, 47, 0.04), 0 10px 28px -18px rgba(10, 25, 47, 0.18);
}

/* --- Sección ------------------------------------------------------------- */

#actualidad.pr-section {
    position: relative;
    padding: clamp(40px, 4.5vw, 60px) 0;
    background-color: transparent !important;
    background-image: none !important;
}

#actualidad.pr-section::before { display: none; }

.pr-wrap {
    position: relative;
    z-index: 1;
    /* Deja 80 px a cada lado: el menú flotante de redes (56 px) va fijo a la derecha. */
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* En escritorio el menú flotante de redes (56 px) va fijo a la derecha: se reservan 80 px por lado. */
@media (min-width: 1200px) {
    .pr-wrap { max-width: min(var(--container-max-width), calc(100vw - 160px)); }
}

/* Los bloques .reveal de styles.css entran con translateY(40px); aquí solo un poco. */
#actualidad .reveal { transform: translateY(18px) scale(1); }
#actualidad .reveal.active { transform: none; }

/* --- Encabezado ---------------------------------------------------------- */

.pr-head { margin-bottom: 22px; }

.pr-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--primary-blue);
}

.pr-eyebrow::before {
    content: '';
    width: 40px;
    height: 2px;
    background: var(--emerald);
    border-radius: 2px;
}

.pr-title {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(1.8rem, 2.2vw, 2.1rem);
    line-height: 1.15;
    letter-spacing: -0.022em;
    color: var(--primary-blue);
    text-wrap: balance;
}


/* --- Grilla -------------------------------------------------------------- */

.pr-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 3.5fr) minmax(0, 3.5fr);
    gap: 20px;
    align-items: stretch;
}

/* La zona de noticias abarca portada + entradas (dos columnas de la grilla). */
.pr-news {
    grid-column: 1 / 3;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 3.5fr);
    gap: 20px;
    align-items: stretch;
    min-width: 0;
}

/* Con una sola noticia la portada ocupa toda la zona. */
.pr-news--solo { grid-template-columns: minmax(0, 1fr); }

.pr-side {
    grid-column: 3;
    display: grid;
    gap: 14px;
    min-width: 0;
}

.pr-side .pr-panel { height: 100%; }

.pr-loading,
.pr-events__empty {
    grid-column: 1 / -1;
    padding: 18px 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--pr-muted);
}

/* --- Enlaces y etiquetas ------------------------------------------------- */

.pr-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--pr-green-dark);
    text-decoration: none;
    transition: color 0.25s ease;
}

.pr-link i { font-size: 0.85em; transition: transform 0.3s var(--pr-ease); }
.pr-link:hover, .pr-link:focus-visible { color: #2F5E13; }
.pr-link:hover i, .pr-link:focus-visible i { transform: translateX(4px); }
.pr-link--small { font-size: 0.84rem; white-space: nowrap; }

.pr-date {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pr-muted);
}

.pr-badge {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-blue);
    background: var(--pr-blue-soft);
}

.pr-badge--solid {
    color: #fff;
    background: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(0, 45, 90, 0.25);
}

/* --- Portada ------------------------------------------------------------- */

.pr-lead {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--pr-line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--pr-shadow);
    cursor: pointer;
    transition: transform 0.3s var(--pr-ease), box-shadow 0.3s ease;
}

.pr-lead:hover,
.pr-lead:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(10, 25, 47, 0.05), 0 18px 36px -20px rgba(10, 25, 47, 0.28);
}

.pr-lead__media {
    position: relative;
    /* Crece hasta igualar la altura del panel de eventos. */
    flex: 1 1 auto;
    min-height: 190px;
    background-size: cover;
    background-position: center;
    transition: transform 0.45s var(--pr-ease);
    transform-origin: center;
}

/* La foto crece dentro de la portada, que la recorta con overflow: hidden. */
.pr-lead:hover .pr-lead__media { transform: scale(1.02); }

.pr-lead__media .pr-badge {
    position: absolute;
    left: 20px;
    bottom: 20px;
}

.pr-lead__body {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 24px 22px;
}

.pr-lead__title {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(1.15rem, 1.45vw, 1.35rem);
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--primary-blue);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pr-lead__summary {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--pr-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pr-lead__body .pr-link { margin-top: 4px; }

/* --- Entradas secundarias ------------------------------------------------ */

.pr-list {
    display: grid;
    grid-auto-rows: minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
}

/* Entrada secundaria: foto panorámica arriba y texto debajo, para que las
   fotos de grupo no se recorten en vertical. */
.pr-item {
    display: grid;
    /* La foto ocupa lo que sobre (mínimo 16:7); el texto va pegado abajo. */
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0;
    background: #fff;
    border: 1px solid var(--pr-line);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s var(--pr-ease), box-shadow 0.3s ease, border-color 0.3s ease;
}

.pr-item:hover,
.pr-item:focus-within {
    transform: translateY(-2px);
    border-color: #D6E0EA;
    box-shadow: var(--pr-shadow);
}

.pr-item__media {
    /* En escritorio las dos entradas comparten altura: la foto rellena lo que
       sobra (mínimo 150 px). Por debajo de 1200 px pasa a proporción 16:7. */
    width: 100%;
    height: 100%;
    min-height: 150px;
    background-size: cover;
    /* Fotos de grupo: las caras suelen estar en el tercio superior. */
    background-position: center 40%;
    transition: transform 0.45s var(--pr-ease);
}

.pr-item:hover .pr-item__media { transform: scale(1.02); }

.pr-item__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 18px 16px;
    min-width: 0;
}
.pr-item__summary {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--gray-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pr-item__link { padding-top: 4px; }

.pr-item__body .pr-badge { align-self: flex-start; margin-bottom: 2px; }

.pr-item__title {
    margin: 2px 0 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--primary-blue);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pr-item__title a { color: inherit; text-decoration: none; }

/* --- Estado vacío -------------------------------------------------------- */

.pr-empty {
    grid-column: 1 / -1;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 26px 28px;
    background: #fff;
    border: 1px dashed #CBD6E2;
    border-radius: 16px;
}

.pr-empty i { font-size: 1.4rem; color: var(--accent-blue); opacity: 0.8; margin-top: 2px; }

.pr-empty__title {
    margin: 0 0 4px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.02rem;
    color: var(--primary-blue);
}

.pr-empty__text {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--pr-muted);
}

/* --- Eventos ------------------------------------------------------------- */

.pr-panel {
    background: #fff;
    border: 1px solid var(--pr-line);
    border-radius: 18px;
    padding: 20px 22px 4px;
    box-shadow: var(--pr-shadow);
}

.pr-panel__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
}

.pr-panel__title {
    position: relative;
    margin: 0;
    padding-bottom: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.22rem;
    letter-spacing: -0.015em;
    color: var(--primary-blue);
}

.pr-panel__title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 36px;
    height: 2px;
    background: var(--emerald);
    border-radius: 2px;
}

.pr-event {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--pr-line);
}

.pr-event__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 68px;
    border-radius: 12px;
    background: var(--pr-green-soft);
    color: var(--pr-green-dark);
    line-height: 1;
}

.pr-event__date span {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.pr-event__date b {
    margin-top: 3px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
}

.pr-event__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.pr-event__type {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-blue);
}

.pr-event__title {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--primary-blue);
}

.pr-event__meta {
    list-style: none;
    margin: 2px 0 2px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 3px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.86rem;
    color: var(--pr-muted);
}

.pr-event__meta li { display: flex; align-items: center; gap: 8px; }
.pr-event__meta i { width: 14px; text-align: center; color: var(--accent-blue); opacity: 0.8; font-size: 0.8rem; }

.pr-event__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px 14px;
}

.pr-event__foot .pr-event__meta { flex: 1 1 200px; margin: 0; }
.pr-event__foot .pr-link--small { margin-left: auto; }

/* --- Botones inferiores -------------------------------------------------- */

.pr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 16px;
    margin-top: 22px;
}

.pr-actions .btn-ld { min-height: 48px; }

/* --- Responsive ---------------------------------------------------------- */

/* Pantallas bajas (portátiles a 125–150 %): menos aire vertical. */
@media (max-height: 820px) and (min-width: 1200px) {
    #actualidad.pr-section { padding: 24px 0 28px; }
    .pr-head { margin-bottom: 16px; }
    .pr-lead__media { min-height: 170px; }
    .pr-actions { margin-top: 16px; }
}

/* Muy bajas (≈700 px con la barra fija encima): todo el bloque en una pantalla. */
@media (max-height: 760px) and (min-width: 1200px) {
    #actualidad.pr-section { padding: 18px 0 22px; }
    .pr-eyebrow { margin-bottom: 6px; }
    .pr-head { margin-bottom: 12px; }
    .pr-lead__media { min-height: 150px; }
    .pr-lead__body { padding: 14px 20px 16px; gap: 6px; }
    /* Misma composición (foto arriba), solo más compacta. */
    .pr-item__media { min-height: 110px; }
    .pr-item__body { padding: 10px 14px 12px; gap: 4px; }
    .pr-item__summary { -webkit-line-clamp: 1; }
    .pr-panel { padding: 16px 18px 2px; }
    .pr-panel__head { padding-bottom: 10px; }
    .pr-panel__title { padding-bottom: 8px; }
    .pr-event { padding: 10px 0; gap: 12px; }
    .pr-event__date { height: 56px; }
    .pr-event__date b { font-size: 1.35rem; }
    .pr-side { gap: 10px; }
    .pr-actions { margin-top: 12px; }
    .pr-actions .btn-ld { min-height: 44px; padding-block: 0.8rem; }
}

@media (max-width: 1199px) {
    .pr-grid, .pr-news { align-items: start; }
    .pr-lead { height: auto; }
    .pr-lead__media { flex: 0 0 auto; aspect-ratio: 16 / 9; }
    .pr-list { grid-auto-rows: auto; }
    .pr-item__media { height: auto; min-height: 0; aspect-ratio: 16 / 7; }
    .pr-grid { grid-template-columns: minmax(0, 1fr); }
    .pr-news { grid-column: 1; }
    .pr-side { grid-column: 1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
    .pr-panel { padding-bottom: 8px; }
}

@media (max-width: 767px) {
    #actualidad.pr-section { padding: 56px 0; }
    .pr-head { margin-bottom: 22px; }
    .pr-title { font-size: clamp(1.8rem, 7.6vw, 2.1rem); }
    .pr-news { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .pr-lead__body { padding: 20px 20px 22px; }
    .pr-lead__title { font-size: 1.25rem; }
    .pr-item__media { aspect-ratio: 16 / 8; }
    .pr-item__body { padding: 12px 14px 14px; }
    .pr-side { grid-template-columns: minmax(0, 1fr); }
    .pr-panel { padding: 20px 18px 4px; }
    .pr-actions { flex-direction: column; align-items: stretch; margin-top: 24px; }
    .pr-actions .btn-ld { justify-content: center; }
}

/* --- Movimiento reducido ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .pr-lead, .pr-item, .pr-lead__media, .pr-item__media, .pr-link i, .pr-link {
        transition: none;
    }
    .pr-lead:hover, .pr-item:hover { transform: none; }
    .pr-lead:hover .pr-lead__media, .pr-item:hover .pr-item__media { transform: none; }
}
