﻿/* Suncity School - Modern Redesign (Dunham Inspired) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700&display=swap');

:root {
    /* Branding Colors */
    --primary-color: #4a0000;
    /* Original Dark Maroon */
    --secondary-color: #ffffff;
    /* White */
    --accent-color: #e6e6e6;
    /* Light gray for borders */
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --bg-light: #f9fafb;

    /* Spacing */
    --section-padding: 3rem 1rem;
    --container-max-width: 1280px;

    /* Transitions */
    --transition-speed: 0.3s;
}

/* Base Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Prevent horizontal scroll during animations */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', serif;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-center {
    text-align: center;
}

.text-white {
    color: var(--white);
}

.section {
    padding: var(--section-padding);
}

.bg-light {
    background-color: var(--bg-light);
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 2rem;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: 1px solid var(--white);
}

.btn-primary:hover {
    background-color: #b08d4b;
    transform: translateY(-2px);
}

.btn-secondary {
    border: 2px solid var(--white);
    color: var(--white);
    background: transparent;
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

/* Header & Nav */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: padding 0.3s;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-family: 'Outfit', serif;
    font-size: 1.8rem;
    /* Slightly larger text */
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
    /* Subtle scale effect on hover */
}

.nav-logo {
    height: 65px;
    /* Increased from 45px */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    /* Add subtle shadow for visibility */
    transition: height 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links li a {
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    color: var(--primary-color);
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-links li a:hover::after {
    width: 100%;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        text-align: center;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-toggle {
        display: block;
    }

    .top-bar {
        text-align: center;
        font-size: 0.75rem;
    }

    .top-bar .container {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Hero Section */
.hero {
    position: relative;
    height: 85vh;
    /* Background image removed as we use slider now */
    display: flex;
    align-items: center;
    color: var(--white);
    transform-origin: center center;
    will-change: transform;
    transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

/* Old pseudo-element removed/hidden */
.hero::before {
    display: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--white);
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Grades / Features (Walker-style Cards) */
.features-section {
    position: relative;
    margin-top: -6rem;
    z-index: 20;
    padding-bottom: 4rem;
    display: flex;
    /* Changed from grid to flex for fanning control */
    justify-content: center;
    gap: 2rem;
    perspective: 1000px;
}

.feature-card {
    position: relative;
    height: 500px;
    width: calc(33.333% - 1.333rem);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    padding: 3px;
    /* Border width */
    background: linear-gradient(90deg, var(--primary-color), #6b0000, var(--primary-color));
    background-size: 200% 100%;
    animation: border-motion 4s linear infinite;
    will-change: transform;
}

.feature-card:nth-child(1) {
    z-index: 10;
}

.feature-card:nth-child(2) {
    z-index: 15;
}

/* Preschool on top */
.feature-card:nth-child(3) {
    z-index: 10;
}

@keyframes border-motion {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.feature-card-content {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    /* slightly smaller than card */
    overflow: hidden;
    color: var(--white);
}

.feature-card-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(130, 36, 51, 0.9));
    z-index: 1;
}

.feature-card:hover {
    transform: translateY(-15px);
}

.feature-number {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 2;
}

.feature-number h2 {
    font-size: 4rem;
    color: var(--white);
    opacity: 0.2;
    margin: 0;
    line-height: 1;
}

.feature-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem 2rem;
    z-index: 2;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.feature-card:hover .feature-caption {
    transform: translateY(0);
}

.feature-caption h6 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.feature-caption h3 {
    font-size: 1.5rem;
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.feature-caption p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card:hover .feature-caption p {
    opacity: 1;
}

.feature-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 4px;
}

.feature-btn i {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-btn i {
    transform: translateX(5px);
}

/* Clean Minimalism - About Us Section (Restored Tilt) */
#about {
    perspective: 2500px;
    position: relative;
    background: var(--white);
    margin: 2rem 0;
    padding: 0;
    overflow: visible;
}

#about .container {
    background: var(--white);
    color: var(--text-dark);
    padding: 4rem 3rem;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    transform-origin: center top;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

#about h2 {
    color: var(--primary-color);
    font-size: 2.8rem;
    margin-bottom: 2rem;
}

#about h4 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

#about p {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-section {
    align-items: flex-start;
    gap: 4rem;
}

.info-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2.5rem 0;
}

.info-card {
    background: #fdfdfd;
    border-left: 4px solid var(--primary-color);
    padding: 2rem;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
}

.about-media {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.about-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.about-media:hover img {
    transform: scale(1.05);
}

.about-additional {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.about-additional p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.about-additional b {
    color: var(--primary-color);
}

/* Remove old about tilt classes */
@media (max-width: 768px) {
    .gallery-masonry {
        grid-template-columns: 1fr;
    }

    .masonry-column.col-2 {
        margin-top: 0;
    }
}

/* Gallery Slide-in Wrapper */
.gallery-slide-wrapper {
    position: relative;
    overflow-x: hidden;
    /* Only hide horizontal to allow vertical overlap */
    overflow-y: visible;
    width: 100%;
    z-index: 10;
}

#gallery {
    transform: translateX(-100%);
    transition: transform 0.1s linear;
    will-change: transform;
    padding-bottom: 0;
    /* Tighten for overlap */
}

/* Services Section */
.services-wrapper {
    background-color: var(--primary-color);
    padding: 10rem 0;
    /* Increased padding to accommodate gallery overlap */
    position: relative;
    z-index: 5;
}

.services-wrapper h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.services-wrapper p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4rem;
    /* More space before grid */
}

.service-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3.5rem 2rem;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--secondary-color);
}

