/* ==========================================================================
   Aparajito Courses Page Styles (WEB-INF/css/courses.css)
   Dedicated, responsive styling for the Courses page (/courses & /course).
   Comprises:
     - Design tokens, shared resets, and header navigation styles
     - Hero Banner: Solid Full-Width Black Banner (#000000)
     - Light Lavender-Blue Background (#C9CDED)
     - Section 1: Special Education (5-Image Gallery + Detailed Curriculum Benefits)
     - Section 2: Artology (Art Behind Science) (Portrait Media + Text)
     - Section 3: Games (5-Image Sports Gallery + Description)
     - Section 4: Vocational Training (Portrait Media + Description)
     - Section 5: Therapy - Occupational & Speech (Dual Balanced Profiles)
     - Mobile Navigation & Responsive Media Queries
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design System & CSS Variables
   -------------------------------------------------------------------------- */
:root {
    /* Color Palette */
    --color-primary: #3b5998;
    --color-primary-hover: #2d4373;
    --color-primary-light: #eef2fb;
    --color-text-dark: #111111;
    --color-text-body: #1a1e26;
    --color-text-muted: #4b5262;
    --color-header-bg: #fdfdfd;
    --color-header-border: #ececee;

    /* Theme Palette for Courses Page Content */
    --color-courses-bg: #c9cded;          /* Authentic light lavender-blue matching reference */
    --color-courses-title: #000000;
    --color-courses-text: #1a1e24;
    --color-banner-bg: #000000;

    /* Typography */
    --font-heading: 'Roboto Condensed', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

    /* Layout & Sizing */
    --container-max-width: 1280px;
    --transition-fast: 0.18s ease;
    --transition-normal: 0.28s ease;
}

/* --------------------------------------------------------------------------
   2. Global Resets & Document Defaults
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--color-courses-text);
    background-color: var(--color-courses-bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Accessible Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 10px;
    background: #000000;
    color: #ffffff;
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 10px;
}

/* Container Utility */
.courses-container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 3.5vw, 2.5rem);
}

/* --------------------------------------------------------------------------
   3. Shared Header Navigation Bar (header.jsp)
   -------------------------------------------------------------------------- */
.site-header {
    width: 100%;
    background-color: var(--color-header-bg);
    border-bottom: 1px solid var(--color-header-border);
    position: relative;
    z-index: 100;
}

.header-inner {
    max-width: 1380px;
    margin: 0 auto;
    padding: 10px clamp(1.25rem, 3.5vw, 2.75rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.header-logo-area {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    outline: none;
}

.site-logo-img {
    display: block;
    width: auto;
    height: 95px;
    max-height: 105px;
    object-fit: contain;
    transition: transform var(--transition-fast, 0.2s ease);
}

.site-logo-img:hover {
    transform: scale(1.03);
}

/* Reusable Header Logo Placeholder */
.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.logo-placeholder-frame {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: 2px solid #111111;
    border-radius: 4px;
    padding: 6px 14px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.logo-symbol-glyph {
    color: var(--color-primary);
    font-size: 1.1rem;
    line-height: 1;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.08em;
    color: #111111;
}

.logo-badge-label {
    position: absolute;
    bottom: -7px;
    background: #ffd166;
    color: #111111;
    font-size: 0.48rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 2px;
    letter-spacing: 0.05em;
    border: 1px solid #111111;
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: clamp(1.2rem, 2.2vw, 2.6rem);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: inline-block;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    font-weight: 500;
    color: var(--color-text-dark);
    text-decoration: none;
    padding: 6px 2px;
    position: relative;
    transition: color var(--transition-fast);
    outline: none;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link.active {
    color: #4747d7;
    font-weight: 700;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #4747d7;
    border-radius: 2px;
}

.nav-link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Header Right Area: Social Icons & 10th Anniversary */
.header-right-area {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-shrink: 0;
}

.social-placeholders-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.social-placeholder-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f1f3f7;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.social-placeholder-item:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    transform: translateY(-2px);
}

.social-placeholder-item.youtube:hover {
    background-color: #ff0000;
}

.social-placeholder-item.facebook:hover {
    background-color: #1877f2;
}

.social-placeholder-item.instagram:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.social-placeholder-item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

.social-icon-svg {
    display: block;
}

/* 10th Anniversary Badge Area */
.anniversary-badge-area {
    display: flex;
    align-items: center;
}

.anniversary-badge-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffe082 0%, #ffb300 70%, #d89600 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(184, 134, 11, 0.4);
    border: 1.5px solid #fff8e1;
    cursor: default;
    transition: transform var(--transition-fast);
}

.anniversary-badge-placeholder:hover {
    transform: scale(1.05);
}

.badge-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}

.badge-number {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    color: #4a2c00;
    letter-spacing: -0.02em;
}

.badge-ordinal {
    font-size: 0.55rem;
    font-weight: 700;
    vertical-align: super;
}

.badge-subtext {
    font-size: 0.44rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #5d3800;
    margin-top: 1px;
}

/* Mobile Hamburger Toggle */
.hamburger-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 38px;
    height: 38px;
    background: #f1f3f7;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    padding: 8px 7px;
    box-sizing: border-box;
    transition: background-color var(--transition-fast);
}

