@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Source+Sans+3:wght@400;600;700&display=swap');

:root {
    --azul: #1565c0;
    --azul-oscuro: #0d47a1;
    --azul-nav: #1565c0;
    --azul-badge: #1e88e5;
    --azul-claro: #e3f2fd;
    --rojo: #e53935;
    --fondo: #cfe3f5;
    --fondo-card: #ffffff;
    --texto: #1a1a2e;
    --texto-suave: #546e7a;
    --borde: #cfd8dc;
    --sombra: 0 2px 12px rgba(0, 0, 0, 0.10);
    --sombra-hover: 0 6px 24px rgba(0, 0, 0, 0.18);
    --radio: 6px;
    --fuente-titulo: 'Playfair Display', Georgia, serif;
    --fuente: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--fondo);
    color: var(--texto);
    font-family: var(--fuente);
    font-size: 16px;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

/* ===================================================
   TOP BAR
=================================================== */
.topbar {
    background: var(--azul-oscuro);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.78rem;
    padding: 5px 0;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-social a {
    color: rgba(255, 255, 255, 0.75);
    margin-left: 10px;
    font-size: 0.82rem;
    transition: color 0.2s;
}

.topbar-social a:hover {
    color: white;
}

/* ===================================================
   LOGO BAR
=================================================== */
.logobar {
    background: white;
    padding: 14px 0;
    border-bottom: 1px solid #dce8f5;
}

.logobar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(160deg, #1565c0 0%, #1e88e5 60%, #29b6f6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(21, 101, 192, 0.4);
}

.logo-text {
    font-family: var(--fuente-titulo);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--azul-oscuro);
    letter-spacing: 3px;
    line-height: 1;
    text-transform: uppercase;
}

.logo-lema {
    font-size: 0.68rem;
    color: var(--texto-suave);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 3px;
    font-weight: 600;
}

.search-box {
    display: flex;
    border: 1px solid #b0c8e8;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f8fc;
}

.search-box input {
    border: none;
    outline: none;
    padding: 10px 16px;
    font-size: 0.9rem;
    width: 220px;
    font-family: var(--fuente);
    background: transparent;
    color: var(--texto);
}

.search-box button {
    background: var(--azul);
    color: white;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--azul-oscuro);
}

/* ===================================================
   NAV BAR
=================================================== */
.navbar {
    background: var(--azul-nav);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links a {
    display: block;
    color: rgba(255, 255, 255, 0.88);
    padding: 14px 20px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: background 0.2s, color 0.2s;
    border-bottom: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a.activo {
    background: rgba(0, 0, 0, 0.15);
    color: white;
    border-bottom-color: white;
}

.nav-search-icon {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    padding: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-search-icon:hover {
    color: white;
}

/* ===================================================
   CONTENEDOR PRINCIPAL
=================================================== */
.site-main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px 40px;
}

/* ===================================================
   HERO GRID
=================================================== */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 4px;
    margin-bottom: 24px;
    border-radius: var(--radio);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    height: 500px;
    /* altura fija — ambas columnas la heredan */
    align-items: stretch;
}

.hero-main {
    position: relative;
    overflow: hidden;
    height: 500px;
    display: block;
    /* Asegurar contexto de posicionamiento */
    isolation: isolate;
}

.hero-main .hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.hero-main:hover .hero-img {
    transform: scale(1.03);
}

.hero-main .hero-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--azul-oscuro), #29b6f6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 5rem;
    opacity: 0.6;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
    padding: 60px 24px 24px;
    z-index: 2;
}

.badge {
    display: inline-block;
    background: var(--azul-badge);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 2px;
    margin-bottom: 10px;
}

.badge-rojo {
    background: var(--rojo);
}

.hero-overlay .titulo {
    color: white;
    font-family: var(--fuente-titulo);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 8px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.hero-overlay .titulo a {
    color: white;
}

.hero-overlay .titulo a:hover {
    text-decoration: underline;
}

.hero-overlay .fecha {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Sidebar hero */
.hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 500px;
    /* igual que hero-grid */
    align-items: stretch;
}

.hero-side-item {
    flex: 1;
    align-self: stretch;
    overflow: hidden;
    text-decoration: none;
    background: #1a3560;
    position: relative;
    /* height se calcula como 50% del sidebar menos el gap */
}

/* La imagen ocupa TODO el contenedor */
.hero-side-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    display: block;
    transition: transform 0.4s, opacity 0.3s;
    max-width: none;
    max-height: none;
}

.hero-side-item:hover img {
    transform: scale(1.04);
    opacity: 0.75;
}

.hero-side-item .side-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.88) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
    z-index: 2;
}

.hero-side-item .badge {
    display: block;
    margin-bottom: 6px;
}

.hero-side-item .titulo {
    color: white;
    font-family: var(--fuente-titulo);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 5px;
}

.hero-side-item .titulo a {
    color: white;
}

