/* =============================================
   NOTICIAS — Red de Salud Aguaytía
   ============================================= */

:root {
    --color-primary: #1e3a5f;
    --color-primary-light: #2563eb;
    --color-text: #334155;
    --color-text-soft: #64748b;
    --color-line: #e2e8f0;
    --color-bg: #f8fafb;
    --color-white: #ffffff;
    --radius: 14px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

/* ===== Hero ===== */
.news-hero {
    position: relative;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.news-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('../img/banner-noticias.png');
    background-size: cover;
    background-position: center;
}

/* El velo (--hero-velo) lo decide el panel: Diseno del sitio -> Noticias */
.news-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 22, 40, var(--hero-velo, 0.4));
    z-index: 1;
}

.news-hero-content {
    position: relative;
    z-index: 2;
}

.news-hero-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.6rem;
}

.news-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
    line-height: 1.15;
}

.news-hero p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* ===== Sección Noticias ===== */
.noticias-section {
    background: var(--color-white);
    padding: 4rem 2rem;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.noticias-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

/* Main */
.noticias-main h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1.5rem;
    letter-spacing: -0.02em;
}

.noticias-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.noticia-card {
    background: var(--color-white);
    border: 1px solid var(--color-line);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s var(--ease);
}

.noticia-card:hover {
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.08);
}

.noticia-img {
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.noticia-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease);
}

/* Todavia no se subio la foto de esa noticia (se hace en el panel) */
.noticia-img.sin-foto {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2f7, #e2e8f0);
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.noticia-card:hover .noticia-img img {
    transform: scale(1.04);
}

.noticia-content {
    padding: 1rem 1.1rem 1.1rem;
}

.noticia-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-primary-light);
    background: #eef2ff;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.6rem;
}

.noticia-content h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.6rem;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.noticia-content h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.noticia-content h3 a:hover {
    color: var(--color-primary-light);
}

/* ===== Lightbox: imagen ampliada ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.abierto {
    opacity: 1;
    visibility: visible;
}

.lightbox-figure {
    position: relative;
    margin: 0;
    max-width: min(880px, 100%);
    max-height: 100%;
    display: flex;
}

.lightbox-figure img {
    max-width: 100%;
    max-height: calc(100vh - 5rem);
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    transform: scale(0.92);
    transition: transform 0.25s ease;
}

.lightbox.abierto .lightbox-figure img {
    transform: scale(1);
}

/* Boton de cierre al costado de la imagen */
.lightbox-cerrar {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #0f172a;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}

.lightbox-cerrar:hover {
    background: #f1f5f9;
    transform: scale(1.08);
}

@media (max-width: 600px) {
    .lightbox {
        padding: 1.2rem;
    }

    .lightbox-figure img {
        max-height: calc(100vh - 2.4rem);
    }

    .lightbox-cerrar {
        top: -14px;
        right: -8px;
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }
}

.noticia-resumen {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0.35rem 0 0.75rem;
}

.noticia-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--color-text-soft);
}

.noticia-meta strong {
    color: #1e293b;
    font-weight: 600;
}

/* Sidebar */
.noticias-sidebar h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1rem;
    letter-spacing: -0.01em;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-item {
    display: flex;
    gap: 0.75rem;
    text-decoration: none;
    padding: 0.6rem;
    border: 1px solid var(--color-line);
    border-radius: 10px;
    transition: all 0.25s var(--ease);
}

.sidebar-item:hover {
    border-color: rgba(37, 99, 235, 0.25);
    background: #fafbfc;
}

.sidebar-item img {
    width: 70px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-info h4 {
    font-size: 0.78rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.3rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-info span {
    font-size: 0.7rem;
    color: var(--color-text-soft);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .noticias-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .noticias-sidebar {
        border-top: 1px solid var(--color-line);
        padding-top: 2rem;
    }
}

@media (max-width: 600px) {
    .noticias-section {
        padding: 3rem 1.25rem;
    }

    .noticias-grid {
        grid-template-columns: 1fr;
    }

    .news-hero {
        height: 220px;
    }
}
