/* ==========================================================================
   King's Hill School — Estilos del tema (rediseño 2026)
   Unión de los estilos de las 6 páginas HTML + adaptaciones para el DOM
   que genera Elementor (clases kh-* asignadas en Avanzado → Clases CSS).
   ========================================================================== */

/* 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;
    }
}

/* 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 Split (portada) — contenedor Elementor kh-hero-split
   ========================================================================== */

.kh-hero-split {
    min-height: 100vh;
}

/* Lado de texto */
.kh-hero-text {
    background-color: #4A0210;
    position: relative;
    overflow: hidden;
}

/* Icono decorativo (Recurso 1) en la esquina inferior derecha */
.kh-hero-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: clamp(250px, 35vw, 600px);
    aspect-ratio: 1/1;
    background-image: url('../../img/recurso-1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom right;
    transform: translate(35%, 35%);
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
}

.kh-hero-text > * {
    position: relative;
    z-index: 1;
}

.kh-hero-title .elementor-heading-title {
    font-size: 4.2rem;
    font-weight: 400;
    line-height: 1.15;
    color: var(--secondary-cream);
    font-family: var(--font-serif);
}

.kh-hero-subtitle .elementor-heading-title {
    font-size: 1.4rem;
    font-weight: 300;
    font-style: italic;
    color: var(--primary-light);
    border-left: 2px solid var(--secondary-red);
    padding-left: 15px;
    letter-spacing: 1px;
    font-family: var(--font-sans);
}

.kh-btn-outline .elementor-button {
    background-color: transparent !important;
    border: 1px solid var(--primary-light) !important;
    color: var(--primary-light) !important;
    padding: 0.8rem 2.5rem !important;
    text-transform: uppercase;
    font-weight: 400 !important;
    letter-spacing: 1px;
    font-size: 0.9rem !important;
    font-family: var(--font-sans);
    border-radius: 0 !important;
    transition: all 0.3s ease !important;
}

.kh-btn-outline .elementor-button:hover {
    background-color: var(--primary-light) !important;
    color: var(--primary-guinda) !important;
}

@media (max-width: 768px) {
    .kh-hero-title .elementor-heading-title {
        font-size: 3rem;
    }

    .kh-hero-subtitle .elementor-heading-title {
        font-size: 1.2rem;
    }
}

/* ==========================================================================
   3. Secciones de introducción / headers de página
   ========================================================================== */

.intro-title {
    color: var(--primary-navy);
    font-weight: 400;
    font-size: 3rem;
}

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

/* Iconos decorativos de sección (asignar la clase al contenedor Elementor) */
.kh-deco {
    position: relative;
    overflow: hidden;
}

.kh-deco::after {
    content: '';
    position: absolute;
    width: clamp(200px, 25vw, 450px);
    aspect-ratio: 1/1;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
}

.kh-deco > * {
    position: relative;
    z-index: 1;
}

/* Recurso 4 arriba-izquierda (intro home, nosotros, modelo, oferta) */
.kh-deco-topleft::after {
    background-image: url('../../img/recurso-4.png');
    top: 0;
    left: 0;
    transform: translate(-25%, -25%);
}

/* Recurso 5 abajo-izquierda (instalaciones) */
.kh-deco-bottomleft-5::after {
    background-image: url('../../img/recurso-5.png');
    bottom: 0;
    left: 0;
    top: auto;
    transform: translate(-15%, -15%);
}

/* Recurso 3 abajo-izquierda (contacto) */
.kh-deco-bottomleft-3::after {
    background-image: url('../../img/recurso-3.png');
    bottom: 0;
    left: 0;
    top: auto;
    transform: translate(-15%, 15%);
}

/* ==========================================================================
   4. Modelo Educativo (tarjetas con icono — portada)
   ========================================================================== */

.propuesta-card {
    background: var(--primary-light);
    border-radius: 12px;
    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;
}

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

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

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

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

/* Elementor puede renderizar algunos íconos como SVG en línea:
   que hereden el color del texto en lugar del fill negro por defecto */
.elementor-icon svg.e-font-icon-svg {
    fill: currentColor;
    width: 1em;
}

.propuesta-card .elementor-icon-box-title {
    font-size: 1.25rem;
    color: var(--primary-navy);
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.4;
    margin-top: 1.25rem;
}

/* ==========================================================================
   5. Divisiones Académicas (tarjeta imagen + franja navy)
   ========================================================================== */

.kh-division-card {
    background-color: var(--primary-navy);
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Imagen que llena el área flexible de la tarjeta
   (!important: Elementor fija flex-grow 0 en los widgets).
   La imagen va en posición absoluta para que nunca empuje la franja
   del título fuera de la tarjeta (pasaba en móvil). */
.kh-division-img {
    flex-grow: 1 !important;
    min-height: 0;
    overflow: hidden;
    align-self: stretch;
    position: relative;
}

.kh-division-img img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.kh-division-strip {
    background-color: var(--primary-navy);
    transition: background-color 0.4s ease;
}

.kh-division-card:hover .kh-division-strip {
    background-color: var(--primary-guinda) !important;
}

.kh-division-strip .elementor-heading-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 1px;
    font-family: var(--font-serif);
    transition: color 0.4s ease;
}

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

