﻿/* ============================================================
   NOTICIAS - HOJA DE ESTILOS
   Proyecto: Nutri Sow
   Basado en la convención de nosotros.css
   ============================================================ */

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-title {
    font-size: 3rem;
    color: var(--purple);
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

    .section-title::after {
        content: '';
        position: absolute;
        bottom: -12px;
        left: 50%;
        transform: translateX(-50%);
        width: 100px;
        height: 4px;
        background: var(--orange);
        border-radius: 2px;
    }

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-top: 24px;
}

.noticias-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 20px 100px;
    background: var(--bg-body);
}

.noticias-container {
    width: 100%;
}

/* ── Noticia Destacada ─────────────────────────────────────── */
.noticia-destacada {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    align-items: center;
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 60px;
    transition: var(--transition-base);
    border-top: 5px solid var(--green);
}

    .noticia-destacada:hover {
        transform: translateY(-6px);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
    }

.noticia-destacada-imagen {
    position: relative;
    height: 380px;
    overflow: hidden;
}

    .noticia-destacada-imagen img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s ease;
    }

.noticia-destacada:hover .noticia-destacada-imagen img {
    transform: scale(1.05);
}

.noticia-badge-destacada {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--orange);
    color: white;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.noticia-destacada-contenido {
    padding: 40px 40px 40px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.noticia-destacada-titulo {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    margin: 0;
}

.noticia-destacada-texto {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* ── Meta (fecha + categoría) ──────────────────────────────── */
.noticia-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.noticia-fecha {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .noticia-fecha i {
        color: var(--green);
    }


/* ── Botón Leer más ────────────────────────────────────────── */
.noticia-btn-leer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--purple);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-base);
    align-self: flex-start;
    border: none;
    cursor: pointer;
}

    .noticia-btn-leer:hover {
        background: var(--orange);
        transform: translateX(4px);
        box-shadow: 0 8px 25px rgba(255, 122, 42, 0.4);
    }


/* ── Grid de Noticias ──────────────────────────────────────── */
.noticias-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.noticia-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--border-soft);
    transition: var(--transition-base);
    position: relative;
}

    .noticia-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 4px;
        background: var(--green);
        transform: scaleX(0);
        transition: transform 0.4s ease;
    }

    .noticia-card:hover::before {
        transform: scaleX(1);
    }

    .noticia-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.13);
    }

.noticia-card-contenido {
    padding: 22px 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.noticia-card-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    margin: 0;
}

.noticia-card-texto {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.imagenNew{
    max-height: 16rem;
}

/* Limitar texto a 2 líneas en las tarjetas */
.truncate-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Limitar texto en la destacada (opcional, p. ej. 6 líneas) */
.truncate-destacada {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Estilos del Modal */
.modal-noticia {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .modal-noticia.active {
        display: flex;
        opacity: 1;
    }

.modal-noticia-content {
    background-color: var(--bg-card, #fff);
    padding: 30px;
    border-radius: 15px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-noticia-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-noticia-body img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
    /*max-height: 350px;*/
    object-fit: cover;
}

.modal-noticia-info h3 {
    margin: 10px 0;
    font-size: 1.8rem;
    color: var(--purple);
}

.modal-noticia-info p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
    white-space: pre-wrap; /* Respeta los saltos de línea del TXT */
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .noticias-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .noticia-destacada {
        grid-template-columns: 1fr;
    }

    .noticia-destacada-imagen {
        height: 280px;
    }

    .noticia-destacada-contenido {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .noticias-section {
        padding: 100px 15px 80px;
    }

    .noticias-grid {
        grid-template-columns: 1fr;
    }

    .noticia-destacada-titulo {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .noticia-destacada-imagen {
        height: 220px;
    }

    .noticia-destacada-contenido {
        padding: 20px;
    }
}
