/* 
   Variable Definitions & Design System 
   Palette:
   - Primary: #070048 (Deep Navy)
   - Secondary: #a8a390 (Muted Gold/Beige)
   - Background Sand: #f3f1e9 (Warm Off-white)
   - White: #ffffff
*/
:root {
    --primary: #070048;
    --primary-light: #1a1260;
    --secondary: #a8a390;
    --secondary-hover: #948f7d;
    --bg-sand: #f3f1e9;
    --bg-white: #ffffff;
    --text-main: #2d2d2d;
    --text-light: #555555;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 25px rgba(7, 0, 72, 0.15);

    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: --font-body, sans-serif;
    /* Fallback syntax fix below */
    font-family: var(--font-body), sans-serif;
    background-color: var(--bg-sand);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-heading), serif;
    color: var(--primary);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Typography & Utilities */
.text-center {
    text-align: center;
}

.highlight {
    color: var(--secondary);
    font-style: italic;
}

.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.separator {
    width: 80px;
    height: 3px;
    background-color: var(--secondary);
    margin: 0 auto 2rem;
}

.separator-left {
    width: 80px;
    height: 3px;
    background-color: var(--secondary);
    margin: 0 0 2rem 0;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-primary-outline,
.btn-primary-light {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--bg-white);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
}

.btn-primary-outline {
    border-color: var(--primary);
    color: var(--primary);
    padding: 0.6rem 1.5rem;
    /* Slightly smaller for nav */
}

.btn-primary-outline:hover {
    background-color: var(--primary);
    color: var(--bg-white);
}

.btn-primary-light {
    background-color: var(--bg-white);
    color: var(--primary);
}

.btn-primary-light:hover {
    background-color: var(--secondary);
    color: var(--bg-white);
}

.btn-text {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: underline;
    transition: var(--transition);
}

.btn-text:hover {
    color: var(--secondary);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(243, 241, 233, 0.95);
    /* Semi-transparent sand */
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 0.8rem 0;
    box-shadow: var(--shadow-md);
}

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