.service-card i {
    color: var(--secondary-color);
    margin-bottom: 2rem;
    display: inline-block;
    transition: transform 0.4s ease;
}

.service-card:hover i {
    transform: translateY(-10px);
}

.service-card h3 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-card p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0;
    font-size: 1rem;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--secondary-color);
    transform: scaleX(0);
    transition: transform 0.4s ease;
    transform-origin: right;
}

.service-card:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Gallery Masonry Styles */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 2rem 0;
}

.masonry-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    will-change: transform;
}

/* Adjust alternate columns to start lower for staggered look */
.masonry-column.col-2,
.masonry-column.col-4 {
    margin-top: 4rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.5s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(74, 0, 0, 0.9), rgba(74, 0, 0, 0.4));
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-text {
    color: var(--white);
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-text {
    transform: translateY(0);
}

.gallery-text h4 {
    color: var(--white);
    margin-bottom: 0.25rem;
    font-size: 1.2rem;
}

/* News / Calendar (Marquee Slider) */
.calendar-marquee {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding: 2rem 0;
}

.calendar-track {
    display: flex;
    width: max-content;
    gap: 2rem;
    animation: marquee 40s linear infinite;
}

.calendar-track:hover {
    animation-play-state: paused;
}

.calendar-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--white);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    min-width: 350px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: default;
}

.calendar-item:hover {
    background-color: rgba(74, 0, 0, 0.85);
    /* Glassy Maroon */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(74, 0, 0, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(74, 0, 0, 0.25);
}

.calendar-item:hover h4,
.calendar-item:hover p {
    color: var(--white);
}

.calendar-item:hover .news-date {
    background: var(--white);
}

.calendar-item:hover .news-date .day {
    color: var(--primary-color);
}

.calendar-item:hover .news-date .month {
    color: var(--primary-color);
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-100% / 2));
    }
}

.calendar-event .news-date {
    animation: pulseGlow 4s infinite;
}

.calendar-today .news-date {
    animation: breathing 3s infinite ease-in-out;
    background: var(--primary-color);
    color: var(--white);
}

.calendar-today .news-date .day {
    color: var(--white);
}

.news-date {
    text-align: center;
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 4px;
    min-width: 80px;
    transition: all 0.3s ease;
}

.news-date .day {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.news-date .month {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-dark);
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 0, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(74, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 0, 0, 0);
    }
}

@keyframes breathing {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

@media (prefers-reduced-motion: reduce) {
    .calendar-item {
        transition: none;
        opacity: 1;
        transform: none;
    }

    .calendar-event .news-date,
    .calendar-today .news-date {
        animation: none;
    }
}

/* Light Glassy Contact Section */
#contact {
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
    position: relative;
    padding: 6rem 0;
    overflow: hidden;
    color: var(--primary-color);
}

#contact::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: var(--secondary-color);
    filter: blur(150px);
    opacity: 0.1;
    border-radius: 50%;
    z-index: 0;
}

#contact::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    filter: blur(120px);
    opacity: 0.1;
    border-radius: 50%;
    z-index: 0;
}

#contact .container {
    position: relative;
    z-index: 1;
}

.contact-glass-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
}

.contact-info-block {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.contact-details-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-info-block h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
}

.contact-info-block p {
    color: #64748b;
}

.contact-detail {
    background: rgba(255, 255, 255, 0.6);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    flex: 1;
    /* Stretch to fill height */
    margin-bottom: 0;
    /* Remove legacy margin */
}

.contact-detail:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--secondary-color);
    transform: translateX(10px);
}

.contact-detail i {
    color: var(--white);
    background: var(--primary-color);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
}

.contact-detail h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.contact-detail a {
    color: #475569;
    transition: color 0.3s;
}

.contact-detail a:hover {
    color: var(--primary-color);
}