/* ==========================================================================
   6. Botones
   ========================================================================== */

/* CTA guinda (Admisiones / Enviar) */
.kh-btn-cta .elementor-button,
.wpcf7 .kh-cf7-submit,
button.btn-cta {
    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: 400 !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,
.wpcf7 .kh-cf7-submit:hover,
button.btn-cta:hover {
    background-color: transparent !important;
    color: var(--primary-guinda) !important;
    box-shadow: 0 15px 25px rgba(102, 6, 26, 0.3);
    transform: translateY(-3px);
}

/* Botón outline guinda redondeado ("Conoce nuestra historia") */
.kh-btn-history .elementor-button {
    border: 2px solid var(--primary-guinda) !important;
    color: var(--primary-guinda) !important;
    background-color: transparent !important;
    padding: 0.8rem 2.5rem !important;
    text-transform: uppercase;
    font-weight: 500 !important;
    letter-spacing: 1px;
    font-size: 0.9rem !important;
    font-family: var(--font-sans);
    border-radius: 50px !important;
    transition: all 0.3s ease !important;
}

.kh-btn-history .elementor-button:hover {
    background-color: var(--primary-guinda) !important;
    color: white !important;
    box-shadow: 0 8px 15px rgba(102, 6, 26, 0.2);
    transform: translateY(-2px);
}

/* ==========================================================================
   7. Galerías (widget Image Carousel)
   ========================================================================== */

/* Base compartida: puntos superpuestos y flechas con sombra */
.kh-galeria-sq .elementor-image-carousel-wrapper,
.kh-galeria-full .elementor-image-carousel-wrapper {
    position: relative;
    padding-bottom: 0 !important;
}

.kh-galeria-sq .swiper-pagination,
.kh-galeria-full .swiper-pagination {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    z-index: 10;
}

.kh-galeria-sq .swiper-pagination-bullet,
.kh-galeria-full .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-sq .swiper-pagination-bullet-active,
.kh-galeria-full .swiper-pagination-bullet-active {
    opacity: 1;
}

.kh-galeria-sq .elementor-swiper-button,
.kh-galeria-full .elementor-swiper-button {
    color: #ffffff;
    filter: drop-shadow(0px 0px 8px rgba(0, 0, 0, 0.8));
}

/* Variante cuadrada (portada) */
.kh-galeria-sq .elementor-image-carousel-wrapper {
    overflow: hidden;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.kh-galeria-sq .swiper-slide img,
.kh-galeria-sq .swiper-slide-image {
    width: 100%;
    aspect-ratio: 1/1;
    height: auto;
    object-fit: cover;
}

/* Variante ancho completo 75vh (página Instalaciones) */
.kh-galeria-full .swiper-slide img,
.kh-galeria-full .swiper-slide-image {
    width: 100%;
    height: 75vh;
    object-fit: cover;
}

.kh-galeria-full .swiper-pagination {
    bottom: 2rem;
}

/* Contenido interno del hero (máx 550px como el diseño original) */
.kh-hero-inner {
    max-width: 550px;
    margin: 0 auto;
}

/* Tarjetas de oferta en la portada: alto fijo de 400px
   (!important: el CSS de contenedores de Elementor carga después) */
.kh-division-fixed {
    height: 400px !important;
}

/* Cita de la sección Instalaciones (portada) */
.kh-quote .elementor-heading-title {
    color: var(--primary-guinda);
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 2.5rem;
    line-height: 1.4;
    font-style: italic;
}

.kh-eyebrow .elementor-heading-title {
    color: var(--primary-navy);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.1rem;
    font-family: var(--font-sans);
}

/* ==========================================================================
   8. Página Modelo Educativo
   ========================================================================== */

/* Tarjetas bullet de enfoque (Educamos con intención...) */
.kh-bullet-card {
    background-color: var(--primary-light);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    border-top: 4px solid var(--primary-guinda);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.kh-bullet-card .elementor-icon {
    font-size: 2.2rem;
    color: var(--primary-guinda);
    transition: transform 0.3s ease;
}

.kh-bullet-card:hover .elementor-icon {
    transform: scale(1.1);
}

.kh-bullet-card .elementor-icon-box-title {
    font-size: 1.1rem;
    color: var(--primary-navy);
    font-weight: 600;
    font-family: var(--font-sans);
    margin-top: 1rem;
}

/* Tarjetas pilar (icono en círculo + listas) */
.kh-pilar-card {
    background-color: var(--primary-light);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(8, 18, 47, 0.01);
    border-top: 5px solid var(--primary-guinda);
    border-left: 1px solid rgba(8, 18, 47, 0.04);
    border-right: 1px solid rgba(8, 18, 47, 0.04);
    border-bottom: 1px solid rgba(8, 18, 47, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.kh-pilar-card:hover {
    transform: translateY(-8px);
    background-color: white !important;
    box-shadow: 0 15px 40px rgba(8, 18, 47, 0.08);
}

.kh-pilar-badge .elementor-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--primary-guinda);
    transition: background-color 0.3s ease, color 0.3s ease;
    box-shadow: 0 4px 10px rgba(8, 18, 47, 0.04);
}

.kh-pilar-card:hover .kh-pilar-badge .elementor-icon {
    background-color: var(--primary-guinda);
    color: white !important;
}

.kh-pilar-card .elementor-heading-title {
    color: var(--primary-navy);
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.3;
}

.kh-pilar-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

.kh-pilar-sub {
    font-weight: 600;
    color: var(--primary-navy);
    font-size: 0.95rem;
    line-height: 1.4;
    font-family: var(--font-sans);
}

/* Listas con palomitas (widget Icon List) */
.kh-check-list .elementor-icon-list-icon i {
    color: var(--primary-guinda);
    font-size: 1rem;
}

.kh-check-list .elementor-icon-list-text {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.4;
}

/* Nota destacada en cursiva con borde navy */
.kh-pilar-extra {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #4a4a4a;
    background-color: white;
    border-left: 3px solid var(--primary-navy);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    box-shadow: 0 4px 10px rgba(8, 18, 47, 0.02);
    transition: background-color 0.3s ease;
}

.kh-pilar-card:hover .kh-pilar-extra {
    background-color: var(--primary-light) !important;
}

/* Banner de compromiso final */
.kh-commitment-banner {
    background-color: var(--primary-guinda);
    color: white;
    border-radius: 12px;
    font-family: var(--font-serif);
    box-shadow: 0 12px 30px rgba(8, 18, 47, 0.15);
}

.kh-commitment-banner p {
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
    font-style: italic;
    color: white;
}

/* ==========================================================================
   9. Página Nosotros
   ========================================================================== */

/* Valores alineados con los ajustes hechos en el editor:
   esquinas 12px y sombra (persisten aunque se reinstale el tema) */
.kh-nosotros-img img {
    object-fit: cover;
    height: 320px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.kh-mvv-icon .elementor-icon {
    font-size: 3rem;
    color: var(--primary-navy);
}

.kh-mvv-title .elementor-heading-title {
    color: var(--primary-guinda);
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.75rem;
}

/* ==========================================================================
   10. Página Contacto — Formulario (Contact Form 7)
   ========================================================================== */

.kh-form-card {
    background: var(--primary-light);
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.kh-form-card:hover {
    background: #ffffff !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

/* Captcha (Really Simple CAPTCHA) */
.kh-form-card .kh-captcha-row img.wpcf7-captchac {
    border-radius: 8px;
    border: 1px solid #ddd;
    display: block;
    margin: 0.3rem 0 0.6rem;
}

.kh-form-card .kh-captcha-row input.wpcf7-captchar {
    max-width: 220px;
}

.kh-form-card .wpcf7 label {
    font-weight: 500;
    color: #4a4a4a;
    display: block;
    margin-bottom: 0.5rem;
    width: 100%;
}

.kh-form-card .wpcf7 input[type="text"],
.kh-form-card .wpcf7 input[type="tel"],
.kh-form-card .wpcf7 input[type="email"],
.kh-form-card .wpcf7 textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-family: var(--font-sans);
    font-size: 1rem;
    background: white;
    margin-top: 0.3rem;
}

.kh-form-card .wpcf7 input:focus,
.kh-form-card .wpcf7 textarea:focus {
    outline: none;
    border-color: var(--primary-guinda);
    box-shadow: 0 0 0 3px rgba(102, 6, 26, 0.1);
}

.kh-form-card .wpcf7-form p {
    margin-bottom: 1.5rem;
}

.kh-form-card .kh-cf7-submit {
    width: 100%;
    max-width: 220px;
    padding: 0.8rem 2rem !important;
    font-size: 1.1rem !important;
    cursor: pointer;
    display: inline-block;
}

.kh-form-card .wpcf7-spinner {
    display: block;
    margin: 0.5rem auto 0;
}

/* ==========================================================================
   11. 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: 400;
    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;
}

.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);
}

/* ==========================================================================
   Responsive Global
   ========================================================================== */

@media (max-width: 991px) {
    /* En pantallas chicas el navbar siempre es sólido (como en el diseño) */
    .navbar.transparent {
        background-color: var(--primary-navy) !important;
    }

    /* Sección Instalaciones (portada): textos centrados al apilarse */
    .kh-eyebrow .elementor-heading-title,
    .kh-quote .elementor-heading-title {
        text-align: center;
    }
}

@media (max-width: 768px) {

    /* El navbar fijo es sólido en móvil: dar aire al título del hero */
    .kh-hero-text {
        padding-top: 11rem !important;
    }

    .kh-galeria-full .swiper-slide img,
    .kh-galeria-full .swiper-slide-image {
        height: 50vh;
    }

    .kh-quote .elementor-heading-title {
        font-size: 1.8rem;
    }
}
