/* =================================================================
   SSELC Design System
   Tokens first, then base styles. All other CSS files reference
   these CSS custom properties — never hardcode colors.
   ================================================================= */

:root {
    /* === Brand colors === */
    --color-primary: #081f62;          /* SSELC navy */
    --color-primary-dark: #050f3a;     /* deeper navy for hover/active */
    --color-primary-light: #3a4f99;    /* mid-blue for borders/secondary */
    --color-primary-tint: #EEF1F9;     /* very pale blue background wash */

    --color-accent: #8BB39B;           /* sage — calm educational accent */
    --color-accent-dark: #6F9580;
    --color-accent-tint: #EEF4EF;

    /* Legacy sage alias (kept for any direct references) */
    --color-sage: #8BB39B;
    --color-sage-tint: #EEF4EF;

    /* Brand gradient — navy with a sage hand-off */
    --gradient-brand: linear-gradient(135deg, #081f62 0%, #3a4f99 100%);
    --gradient-brand-soft: linear-gradient(135deg, #EEF1F9 0%, #EEF4EF 100%);
    --gradient-warm: linear-gradient(135deg, #FAF7F2 0%, #FDF6F2 100%);

    /* === Neutrals === */
    --color-text: #2D3748;             /* deep slate */
    --color-text-muted: #5A6477;
    --color-text-light: #94A3B8;
    --color-text-on-brand: #FFFFFF;

    --color-bg: #FFFFFF;
    --color-bg-soft: #FAF7F2;          /* warm cream */
    --color-bg-alt: #F5F1EA;
    --color-bg-tint: #FDF6F2;

    --color-border: #E8E2D8;
    --color-border-strong: #D6CFC2;

    /* === Status === */
    --color-success: #5BB89F;
    --color-error: #D9614A;
    --color-warning: #E0A458;

    /* === Typography === */
    --font-body: 'Poppins', 'Noto Sans Myanmar', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Quicksand', 'Noto Sans Myanmar', system-ui, sans-serif;

    --fs-xs: 0.8rem;
    --fs-sm: 0.9rem;
    --fs-base: 1rem;
    --fs-md: 1.1rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 1.875rem;
    --fs-3xl: 2.25rem;
    --fs-4xl: 2.75rem;

    --lh-tight: 1.2;
    --lh-snug: 1.4;
    --lh-base: 1.6;
    --lh-relaxed: 1.75;

    /* === Spacing (8px base) === */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 2.5rem;
    --sp-8: 3rem;
    --sp-10: 4rem;
    --sp-12: 5rem;
    --sp-14: 6rem;

    /* === Radius === */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    /* === Shadows (soft, layered) === */
    --shadow-xs: 0 1px 2px rgba(45, 55, 72, 0.04);
    --shadow-sm: 0 1px 3px rgba(45, 55, 72, 0.05), 0 2px 6px rgba(45, 55, 72, 0.04);
    --shadow-md: 0 4px 12px rgba(45, 55, 72, 0.06), 0 8px 20px rgba(45, 55, 72, 0.05);
    --shadow-lg: 0 6px 16px rgba(45, 55, 72, 0.07), 0 16px 40px rgba(45, 55, 72, 0.07);
    --shadow-brand: 0 8px 24px rgba(8, 31, 98, 0.28);

    /* === Motion === */
    --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* === Layout === */
    --max-w-content: 1140px;
    --max-w-text: 720px;
    --header-height: 72px;
}

/* Respect users who don't want motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =================================================================
   Base
   ================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: var(--lh-base);
    color: var(--color-text);
    background: var(--color-bg);
    font-size: var(--fs-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--t-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-text);
    line-height: var(--lh-tight);
    letter-spacing: -0.01em;
    font-weight: 600;
}

p {
    margin: 0;
}

/* Larger touch targets on mobile */
button,
[role="button"],
input[type="submit"],
input[type="button"] {
    min-height: 44px;
    font-family: inherit;
}

/* =================================================================
   Header & Navigation
   ================================================================= */

/* IMPORTANT: scoped to .site-header (the nav bar). A bare `header` selector
   would also stick every <header class="section-header"> in the page. */
.site-header {
    background: var(--color-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: var(--max-w-content);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-4) var(--sp-6);
    min-height: var(--header-height);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: opacity var(--t-fast);
}

.logo:hover {
    color: var(--color-primary);
    opacity: 0.85;
}

.logo-img {
    height: 44px;
    width: auto;
    display: block;
}

.logo-text {
    line-height: 1;
}

@media (max-width: 480px) {
    .logo-img {
        height: 36px;
    }
    .logo-text {
        display: none;  /* keep just the mark on small screens to save space */
    }
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--sp-7);
}

.nav-links a {
    color: var(--color-text);
    font-weight: 500;
    font-size: var(--fs-sm);
    transition: color var(--t-fast);
}

.nav-links a:hover {
    color: var(--color-primary);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: var(--sp-2);
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    margin: 3px 0;
    border-radius: 2px;
    transition: var(--t-base);
}

/* =================================================================
   Hero (legacy block — current hero lives in hero.css)
   Keeping these so old pages that still reference .hero work.
   ================================================================= */

.hero {
    background: var(--gradient-brand);
    color: var(--color-text-on-brand);
    text-align: center;
    padding: var(--sp-12) var(--sp-6);
}

.hero h1 {
    font-size: var(--fs-4xl);
    margin-bottom: var(--sp-4);
    color: inherit;
}

.hero p {
    font-size: var(--fs-md);
    margin-bottom: var(--sp-7);
    opacity: 0.95;
}

.cta-button {
    background: var(--color-bg);
    color: var(--color-primary);
    padding: var(--sp-4) var(--sp-7);
    text-decoration: none;
    border-radius: var(--radius-pill);
    font-size: var(--fs-base);
    font-weight: 600;
    display: inline-block;
    transition: transform var(--t-base), box-shadow var(--t-base);
    box-shadow: var(--shadow-md);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--color-primary-dark);
}

/* =================================================================
   Stats
   ================================================================= */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--sp-6);
    max-width: var(--max-w-content);
    margin: var(--sp-10) auto;
    padding: 0 var(--sp-6);
    text-align: center;
}

