/* ==========================================================================
   King's Hill School — Estilos del tema
   ========================================================================== */

/* Variables de Marca (Brandbook) */
:root {
    --primary-guinda: #66061A;
    --primary-navy: #08122F;
    --primary-light: #F2F2F2;
    --secondary-red: #A61723;
    --secondary-cream: #FFDBB3;
    --secondary-royal: #001F56;

    --font-serif: 'Libre Baskerville', serif;
    --font-sans: 'Inter', sans-serif;
}

/* Resets & Body Generales */
body {
    font-family: var(--font-sans);
    color: #333;
    background-color: var(--primary-light);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
}

/* 1. Header & Navbar */
.navbar {
    transition: background-color 0.4s ease-in-out, padding 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
    padding: 1.2rem 0;
}

.navbar.transparent {
    background-color: transparent !important;
}

.navbar.scrolled {
    background-color: var(--primary-navy) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 0.6rem 0;
}

.navbar-brand img {
    height: 90px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.nav-link {
    color: #ffffff !important;
    font-weight: 500;
    margin: 0 0.5rem;
    position: relative;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-cream);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.dropdown-item:hover,
.dropdown-item:active {
    background-color: var(--primary-light);
    color: var(--primary-guinda);
}

@media (min-width: 992px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

/* Páginas interiores: navbar sólida y espacio para el header fijo */
body.kh-inner-page .navbar {
    background-color: var(--primary-navy) !important;
}

body.kh-inner-page .site-main {
    padding-top: 130px;
    min-height: 60vh;
    background-color: #ffffff;
}

/* Compatibilidad con la barra de administración de WordPress */
body.admin-bar .navbar.fixed-top {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .navbar.fixed-top {
        top: 46px;
    }
}

/* 2. Hero Section (Inmersivo con Video) */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.hero video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    z-index: -2;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Degradado desde Azul Marino a Guinda */
    background: linear-gradient(135deg, rgba(8, 18, 47, 0.75) 0%, rgba(102, 6, 26, 0.65) 100%);
    z-index: -1;
}

.hero-content {
    animation: fadeIn 1.5s ease-out;
    padding: 0 15px;
}

.hero-content h1 {
    font-size: 4.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
    margin-bottom: 0.5rem;
}

.hero-content p {
    font-size: 1.8rem;
    font-weight: 300;
    font-style: italic;
    color: var(--secondary-cream);
    letter-spacing: 2px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 3. Introducción Institucional */
.intro-section {
    background-color: var(--primary-light);
    padding: 7rem 0;
}

.intro-title {
    color: var(--primary-navy);
    margin-bottom: 2rem;
    font-weight: 700;
    font-size: 3rem;
}

.intro-text {
    font-size: 1.2rem;
    line-height: 1.9;
    color: #4a4a4a;
    max-width: 850px;
    margin: 0 auto;
}

/* 4. Propuesta Educativa */
.propuesta-section {
    padding: 6rem 0;
    background-color: #ffffff;
}

.propuesta-card {
    background: var(--primary-light);
    border-radius: 12px;
    padding: 3rem 2rem;
    height: 100%;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    position: relative;
    z-index: 1;
}

.propuesta-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.propuesta-icon {
    font-size: 3.5rem;
    color: var(--primary-guinda);
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.propuesta-card:hover .propuesta-icon {
    color: var(--secondary-royal);
}

.propuesta-card h3 {
    font-size: 1.25rem;
    color: var(--primary-navy);
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.4;
}

/* 5. Banner Destacado */
.banner-destacado {
    background-color: var(--primary-navy);
    background-image: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-royal) 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
    position: relative;
}

.banner-destacado h2 {
    font-size: 2.8rem;
    max-width: 1000px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.5;
    text-shadow: 0px 4px 15px rgba(0, 0, 0, 0.3);
    color: var(--secondary-cream);
}

/* 6. Divisiones Académicas */
.divisiones-section {
    padding: 7rem 0;
    background-color: var(--primary-light);
}

.division-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 400px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.division-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.division-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(8, 18, 47, 0.95) 0%, rgba(8, 18, 47, 0.1) 80%);
    display: flex;
    align-items: flex-end;
    padding: 2.5rem;
    transition: background 0.5s ease;
}

.division-card:hover .division-bg {
    transform: scale(1.1);
}

.division-card:hover .division-overlay {
    background: linear-gradient(to top, rgba(102, 6, 26, 0.95) 0%, rgba(102, 6, 26, 0.2) 80%);
}

.division-title {
    color: white;
    font-size: 2rem;
    margin: 0;
    font-weight: 700;
    transform: translateY(15px);
    transition: transform 0.4s ease, color 0.4s ease;
}

.division-card:hover .division-title {
    transform: translateY(0);
    color: var(--secondary-cream);
}

/* 7. Call to Action (Admisiones) */
.cta-section {
    padding: 6rem 0;
    text-align: center;
    background-color: white;
}

