/*
 * EduWave — Design System
 * KidZone-inspired: playful, colourful, child-friendly.
 */

/* ─────────────────────────────────────────────
   0. Self-hosted Comfortaa (variable font, weights 300–700)
───────────────────────────────────────────── */
@font-face {
    font-family: 'Comfortaa';
    src: url('../fonts/Comfortaa-VariableFont_wght.ttf') format('truetype');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

/* ─────────────────────────────────────────────
   1. CSS Custom Properties (design tokens)
───────────────────────────────────────────── */
:root {
    /* Brand colours */
    --color-yellow:      #FEC22F;
    --color-yellow-dark: #E5A800;
    --color-red:         #F05D5E;
    --color-red-dark:    #D44445;
    --color-blue:        #5DC5F1;
    --color-blue-dark:   #3AAEDD;
    --color-green:       #8CC63E;
    --color-green-dark:  #6FA82C;
    --color-purple:      #9B6BCC;

    /* Neutrals */
    --color-text:        #333333;
    --color-text-light:  #666666;
    --color-text-muted:  #999999;
    --color-bg:          #FFFDF5;
    --color-bg-alt:      #FFF3D8;
    --color-white:       #FFFFFF;
    --color-border:      #E8E0D0;

    /* Typography */
    --font-heading: 'Comfortaa', sans-serif;
    --font-body:    'Comfortaa', sans-serif;

    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.5rem;
    --text-3xl:  1.875rem;
    --text-4xl:  2.25rem;
    --text-5xl:  3rem;
    --text-6xl:  3.75rem;

    /* Spacing scale */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Borders */
    --radius-sm:   0.5rem;
    --radius-md:   1rem;
    --radius-lg:   1.5rem;
    --radius-xl:   2rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.15);
    --shadow-card: 0 6px 24px rgba(0,0,0,.10);

    /* Transitions */
    --transition-fast:   150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow:   400ms ease;

    /* Layout */
    --container-max: 1200px;
    --nav-height:    72px;
}

/* ─────────────────────────────────────────────
   2. Reset & Base
───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

button, input, textarea, select {
    font: inherit;
}

/* ─────────────────────────────────────────────
   3. Typography
───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

/* ─────────────────────────────────────────────
   4. Layout Utilities
───────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

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

.section--alt {
    background-color: var(--color-bg-alt);
}

/* Grid helpers */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.gap-4        { gap: var(--space-4); }
.gap-6        { gap: var(--space-6); }
.gap-8        { gap: var(--space-8); }

.text-center { text-align: center; }
.text-left   { text-align: left; }

/* ─────────────────────────────────────────────
   5. Buttons
───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: var(--text-base);
    cursor: pointer;
    transition: transform var(--transition-fast),
                box-shadow var(--transition-fast),
                background-color var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn:active { transform: translateY(0); }

.btn--primary {
    background-color: var(--color-yellow);
    color: var(--color-text);
    box-shadow: 0 4px 0 var(--color-yellow-dark);
}
.btn--primary:hover { background-color: var(--color-yellow-dark); }

.btn--red {
    background-color: var(--color-red);
    color: var(--color-white);
    box-shadow: 0 4px 0 var(--color-red-dark);
}
.btn--red:hover { background-color: var(--color-red-dark); }

.btn--blue {
    background-color: var(--color-blue);
    color: var(--color-white);
    box-shadow: 0 4px 0 var(--color-blue-dark);
}
.btn--blue:hover { background-color: var(--color-blue-dark); }

.btn--green {
    background-color: var(--color-green);
    color: var(--color-white);
    box-shadow: 0 4px 0 var(--color-green-dark);
}
.btn--green:hover { background-color: var(--color-green-dark); }

.btn--outline {
    background-color: transparent;
    border: 2px solid var(--color-yellow);
    color: var(--color-text);
}
.btn--outline:hover { background-color: var(--color-yellow); }

.btn--sm { padding: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.btn--lg { padding: var(--space-4) var(--space-8); font-size: var(--text-lg); }

/* ─────────────────────────────────────────────
   6. Cards
───────────────────────────────────────────── */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card__body {
    padding: var(--space-6);
}

