/* VARIABLES CORPORATIVAS */
:root {
    --blue-primary: #1A2B50;
    /* Azul del Escudo */
    --blue-light: #2D9CDB;
    /* Cian del Escudo */
    --yellow-accent: #FDC82F;
    /* Amarillo del Escudo */
    --red-alert: #E03E36;
    /* Rojo del círculo central */
    --white: #ffffff;
    --gray-bg: #f4f6f8;
    --green-success: #27ae60;
    /* Verde para deportes/éxito */
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.1);
    --text-dark: #333333;
}

/* RESET & BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

main-header {
    display: contents;
}

main-footer {
    display: block;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--gray-bg);
}

h1,
h2,
h3,
h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--blue-primary);
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* BARRA SUPERIOR */
.top-bar {
    background-color: var(--blue-primary);
    color: var(--white);
    padding: 5px 0;
    font-size: 0.9rem;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.social-links a {
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    transition: color 0.3s, transform 0.2s;
}

.top-bar a:hover {
    color: var(--yellow-accent);
}

.social-links a:hover {
    transform: scale(1.1);
}

.social-links svg {
    width: 18px;
    height: 18px;
}

.accessibility-tools button {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    padding: 0 5px;
}

/* HEADER & NAV */
/* HEADER & NAV */
main-header header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 9999;
    border-bottom: 4px solid var(--yellow-accent);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 80px;
    width: auto;
}

/* Ajusta altura según necesidad */
.school-name h1 {
    font-size: 1.2rem;
    line-height: 1.2;
    text-transform: uppercase;
}

.school-name p {
    font-size: 0.9rem;
    color: var(--blue-light);
    font-weight: 600;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-menu a {
    font-weight: 600;
    color: var(--blue-primary);
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--blue-light);
}

.btn-contact {
    background-color: var(--blue-primary);
    color: white !important;
    padding: 8px 15px;
    border-radius: 5px;
}

/* HERO SECTION */
.hero {
    background-image: linear-gradient(rgba(26, 43, 80, 0.7), rgba(26, 43, 80, 0.7)), url('../images/hero.webp');
    /* Pon una foto real aquí */
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 100px 20px;
}

