/* ========================================
   MY HAPPY LITTLE SCHOOL - Responsive
   Whimsical Design - Mobile-First Approach
   ======================================== */

/* ===== Large Desktop (1280px+) ===== */
@media screen and (min-width: 1280px) {
    .container {
        padding: 0 var(--spacing-lg);
    }

    .hero__container {
        gap: var(--spacing-xxl);
    }
}

/* ===== Desktop (1024px - 1279px) ===== */
@media screen and (max-width: 1279px) {
    .hero__container {
        gap: var(--spacing-xl);
    }

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

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

    .services__grid,
    .press__grid,
    .values__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer__content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

/* ===== Tablet (768px - 1023px) ===== */
@media screen and (max-width: 1023px) {
    :root {
        --header-height: 80px;
    }

    /* Navigation Mobile */
    .nav__menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 380px;
        height: 100vh;
        background: linear-gradient(180deg, var(--color-cream-bg) 0%, var(--color-lavender) 100%);
        backdrop-filter: var(--glass-blur);
        box-shadow: -8px 0 40px rgba(107, 91, 149, 0.2);
        padding: 7rem var(--spacing-lg) var(--spacing-lg);
        transition: right 0.5s var(--ease-out-back);
        z-index: 1001;
        overflow-y: auto;
    }

    .nav__menu.show-menu {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .nav__link {
        font-size: 1.25rem;
        font-weight: 600;
    }

    .nav__link::after {
        display: none;
    }

    .nav__link--cta {
        width: 100%;
        text-align: center;
        margin-top: var(--spacing-md);
    }

    /* Dropdown on mobile */
    .nav__item--dropdown {
        position: static;
    }

    .nav__link--dropdown::after {
        content: '+';
        font-size: 1rem;
    }

    .nav__dropdown {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        background: var(--glass-bg);
        margin-top: var(--spacing-xs);
        border-radius: var(--radius-md);
        border: 1px solid var(--glass-border);
    }

    .nav__dropdown a {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .nav__close {
        display: flex;
        position: absolute;
        top: var(--spacing-lg);
        right: var(--spacing-lg);
        width: 48px;
        height: 48px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        background: var(--glass-bg);
        border-radius: var(--radius-full);
        border: 1px solid var(--glass-border);
        transition: all var(--transition-normal);
    }

    .nav__close:hover {
        background: var(--color-lavender);
        transform: rotate(90deg);
    }

    .nav__toggle {
        display: flex;
        width: 48px;
        height: 48px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        background: var(--glass-bg);
        border-radius: var(--radius-md);
        border: 1px solid var(--glass-border);
        transition: all var(--transition-normal);
    }

    .nav__toggle:hover {
        background: var(--color-lavender);
    }

    /* Hero */
    .hero__container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero__content {
        order: 2;
    }

    .hero__image {
        order: 1;
        max-width: 420px;
        margin: 0 auto;
    }

    .hero__image-wrapper {
        transform: rotate(0deg);
    }

    .hero__subtitle {
        justify-content: center;
    }

    .hero__badges {
        justify-content: center;
    }

    .hero__buttons {
        justify-content: center;
    }

    .hero__quote-main {
        text-align: center;
        border-left: none;
        padding-left: 0;
        border-top: 4px solid var(--color-lavender);
        padding-top: var(--spacing-sm);
    }

    /* About */
    .about__content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .about__image {
        max-width: 380px;
        margin: 0 auto;
    }

    .about__image-wrapper {
        transform: rotate(0deg);
    }

    .about__text {
        text-align: center;
    }

    .about__description--highlight {
        text-align: left;
    }

    .about__values {
        justify-content: center;
    }

    /* Courses */
    .courses__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Camps */
    .camps__content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Testimonials */
    .testimonial-card {
        flex: 0 0 calc(100% - var(--spacing-sm));
    }

    /* Booking */
    .booking__content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Footer */
    .footer__content {
        grid-template-columns: 1fr 1fr;
    }

    .footer::before {
        top: -40px;
        height: 60px;
    }
}

/* ===== Mobile Large (576px - 767px) ===== */
@media screen and (max-width: 767px) {
    :root {
        --spacing-xxl: 4rem;
        --spacing-xl: 3rem;
    }

    /* Typography adjustments */
    .section__title {
        font-size: 1.875rem;
    }

    .hero__title {
        font-size: 2.25rem;
    }

    /* Bubbles - reduce on mobile */
    .bubble {
        filter: blur(80px);
        opacity: 0.35;
    }

    .bubble--1 { width: 250px; height: 250px; }
    .bubble--2 { width: 200px; height: 200px; }
    .bubble--3 { width: 150px; height: 150px; }
    .bubble--4 { width: 200px; height: 200px; }
    .bubble--5, .bubble--6 { display: none; }

    /* Method */
    .method__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .method__card {
        padding: var(--spacing-lg);
    }

    /* Courses */
    .courses__grid {
        grid-template-columns: 1fr;
    }

    /* Community */
    .community__events {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }

    /* Services, Press, Values */
    .services__grid,
    .press__grid,
    .values__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .service-card,
    .press-card,
    .value-card {
        padding: var(--spacing-lg);
    }

    /* Footer */
    .footer__content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer__brand {
        margin-bottom: var(--spacing-lg);
    }

    .footer__logo {
        margin: 0 auto var(--spacing-sm);
    }

    .footer__social-links {
        justify-content: center;
    }

    .footer__bottom {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }

    .footer::before {
        top: -30px;
        height: 50px;
    }
}

/* ===== Mobile (max 575px) ===== */
@media screen and (max-width: 575px) {
    :root {
        --header-height: 70px;
        --spacing-xxl: 3.5rem;
        --spacing-xl: 2.5rem;
    }

    /* Container */
    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Logo */
    .nav__logo-img {
        height: 50px;
    }

    /* Hero */
    .hero {
        padding-top: calc(var(--header-height) + var(--spacing-lg));
        min-height: auto;
        padding-bottom: var(--spacing-xl);
    }

    .hero::before {
        height: 100px;
        bottom: -50px;
    }

    .hero__title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero__description {
        font-size: 1rem;
    }

    .hero__quote-main {
        font-size: 1.0625rem;
    }

    .hero__buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero__buttons .btn {
        width: 100%;
    }

    .hero__image {
        max-width: 300px;
    }

    .hero__badges {
        flex-direction: column;
        align-items: center;
    }

    .badge {
        width: 100%;
        max-width: 220px;
        justify-content: center;
    }

    /* Shapes - smaller on mobile */
    .shape--1 {
        width: 120px;
        height: 120px;
        top: 10%;
        right: -40px;
    }

    .shape--2 {
        width: 80px;
        height: 80px;
        bottom: 30%;
        left: -20px;
    }

    .shape--3 {
        width: 60px;
        height: 60px;
    }

    /* Section */
    .section {
        padding: var(--spacing-xl) 0;
    }

    .section__header {
        margin-bottom: var(--spacing-lg);
    }

    .section__subtitle {
        font-size: 0.8125rem;
        padding: 0.375rem 1rem;
    }

    /* About */
    .about__image {
        max-width: 280px;
    }

    .about__values {
        flex-direction: column;
        align-items: center;
    }

    .value {
        width: 100%;
        max-width: 220px;
        justify-content: center;
    }

    /* Method */
    .method__icon {
        font-size: 3rem;
    }

    .method__cta {
        padding: var(--spacing-md);
    }

    .method__cta-text {
        font-size: 1rem;
    }

    /* Course cards */
    .course-card__header {
        padding: var(--spacing-md);
    }

    .course-card__body {
        padding: var(--spacing-md);
    }

    .course-card__badge {
        font-size: 0.6875rem;
        padding: 0.25rem 0.75rem;
    }

    /* Camps */
    .camps__activities {
        justify-content: center;
    }

    .activity {
        font-size: 0.8125rem;
        padding: 0.5rem 0.875rem;
    }

    .camps__card {
        padding: var(--spacing-lg);
    }

    /* Community */
    .community__events {
        grid-template-columns: 1fr;
    }

    .event {
        padding: var(--spacing-md);
    }

    .event__icon {
        font-size: 2.5rem;
    }

    /* Testimonials */
    .testimonial-card {
        padding: var(--spacing-md);
    }

    .testimonial-card::before {
        font-size: 3rem;
    }

    .testimonial-card__text {
        font-size: 1rem;
    }

    .testimonials__btn {
        width: 44px;
        height: 44px;
    }

    /* Booking */
    .booking__card {
        padding: var(--spacing-md);
    }

    .booking__steps li {
        align-items: flex-start;
    }

    .step__number {
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        font-size: var(--fs-small);
    }

    .calendly-placeholder {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    /* Social links */
    .social-link {
        width: 48px;
        height: 48px;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-xl) 0 var(--spacing-md);
    }

    .footer::before {
        top: -20px;
        height: 40px;
    }

    .footer__logo {
        width: 70px;
        height: 70px;
    }

    .footer__tagline {
        font-size: 1.125rem;
    }

    .footer__title {
        font-size: 0.875rem;
    }

    .footer__copyright,
    .footer__legal {
        font-size: 0.8125rem;
    }

    .footer__social-links a {
        width: 40px;
        height: 40px;
    }
}

/* ===== Very Small Mobile (max 359px) ===== */
@media screen and (max-width: 359px) {
    :root {
        --header-height: 60px;
    }

    .hero__title {
        font-size: 1.75rem;
    }

    .section__title {
        font-size: 1.5rem;
    }

    .nav__logo-img {
        height: 44px;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }

    .badge {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .method__icon,
    .service-card__icon,
    .press-card__logo {
        font-size: 2.5rem;
    }
}

/* ===== Landscape Mode on Mobile ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--spacing-md)) 0 var(--spacing-md);
    }

    .hero::before {
        display: none;
    }

    .hero__container {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }

    .hero__content {
        order: 1;
    }

    .hero__image {
        order: 2;
        max-width: 200px;
    }

    .hero__badges {
        flex-direction: row;
        justify-content: flex-start;
    }

    .hero__buttons {
        flex-direction: row;
        justify-content: flex-start;
    }
}

/* ===== Print Styles ===== */
@media print {
    .header,
    .hero__shapes,
    .bubbles-container,
    .nav__toggle,
    .testimonials__nav,
    .social-links,
    .booking__calendly {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding-top: 0;
        background: none !important;
    }

    .hero::before {
        display: none;
    }

    .section {
        page-break-inside: avoid;
        padding: var(--spacing-lg) 0;
        background: none !important;
    }

    .footer::before {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: white !important;
    }

    .section__title,
    .hero__title-highlight {
        background: none !important;
        -webkit-text-fill-color: #000 !important;
        color: #000 !important;
    }

    a {
        text-decoration: underline;
    }

    .btn {
        border: 2px solid #000;
        background: none !important;
        color: #000 !important;
    }

    .method__card,
    .course-card,
    .service-card,
    .press-card,
    .value-card,
    .testimonial-card {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #4A0080;
        --color-text: #000000;
        --color-text-light: #333333;
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .btn--secondary,
    .btn--outline {
        border-width: 3px;
    }

    .nav__link::after {
        height: 4px;
    }

    .method__card,
    .course-card,
    .testimonial-card,
    .press-card,
    .service-card,
    .value-card {
        border: 2px solid var(--color-primary);
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .hero__image-wrapper,
    .about__image-wrapper {
        transform: none !important;
    }

    .hero__image-wrapper:hover,
    .about__image-wrapper:hover {
        transform: none !important;
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .method__card:hover,
    .course-card:hover,
    .testimonial-card:hover,
    .press-card:hover,
    .service-card:hover,
    .value-card:hover,
    .event:hover,
    .activity:hover {
        transform: none;
    }

    .nav__link:hover::after {
        width: 0;
    }

    /* Larger touch targets */
    .btn {
        min-height: 48px;
    }

    .nav__link {
        padding: 0.75rem 0;
    }

    .testimonials__btn {
        width: 56px;
        height: 56px;
    }
}
