/* =========================================================
   NOTICIAS CECOPI — VITRINA EDITORIAL (12 columnas)
   Depende de las variables globales de style.css
========================================================= */

/* ===== ESTADOS DE CARGA / VACÍO ===== */
.noticias-loading,
.noticias-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gris);
}

.noticias-loading .spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 16px;
    border: 4px solid rgba(201, 162, 39, 0.2);
    border-top-color: var(--azul-cecopi);
    border-radius: 50%;
    animation: spinNoti 0.9s linear infinite;
}

@keyframes spinNoti {
    to { transform: rotate(360deg); }
}

.noticias-empty i {
    font-size: 48px;
    color: var(--azul-cecopi);
    opacity: 0.4;
    display: block;
    margin-bottom: 10px;
}

/* =========================================================
   GRID 12 COLUMNAS
========================================================= */
.noticias-bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(220px, auto);
    gap: 18px;
}

/* ===== TARJETA BASE ===== */
.noti-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(24, 32, 42, 0.08);
    border: 1px solid rgba(201, 162, 39, 0.08);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    min-height: 0;
    min-width: 0;
}

.noti-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(24, 32, 42, 0.16);
}

/* =========================================================
   DISTRIBUCIÓN EDITORIAL
   ---------------------------------------------------------
   FILA 1:
     - #1 FEATURED: 8/12 (izq), 2 filas alto
     - #2 y #3: 4/12 (der), 1 fila cada una (cuadradas)
   FILA 2:
     - #4, #5, #6, #7: 4 x 3/12
   FILA 3:
     - #8 y #9: 2 noticias 4/12 (izq)
     - #10 FEATURED SECUNDARIA: 8/12 (der), 2 filas alto
   FILA 4:
     - #11, #12, #13, #14: 4 x 3/12
   FILA 5+:
     - patrón 3 x 4/12 (3 noticias por fila)
   ========================================================= */

/* FILA 1 — #1 Featured izquierda grande */
.noti-card.noti-featured {
    grid-column: span 8;
    grid-row: span 2;
}

/* FILA 1 — #2 y #3 apiladas a la derecha, cuadradas */
.noti-card:nth-child(2),
.noti-card:nth-child(3) {
    grid-column: span 4;
    grid-row: span 1;
}

/* FILA 2 — #4, #5, #6, #7 → 4 noticias en fila */
.noti-card:nth-child(4),
.noti-card:nth-child(5),
.noti-card:nth-child(6),
.noti-card:nth-child(7) {
    grid-column: span 3;
    grid-row: span 1;
}

/* FILA 3 — #8 y #9 a la izquierda (2 columnas medianas) */
.noti-card:nth-child(8),
.noti-card:nth-child(9) {
    grid-column: span 4;
    grid-row: span 1;
}

/* FILA 3 — #10 FEATURED SECUNDARIA a la derecha (grande) */
.noti-card:nth-child(10) {
    grid-column: span 8;
    grid-row: span 2;
}

/* FILA 4 — #11, #12, #13, #14 → 4 noticias en fila */
.noti-card:nth-child(11),
.noti-card:nth-child(12),
.noti-card:nth-child(13),
.noti-card:nth-child(14) {
    grid-column: span 3;
    grid-row: span 1;
}

/* FILA 5 en adelante — 3 noticias por fila (4/12 cada una) */
.noti-card:nth-child(n+15) {
    grid-column: span 4;
    grid-row: span 1;
}

/* =========================================================
   IMAGEN
========================================================= */
.noti-img-wrap {
    position: relative;
    width: 100%;
    background: #f3f4f6;
    overflow: hidden;
    flex-shrink: 0;
}

.noti-img-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s ease;
}

.noti-card:hover .noti-img-wrap img {
    transform: scale(1.02);
}

/* Alturas de imagen */
.noti-featured .noti-img-wrap                          { height: 460px; }
.noti-card:nth-child(2) .noti-img-wrap,
.noti-card:nth-child(3) .noti-img-wrap                 { height: 220px; }  /* cuadradas */
.noti-card:nth-child(4) .noti-img-wrap,
.noti-card:nth-child(5) .noti-img-wrap,
.noti-card:nth-child(6) .noti-img-wrap,
.noti-card:nth-child(7) .noti-img-wrap                 { height: 200px; }
.noti-card:nth-child(8) .noti-img-wrap,
.noti-card:nth-child(9) .noti-img-wrap                 { height: 200px; }
.noti-card:nth-child(10) .noti-img-wrap                { height: 460px; }  /* featured secundaria */
.noti-card:nth-child(11) .noti-img-wrap,
.noti-card:nth-child(12) .noti-img-wrap,
.noti-card:nth-child(13) .noti-img-wrap,
.noti-card:nth-child(14) .noti-img-wrap                { height: 200px; }
.noti-card:nth-child(n+15) .noti-img-wrap              { height: 200px; }

/* ===== BADGE DE FECHA ===== */
.noti-fecha-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(201, 162, 39, 0.95);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 5px 12px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
}

.noti-fecha-badge i { font-size: 10px; }

/* ===== PIE DE FOTO ===== */
.noti-pie-foto {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(24,32,42,0) 0%, rgba(24,32,42,0.85) 100%);
    color: #fff;
    padding: 22px 14px 10px;
    font-size: 11px;
    font-style: italic;
    line-height: 1.35;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    pointer-events: none;
}

.noti-pie-foto i {
    color: var(--azul-cecopi);
    font-style: normal;
    flex-shrink: 0;
}

