/* ===== RESET Y CONFIGURACIÓN BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

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

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, #1a2a6c, #2d4373, #4a69bd);
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo h1 a {
    color: #fff;
    text-decoration: none;
}

.logo h1 a:hover {
    color: #ffd700;
    text-decoration: none;
}

.logo span {
    font-size: 0.85rem;
    opacity: 0.85;
    display: block;
    font-weight: 300;
}

/* Menú de navegación */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-menu li a {
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: block;
}

.nav-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffd700;
    text-decoration: none;
}

.nav-menu li a.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffd700;
}

/* Botón hamburguesa (menú responsive) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* ===== MAIN CONTENT ===== */
main {
    flex: 1;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 3rem 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 3rem;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}
/* Grid de secciones */
.sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0 3rem;
}

.section-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e8ecf1;
    display: flex;
    flex-direction: column;
}

.section-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.section-card .icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.section-card h3 {
    font-size: 1.2rem;
    color: #1a2a6c;
    margin-bottom: 0.5rem;
}

.section-card > p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* Lista de artículos recientes dentro de cada tarjeta */
.section-articles {
    list-style: none;
    text-align: left;
    margin: 0.5rem 0 1rem;
    flex: 1;
}

.section-articles li {
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.section-articles li:last-child {
    border-bottom: none;
}

.section-articles li a {
    color: #333;
    display: block;
    transition: color 0.3s ease;
}

.section-articles li a:hover {
    color: #667eea;
    text-decoration: none;
}

.section-articles li .article-date {
    font-size: 0.75rem;
    color: #999;
    display: block;
    margin-top: 0.15rem;
}

/* Sección de Noticias en vertical (ocupa la 4ª columna) */
.section-card.noticias-vertical {
    background: linear-gradient(135deg, #1a2a6c, #2d4373);
    color: #fff;
    text-align: left;
    padding: 1.5rem;
}

.section-card.noticias-vertical .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-card.noticias-vertical h3 {
    color: #ffd700;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 0.5rem;
}

.section-card.noticias-vertical > p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.noticias-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.noticias-list li {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    transition: background-color 0.3s ease;
}

.noticias-list li:hover {
    background: rgba(255, 255, 255, 0.2);
}

.noticias-list li a {
    color: #fff;
    display: block;
    text-decoration: none;
}

.noticias-list li a:hover {
    color: #ffd700;
    text-decoration: none;
}

.noticias-list li .noticia-titulo {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.2rem;
}

.noticias-list li .noticia-fecha {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    display: block;
}

.noticias-list li .noticia-resumen {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    display: block;
    margin-top: 0.25rem;
    line-height: 1.3;
}

/* Códigos se muestra debajo en otra fila */
.section-card.codigos-section {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
    text-align: left;
    padding: 1.5rem 2rem;
}

.section-card.codigos-section .codigos-header {
    text-align: center;
    min-width: 180px;
}

.section-card.codigos-section .codigos-header .icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-card.codigos-section .codigos-header h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.section-card.codigos-section .codigos-header p {
    font-size: 0.85rem;
    color: #666;
}

.section-card.codigos-section .codigos-articles {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    flex: 1;
}

.section-card.codigos-section .codigos-articles .mini-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid #e8ecf1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section-card.codigos-section .codigos-articles .mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.section-card.codigos-section .codigos-articles .mini-card a {
    color: #333;
    display: block;
    text-decoration: none;
}

.section-card.codigos-section .codigos-articles .mini-card a:hover {
    color: #667eea;
    text-decoration: none;
}

.section-card.codigos-section .codigos-articles .mini-card .mini-titulo {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.2rem;
}

.section-card.codigos-section .codigos-articles .mini-card .mini-fecha {
    font-size: 0.75rem;
    color: #999;
    display: block;
}
.section-card h3 {
    font-size: 1.2rem;
    color: #1a2a6c;
    margin-bottom: 0.5rem;
}

.section-card p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Lista de artículos dentro de cada tarjeta de sección */
.article-list {
    list-style: none;
    text-align: left;
    margin: 0.5rem 0 1rem;
    flex-grow: 1;
}

.article-list .article-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.article-list .article-item:last-child {
    border-bottom: none;
}

.article-list .article-item a {
    color: #333;
    display: block;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.article-list .article-item a:hover {
    color: #007bff;
    padding-left: 5px;
    text-decoration: none;
}

.article-list .article-item .article-date {
    font-size: 0.75rem;
    color: #aaa;
    display: block;
    margin-top: 2px;
}

/* Tarjeta de Noticias: estilo vertical */
.section-card-vertical {
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fff, #fafafa);
    border-color: #ffd700;
}

.section-card-vertical .section-card-header {
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #ffd700;
    margin-bottom: 0.5rem;
}

.section-card-vertical .article-list .article-item {
    padding: 0.65rem 0;
    border-bottom: 1px dashed #e8e8e8;
}

.section-card-vertical .article-list .article-item a {
    font-weight: 500;
}

.section-card-vertical .article-list .article-item a:hover {
    color: #d4a017;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.btn-secondary:hover {
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

/* Títulos de página */
.page-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.page-title h2 {
    font-size: 2.2rem;
    color: #1a2a6c;
    margin-bottom: 0.75rem;
}

.page-title p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Tarjetas de contenido (artículos/notas) */
.content-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e8ecf1;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #e8ecf1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #999;
}

.card-body {
    padding: 1.5rem;
}

.card-body h3 {
    font-size: 1.2rem;
    color: #1a2a6c;
    margin-bottom: 0.75rem;
}

.card-body p {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.card-meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.75rem;
}

/* ===== PÁGINA DE NOTA ===== */
.nota-container {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecf1;
    max-width: 800px;
    margin: 0 auto;
}

.nota-container h2 {
    font-size: 2rem;
    color: #1a2a6c;
    margin-bottom: 0.5rem;
}

.nota-container .meta {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e8ecf1;
}

.nota-container .contenido {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #444;
}

.nota-container .contenido p {
    margin-bottom: 1.5rem;
}

.nota-container .contenido h3 {
    color: #1a2a6c;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* ===== FOOTER ===== */
footer {
    background: #1a2a6c;
    color: #ccc;
    padding: 2.5rem 0 1.5rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-col h4 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: #ffd700;
    border-radius: 2px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: #ccc;
    font-size: 0.9rem;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-col ul li a:hover {
    color: #ffd700;
    padding-left: 5px;
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ===== RESPONSIVE ===== */

/* Tablets y pantallas pequeñas */
@media (max-width: 992px) {
    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.05rem;
    }

    .header-container {
        flex-direction: row;
    }
}

/* Móviles */
@media (max-width: 768px) {
    header {
        padding: 0.75rem 0;
    }

    .header-container {
        padding: 0 1rem;
    }

    .logo h1 {
        font-size: 1.4rem;
    }

    .logo span {
        font-size: 0.75rem;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background: rgba(26, 42, 108, 0.98);
        padding: 1rem 0;
        border-radius: 0 0 10px 10px;
        margin-top: 0.75rem;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        padding: 0.75rem 1.5rem;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .hero {
        padding: 2rem 1.5rem;
        border-radius: 8px;
    }

    .hero h2 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .sections-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .section-card {
        padding: 1.25rem 1rem;
    }

    .section-card .icon {
        font-size: 2.2rem;
    }

    .section-card h3 {
        font-size: 1.1rem;
    }

    .content-cards {
        grid-template-columns: 1fr;
    }

    .page-title h2 {
        font-size: 1.7rem;
    }

    .nota-container {
        padding: 1.5rem;
    }

    .nota-container h2 {
        font-size: 1.5rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .sections-grid {
        grid-template-columns: 1fr;
    }

    .hero h2 {
        font-size: 1.3rem;
    }

    .btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.85rem;
    }
}