.hamburger-toggle:hover {
    background-color: #e2e8f0;
}

.hamburger-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.hamburger-bar {
    width: 100%;
    height: 3px;
    background-color: var(--color-text-dark);
    border-radius: 3px;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
    display: none;
}

/* --------------------------------------------------------------------------
   4. Courses Hero Banner (Solid Full-Width Black #000000)
   -------------------------------------------------------------------------- */
.courses-hero-banner {
    width: 100%;
    background-color: var(--color-banner-bg);
    min-height: 290px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
    position: relative;
    box-sizing: border-box;
}

.courses-hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.75rem, 6.2vw, 5.25rem); /* ~44px on mobile up to 84px on desktop */
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   5. Courses Main Content Wrapper
   -------------------------------------------------------------------------- */
.courses-content-wrapper {
    width: 100%;
    background-color: var(--color-courses-bg);
    padding: clamp(3rem, 5.5vw, 5rem) 0 clamp(4rem, 6.5vw, 6.5rem) 0;
}

/* Generic Course Section Spacing */
.course-section {
    width: 100%;
    padding: clamp(2.5rem, 4vw, 4rem) 0;
    position: relative;
}

.course-section:first-child {
    padding-top: 0.5rem;
}

/* Main Section Heading */
.course-section-title {
    font-family: var(--font-heading);
    font-size: clamp(2.1rem, 3.4vw, 3.4rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--color-courses-title);
    margin: 0 0 clamp(1.75rem, 2.5vw, 2.5rem) 0;
    letter-spacing: -0.015em;
    text-align: left;
}

/* Two-column layout grid */
.course-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4.5vw, 4.75rem);
    align-items: start;
}

/* --------------------------------------------------------------------------
   6. Section One: Special Education Gallery & Detailed Curriculum
   -------------------------------------------------------------------------- */
.sp-education-section .course-section-title {
    margin-bottom: clamp(1.75rem, 2.5vw, 2.5rem);
}

/* Left Gallery Column: 2-column Grid with 5th image in col 1 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(10px, 1.2vw, 16px);
    width: 100%;
}

.gallery-item {
    background-color: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Aspect ratio handling for Special Education gallery */
.sp-education-gallery .gallery-item.item-1,
.sp-education-gallery .gallery-item.item-2,
.sp-education-gallery .gallery-item.item-3,
.sp-education-gallery .gallery-item.item-4 {
    aspect-ratio: 4 / 3;
}

.sp-education-gallery .gallery-item.item-5 {
    grid-column: 1;
    aspect-ratio: 3 / 4; /* Portrait 5th image matching reference */
}

/* Right Content Column: Introductory Paragraph + 4 Numbered Benefits */
.content-col {
    display: flex;
    flex-direction: column;
}

.section-intro-text {
    font-family: var(--font-body);
    font-size: clamp(1.02rem, 1.15vw, 1.125rem);
    line-height: 1.7;
    color: var(--color-courses-text);
    margin: 0 0 clamp(1.5rem, 2.2vw, 2.25rem) 0;
}

.benefit-subsections {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 2.2vw, 2.25rem);
}

.benefit-block {
    display: flex;
    flex-direction: column;
}

.benefit-title {
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 1.8vw, 1.85rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-courses-title);
    margin: 0 0 0.65rem 0;
    letter-spacing: -0.01em;
}

.benefit-desc {
    font-family: var(--font-body);
    font-size: clamp(0.98rem, 1.1vw, 1.08rem);
    line-height: 1.7;
    color: var(--color-courses-text);
    margin: 0;
}

/* --------------------------------------------------------------------------
   7. Section Two & Four: Single Media + Text Grid (Artology & Vocational)
   -------------------------------------------------------------------------- */
.media-text-grid {
    align-items: center; /* Vertically align text around the middle of portrait image */
}

.single-media-col {
    display: flex;
    justify-content: flex-start;
}

.portrait-img-card {
    width: 100%;
    max-width: 415px; /* Approx 400-420px wide on desktop per requirement */
    background-color: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.portrait-img-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
}

.portrait-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.media-text-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.course-section-desc {
    font-family: var(--font-body);
    font-size: clamp(1.02rem, 1.15vw, 1.125rem);
    line-height: 1.75;
    color: var(--color-courses-text);
    margin: 0;
}

/* --------------------------------------------------------------------------
   8. Section Three: Games Gallery
   -------------------------------------------------------------------------- */
.games-grid {
    align-items: center;
}

.games-gallery .gallery-item.item-1,
.games-gallery .gallery-item.item-2 {
    aspect-ratio: 3 / 4; /* Portrait top row images matching reference */
}

