:root {
    --bg: #FFFFFF;
    --muted: #E0D8DE;
    --text: #1F1F1F;
    --text-muted: #4A4A4A;
    --accent: #1f4f8f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
}

.container { 
    width: min(1100px, 92%); 
    margin: 0 auto; 
    padding: 0 16px;
    max-width: 100vw;
}

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,0.9);
    backdrop-filter: saturate(180%) blur(2px);
    border-bottom: 1px solid var(--muted);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 2px 0; }
.logo { text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: 0.2px; display: flex; align-items: center; flex: 1; }
.logo strong { color: var(--accent); }
.logo img { width: 100%; height: auto; max-height: 250px; object-fit: contain; }

.site-nav ul { list-style: none; display: flex; gap: 10px; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; color: var(--text); padding: 8px 10px; border-radius: 8px; }
.site-nav a:hover { background: var(--muted); }
.site-nav li.cta { margin-left: 6px; }
.nav-pill { background: #fff; color: var(--accent); border: 2px solid var(--accent); padding: 8px 14px; border-radius: 999px; font-weight: 700; box-shadow: 0 4px 14px rgba(31,79,143,0.15); }
.nav-pill:hover { background: var(--accent); color: #fff; }

.nav-toggle { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
.nav-toggle .bar { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; }

/* Sections */
.section { padding: 68px 0; }
.section.alt { background: var(--muted); }

/* Espaciado adicional entre secciones específicas */
#resultados {
    margin-bottom: 40px;
}

.cards-grid.three-cols {
    margin-bottom: 40px;
}

.founders {
    margin-bottom: 40px;
}

.team {
    margin-bottom: 40px;
}

.coordinators {
    margin-bottom: 40px;
}
.section h2 { 
    margin: 0 0 23px; 
    font-size: 2rem; 
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
}
.section h3 { 
    margin: 0 0 23px; 
    font-size: 2rem; 
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
}
.section p { margin: 0 0 14px; color: var(--text-muted); }

/* Hero */
.hero { padding: 90px 0 68px; }
.grid.two-cols { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: center; }
.hero h1 { font-size: 2.25rem; margin: 0 0 10px; }
.hero-cta { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { border: 2px solid var(--accent); color: var(--accent); }

.media-card { background: #fff; border: 1px solid var(--muted); border-radius: 12px; padding: 16px; box-shadow: 0 6px 22px rgba(0,0,0,0.06); }
.badge { display: inline-block; background: var(--accent); color: #fff; padding: 6px 10px; border-radius: 999px; font-size: 12px; margin-bottom: 8px; }
.facts { margin: 0; padding-left: 18px; color: var(--text-muted); }

/* Hero banner with background image */
.hero.banner { position: relative; color: #fff; }
.hero.banner::before { content: ""; position: absolute; inset: 0; background: url('../img/hero-banner.jpeg') center/cover no-repeat; z-index: -2; }
.hero.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.35)); z-index: -1; }
.hero.banner .media-card { background: rgba(255,255,255,0.9); }
.hero.banner p { color: #f3f3f3; }

/* Cards */
.cards-grid { display: grid; gap: 18px; }
.cards-grid.two-cols { grid-template-columns: repeat(2, 1fr); }
.cards-grid.three-cols { grid-template-columns: repeat(3, 1fr); }
.card { background: #fff; border: 1px solid var(--muted); border-radius: 12px; padding: 16px; }
.card h3, .card h4 { 
    margin-top: 0; 
    text-align: center;
    text-transform: uppercase;
    font-weight: 600;
}
.card ul { padding-left: 18px; margin: 8px 0 0; color: var(--text-muted); }

/* Testimonial Carousel */
.testimonial-carousel {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    display: none;
}

.carousel-slide.active {
    display: block;
}

.slide-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 400px;
}

.slide-image {
    position: relative;
    overflow: hidden;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.slide-text {
    padding: 40px;
    display: flex;
    align-items: center;
    background: #fff;
}

.slide-text blockquote {
    margin: 0;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text);
    width: 100%;
}

.slide-text blockquote p {
    margin: 0 0 20px;
    color: var(--text);
    font-size: inherit;
    line-height: inherit;
}

/* Mostrar versiones corta/larga de testimonios según viewport */
.slide-text blockquote p.t-mobile { display: none; }
.slide-text blockquote p.t-desktop { display: block; }

.slide-text blockquote cite {
    display: block;
    font-style: normal;
    font-weight: 600;
    color: var(--accent);
    font-size: 0.95rem;
}

.testimonial-arrow {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 10;
    flex-shrink: 0;
}

.testimonial-arrow:hover {
    background: var(--text);
}

/* Responsive */
@media (max-width: 800px) {
    .slide-content {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .slide-image {
        height: 300px;
        order: 1;
    }
    
    .slide-text {
        padding: 30px;
        order: 2;
        min-height: 700px;
        height: 700px;
        display: flex;
        align-items: flex-start;
        background: #fff;
        overflow-y: auto;
    }
    
    .slide-text blockquote {
        font-size: 0.9rem;
        color: var(--text);
    }
    .slide-text blockquote p.t-mobile { display: block; }
    .slide-text blockquote p.t-desktop { display: none; }
    
    .slide-text blockquote p {
        color: var(--text);
    }
}

@media (max-width: 600px) {
    .slide-text {
        padding: 20px;
        min-height: 600px;
        height: 600px;
        display: flex;
        align-items: flex-start;
        background: #fff;
        overflow-y: auto;
    }
    
    .slide-text blockquote {
        font-size: 0.85rem;
        color: var(--text);
    }
    .slide-text blockquote p.t-mobile { display: block; }
    .slide-text blockquote p.t-desktop { display: none; }
    
    .slide-text blockquote p {
        color: var(--text);
    }
}

/* Logos debajo del título de Oferta Académica */
.logos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; justify-items: center; gap: 24px; margin: 4px 0 24px; }
.logo-box { width: 100%; max-width: 520px; height: 360px; display: grid; place-items: center; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.08)); }
@media (max-width: 600px) {
    .logos { grid-template-columns: 1fr; }
    .logo-box { width: 100%; height: 260px; }
}

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.g-item { aspect-ratio: 4/3; border-radius: 10px; border: 1px solid var(--muted); overflow: hidden; background: #f7f5f7; }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Gallery Carousel (mobile only) */
.gallery-carousel {
    display: none;
    max-width: 100%;
    margin: 0 auto;
}

.gallery-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
}

.gallery-track {
    flex: 1;
    position: relative;
    height: 300px;
    overflow: hidden;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    display: none;
    align-items: center;
    justify-content: center;
}

.gallery-slide.active {
    opacity: 1;
    display: flex;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.gallery-arrow {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 10;
    flex-shrink: 0;
}

.gallery-arrow:hover {
    background: var(--text);
}


/* Mobile: Show carousel, hide grid */
@media (max-width: 700px) {
    .gallery-grid {
        display: none !important;
    }
    
    .gallery-carousel {
        display: block !important;
        max-width: 100%;
        margin: 0 auto;
        width: 100%;
    }
    
    .gallery-container {
        max-width: 100%;
        overflow: hidden;
        width: 100%;
    }
    
    .gallery-slide {
        max-width: 100%;
        width: 100%;
        height: 250px;
        flex: 0 0 100%;
    }
    
    .gallery-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        max-width: 100%;
    }
}

/* Avatares en tarjetas del equipo */
.avatar { width: 100%; height: 220px; margin: 8px 0 8px; border-radius: 12px; overflow: hidden; background: #f7f5f7; border: 1px solid var(--muted); display: grid; place-items: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.avatar img.avatar-top { object-position: 50% 90%; }

/* Photo bubble under "¿Quiénes somos?" */
.photo-bubble { display: grid; place-items: center; margin: 24px auto 8px; }
.photo-bubble img {
    width: min(100%, 980px);
    display: block;
    border-radius: 24px;
    border: 1px solid var(--muted);
    padding: 10px;
    background: radial-gradient(1200px 400px at 50% -10%, #ffffff, #f8f6f8 60%, var(--muted));
    box-shadow: 0 16px 40px rgba(0,0,0,0.12), inset 0 0 0 1px rgba(255,255,255,0.6);
}

/* Photo Carousel under "¿Quiénes somos?" */
.photo-carousel {
    display: grid;
    place-items: center;
    margin: 24px auto 8px;
    max-width: 1000px;
}

.photo-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1000px;
}

.photo-track {
    flex: 1;
    position: relative;
    height: 400px;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--muted);
    background: radial-gradient(1200px 400px at 50% -10%, #ffffff, #f8f6f8 60%, var(--muted));
    box-shadow: 0 16px 40px rgba(0,0,0,0.12), inset 0 0 0 1px rgba(255,255,255,0.6);
}

.photo-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
}

.photo-slide.active {
    opacity: 1;
    display: flex;
}

.photo-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 16px;
    display: block;
}

.photo-arrow {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(31,79,143,0.3);
}

.photo-arrow:hover {
    background: var(--text);
    transform: scale(1.05);
}

/* Responsive adjustments for photo carousel */
@media (max-width: 700px) {
    .photo-track {
        height: 300px;
    }
    
    .photo-arrow {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .photo-container {
        gap: 8px;
    }
}

/* Footer */
.site-footer { border-top: 1px solid var(--muted); padding: 22px 0; background: #fff; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer nav a { margin-right: 12px; color: var(--text); text-decoration: none; }
.site-footer nav a:last-child { margin-right: 0; }

/* Responsive */
@media (max-width: 900px) {
    .grid.two-cols { grid-template-columns: 1fr; }
    .cards-grid.three-cols { grid-template-columns: 1fr 1fr; }
}

/* Contact section */
.contact .contact-grid { 
    display: grid; 
    grid-template-columns: 1.2fr 0.8fr; 
    gap: 20px; 
}

.contact-form { 
    background: #fff; 
    border: 1px solid var(--muted); 
    border-radius: 12px; 
    padding: 16px; 
    box-shadow: 0 6px 22px rgba(0,0,0,0.06); 
}

.contact-form .form-field { margin-bottom: 12px; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.contact-form input[type="text"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea { 
    width: 100%; 
    padding: 10px 12px; 
    border-radius: 10px; 
    border: 1px solid var(--muted); 
    font: inherit; 
}

.contact-actions { 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    align-items: flex-start; 
}

.social-links { display: flex; flex-direction: column; gap: 10px; }
.social { 
    display: inline-flex; 
    align-items: center; 
    gap: 10px; 
    text-decoration: none; 
    color: var(--text); 
    border: 1px solid var(--muted); 
    border-radius: 10px; 
    padding: 10px 12px; 
}
.social.instagram { color: #CF2E92; }
.social.facebook { color: #1877F2; }

.btn.whatsapp { 
    background: #25D366; 
    color: #fff; 
}

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

@media (max-width: 700px) {
    .cards-grid.two-cols, .cards-grid.three-cols { grid-template-columns: 1fr; }
    .nav-toggle { display: inline-block; }
    .site-nav { position: absolute; top: 60px; right: 4%; background: #fff; border: 1px solid var(--muted); border-radius: 10px; padding: 8px; box-shadow: 0 10px 24px rgba(0,0,0,0.08); display: none; }
    .site-nav.open { display: block; }
    .site-nav ul { flex-direction: column; gap: 6px; }
    .site-nav li.cta { margin-left: 0; }
    
    /* Prevent horizontal scrolling on mobile */
    .container {
        padding: 0 16px;
        max-width: calc(100vw - 32px);
    }
    
    /* Ensure all elements stay within viewport */
    * {
        max-width: 100%;
    }
}

/* Resultados: layout 3 columnas tipo burbuja */
#resultados .results-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: stretch;
}
#resultados .results-list .card {
    background: #fff;
    border: 1px solid var(--muted);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 26px rgba(0,0,0,0.06);
    position: relative;
}
#resultados .results-list .card h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    text-align: center;
    text-transform: uppercase;
    font-weight: 600;
}
#resultados .results-list .card ul { margin-top: 8px; }
#resultados .results-list .kpi { color: var(--accent); font-weight: 800; }

@media (max-width: 1000px) {
    #resultados .results-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    #resultados .results-list { grid-template-columns: 1fr; }
}

/* Mobile: Show arrows, hide dots for testimonials */
@media (max-width: 700px) {
    .testimonial-arrow {
        display: flex;
    }
    
    .carousel-dots {
        display: none !important;
    }
    
    .carousel-container {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px;
    }
    
    .carousel-track {
        flex: 1;
        position: relative;
        min-height: 600px;
        height: 600px;
        overflow: hidden;
    }
    
    .carousel-slide {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        min-height: 100%;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        display: none;
    }
    
    .carousel-slide.active {
        opacity: 1;
        display: block;
    }
    
    .slide-content {
        min-height: 600px;
        height: 600px;
    }
    
    .slide-text {
        min-height: 600px;
        height: 600px;
        align-items: flex-start;
        overflow-y: auto;
        border: 1px solid #e0e0e0;
        position: relative;
        z-index: 1;
    }
}

/* Desktop: Show both arrows and dots for testimonials */
@media (min-width: 701px) {
    .testimonial-arrow {
        display: flex;
    }
    
    .carousel-dots {
        display: flex;
    }
    
    .carousel-container {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px;
    }
    
    .carousel-track {
        flex: 1;
        position: relative;
        min-height: 400px;
        overflow: hidden;
    }
    
    .carousel-slide {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        min-height: 100%;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        display: none;
    }
    
    .carousel-slide.active {
        opacity: 1;
        display: block;
    }
    
    .slide-content {
        min-height: 400px;
        height: 400px;
    }
}

/* Mobile: Logo más pequeño */
@media (max-width: 700px) {
    .logo img { 
        max-height: 50px; 
        width: auto;
    }
    
    .header-inner { 
        padding: 4px 0; 
    }
}