.stat-box {
    padding: var(--sp-7) var(--sp-5);
    background: var(--color-bg-soft);
    border-radius: var(--radius-lg);
    transition: transform var(--t-base), box-shadow var(--t-base);
    border: 1px solid var(--color-border);
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-box h3 {
    font-size: var(--fs-3xl);
    color: var(--color-primary);
    margin-bottom: var(--sp-2);
    font-weight: 700;
}

.stat-box p {
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
}

/* =================================================================
   Features
   ================================================================= */

.features {
    background: var(--color-bg-soft);
    padding: var(--sp-10) var(--sp-6);
}

.features h2 {
    text-align: center;
    font-size: var(--fs-3xl);
    margin-bottom: var(--sp-8);
    color: var(--color-text);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-6);
    max-width: var(--max-w-content);
    margin: 0 auto;
}

.feature-card {
    background: var(--color-bg);
    padding: var(--sp-7);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-base), box-shadow var(--t-base);
    border: 1px solid var(--color-border);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-brand);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--sp-5);
    font-size: 1.8rem;
    color: var(--color-text-on-brand);
}

.feature-card h3 {
    font-size: var(--fs-lg);
    margin-bottom: var(--sp-3);
    color: var(--color-text);
}

.feature-card p {
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    line-height: var(--lh-base);
}

/* =================================================================
   About
   ================================================================= */

.about {
    max-width: var(--max-w-content);
    margin: var(--sp-10) auto;
    padding: 0 var(--sp-6);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
    align-items: center;
}

.about-content h2 {
    font-size: var(--fs-3xl);
    margin-bottom: var(--sp-5);
    color: var(--color-text);
}

.about-content p {
    margin-bottom: var(--sp-4);
    color: var(--color-text-muted);
    font-size: var(--fs-md);
    line-height: var(--lh-relaxed);
}