.games-gallery .gallery-item.item-3,
.games-gallery .gallery-item.item-4 {
    aspect-ratio: 4 / 3; /* Landscape middle row images */
}

.games-gallery .gallery-item.item-5 {
    grid-column: 1;
    aspect-ratio: 3 / 4; /* Portrait bottom image */
}

/* --------------------------------------------------------------------------
   9. Section Five: Therapy (Occupational & Speech Dual Balanced Profiles)
   -------------------------------------------------------------------------- */
.therapy-section {
    padding-bottom: 1rem;
}

.therapy-main-heading {
    text-align: left;
    margin-bottom: clamp(2rem, 3.5vw, 3.5rem);
}

.therapy-profiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(2.5rem, 5vw, 5.5rem);
    align-items: start;
}

.therapist-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.therapist-img-wrapper {
    width: 100%;
    max-width: 280px;
    background-color: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.therapist-img-wrapper:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.therapist-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.therapist-service-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 2.2vw, 2.15rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-courses-title);
    margin: 0 0 1rem 0;
}

.therapist-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.therapist-name {
    font-family: var(--font-body);
    font-size: clamp(1.05rem, 1.2vw, 1.22rem);
    font-weight: 700;
    color: var(--color-courses-title);
    margin: 0;
}

.therapist-role {
    font-family: var(--font-body);
    font-size: clamp(0.98rem, 1.1vw, 1.1rem);
    font-weight: 700;
    color: var(--color-courses-title);
    margin: 0;
}

/* --------------------------------------------------------------------------
   10. Responsive Media Queries
   -------------------------------------------------------------------------- */

/* Tablet & Intermediate Desktop (992px to 1199px) */
@media (max-width: 1199px) {
    .course-two-col {
        gap: clamp(1.75rem, 3vw, 2.75rem);
    }

    .portrait-img-card {
        max-width: 360px;
    }
}

/* Tablet Screens (768px to 991px) */
@media (max-width: 991px) {
    .header-inner {
        padding: 10px 1.25rem;
    }

    .desktop-nav {
        display: none;
    }

    .hamburger-toggle {
        display: flex;
    }

    .mobile-nav-drawer {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
    }

    .mobile-nav-drawer[hidden] {
        display: none;
    }

    .mobile-nav-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
    }

    .mobile-nav-panel {
        position: absolute;
        top: 0;
        right: 0;
        width: min(320px, 85vw);
        height: 100%;
        background-color: #ffffff;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.25);
        display: flex;
        flex-direction: column;
        padding: 1.5rem;
        box-sizing: border-box;
        overflow-y: auto;
    }

    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 1rem;
        border-bottom: 1px solid #e2e8f0;
        margin-bottom: 1.5rem;
    }

    .mobile-nav-title {
        font-family: var(--font-heading);
        font-weight: 700;
        font-size: 1.35rem;
        color: #111111;
    }

    .mobile-nav-close {
        background: transparent;
        border: none;
        font-size: 1.85rem;
        line-height: 1;
        cursor: pointer;
        color: #4b5563;
        padding: 4px;
        transition: color var(--transition-fast);
    }

    .mobile-nav-close:hover {
        color: #000000;
    }

    .mobile-nav-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .mobile-nav-link {
        display: block;
        padding: 10px 14px;
        font-size: 1.05rem;
        font-weight: 600;
        color: #1f2937;
        text-decoration: none;
        border-radius: 6px;
        transition: background-color var(--transition-fast), color var(--transition-fast);
    }

    .mobile-nav-link:hover,
    .mobile-nav-link.active {
        background-color: #eef2fb;
        color: var(--color-primary);
    }

    .mobile-nav-footer {
        margin-top: auto;
        padding-top: 1.5rem;
        border-top: 1px solid #e2e8f0;
    }

    .mobile-social-group {
        display: flex;
        gap: 0.75rem;
        justify-content: center;
    }

    /* Stack sections that get too cramped on mid screens */
    .course-two-col {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .portrait-img-card {
        max-width: 400px;
        margin: 0 auto;
    }

    .single-media-col {
        justify-content: center;
    }
}

/* Mobile Screens (Below 768px) */
@media (max-width: 767px) {
    .courses-hero-banner {
        min-height: 220px;
        padding: 2rem 1rem;
    }

    .courses-hero-title {
        font-size: clamp(2.4rem, 10vw, 3.25rem); /* 42px - 52px */
    }

    .courses-content-wrapper {
        padding: 2.5rem 0 3.5rem 0;
    }

    .course-section {
        padding: 2rem 0;
    }

    .course-section-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    /* Keep 2-column gallery on mobile, but stack sections */
    .gallery-grid {
        gap: 8px;
    }

    .portrait-img-card {
        max-width: 100%;
    }

    /* Stack therapy profiles vertically: Occupational first, Speech second */
    .therapy-profiles-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .therapist-img-wrapper {
        max-width: 240px;
    }
}