.btn-cta {
    background-color: var(--primary-guinda);
    color: white;
    padding: 1.2rem 3.5rem;
    font-size: 1.3rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-guinda);
    box-shadow: 0 8px 15px rgba(102, 6, 26, 0.2);
    text-decoration: none;
    display: inline-block;
}

.btn-cta:hover {
    background-color: transparent;
    color: var(--primary-guinda);
    box-shadow: 0 15px 25px rgba(102, 6, 26, 0.3);
    transform: translateY(-3px);
}

/* 8. Galería de Instalaciones */
.galeria-section {
    padding: 6rem 0;
    background-color: var(--primary-light);
}

.carousel-item img {
    height: 600px;
    object-fit: cover;
    border-radius: 12px;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--secondary-cream);
}

/* 9. Footer */
.footer {
    background-color: var(--primary-navy);
    color: white;
    padding: 5rem 0 2rem 0;
}

.footer h4 {
    color: var(--secondary-cream);
    margin-bottom: 1.5rem;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.4rem;
}

.footer p,
.footer a {
    color: #d1d5db;
    font-size: 1rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
}

.footer-logo {
    max-width: 220px;
    margin-bottom: 1.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    /* placeholder visibility */
    border-radius: 5px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    margin-right: 0.8rem;
    color: white;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

.social-icons a:hover {
    background-color: var(--primary-guinda);
    transform: translateY(-5px);
}

/* ==========================================================================
   Portada construida con Elementor — estilos y efectos hover que replican
   el diseño original sobre los widgets nativos de Elementor.
   ========================================================================== */

/* Tarjetas de Propuesta Educativa (contenedor Elementor con clase kh-propuesta-card) */
.kh-propuesta-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.kh-propuesta-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    background-color: #ffffff !important;
}

.kh-propuesta-card .elementor-icon {
    transition: color 0.3s ease;
}

.kh-propuesta-card:hover .elementor-icon {
    color: var(--secondary-royal) !important;
}

.kh-propuesta-card .elementor-icon i {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
}

/* Tarjetas de Oferta Educativa (contenedor Elementor con clase kh-division-card) */
.kh-division-card {
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.kh-division-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

/* El overlay de los contenedores de Elementor se pinta en el ::before */
.kh-division-card::before {
    transition: background 0.5s ease, background-image 0.5s ease;
}

.kh-division-card:hover::before {
    background-image: linear-gradient(0deg, rgba(102, 6, 26, 0.95) 0%, rgba(102, 6, 26, 0) 80%) !important;
}

.kh-division-title .elementor-heading-title {
    transform: translateY(15px);
    transition: transform 0.4s ease, color 0.4s ease;
}

.kh-division-card:hover .kh-division-title .elementor-heading-title {
    transform: translateY(0);
    color: var(--secondary-cream) !important;
}

/* Botón CTA (widget botón con clase kh-btn-cta).
   !important: el CSS del kit global de Elementor carga después del tema. */
.kh-btn-cta .elementor-button {
    background-color: var(--primary-guinda) !important;
    color: white !important;
    padding: 1.2rem 3.5rem !important;
    font-size: 1.3rem !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease !important;
    border: 2px solid var(--primary-guinda) !important;
    box-shadow: 0 8px 15px rgba(102, 6, 26, 0.2);
}

.kh-btn-cta .elementor-button:hover {
    background-color: transparent !important;
    color: var(--primary-guinda) !important;
    box-shadow: 0 15px 25px rgba(102, 6, 26, 0.3);
    transform: translateY(-3px);
}

/* Galería (widget Image Carousel con clase kh-galeria) */
.kh-galeria .elementor-image-carousel-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    /* Elementor reserva 30px para la paginación "outside"; la ponemos encima de la imagen */
    padding-bottom: 0 !important;
}

.kh-galeria .swiper-slide img,
.kh-galeria .swiper-slide-image {
    height: 600px;
    width: 100%;
    object-fit: cover;
    display: block;
}

/* Puntos de navegación superpuestos sobre la imagen */
.kh-galeria .swiper-pagination {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    z-index: 10;
}

.kh-galeria .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background-color: var(--secondary-cream);
    opacity: 0.6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.kh-galeria .swiper-pagination-bullet-active {
    opacity: 1;
}

.kh-galeria .elementor-swiper-button {
    color: #ffffff;
    filter: drop-shadow(0px 0px 5px black);
}

@media (max-width: 768px) {

    .kh-galeria .swiper-slide img,
    .kh-galeria .swiper-slide-image {
        height: 400px;
    }
}

/* Responsive Global */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-content p {
        font-size: 1.3rem;
    }

    .banner-destacado h2 {
        font-size: 1.8rem;
    }

    .carousel-item img {
        height: 400px;
    }

    .navbar.transparent {
        background-color: var(--primary-navy) !important;
    }
}