/* =========================================================
   CONTENIDO
========================================================= */
.noti-body {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.noti-titulo {
    color: var(--amarillo-cecopi);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.3;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.noti-featured .noti-titulo {
    font-size: 26px;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* Featured secundaria (#10) — un poco más chica que la principal */
.noti-card:nth-child(10) .noti-titulo {
    font-size: 22px;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.noti-resumen {
    color: var(--gris);
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.noti-featured .noti-resumen {
    font-size: 15px;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.noti-card:nth-child(10) .noti-resumen {
    font-size: 14px;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.noti-card:nth-child(2) .noti-resumen,
.noti-card:nth-child(3) .noti-resumen,
.noti-card:nth-child(n+4) .noti-resumen {
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/* ===== META (solo fecha) ===== */
.noti-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-size: 11px;
    color: var(--gris);
    padding-top: 10px;
    border-top: 1px solid rgba(24, 32, 42, 0.06);
    margin-top: auto;
}

.noti-meta .noti-fecha-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.noti-meta .noti-fecha-text i {
    color: var(--azul-cecopi);
}

/* =========================================================
   RESPONSIVE
========================================================= */

/* Tablet grande */
@media (max-width: 1199px) {
    .noti-featured .noti-img-wrap,
    .noti-card:nth-child(10) .noti-img-wrap        { height: 400px; }
    .noti-card:nth-child(2) .noti-img-wrap,
    .noti-card:nth-child(3) .noti-img-wrap         { height: 195px; }
    .noti-card:nth-child(n+4) .noti-img-wrap       { height: 180px; }
    .noti-featured .noti-titulo                    { font-size: 22px; }
    .noti-card:nth-child(10) .noti-titulo          { font-size: 20px; }
}

/* Tablet: 6 columnas, layout simplificado */
@media (max-width: 991px) {
    .noticias-bento {
        grid-template-columns: repeat(6, 1fr);
        grid-auto-rows: minmax(200px, auto);
        gap: 14px;
    }

    /* Featured principal: full width */
    .noti-card.noti-featured {
        grid-column: span 6;
        grid-row: span 1;
    }

    /* #2, #3: mitad y mitad */
    .noti-card:nth-child(2),
    .noti-card:nth-child(3) {
        grid-column: span 3;
        grid-row: span 1;
    }

    /* #4 a #9: mitad y mitad */
    .noti-card:nth-child(n+4):nth-child(-n+9) {
        grid-column: span 3;
        grid-row: span 1;
    }

    /* Featured secundaria #10: full width */
    .noti-card:nth-child(10) {
        grid-column: span 6;
        grid-row: span 1;
    }

    /* Todas las demás: mitad y mitad */
    .noti-card:nth-child(n+11) {
        grid-column: span 3;
        grid-row: span 1;
    }

    .noti-featured .noti-img-wrap,
    .noti-card:nth-child(10) .noti-img-wrap        { height: 340px; }
    .noti-card:nth-child(2) .noti-img-wrap,
    .noti-card:nth-child(3) .noti-img-wrap         { height: 190px; }
    .noti-card:nth-child(n+4) .noti-img-wrap       { height: 180px; }

    .noti-featured .noti-titulo                    { font-size: 22px; }
    .noti-card:nth-child(10) .noti-titulo          { font-size: 20px; }
    .noti-featured .noti-resumen,
    .noti-card:nth-child(10) .noti-resumen         { font-size: 14px; -webkit-line-clamp: 3; line-clamp: 3; }
}

/* Móvil: 1 columna */
@media (max-width: 575px) {
    .noticias-bento {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 16px;
    }

    .noti-card,
    .noti-card.noti-featured,
    .noti-card:nth-child(n) {
        grid-column: span 1 !important;
        grid-row: auto !important;
    }

    .noti-featured .noti-img-wrap,
    .noti-card:nth-child(10) .noti-img-wrap,
    .noti-card .noti-img-wrap {
        height: 220px !important;
    }

    .noti-featured .noti-titulo,
    .noti-card:nth-child(10) .noti-titulo,
    .noti-titulo {
        font-size: 18px !important;
        -webkit-line-clamp: 3 !important;
        line-clamp: 3 !important;
    }

    .noti-featured .noti-resumen,
    .noti-card:nth-child(10) .noti-resumen,
    .noti-resumen {
        font-size: 13.5px !important;
        -webkit-line-clamp: 3 !important;
        line-clamp: 3 !important;
    }
}
/* =========================================================
   MARCA DE AGUA SOBRE IMÁGENES DE NOTICIAS
   Reset total para que no herede animaciones del logo
   del header ni el hover de las tarjetas.
========================================================= */
.noti-img-wrap .marca-agua {
    all: unset;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 55%;
    max-width: 160px;
    height: auto;
    transform: translate(-50%, -50%) !important;
    opacity: 0.32;
    z-index: 2;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
    pointer-events: none !important;
    user-select: none;
    -webkit-user-drag: none;
    animation: none !important;
    transition: none !important;
}

.noti-card:hover .marca-agua {
    transform: translate(-50%, -50%) !important;
    animation: none !important;
    transition: none !important;
}

/* Featured: marca un poco más grande */
.noti-featured .noti-img-wrap .marca-agua {
    max-width: 200px;
    width: 50%;
}

/* Móvil: marca más pequeña */
@media (max-width: 767px) {
    .noti-img-wrap .marca-agua {
        width: 45%;
        max-width: 110px;
        opacity: 0.28;
    }
    .noti-featured .noti-img-wrap .marca-agua {
        max-width: 130px;
    }
}