/* Sections */
.section {
    padding: var(--section-padding);
}

.section-sm {
    padding: 2rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--school-navy);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

[data-theme="dark"] .section-title h2 {
    color: var(--foreground);
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 10px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 10" preserveAspectRatio="none"><path d="M0,5 Q25,0 50,5 T100,5" stroke="%238b4513" stroke-width="3" fill="none" stroke-linecap="round"/></svg>');
    background-size: 100% 10px;
    background-repeat: no-repeat;
    opacity: 0.7;
}

.section-title p {
    font-family: var(--font-accent);
    font-size: 1.35rem;
    color: var(--school-brown);
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.85;
}

[data-theme="dark"] .section-title p {
    color: var(--school-beige);
}

/* Hero section */
.hero {
    position: relative;
    color: var(--hero-text);
    padding: 3rem 0;
    text-align: center;
    background: var(--school-navy);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    display: flex;
    align-items: center;
    z-index: 1;
}

/* Home Hero (Large for Carousel) */
.hero-home {
    padding: 10rem 0;
    min-height: 80vh;
}

.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    /* Start off-screen right with a dynamic entry skew */
    transform: translateX(100%) scale(0.9) skewX(10deg);
    transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1s ease-out;
    z-index: 0;
}

.carousel-slide.active {
    opacity: 1;
    transform: translateX(0) scale(1) skewX(0);
    z-index: 2;
}

.carousel-slide.exit {
    opacity: 0;
    /* Shuttering/Slicing exit to the left */
    transform: translateX(-100%) skewX(-20deg) scale(0.9);
    transition: transform 0.8s ease-in, opacity 0.8s ease-in;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    /* Overlay for readability */
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    position: relative;
    display: inline-block;
}

.hero h1::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 20%;
    width: 60%;
    height: 12px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 10" preserveAspectRatio="none"><path d="M0,5 Q25,0 50,5 T100,5" stroke="%23ffffff" stroke-width="4" fill="none" stroke-linecap="round"/></svg>');
    background-size: 100% 12px;
    background-repeat: no-repeat;
    opacity: 0.8;
}

.hero-home h1 {
    font-size: 4rem;
    /* Large for home */
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    /* Smaller for subpages */
    opacity: 0.9;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-home p {
    font-size: 1.5rem;
    /* Large for home */
    margin-bottom: 2.5rem;
    opacity: 1;
    max-width: 800px;
}

/* Carousel Navigation */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--school-white);
    font-size: 1.5rem;
    font-family: monospace; /* For crisp < > characters */
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    padding-bottom: 4px; /* Visual alignment */
}

.carousel-nav:hover {
    background: var(--school-white);
    color: var(--school-navy);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.carousel-nav.prev {
    left: 2rem;
}

.carousel-nav.next {
    right: 2rem;
}

/* Section Colors */
.section-muted {
    background-color: var(--muted);
}

.section-navy {
    background-color: var(--footer-bg);
    color: var(--footer-text);
}

/* CTA Section — distinctly warm, different from footer */
.section-cta {
    background: linear-gradient(135deg, #5d4037 0%, #3e2723 40%, #1a237e 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.section-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at top right, rgba(255, 213, 79, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(93, 64, 55, 0.4) 0%, transparent 60%);
    pointer-events: none;
}

.section-cta .container {
    position: relative;
    z-index: 1;
}

.section-cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.section-cta p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Card Visuals (Modern Styles) */
.card-visual-container {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    transition: var(--transition);
}

.card-image-bg {
    position: relative;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    z-index: 1;
}

.card-image-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-overlay-bg);
    z-index: 1;
    transition: var(--transition);
}

.card-image-bg>* {
    position: relative;
    z-index: 2;
}

.card-image-bg .btn-outline {
    border-color: rgba(255, 255, 255, 0.8);
    color: #ffffff;
}

.card-image-bg .btn-outline:hover {
    background-color: var(--school-beige);
    border-color: var(--school-beige);
    color: var(--school-navy);
}

/* Cinematic Animation for "Video" feel */
.cinematic-bg {
    animation: kenBurns 20s infinite alternate linear;
}

@keyframes kenBurns {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

/* Video Background Support */
.card-video-bg video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.card-video-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

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

    .section-title h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 4rem 0;
    }

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

    .section {
        padding: 2rem 0;
    }
}