.about-image {
    height: 380px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback styling when no image is uploaded in Strapi */
.about-image-placeholder {
    background: var(--gradient-brand-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.about-image-fallback {
    font-size: 3rem;
    color: var(--color-primary);
}

/* =================================================================
   Gallery
   ================================================================= */

.gallery {
    background: var(--color-bg-soft);
    padding: var(--sp-10) var(--sp-6);
}

.gallery h2 {
    text-align: center;
    font-size: var(--fs-3xl);
    margin-bottom: var(--sp-8);
    color: var(--color-text);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--sp-4);
    max-width: var(--max-w-content);
    margin: 0 auto;
}

.gallery-item {
    background: var(--gradient-brand-soft);
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: var(--fs-md);
    transition: transform var(--t-base), box-shadow var(--t-base);
    cursor: pointer;
    overflow: hidden;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* =================================================================
   Testimonials
   ================================================================= */

.testimonials {
    max-width: var(--max-w-content);
    margin: var(--sp-10) auto;
    padding: 0 var(--sp-6);
}

.testimonials h2 {
    text-align: center;
    font-size: var(--fs-3xl);
    margin-bottom: var(--sp-8);
    color: var(--color-text);
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--sp-6);
}

.testimonial-card {
    background: var(--color-bg);
    padding: var(--sp-7);
    border-left: 3px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
    transition: box-shadow var(--t-base), transform var(--t-base);
}

.testimonial-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: var(--sp-4);
    color: var(--color-text-muted);
    line-height: var(--lh-relaxed);
}

.testimonial-author {
    font-weight: 600;
    color: var(--color-text);
    font-size: var(--fs-sm);
}

/* =================================================================
   Contact
   ================================================================= */

.contact {
    background: var(--gradient-brand);
    color: var(--color-text-on-brand);
    padding: var(--sp-10) var(--sp-6);
    text-align: center;
}

.contact h2 {
    font-size: var(--fs-3xl);
    margin-bottom: var(--sp-4);
    color: inherit;
}

.contact p {
    font-size: var(--fs-md);
    margin-bottom: var(--sp-7);
    opacity: 0.95;
}

/* =================================================================
   Footer
   ================================================================= */

footer {
    background: var(--color-text);
    color: var(--color-text-on-brand);
    text-align: center;
    padding: var(--sp-7) var(--sp-6);
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
}

footer a {
    color: var(--color-primary-light);
}

footer a:hover {
    color: var(--color-primary);
}

/* =================================================================
   Responsive
   ================================================================= */

@media (max-width: 768px) {
    body {
        font-size: 1.0625rem; /* 17px on mobile for readability */
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-bg);
        flex-direction: column;
        padding: var(--sp-5);
        box-shadow: var(--shadow-md);
        display: none;
        gap: var(--sp-3);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: var(--sp-3) 0;
        font-size: var(--fs-base);
    }

    .hero {
        padding: var(--sp-8) var(--sp-4);
    }

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

    .about {
        grid-template-columns: 1fr;
        gap: var(--sp-6);
    }

    .about-image {
        height: 280px;
    }

    .features,
    .gallery,
    .contact {
        padding: var(--sp-8) var(--sp-4);
    }

    .stats {
        margin: var(--sp-7) auto;
    }
}

/* =================================================================
   Section header (shared, used by every section that has a title)
   Left-aligned, brand-accent bar — grounded, not floating.
   ================================================================= */

.section-header {
    margin-bottom: var(--sp-7);
    max-width: var(--max-w-text);
}

.section-header-title {
    font-size: var(--fs-2xl);
    line-height: var(--lh-tight);
    color: var(--color-text);
    margin: 0 0 var(--sp-3);
    position: relative;
    padding-left: var(--sp-4);
    font-weight: 600;
}

.section-header-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25em;
    bottom: 0.25em;
    width: 4px;
    border-radius: 2px;
    background: var(--color-primary);
}

.section-header-description {
    font-size: var(--fs-base);
    color: var(--color-text-muted);
    line-height: var(--lh-base);
    margin: 0;
    padding-left: calc(var(--sp-4) + 4px); /* align with title text after the bar */
}

@media (max-width: 600px) {
    .section-header-title {
        font-size: var(--fs-xl);
    }
}

/* =================================================================
   Utilities
   ================================================================= */

.container {
    max-width: var(--max-w-content);
    margin: 0 auto;
    padding: 0 var(--sp-6);
}

.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.bg-soft { background: var(--color-bg-soft); }