.map-container {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    height: 420px;
    /* Slightly reduced height to better match compact cards */
}

.map-container iframe {
    width: 100%;
    height: 100%;
    filter: none;
    /* Removed dark filter for light feel */
}

/* Footer */
footer {
    background-color: #2a0b0d;
    /* Deep maroon-black for depth */
    color: rgba(255, 255, 255, 0.7);
    padding: 5rem 0 2rem;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand p {
    margin-bottom: 2rem;
    max-width: 350px;
    color: var(--white);
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--white);
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    transform: translateY(-5px);
}

.footer-links h4,
.footer-contact h4 {
    color: var(--white);
    font-family: 'Outfit', sans-serif;
    margin-bottom: 2rem;
    font-size: 1.25rem;
}

.footer-links ul li {
    margin-bottom: 0.75rem;
}

.footer-links ul li a {
    color: var(--white);
    transition: color 0.3s;
}

.footer-links ul li a:hover {
    color: var(--secondary-color);
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-contact i {
    color: var(--white);
    width: 20px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--white);
}

.footer-bottom p {
    color: var(--white);
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .footer-brand p {
        margin: 0 auto 2rem;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Reveal Classes */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid items */
.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

/* Subtle Follow Parallax Utility */
.follow-scroll {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* Flip Card Styles for Services */
.service-flip-container {
    perspective: 1000px;
    background-color: transparent;
    cursor: pointer;
    /* Ensure height is respected if grid dictates it, otherwise auto */
    height: 100%;
}

.service-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.service-flip-container:hover .service-flip-inner {
    transform: rotateX(180deg);
}

/* Adjust existing service-card to be the front face */
.service-card {
    /* Keep existing nice styles but ensure backface visibility */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    height: 100%;
    width: 100%;
    /* Ensure z-index is handled */
    z-index: 2;
    transform: rotateX(0deg);
    /* Fix for some browsers */
    position: relative;
}

/* Back Face */
.service-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: rotateX(180deg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: var(--primary-color);
    /* Fallback */
}

.service-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
    transition: filter 0.3s ease;
}

.service-flip-container:hover .service-back img {
    filter: brightness(1);
}

/* Ensure scale effect applies to the whole inner container or handled gracefully */
/* We override the .service-card:hover transform so it doesn't mess up the flip axis. */
.service-card:hover {
    transform: none !important;
    /* Disable individual scale on hover, delegate to inner/container */
}

/* Trigger the border effect on hover of the container */
transition: all 0.3s ease;
}

.footer-social a:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    transform: translateY(-5px);
}

.footer-links h4,
.footer-contact h4 {
    color: var(--white);
    font-family: 'Outfit', sans-serif;
    margin-bottom: 2rem;
    font-size: 1.25rem;
}

.footer-links ul li {
    margin-bottom: 0.75rem;
}

.footer-links ul li a {
    color: var(--white);
    transition: color 0.3s;
}

.footer-links ul li a:hover {
    color: var(--secondary-color);
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-contact i {
    color: var(--white);
    width: 20px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--white);
}

