/* ============================================
   Isamu Foundation School - Responsive Stylesheet
   Updated: Modern, Fluid, Fully Responsive
   Hero: Big on home (.home), smaller elsewhere
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary-color: #E31E24;      /* Red */
    --secondary-color: #009245;    /* Green */
    --accent-color: #FBB03B;       /* Yellow/Gold */
    --dark-color: #231F20;         /* Black/Dark Grey */
    --light-color: #F8F9FA;
    --white: #FFFFFF;
    --text-color: #333333;
    --text-muted: #666666;
    --transition: all 0.3s ease;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.15);
    
    /* Fluid spacing */
    --space-xs: clamp(0.5rem, 1vw, 0.75rem);
    --space-sm: clamp(0.75rem, 2vw, 1rem);
    --space-md: clamp(1rem, 3vw, 1.5rem);
    --space-lg: clamp(1.5rem, 4vw, 2rem);
    --space-xl: clamp(2rem, 5vw, 3rem);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Avoid header overlap */
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
    line-height: 1.3;
}

h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
}

h2 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}

h3 {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
}

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

ul {
    list-style: none;
}

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

/* ---------- Utility Classes ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-title h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: #c41a1f;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

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

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #007a3a;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* Focus styles for accessibility */
.btn:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ---------- Top Bar ---------- */
.top-bar {
    background-color: var(--dark-color);
    color: var(--white);
    padding: var(--space-xs) 0;
    font-size: 0.9rem;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.contact-info span {
    margin-right: 20px;
    display: inline-block;
}

.contact-info i {
    color: var(--accent-color);
    margin-right: 5px;
}

.social-links a {
    margin-left: 15px;
    color: var(--white);
    display: inline-block;
    transition: transform 0.2s ease;
}

.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

/* ---------- Header & Navigation ---------- */
.main-header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(0); /* Fallback */
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.logo a {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 60px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.school-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 4vw, 1.2rem);
    color: var(--primary-color);
    line-height: 1.2;
}

.motto {
    font-size: 0.75rem;
    color: var(--secondary-color);
    font-style: italic;
}

