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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

:root {
    --navy: #2c3e50;
    --green: #27ae60;
    --accent-green: #2ecc71;
    --light-green: #a8e6cf;
    --black: #2c3e50;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --cream: #fef9f3;
    --dark-navy: #1a252f;
    --warm-gray: #ecf0f1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.8;
    color: var(--black);
    background-color: var(--cream);
    overflow-x: hidden;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navigation */
header {
    background-color: var(--navy);
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

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

.logo h1 {
    font-size: 1.5rem;
    color: var(--white);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex-wrap: wrap;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    margin: 3px 0;
    transition: all 0.3s;
    border-radius: 3px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    padding: 0.5rem 0;
    -webkit-tap-highlight-color: transparent;
}

.nav-link:hover {
    color: var(--light-green);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    position: relative;
    color: var(--white);
    overflow: hidden;
    /* viewport-based height (fallback to 360px) so the hero always appears large and images cover the area */
    min-height: 360px;
    min-height: 60vh;
    display: flex;
    align-items: flex-start; /* start at top so navbar sits closer */
}

/* Carousel */
.carousel {
    position: relative;
    width: 100%;
    height: 100%;
    /* allow the carousel to stretch vertically even when the parent .hero uses align-items:flex-start */
    align-self: stretch;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
    transform: scale(1.02);
}

.slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}

.carousel-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 1.25rem 0; /* reduced vertical padding */
    pointer-events: none;
}

.carousel-overlay .container {
    position: relative;
}

.carousel-overlay h2 {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 3px 8px rgba(0,0,0,0.5);
}

.carousel-overlay .tagline {
    color: var(--light-green);
    font-weight: 600;
    font-size: 1.2rem;
}

.carousel-overlay .hero-location {
    margin-top: 0.8rem;
    font-size: 1rem;
    color: rgba(255,255,255,0.95);
}

.carousel-dots {
    position: absolute;
    z-index: 3;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.dot {
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.dot.active {
    background: var(--green);
}

/* Section Styles */
section {
    padding: 1rem 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--navy);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--green);
}

/* About Section */
.about {
    background-color: var(--light-gray);
}

.about-content p {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

.about-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 4px solid var(--green);
}