.footer-bottom p {
    color: var(--white);
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .footer-brand p {
        margin: 0 auto 2rem;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Reveal Classes */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid items */
.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

/* Subtle Follow Parallax Utility */
.follow-scroll {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* Flip Card Styles for Services */
.service-flip-container {
    perspective: 1000px;
    background-color: transparent;
    cursor: pointer;
    /* Ensure height is respected if grid dictates it, otherwise auto */
    height: 100%;
}

.service-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.service-flip-container:hover .service-flip-inner {
    transform: rotateX(180deg);
}

/* Adjust existing service-card to be the front face */
.service-card {
    /* Keep existing nice styles but ensure backface visibility */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    height: 100%;
    width: 100%;
    /* Ensure z-index is handled */
    z-index: 2;
    transform: rotateX(0deg);
    /* Fix for some browsers */
    position: relative;
}

/* Back Face */
.service-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: rotateX(180deg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: var(--primary-color);
    /* Fallback */
}

.service-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
    transition: filter 0.3s ease;
}

.service-flip-container:hover .service-back img {
    filter: brightness(1);
}

/* Ensure scale effect applies to the whole inner container or handled gracefully */
/* We override the .service-card:hover transform so it doesn't mess up the flip axis. */
.service-card:hover {
    transform: none !important;
    /* Disable individual scale on hover, delegate to inner/container */
}

/* Trigger the border effect on hover of the container */
.service-flip-container:hover .service-card::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* =========================================
   MOBILE RESPONSIVENESS & OPTIMIZATION
   ========================================= */

@media (max-width: 991px) {
    :root {
        --section-padding: 4rem 1rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
    }

    .masonry-column.col-2,
    .masonry-column.col-4 {
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 3rem 1rem;
    }

    /* Typography Adjustments */
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.35rem;
    }

    /* Global Layout */
    .container {
        padding: 0 1rem;
    }

    .nav-logo {
        height: 50px;
        /* Slightly smaller on mobile */
    }

    .logo {
        font-size: 1.4rem;
        /* Scale down text */
        gap: 0.6rem;
    }

    .grid,
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Hero Section */
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 6rem 0 3rem;
        /* Account for fixed header */
        text-align: center;
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-buttons {
        justify-content: center;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    /* Features / Grades (Walker Cards) */
    .features-section {
        flex-direction: column;
        margin-top: 0;
        padding-top: 2rem;
        gap: 1.5rem;
    }

    .feature-card {
        width: 100%;
        height: 400px;
        /* Reduced height for mobile */
        transform: none !important;
        /* Disable fan effect */
    }

    .feature-caption {
        transform: translateY(0);
        /* Always show caption on mobile */
        padding: 1.5rem;
    }

    .feature-caption p {
        opacity: 1;
        /* Always visible */
    }

    /* About Section */
    #about .container {
        padding: 2rem 1.5rem;
    }

    .about-section {
        flex-direction: column;
        gap: 2rem;
    }

    .info-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }

    /* Services Section */
    .services-wrapper {
        padding: 4rem 0;
    }

    .service-flip-container {
        height: 350px;
        /* Specific height for stacked cards */
        margin-bottom: 1rem;
    }

    /* Gallery Section */
    .gallery-masonry {
        grid-template-columns: 1fr;
        /* Single column */
        gap: 1rem;
    }

    .masonry-column {
        gap: 1rem;
    }

    .masonry-column.col-2,
    .masonry-column.col-4 {
        margin-top: 0;
        /* Align all tops */
    }

    .gallery-item {
        height: 300px;
    }

    .gallery-item img {
        height: 100%;
    }

    .gallery-overlay {
        opacity: 1;
        /* optional: always show text on mobile, or keep hover */
        background: linear-gradient(to top, rgba(74, 0, 0, 0.8), transparent);
    }

    .gallery-text {
        transform: translateY(0);
    }

    /* Calendar Section */
    .calendar-item {
        min-width: 280px;
        /* Allow smaller cards */
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }

    .news-date {
        margin: 0 auto;
        width: 100%;
    }

    .calendar-item>div:last-child {
        text-align: center;
    }

    /* Contact Section */
    #contact {
        padding: 3rem 0;
    }

    .contact-glass-card {
        padding: 1.5rem;
    }

    .contact-info-block h2 {
        font-size: 1.8rem;
    }

    .contact-detail {
        flex-direction: column;
        /* Stack icon and text */
        text-align: center;
        gap: 0.5rem;
    }

    .contact-detail i {
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }

    .map-container {
        height: 300px;
        order: -1;
        /* Show map first or keep last? user didn't specify, default is fine */
    }

    /* Footer */
    footer {
        padding: 3rem 0 1.5rem;
        text-align: center;
    }

    .footer-grid {
        gap: 2rem;
    }

    .footer-brand p {
        margin: 0 auto 1.5rem;
    }

    .footer-links ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .footer-links ul li {
        margin: 0;
    }

    .footer-contact p {
        justify-content: center;
    }
}

@media (max-width: 480px) {

    /* Small Phones */
    .hero h1 {
        font-size: 2rem;
    }

    .feature-number h2 {
        font-size: 3rem;
    }

    .service-flip-container {
        height: 300px;
    }

    .calendar-marquee {
        width: 100vw;
        /* Ensure full width */
        margin-left: -1rem;
        /* Counter container padding if needed */
        padding-left: 1rem;
    }
}

/* =========================================
   HERO SLIDER ANIMATION
   ========================================= */

.hero {
    background-image: none !important;
}

.hero::before {
    display: none !important;
}

/* Slider Wrapper */
.hero-slider-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slider-track {
    width: 100%;
    height: 500%;
    /* 5 slides */
    animation: slideUp 20s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
}

.hero-slide {
    width: 100%;
    height: 20%;
    /* 1/5 of the track */
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(74, 0, 0, 0.6), rgba(74, 0, 0, 0.4));
    z-index: 2;
    pointer-events: none;
}

@keyframes slideUp {

    0%,
    20% {
        transform: translateY(0);
    }

    25%,
    45% {
        transform: translateY(-20%);
    }

    50%,
    70% {
        transform: translateY(-40%);
    }

    75%,
    95% {
        transform: translateY(-60%);
    }

    100% {
        transform: translateY(-80%);
    }
}