.hero h2 {
    color: var(--yellow-accent);
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.btn-primary {
    display: inline-block;
    background-color: var(--red-alert);
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 20px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: #c0302a;
}

/* BOTONES DE ACCESO RÁPIDO */
.quick-access {
    padding: 40px 0;
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.grid-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.card-button {
    background: white;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-bottom: 4px solid var(--blue-light);
    transition: transform 0.2s;
}

.card-button:hover {
    transform: translateY(-5px);
}

.card-button .icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.card-button.highlight {
    border-bottom-color: var(--yellow-accent);
    background-color: #fffff0;
}

/* NOTICIAS */
.news-section {
    padding: 50px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--red-alert);
    margin: 10px auto 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    border-bottom: 4px solid var(--blue-light);
    transition: transform 0.2s, box-shadow 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.news-card h3 {
    margin: 5px 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.news-card p {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.news-card .read-more {
    font-size: 0.85rem;
}

.news-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
}

.news-tag.art {
    background-color: var(--blue-light);
}

.news-tag.academic {
    background-color: var(--blue-primary);
}

.news-tag.institutional {
    background-color: var(--blue-light);
}

.news-tag.sports {
    background-color: var(--green-success);
}

.news-tag.urgent {
    background-color: var(--red-alert);
}

.date {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* FOOTER */
footer {
    background-color: var(--blue-primary);
    color: white;
    padding: 50px 0 0;
    margin-top: 50px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    padding-bottom: 40px;
}

.footer-col h4 {
    color: var(--yellow-accent);
    margin-bottom: 15px;
}

/* Footer Styling Updates */
.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col li {
    margin-bottom: 12px;
}

/* Specific styles for contact list with icons */
.contact-list li {
    margin-bottom: 12px;
}

.contact-list a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: inherit;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--yellow-accent);
}

.contact-list svg {
    flex-shrink: 0;
    color: var(--yellow-accent);
    margin-top: 3px;
    /* Visual adjustment to align with text line-height */
}

.footer-bottom {
    background-color: #111c36;
    text-align: center;
    padding: 15px;
    font-size: 0.8rem;
    color: #aaa;
}

/* MENU TOGGLE (Mobile) */
.menu-toggle {
    display: none;
    /* Oculto en escritorio */
    background: none;
    border: none;
    color: var(--blue-primary);
    cursor: pointer;
    padding: 5px;
    /* Reducir padding pues el SVG tiene su propio tamaño */
    z-index: 1001;
}

.menu-toggle svg {
    display: block;
    width: 30px;
    height: 30px;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .header-content {
        justify-content: space-between;
        align-items: center;
        /* Asegurar centrado vertical */
        flex-wrap: nowrap;
        /* EVITAR QUE EL MENU SE CAIGA */
    }

    .menu-toggle {
        display: block;
        flex-shrink: 0;
        /* Asegurar que el botón no se aplaste */
    }

    /* NAV wrapper sale del flujo flex para que el botón se vaya a la derecha */
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 999;
    }

    .nav-menu {
        /* Ya no necesita ser absoluto aquí, su padre nav lo es */
        background-color: var(--white);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);

        /* Ocultar por defecto */
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 15px;
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    .nav-menu li:last-child a {
        border-bottom: none;
    }

    .school-name {
        display: block;
    }

    .quick-access {
        margin-top: 0;
    }

    /* Ajustes adicionales para móviles pequeños */
    @media (max-width: 600px) {
        .logo-img {
            height: 50px;
        }

        .school-name h1 {
            font-size: 0.9rem;
            /* Texto más pequeño para que quepa */
        }

        .logo-container {
            gap: 10px;
            max-width: 80%;
            /* Asegurar espacio para el botón */
        }
    }
}

/* =========================================
   COMPONENTES COMPARTIDOS (SHARED)
   ========================================= */

/* Page Header (Usado en Documentos, Noticias, Circulares, Calendario, Menu) */
.page-header {
    background-color: var(--blue-primary);
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
    margin-top: 0;
}

.page-header h1 {
    color: var(--yellow-accent);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Contenedor Genérico de Contenido (Usado en documentos, circulares, etc) */
.docs-container,
.circulars-container,
.news-page-container {
    padding-bottom: 80px;
    min-height: 60vh;
}

.docs-intro {
    background-color: #eef2f7;
    padding: 15px;
    border-left: 4px solid var(--blue-light);
    margin-bottom: 30px;
    border-radius: 4px;
}

/* Breadcrumbs (Migas de pan) */
.breadcrumbs {
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumbs a {
    color: var(--blue-light);
    font-weight: 600;
}

.breadcrumbs .current {
    color: var(--text-dark);
}

/* Botón Volver Genérico */
.btn-back {
    display: inline-block;
    margin-top: 30px;
    color: var(--blue-light);
    font-weight: bold;
    border: 2px solid var(--blue-light);
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s;
}

.btn-back:hover {
    background-color: var(--blue-light);
    color: white;
}

/* Sidebar & Widgets (Usado en Noticias y potencialmente otros) */
.sidebar {
    flex: 1;
    min-width: 250px;
}

.widget {
    background-color: var(--gray-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-right: 4px solid var(--blue-light);
}

.widget h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--yellow-accent);
    padding-bottom: 10px;
    display: inline-block;
    color: var(--blue-primary);
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.sidebar-list li:last-child {
    border: none;
}

.sidebar-list a {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 600;
}

.sidebar-list a:hover {
    color: var(--blue-light);
}

.btn-small {
    background-color: var(--yellow-accent);
    color: var(--blue-primary);
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
}

/* CAROUSEL STYLES (Added dynamically) */
.hero.carousel-active {
    padding: 0;
    /* Let slides handle padding/height */
    position: relative;
    background: #1a2b50;
    /* Fallback color */
    overflow: hidden;
}

.carousel-track {
    display: grid;
    grid-template-areas: "stack";
    width: 100%;
    min-height: 500px;
    /* Adjust as needed */
}

.carousel-slide {
    grid-area: stack;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 100px 20px;
    /* Matches original hero padding */
    width: 100%;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.carousel-slide .hero-overlay {
    width: 100%;
}

/* Controls (Arrows) */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
    border-radius: 5px;
}

.carousel-control:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-control.prev {
    left: 20px;
}

.carousel-control.next {
    right: 20px;
}

/* Indicators (Dots) */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.indicator.active {
    background: var(--yellow-accent);
    transform: scale(1.2);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Ensure inner content matches original hero styles */
.carousel-slide h2 {
    color: var(--yellow-accent);
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-slide p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Mobile adjustments for carousel */
@media (max-width: 768px) {
    .carousel-slide h2 {
        font-size: 1.8rem;
    }

    .carousel-control {
        padding: 5px 10px;
        font-size: 1.5rem;
    }
}