.card__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.card__excerpt {
    color: var(--color-text-light);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

/* Coloured top-border variants */
.card--yellow { border-top: 5px solid var(--color-yellow); }
.card--red    { border-top: 5px solid var(--color-red); }
.card--blue   { border-top: 5px solid var(--color-blue); }
.card--green  { border-top: 5px solid var(--color-green); }

/* ─────────────────────────────────────────────
   7. Badges / Tags
───────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge--yellow { background: var(--color-yellow);  color: var(--color-text); }
.badge--red    { background: var(--color-red);     color: var(--color-white); }
.badge--blue   { background: var(--color-blue);    color: var(--color-white); }
.badge--green  { background: var(--color-green);   color: var(--color-white); }

/* ─────────────────────────────────────────────
   8. Section Headers
───────────────────────────────────────────── */
.section-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.section-header__eyebrow {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    color: var(--color-red);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-2);
}

.section-header__title {
    font-size: var(--text-4xl);
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

.section-header__subtitle {
    max-width: 560px;
    margin: 0 auto;
    color: var(--color-text-light);
    font-size: var(--text-lg);
}

/* ─────────────────────────────────────────────
   9. Wave Dividers
───────────────────────────────────────────── */
.wave-divider {
    display: block;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-divider svg {
    display: block;
    width: 100%;
}

/* ─────────────────────────────────────────────
   10. Forms
───────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    color: var(--color-text);
    background: var(--color-white);
    transition: border-color var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--color-yellow);
    box-shadow: 0 0 0 3px rgba(254, 194, 47, 0.25);
}

/* ─────────────────────────────────────────────
   11. Alerts / Flash messages
───────────────────────────────────────────── */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    font-size: var(--text-sm);
}

.alert--success { background: #D4EDDA; color: #155724; border-left: 4px solid var(--color-green); }
.alert--error   { background: #F8D7DA; color: #721C24; border-left: 4px solid var(--color-red); }
.alert--info    { background: #D1ECF1; color: #0C5460; border-left: 4px solid var(--color-blue); }

/* ─────────────────────────────────────────────
   12. Navigation
───────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    height: var(--nav-height);
}
.site-header .container {
    height: 100%;
}

.site-nav {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-nav__logo {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    color: var(--color-red);
}

.site-nav__logo span { color: var(--color-yellow); }

.site-nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.site-nav__link {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    color: var(--color-text);
    transition: color var(--transition-fast);
    position: relative;
}

.site-nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--color-yellow);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.site-nav__link:hover,
.site-nav__link--active {
    color: var(--color-red);
}

.site-nav__link:hover::after,
.site-nav__link--active::after {
    width: 100%;
}

.site-nav__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Mobile hamburger */
.site-nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
}

.site-nav__toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--color-text);
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* ─────────────────────────────────────────────
   13. Footer
───────────────────────────────────────────── */
.site-footer {
    background: #2D2D2D;
    color: #CCCCCC;
    padding: var(--space-16) 0 var(--space-8);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-10);
    margin-bottom: var(--space-10);
}

.site-footer__logo {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    color: var(--color-yellow);
    margin-bottom: var(--space-4);
}

.site-footer__logo span { color: var(--color-white); }

.site-footer__desc {
    font-size: var(--text-sm);
    line-height: 1.7;
    color: #AAAAAA;
}

.site-footer__heading {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--color-white);
    margin-bottom: var(--space-5);
}

.site-footer__links li {
    margin-bottom: var(--space-3);
}

.site-footer__links a {
    color: #AAAAAA;
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.site-footer__links a:hover { color: var(--color-yellow); }

.site-footer__bottom {
    border-top: 1px solid #444444;
    padding-top: var(--space-6);
    text-align: center;
    font-size: var(--text-sm);
    color: #777777;
}

/* ─────────────────────────────────────────────
   14. Responsive
───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    h1 { font-size: var(--text-4xl); }
    h2 { font-size: var(--text-3xl); }

    .grid-2,
    .grid-3,
    .grid-4 { grid-template-columns: 1fr; }

    .site-nav__links,
    .site-nav__actions { display: none; }

    .site-nav__links--open,
    .site-nav__actions--open { display: flex; }

    .site-nav__links--open {
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--color-white);
        padding: var(--space-6);
        box-shadow: var(--shadow-md);
        gap: var(--space-4);
    }

    .site-nav__toggle { display: flex; }

    .site-footer__grid { grid-template-columns: 1fr; gap: var(--space-8); }

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

@media (max-width: 480px) {
    .container { padding: 0 var(--space-4); }
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
}