.about-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.about-card h3 {
    color: var(--navy);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Events Section */
.events {
    background-color: var(--white);
}

.admin-controls {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-controls #adminPanel {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.login-hint {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}

.events-controls {
    text-align: center;
    margin-bottom: 2rem;
}

.btn {
    background-color: var(--green);
    color: var(--white);
    padding: 0.85rem 2rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn:hover,
.btn:active {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(39, 174, 96, 0.4);
}

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

.btn-secondary:hover {
    background-color: var(--dark-navy);
}

.event-form {
    background-color: var(--light-gray);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.event-form.hidden {
    display: none;
}

.event-form h3 {
    color: var(--navy);
    margin-bottom: 1rem;
}

.event-form input,
.event-form textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    max-width: 100%;
}

.form-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.event-card {
    background-color: var(--white);
    border: none;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.event-date {
    background-color: var(--navy);
    color: var(--white);
    padding: 1.5rem;
    text-align: center;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-date .day {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

.event-date .month {
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--green);
}

.event-details {
    padding: 1.5rem;
    flex: 1;
}

.event-details h3 {
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.event-details p {
    color: #555;
}

/* Gallery Section */
.gallery {
    background-color: var(--light-gray);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    /* keep a consistent tile aspect ratio so images can fill the area */
    aspect-ratio: 4/3;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%; /* fill the tile created by aspect-ratio */
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

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

.placeholder-img {
    background: linear-gradient(135deg, var(--navy) 0%, var(--green) 100%);
    color: var(--white);
    /* match the gallery tile aspect ratio */
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Contact Section */
.contact {
    background-color: var(--white);
}

/* Grades Section */
.grades {
    background-color: var(--cream);
    padding: 3rem 0;
}

.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.grade-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.grade-num {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--navy);
}

.grade-info {
    font-size: 0.95rem;
    color: #444;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.contact-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border-left: 5px solid var(--green);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
}

.contact-card:hover {
    transform: translateY(-3px);
}

.contact-card h3 {
    color: var(--navy);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.contact-card p {
    color: #555;
    line-height: 1.8;
}

/* Footer */
footer {
    background-color: var(--navy);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
}

/* Responsive Design */

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }

    .hero-content h2 {
        font-size: 2.5rem;
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .events-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .navbar .container {
        position: relative;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 250px;
        height: calc(100vh - 60px);
        background-color: var(--navy);
        flex-direction: column;
        gap: 0;
        padding: 2rem 0;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease-in-out;
        overflow-y: auto;
    }

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

    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 1rem 2rem;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
    }

    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        transform: none;
    }

    .logo h1 {
        font-size: 1.3rem;
        text-align: left;
    }

    .hero {
        padding: 0; /* remove extra vertical padding on tablets */
    }

    .hero-content h2 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    /* slightly increase overlay padding on tablets for breathing room */
    .carousel-overlay {
        padding: 1.75rem 0;
    }

    .tagline {
        font-size: 1.2rem;
    }

    section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .about-content p {
        font-size: 1rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about-card {
        padding: 1.5rem;
    }

    .events-grid {
        grid-template-columns: 1fr;
    }

    .event-card {
        flex-direction: row;
    }

    .event-date {
        min-width: 80px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .contact-card {
        padding: 1.5rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .event-form {
        padding: 1.5rem;
    }
}

/* Mobile Landscape and Small Tablets */
@media (max-width: 600px) {
    .hero-content h2 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .navbar .container {
        padding: 0 10px;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .nav-menu {
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.3rem 0.4rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero-content h2 {
        font-size: 1.5rem;
        padding: 0 10px;
    }

    .hero-content p {
        font-size: 0.95rem;
        padding: 0 10px;
    }

    .tagline {
        font-size: 1rem;
        padding: 0 10px;
    }

    section {
        padding: 2.5rem 0;
    }

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

    .section-title::after {
        width: 60px;
    }

    .about-content p {
        font-size: 0.95rem;
        text-align: left;
    }

    .about-grid {
        gap: 1.2rem;
    }

    .about-card,
    .contact-card {
        padding: 1.2rem;
    }

    .about-card h3,
    .contact-card h3 {
        font-size: 1.1rem;
    }

    .event-card {
        flex-direction: column;
    }

    .event-date {
        min-width: 100%;
        padding: 1rem;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }

    .event-date .day {
        font-size: 1.8rem;
    }

    .event-date .month {
        font-size: 1.2rem;
        display: flex;
        align-items: center;
    }

    .event-details {
        padding: 1.2rem;
    }

    .event-details h3 {
        font-size: 1.1rem;
    }

    .event-details p {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.7rem 1.3rem;
        font-size: 0.9rem;
    }

    .event-form {
        padding: 1.2rem;
    }

    .event-form h3 {
        font-size: 1.2rem;
    }

    .event-form input,
    .event-form textarea {
        padding: 0.65rem;
        font-size: 0.95rem;
    }

    .form-buttons {
        flex-direction: column;
    }

    .form-buttons .btn {
        width: 100%;
    }

    .admin-controls #adminPanel {
        flex-direction: column;
        gap: 0.8rem;
    }

    .admin-controls .btn {
        width: 100%;
        max-width: 300px;
    }

    .gallery-item img,
    .placeholder-img {
        height: 200px;
    }

    footer {
        padding: 1.5rem 0;
    }

    footer p {
        font-size: 0.9rem;
    }
}

/* Extra Small Devices */
@media (max-width: 360px) {
    .logo h1 {
        font-size: 1rem;
    }

    .nav-link {
        font-size: 0.8rem;
    }

    .hero-content h2 {
        font-size: 1.3rem;
    }

    .hero-content p,
    .tagline {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .about-card,
    .contact-card,
    .event-details {
        padding: 1rem;
    }
}
