﻿/* ============================================================
   ACOLCTI — Estilos para Noticias y Detalle de Noticia
   ============================================================ */

body {
    padding-top: 90px;
}

.nav-menu .btn-nav {
    padding: 0.6rem 1.25rem;
}

/* =========================
   LISTADO DE NOTICIAS
========================= */
.news-section {
    padding: 6rem 2rem;
    background: var(--bg-light);
    min-height: calc(100vh - 90px - 200px);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.news-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, .06);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, .10);
}

.news-img {
    width: 100%;
    height: 210px;
    background: #eee;
    object-fit: cover;
    display: block;
}

.news-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    flex: 1;
}

.news-date {
    color: var(--text-light);
    font-size: .95rem;
}

.news-title {
    color: var(--secondary-color);
    font-size: 1.4rem;
    line-height: 1.3;
}

.news-excerpt {
    color: var(--text-light);
    line-height: 1.7;
}

.news-link {
    margin-top: auto;
    display: inline-block;
    text-decoration: none;
    font-weight: 700;
    color: var(--primary-color);
    padding-top: .5rem;
}

.news-link:hover {
    text-decoration: underline;
}

/* =========================
   PAGINACIÓN
========================= */
.pagination-nav {
    margin-top: 3.5rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.85rem;
    border-radius: 10px;
    background: var(--white);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border: 1px solid #eaeaea;
    transition: var(--transition);
}

.page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231,49,49,.15);
}

.page-link.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    cursor: default;
    transform: none;
}

/* =========================
   DETALLE DE NOTICIA
========================= */
.detail {
    padding: 6rem 2rem;
    background: var(--white);
    min-height: calc(100vh - 90px - 200px);
}

.box {
    max-width: 1180px;
    margin: 0 auto;
}

.title {
    font-size: 2.6rem;
    color: var(--secondary-color);
    margin: .75rem 0 1rem;
    line-height: 1.25;
}

.meta {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.img {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin: 1.5rem 0 2.5rem;
    cursor: pointer;
}

.img img {
    width: 100%;
    height: auto;
    display: block;
}

.back {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition);
}

.back:hover {
    transform: translateX(-4px);
}

/* =========================
   BLOQUES DE CONTENIDO
========================= */
.news-blocks {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    color: var(--text-light);
    line-height: 1.9;
}

.nb-text {
    font-size: 1rem;
}

/* Solo imagen centrada */
.nb-image {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.nb-image img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.nb-big-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.nb-heading {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--secondary-color);
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
    padding-bottom: .2rem;
}

/* Bloque texto + imagen lateral */
.nb-side {
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

.nb-side-right {
    flex-direction: row;
}

.nb-side-left {
    flex-direction: row-reverse;
}

.nb-side-text {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: justify;
}

.nb-side-text > p,
.nb-side-text > div {
    margin: 0;
}

.nb-side-img {
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    max-width: 560px;
    width: 50%;
    height: 500px;
    justify-self: center;
}

.nb-side-img img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    cursor: pointer;
}

/* =========================
   MODAL DE IMAGEN
========================= */
.img-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.img-modal.open {
    display: flex;
}

.img-modal-inner {
    position: relative;
    max-width: 100%;
    max-height: 100%;
}

.img-modal-inner img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.img-modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    background: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 36px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,.4);
    transition: var(--transition);
}

.img-modal-close:hover {
    background: var(--primary-color);
    color: #fff;
}

/* =========================
   PÁGINA 404 NOTICIA
========================= */
.not-found-card {
    text-align: center;
    padding: 4rem 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-light);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
}

.not-found-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.not-found-text {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.not-found-btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}

.not-found-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231,49,49,.3);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1024px) {
    .detail {
        padding: 4rem 1.5rem;
    }

    .box {
        max-width: 100%;
    }

    .title {
        font-size: 2.2rem;
    }

    .nb-side {
        gap: 1.25rem;
    }

    .nb-side-img {
        max-width: 380px;
        height: 380px;
    }
}

@media (max-width: 768px) {
    .news-section {
        padding: 4rem 1rem;
    }

    .news-grid {
        display: flex;
        align-items: stretch;
        justify-content: center;
        flex-direction: column;
    }

    .detail {
        padding: 4rem 1rem;
    }

    .title {
        font-size: 1.9rem;
    }

    .img {
        margin: 1.25rem 0 2rem;
    }

    .news-blocks {
        gap: 1.5rem;
    }

    .nb-side,
    .nb-side-left,
    .nb-side-right {
        flex-direction: column;
        align-items: stretch;
    }

    .nb-side-text {
        align-items: flex-start;
    }

    .nb-side-img {
        max-width: 100%;
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        margin-top: .5rem;
    }
}

@media (min-width: 1400px) {
    .box {
        max-width: 1280px;
    }
}