.nav-menu {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.nav-item {
    margin-left: 0; /* Reset for responsive */
}

.nav-link {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
    padding: 0.5rem 0;
    display: inline-block;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ---------- Hero Section ---------- */
/* Default hero (big) – used on home page */
.hero {
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: left;
    min-height: 600px;
    height: 80vh;
    max-height: 800px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    animation: fadeInUp 0.8s ease-out;
}

.hero-content h1 {
    color: var(--white);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Force compact hero on all pages except home */
body:not(.home) .hero {
    min-height: 200px !important;
    height: auto !important;
    max-height: 300px !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Adjust inner content to fit */
body:not(.home) .hero .hero-content {
    padding: 0.5rem 0 !important;
    position: relative !important;
    z-index: 1 !important;
    max-width: 100% !important;
    text-align: center !important;
}

body:not(.home) .hero h1 {
    font-size: clamp(1.2rem, 4vw, 1.6rem) !important;
    margin-bottom: 0.25rem !important;
}

body:not(.home) .hero p {
    font-size: clamp(0.8rem, 3vw, 0.9rem) !important;
    margin-bottom: 0.5rem !important;
}

body:not(.home) .hero .btn {
    padding: 6px 14px !important;
    font-size: 0.8rem !important;
}
/* ---------- Hero Slider (Home Page Only) ---------- */
/* ---------- Hero Slider with Smooth Transitions ---------- */
.hero-slider {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 600px;
    max-height: 800px;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* smooth easing */
    will-change: opacity; /* hint for smoother animation */
    pointer-events: none; /* prevent clicks on invisible slides */
    z-index: 0;
}

.slide.active {
    opacity: 1;
    pointer-events: auto; /* only active slide receives clicks */
    z-index: 1;
}

/* Remove any default overlay */
.slide::before {
    display: none;
}

/* Centered text box with gradient background */
.slide .hero-content {
    position: relative;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 100%);
    padding: 1.5rem 2rem;
    color: #fff;
    text-align: center;
    max-width: 90%;
    width: auto;
    margin: 0 auto 2rem auto; /* center horizontally and bottom spacing */
    border-radius: 8px;
    z-index: 2;
    backdrop-filter: blur(2px);
    box-sizing: border-box;
    transform: translateY(0); /* ensure no transform interfering */
}

/* For vertical centering at bottom, use flex on slide */
.slide {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Text styling */
.slide .hero-content h1 {
    color: #fff;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.slide .hero-content p {
    color: #fff;
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: 1rem;
    opacity: 0.95;
}

.slide .hero-btns {
    margin-top: 0.5rem;
}

.slide .hero-btns .btn {
    margin: 0 0.5rem;
}

/* Slider controls */
.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
    border-radius: 4px;
}

.slider-prev:hover,
.slider-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.slider-prev {
    left: 20px;
}

.slider-next {
    right: 20px;
}

/* Dots */
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
}

.slider-dots .dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.slider-dots .dot.active {
    background-color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .hero-slider {
        height: 70vh;
        min-height: 500px;
    }
    .slide .hero-content {
        padding: 1.2rem 1.8rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-slider {
        height: 60vh;
        min-height: 450px;
    }
    .slide .hero-content {
        padding: 1rem 1.5rem;
        margin-bottom: 1rem;
    }
    .slider-prev,
    .slider-next {
        font-size: 1.5rem;
        padding: 0.3rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero-slider {
        height: 50vh;
        min-height: 400px;
    }
    .slide .hero-content h1 {
        font-size: 1.5rem;
    }
    .slide .hero-content p {
        font-size: 0.9rem;
    }
}
/* Responsive adjustments for slider */
@media (max-width: 1024px) {
    .hero-slider {
        height: 70vh;
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .hero-slider {
        height: 60vh;
        min-height: 450px;
    }
    .slider-prev,
    .slider-next {
        font-size: 1.5rem;
        padding: 0.3rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero-slider {
        height: 50vh;
        min-height: 400px;
    }
}

/* ---------- Footer ---------- */
.main-footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: var(--space-xl) 0 var(--space-md);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: var(--space-md);
}

.footer-logo img {
    height: 50px;
    width: auto;
}

.footer-logo h3 {
    color: var(--white);
    margin-bottom: 0;
    font-size: 1.2rem;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
    font-size: 1.2rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    transition: var(--transition);
    display: inline-block;
}

.footer-col ul li a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.contact-details li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.contact-details i {
    color: var(--accent-color);
    margin-top: 5px;
    min-width: 20px;
}

.footer-social {
    margin-top: var(--space-md);
    display: flex;
    gap: 12px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.footer-social a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.map-placeholder {
    background-color: #333;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    text-align: center;
    padding: var(--space-sm);
}

.map-placeholder i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-md);
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
}

.footer-bottom a {
    color: #aaa;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--white);
}

/* ---------- Back to Top ---------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    text-align: center;
    line-height: 45px;
    z-index: 999;
    display: none;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* ---------- Responsive Design ---------- */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
    
    /* Hero adjustments */
    .hero {
        height: 70vh;
        min-height: 500px;
    }
    body:not(.home) .hero {
        height: 45vh;
        min-height: 400px;
    }
    
    .top-bar-content {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-info span {
        display: block;
        margin-bottom: 5px;
        margin-right: 0;
    }
    
    .social-links {
        margin-top: var(--space-xs);
    }
    
    .social-links a {
        margin: 0 10px;
    }
    
    .hero {
        height: 60vh;
        min-height: 450px;
        text-align: center;
    }
    body:not(.home) .hero {
        height: 40vh;
        min-height: 350px;
    }
    
    .hero-content {
        text-align: center;
        margin: 0 auto;
    }
    
    .section {
        padding: var(--space-xl) 0;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .footer-col h4::after {
        left: 0;
        right: auto;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        line-height: 40px;
        bottom: 20px;
        right: 20px;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .logo img {
        height: 45px;
    }
    
    .school-name {
        font-size: 0.9rem;
    }
    
    .motto {
        font-size: 0.7rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .hero {
        height: 50vh;
        min-height: 400px;
    }
    body:not(.home) .hero {
        height: 35vh;
        min-height: 300px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
}

/* Large Screens (min-width: 1440px) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .hero {
        height: 70vh;
        max-height: 700px;
    }
    body:not(.home) .hero {
        height: 50vh;
        max-height: 500px;
    }
}

/* ---------- Print Styles (optional) ---------- */
@media print {
    .top-bar,
    .main-header,
    .back-to-top,
    .footer-social,
    .map-placeholder {
        display: none;
    }
    
    body {
        color: black;
        background: white;
    }
    
    a {
        text-decoration: underline;
    }
}
