/* Reset y Variables */
:root {
    /* Colores oficiales basados en el logo IEP */
    --primary-color: #1e40af;
    /* Azul IEP oficial */
    --secondary-color: #b91c1c;
    /* Rojo IEP oficial */
    --accent-color: #eab308;
    /* Dorado IEP oficial */
    --accent-warm: #facc15;
    /* Dorado cálido */
    --accent-light: #fef08a;
    /* Dorado claro para acentos */
    --green-iep: #15803d;
    /* Verde IEP oficial */

    /* Colores de texto y fondo */
    --text-dark: #111827;
    /* Gris muy oscuro para mejor lectura */
    --text-light: #4b5563;
    /* Gris medio */
    --bg-light: #f3f4f6;
    --white: #ffffff;

    /* Gradientes mejorados con colores oficiales */
    --gradient-primary: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    --gradient-accent: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    /* Ahora usamos el rojo para botones primarios */
    --gradient-gold: linear-gradient(135deg, #eab308 0%, #facc15 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navegación */
.navbar {
    background: var(--gradient-primary);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1010;
    box-shadow: 0 4px 20px rgba(30, 58, 138, 0.3);
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1002;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }
}

.nav-brand {
    display: flex;
    align-items: center;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.nav-brand:hover {
    transform: scale(1.05);
}

.nav-brand i {
    margin-right: 0.5rem;
    color: var(--accent-light);
    filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.3));
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
}

.nav-menu>li {
    position: relative;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: var(--accent-light);
    transition: transform 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 240px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.nav-menu>li:hover>.dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
    position: relative;
}

.dropdown-menu a {
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    border-left-color: var(--primary-color);
    padding-left: 1.5rem;
}

/* Sub-dropdown */
.dropdown-menu .submenu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-top: -0.5rem;
    margin-left: 0.1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    background: var(--white);
    min-width: 220px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.5rem 0;
}

.dropdown-menu li:hover>.submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.dropdown-menu li:hover>a {
    background: var(--bg-light);
    border-left-color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 120px 0 80px;
    text-align: center;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(251, 191, 36, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(37, 99, 235, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    position: relative;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 1.3rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
    opacity: 0.95;
}

.btn {
    display: inline-block;
    padding: 14px 36px;
    background: var(--gradient-accent);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(217, 119, 6, 0.5);
}

/* Secciones */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
}

/* Grid de Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(30, 58, 138, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(217, 119, 6, 0.1);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(30, 58, 138, 0.15),
        0 0 0 1px rgba(217, 119, 6, 0.3);
    border-color: rgba(217, 119, 6, 0.3);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.card:hover .card-title {
    color: var(--secondary-color);
}

.card-date {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card-date i {
    color: var(--accent-color);
}

.card-text {
    color: var(--text-dark);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: linear-gradient(to bottom, #1e3a8a, #1f2937);
    color: var(--white);
    padding: 3rem 0 1rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-accent);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--accent-light);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section h3 i {
    color: var(--accent-color);
}

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

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

.footer-section a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

.footer-section a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-light);
    transition: width 0.3s ease;
}

.footer-section a:hover {
    opacity: 1;
    color: var(--accent-light);
    transform: translateX(3px);
}

.footer-section a:hover::after {
    width: 100%;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(217, 119, 6, 0.2);
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        padding: 5rem 2rem;
        transition: 0.4s ease;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 1001;
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        color: var(--text-dark);
        font-size: 1.1rem;
        padding: 1rem;
        border-bottom: 1px solid var(--bg-light);
    }

    .nav-link i {
        margin-left: auto;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        display: none;
        transform: none;
        box-shadow: none;
        padding-left: 1rem;
        margin-top: 0;
    }

    .nav-menu li.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu .submenu {
        position: static;
        display: none;
        transform: none;
        box-shadow: none;
        padding-left: 1rem;
    }

    .dropdown-menu li.active .submenu {
        display: block;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero {
        padding: 80px 0 60px;
    }
}

/* Fix for content overflow */
article,
.cms-content,
.card-text,
p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: none;
}

.overlay.active {
    display: block;
}

/* Clases para estados de carga */
.loading-placeholder {
    height: 300px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 12px;
}

@keyframes loading-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}