.hero-side-item .fecha {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===================================================
   SECCIÓN TÍTULO
=================================================== */
.seccion-encabezado {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.seccion-encabezado h2 {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--texto);
    white-space: nowrap;
    background: white;
    padding: 6px 16px 6px 12px;
    border-left: 4px solid var(--azul);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 1px 4px rgba(21, 101, 192, 0.12);
}

.seccion-encabezado .linea {
    flex: 1;
    height: 1px;
    background: rgba(21, 101, 192, 0.2);
}

.seccion-encabezado .ver-mas {
    color: var(--azul);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.seccion-encabezado .ver-mas:hover {
    text-decoration: underline;
}

/* ===================================================
   GRID DE NOTICIAS — 4 columnas
=================================================== */
.grid-noticias {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.card {
    background: var(--fondo-card);
    border-radius: var(--radio);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sombra-hover);
}

.card-img-wrap {
    overflow: hidden;
    height: 160px;
    flex-shrink: 0;
    background: var(--azul-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.card:hover .card-img-wrap img {
    transform: scale(1.06);
}

/* Badge sobre imagen (esquina inferior izquierda como en la ref) */
.card-img-wrap .badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    margin: 0;
}

.card-placeholder {
    color: var(--azul);
    font-size: 2.2rem;
    opacity: 0.35;
}

.card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-titulo {
    font-family: var(--fuente-titulo);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--texto);
    margin-bottom: 10px;
    flex: 1;
}

.card-titulo a {
    color: var(--texto);
    transition: color 0.2s;
}

.card-titulo a:hover {
    color: var(--azul);
}

.card-fecha {
    color: var(--texto-suave);
    font-size: 0.76rem;
    display: flex;
    align-items: center;
    gap: 5px;
    border-top: 1px solid var(--borde);
    padding-top: 9px;
    margin-top: auto;
}

/* ===================================================
   ARTÍCULO COMPLETO
=================================================== */
.articulo-wrap {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
}

.articulo-completo {
    background: var(--fondo-card);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 40px;
}

.articulo-completo .badge {
    margin-bottom: 12px;
}

.articulo-completo h1 {
    font-family: var(--fuente-titulo);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.2;
    color: var(--texto);
    margin-bottom: 14px;
}

.articulo-completo .meta {
    color: var(--texto-suave);
    font-size: 0.85rem;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--borde);
    display: flex;
    align-items: center;
    gap: 18px;
}

.articulo-completo .imagen-noticia {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 28px;
    box-shadow: var(--sombra);
}

.articulo-completo .contenido {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #2c3e50;
    white-space: pre-wrap;
}

.sidebar-widget {
    background: var(--fondo-card);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 18px;
    margin-bottom: 18px;
}

.sidebar-widget h3 {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--azul-oscuro);
    border-bottom: 2px solid var(--azul);
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.sidebar-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--borde);
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-item-img {
    width: 68px;
    height: 52px;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--azul-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--azul);
    font-size: 1.2rem;
    overflow: hidden;
}

.sidebar-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-item-titulo {
    font-family: var(--fuente-titulo);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--texto);
    margin-bottom: 4px;
}

.sidebar-item-titulo a:hover {
    color: var(--azul);
}

.sidebar-item-fecha {
    font-size: 0.72rem;
    color: var(--texto-suave);
}

/* ===================================================
   BREADCRUMB
=================================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--texto-suave);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--azul);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb i {
    font-size: 0.7rem;
}

/* ===================================================
   FOOTER
=================================================== */
.site-footer {
    background: var(--azul-oscuro);
    color: rgba(255, 255, 255, 0.65);
    margin-top: 50px;
}

.footer-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 30px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-brand .logo-text {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-family: var(--fuente-titulo);
}

.footer-brand p {
    font-size: 0.88rem;
    line-height: 1.7;
    max-width: 300px;
}

.footer-col h4 {
    color: white;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--azul-badge);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.88rem;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    padding: 14px 20px;
    font-size: 0.8rem;
}

/* ===================================================
   SIN NOTICIAS
=================================================== */
.sin-noticias {
    text-align: center;
    padding: 80px 20px;
    color: var(--texto-suave);
    background: white;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
}

.sin-noticias-icono {
    font-size: 4rem;
    color: var(--borde);
    margin-bottom: 20px;
}

.sin-noticias p {
    font-size: 1.05rem;
}

.sin-noticias a {
    color: var(--azul);
    font-weight: 600;
}

/* ===================================================
   RESPONSIVE
=================================================== */
@media (max-width: 1024px) {
    .grid-noticias {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .hero-main {
        height: 360px;
        min-height: unset;
        position: relative;
        overflow: hidden;
    }

    .hero-sidebar {
        flex-direction: row;
        height: 220px;
        width: 100%;
    }

    .hero-side-item {
        flex: 1;
    }

    .grid-noticias {
        grid-template-columns: repeat(2, 1fr);
    }

    .articulo-wrap {
        grid-template-columns: 1fr;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .logobar-inner {
        flex-direction: column;
        gap: 12px;
    }

    .search-box input {
        width: 150px;
    }

    .grid-noticias {
        grid-template-columns: 1fr;
    }

    .logo-text {
        font-size: 1.8rem;
    }

    .hero-sidebar {
        flex-direction: column;
        height: 400px;
        /* 200px por cada item */
        width: 100%;
    }

    .hero-side-item {
        flex: 1;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .nav-links a {
        padding: 12px 10px;
        font-size: 0.8rem;
    }

    .articulo-completo {
        padding: 22px;
    }

    .articulo-completo h1 {
        font-size: 1.5rem;
    }
}