.logo-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.nav-logo {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:not(.btn-primary-outline):hover {
    color: var(--secondary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary);
    margin: 5px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    background-color: #e6e6e6;
    overflow: hidden;
    margin-top: -80px;
    /* Offset navbar */
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Create a shape or overlay effect */
    background: radial-gradient(circle at center, rgba(230, 230, 230, 0.2) 0%, #e6e6e6 85%),
        url('logo de pagina.avif') no-repeat center center;
    background-size: 80%;
    opacity: 0.75;
    /* Increased from 0.5 */
    filter: blur(0.5px);
    /* Reduced blur */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(7, 0, 72, 0.1);
    color: var(--primary);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

/* Philosophy Section */
.philosophy {
    background-color: var(--bg-white);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.value-card {
    background: var(--bg-sand);
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(168, 163, 144, 0.2);
}

.value-card:hover {
    background: var(--bg-white);
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.value-card h3 {
    margin-bottom: 1rem;
}

/* Levels Section */
.bg-light-sand {
    background-color: var(--bg-sand);
}

.split-layout {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.split-content {
    flex: 1;
}

.split-image {
    flex: 1;
    height: 500px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    opacity: 0.8;
}

.levels-list li {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.level-marker {
    width: 12px;
    height: 12px;
    background-color: var(--primary);
    border-radius: 50%;
    margin-top: 8px;
    /* Align with text top */
    flex-shrink: 0;
    position: relative;
}

.level-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 1px solid var(--secondary);
    border-radius: 50%;
}

/* Innovation / Knotion Section */
.reverse-layout {
    flex-direction: row-reverse;
}

.highlight-badge {
    display: inline-block;
    background-color: var(--secondary);
    color: var(--bg-white);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.lead-text {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 2rem;
}

.innovation-list {
    list-style: none;
}

.innovation-list li {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.innovation-list .icon {
    font-size: 2rem;
    background-color: rgba(7, 0, 72, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.innovation-list h4 {
    margin-bottom: 0.3rem;
    color: var(--primary);
}

.innovation-list p {
    font-size: 0.95rem;
    color: var(--text-light);
}

.knotion-bg {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    /* Knotion-like blue gradient */
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
}

.knotion-overlay h3 {
    color: white;
    font-size: 3rem;
    letter-spacing: 5px;
    margin-bottom: 0.5rem;
}

.knotion-overlay p {
    font-size: 1.2rem;
    letter-spacing: 2px;
    font-weight: 300;
}


/* CTA Section */
.cta-section {
    background-color: var(--primary);
    color: var(--bg-white);
    padding: 6rem 0;
}

.cta-title {
    color: var(--bg-white);
    margin-bottom: 1.5rem;
}

.cta-text {
    margin-bottom: 2.5rem;
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Footer */
.footer {
    background-color: #050036;
    /* Darker than primary */
    color: rgba(255, 255, 255, 0.7);
    padding: 4rem 0 2rem;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.school-name-footer {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--bg-white);
    display: block;
    margin-bottom: 1rem;
}

.footer h4 {
    color: var(--secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a:hover {
    color: var(--secondary);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    color: var(--bg-white);
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-icons a:hover {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* --- Gallery Section --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 200px);
    gap: 15px;
    margin-top: 3rem;
}

.gallery-item {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Bento-style grid layout: adjust spans for variety */
.item-1 {
    grid-column: span 2;
    grid-row: span 2;
}

.item-2 {
    grid-column: span 1;
    grid-row: span 1;
}

.item-3 {
    grid-column: span 1;
    grid-row: span 1;
}

.item-4 {
    grid-column: span 2;
    grid-row: span 1;
}

/* If there are more items, handle them or let them default */

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .item-1,
    .item-2,
    .item-3,
    .item-4,
    .item-5 {
        grid-column: span 1;
        grid-row: span 1;
        height: 250px;
    }
}


/* --- News Carousel --- */
.carousel-container {
    position: relative;
    height: 450px;
    width: 100%;
    margin: 0 auto;
    max-width: 1000px;
}

.carousel-track-container {
    height: 100%;
    position: relative;
    overflow: hidden;
    padding: 20px 0;
    /* Space for shadow */
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
    height: 100%;
    list-style: none;
    /* Reset again just in case */
}

.carousel-slide {
    min-width: 33.333%;
    /* Show 3 items on desktop */
    padding: 0 15px;
    box-sizing: border-box;
}

.news-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(168, 163, 144, 0.2);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-image {
    height: 180px;
    background-color: var(--secondary);
    background-size: cover;
    background-position: center;
}

.news-1 {
    background-image: linear-gradient(45deg, #070048, #2a2a72);
}

/* Placeholders */
.news-2 {
    background-image: linear-gradient(45deg, #a8a390, #d4d0c2);
}

.news-3 {
    background-image: linear-gradient(45deg, #004d40, #00695c);
}

.news-4 {
    background-image: linear-gradient(45deg, #b71c1c, #d32f2f);
}

.news-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 0.8rem;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: block;
}

.news-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    font-family: var(--font-heading);
}

.news-content p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    color: var(--primary);
    font-size: 1.2rem;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.carousel-btn:hover {
    background: var(--primary);
    color: var(--bg-white);
}

.prev-btn {
    left: -20px;
}

.next-btn {
    right: -20px;
}

.carousel-nav {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    gap: 10px;
}

.carousel-indicator {
    border: none;
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.carousel-indicator.current-slide {
    background: var(--primary);
    transform: scale(1.2);
}

/* Appointment Form Styles */
.appointment-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border-top: 5px solid var(--secondary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
    background-color: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(7, 0, 72, 0.1);
}

.full-width {
    width: 100%;
    text-align: center;
    margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .carousel-slide {
        min-width: 100%;
        /* Show 1 item on mobile */
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .appointment-container {
        padding: 2rem;
    }

    .carousel-container {
        height: auto;
        min-height: 500px;
        /* Give space for card */
    }
}

.visible {
    opacity: 1;
    transform: translate(0);
}

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

/* Mobile Responsive */
@media (max-width: 992px) {
    .hero-title {
        font-size: 3rem;
    }

    .split-layout,
    .reverse-layout {
        flex-direction: column;
        direction: column;
        gap: 2rem;
        flex-direction: column;
    }

    .split-image {
        width: 100%;
        height: 300px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        background-color: var(--bg-white);
        flex-direction: column;
        justify-content: center;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.4s ease;
    }

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

    .hero {
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }
}

/* --- Language Toggle & Rich Links --- */

.lang-toggle-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 1rem;
    transition: var(--transition);
}

.lang-toggle-btn:hover {
    background: var(--primary);
    color: var(--bg-white);
}

/* Rich Link Overlay for Notice Images */
.news-image {
    position: relative;
    cursor: pointer;
}

.news-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-image:hover .news-image-overlay {
    opacity: 1;
}

.external-icon {
    font-size: 3rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Ensure card is clickable for rich links */
.rich-card-link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.rich-card-link:hover .news-image-overlay {
    opacity: 1;
}