/* =========================================================
   CIRCLES WEBSITE
   RESPONSIVE STYLESHEET
   File: css/responsive.css
========================================================= */

/* =========================================================
   1. LARGE TABLETS / SMALL LAPTOPS
========================================================= */

@media (max-width: 1200px) {

    .container {
        width: min(94%, var(--container));
    }

    .hero-container,
    .page-hero-container,
    .about-story-container,
    .student-section-container,
    .lesson-discovery-container,
    .about-preview-container,
    .contact-whatsapp-container,
    .instructors-hero-container,
    .years-page-hero-container,
    .courses-hero-container,
    .course-detail-hero-grid,
    .course-information-grid {
        gap: 50px;
    }

    .years-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .benefits-grid,
    .steps-grid,
    .contact-options-grid,
    .contact-help-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .courses-catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .year-courses-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .footer-container {
        grid-template-columns: 1.25fr 0.75fr 0.75fr;
        gap: 40px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   2. TABLETS + MOBILE NAVIGATION
========================================================= */

@media (max-width: 900px) {

    html {
        scroll-padding-top: 74px;
    }

    .section {
        padding: 80px 0;
    }

    /* ---------- HEADER ---------- */

    .navbar-container {
        position: relative;
        min-height: 74px;
        gap: 15px;
    }

    .site-logo {
        width: 118px;
        height: 52px;
    }

    .mobile-menu-button {
        position: relative;
        z-index: 1002;

        display: block;

        flex: 0 0 46px;
    }

    .main-navigation {
        position: absolute;
        z-index: 1001;

        top: calc(100% + 8px);
        left: 0;
        right: 0;

        margin-left: 0;
        padding: 12px;

        border: 1px solid var(--gray-200);
        border-radius: 18px;

        background: rgba(255, 255, 255, 0.99);

        box-shadow: var(--shadow-medium);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform: translateY(-8px);

        transition:
            opacity var(--transition),
            visibility var(--transition),
            transform var(--transition);
    }

    .main-navigation.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: translateY(0);
    }

    .navigation-list {
        width: 100%;

        flex-direction: column;
        align-items: stretch;

        gap: 3px;
    }

    .navigation-list li {
        width: 100%;
    }

    .nav-link {
        width: 100%;

        justify-content: flex-start;

        padding: 12px 14px;

        border-radius: 10px;
    }

    .nav-link.active::after {
        display: none;
    }

    .nav-contact-link,
    .nav-contact-link.active {
        margin: 6px 0 0;

        justify-content: center;

        background: var(--black);
        color: var(--white);
    }

    .mobile-menu-button.is-open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-menu-button.is-open span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-button.is-open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* ---------- HOME HERO ---------- */

    .hero-section {
        min-height: auto;
        padding: 70px 0 100px;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 55px;
    }

    .hero-content {
        max-width: 760px;
    }

    .hero-title {
        max-width: 760px;
    }

    .hero-visual {
        width: 100%;
        max-width: 430px;

        margin-inline: auto;
    }

    .hero-logo-wrapper,
    .hero-logo-card {
        width: min(100%, 390px);
    }

    .hero-circle-yellow,
    .hero-decoration-yellow {
        left: auto;
        right: 12%;
    }

    /* ---------- HOME SEARCH ---------- */

    .course-finder-box,
    .home-search-box {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* ---------- HOME GRIDS ---------- */

    .search-intent-grid,
    .subjects-grid,
    .instructors-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    /* ---------- HOME SPLIT SECTIONS ---------- */

    .lesson-discovery-container,
    .about-preview-container,
    .student-section-container {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .lesson-search-visual {
        min-height: 330px;
    }

    .about-preview-visual {
        max-width: 420px;
        margin-inline: auto;
    }

    /* ---------- GENERAL PAGE HERO ---------- */

    .page-hero {
        min-height: auto;
        padding: 75px 0;
    }

    .page-hero-container {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .page-hero-visual {
        min-height: 310px;
    }

    /* ---------- ABOUT ---------- */

    .about-story-container,
    .contact-whatsapp-container {
        grid-template-columns: 1fr;
        gap: 45px;
    }

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

    /* ---------- CONTACT ---------- */

    .social-contact-container,
    .contact-cta-container {
        align-items: flex-start;
        flex-direction: column;
    }

    .contact-cta-buttons {
        width: 100%;
    }

    /* ---------- INSTRUCTORS PAGE ---------- */

    .instructors-hero-container {
        grid-template-columns: 1fr;
    }

    .instructors-hero-circles {
        display: none;
    }

    .instructors-page-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* ---------- YEARS PAGE ---------- */

    .years-page-hero {
        min-height: auto;
        padding: 75px 0 105px;
    }

    .years-page-hero-container {
        grid-template-columns: 1fr;
    }

    .years-page-visual {
        display: none;
    }

    .year-navigation {
        display: flex;

        overflow-x: auto;
        overflow-y: hidden;

        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .year-navigation a {
        min-width: 145px;
        flex: 0 0 145px;

        flex-direction: column;

        border-right: 1px solid var(--gray-200);
    }

    .year-courses-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* ---------- COURSES PAGE ---------- */

    .courses-page-hero {
        padding: 75px 0;
    }

    .courses-hero-container {
        grid-template-columns: 1fr;
    }

    .courses-hero-visual {
        display: none;
    }

    .courses-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* ---------- COURSE DETAIL, IF USED ---------- */

    .course-detail-hero-grid,
    .course-information-grid {
        grid-template-columns: 1fr;
    }

    .course-instructor-box,
    .course-quick-info {
        width: 100%;
        max-width: 480px;
    }

    .course-facts-grid,
    .related-course-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   3. MOBILE
========================================================= */

@media (max-width: 650px) {

    .container {
        width: min(92%, 100%);
    }

    .section {
        padding: 65px 0;
    }

    .section-heading {
        margin-bottom: 36px;
    }

    .section-heading-row {
        align-items: flex-start;
        flex-direction: column;

        gap: 18px;

        margin-bottom: 38px;
    }

    .section-heading h2,
    .about-story-content h2,
    .student-section-content h2,
    .lesson-discovery-content h2,
    .contact-whatsapp-content h2,
    .social-contact-container h2 {
        font-size: clamp(1.8rem, 9vw, 2.45rem);
        letter-spacing: -0.8px;
    }

    /* ---------- HEADER ---------- */

    .site-header {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .navbar-container {
        min-height: 70px;
    }

    .site-logo {
        width: 104px;
        height: 48px;
    }

    .main-navigation {
        left: 0;
        right: 0;
    }

    /* ---------- BUTTONS ---------- */

    .hero-buttons,
    .page-hero-buttons,
    .course-detail-actions {
        align-items: stretch;
        flex-direction: column;

        width: 100%;
    }

    .hero-buttons .button,
    .page-hero-buttons .button,
    .course-detail-actions .button {
        width: 100%;
    }

    /* ---------- HOME HERO ---------- */

    .hero-section {
        padding: 55px 0 85px;
    }

    .hero-title {
        font-size: clamp(2.65rem, 13vw, 4rem);
        letter-spacing: -1.8px;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-features {
        align-items: flex-start;
        flex-direction: column;

        gap: 12px;
    }

    .hero-visual {
        max-width: 315px;
    }

    .hero-logo-wrapper,
    .hero-logo-card {
        width: min(100%, 300px);
    }

    .circle-one {
        width: 78px;
        height: 78px;
    }

    .circle-two {
        width: 62px;
        height: 62px;
    }

    .hero-circle-orange,
    .hero-decoration-orange {
        width: 190px;
        height: 190px;
        border-width: 42px;
    }

    /* ---------- SEARCH ---------- */

    .course-finder-section,
    .home-search-section {
        margin-top: -32px;
    }

    .course-finder-box,
    .home-search-box {
        padding: 24px;
        border-radius: 20px;
    }

    .course-search-form {
        align-items: stretch;
        flex-direction: column;

        padding: 7px;

        border-radius: 16px;
    }

    .course-search-form input {
        min-height: 48px;
    }

    .search-button {
        width: 100%;
    }

    /* ---------- HOME CARDS ---------- */

    .search-intent-grid,
    .years-grid,
    .subjects-grid,
    .benefits-grid,
    .instructors-grid,
    .steps-grid,
    .about-services-grid,
    .contact-options-grid,
    .contact-help-grid {
        grid-template-columns: 1fr !important;
    }

    .search-intent-card,
    .subject-card,
    .benefit-card,
    .about-service-card,
    .step-card,
    .contact-option-card {
        min-height: 0;
    }

    .subject-card .subject-card-link {
        min-height: 285px;
    }

    .instructor-home-image {
        height: auto;
        aspect-ratio: 4 / 4.6;
    }

    .instructor-profile-image {
        height: auto;
        aspect-ratio: 4 / 4.7;
    }

    /* ---------- LESSON VISUAL ---------- */

    .lesson-search-visual {
        min-height: 285px;

        transform: scale(0.9);
    }

    .visual-circle-one {
        width: 215px;
        height: 215px;
    }

    .visual-circle-two {
        width: 165px;
        height: 165px;
    }

    .visual-circle-three {
        width: 125px;
        height: 125px;
    }

    .visual-search-text {
        font-size: 2.55rem;
    }

    /* ---------- GENERAL PAGE HERO ---------- */

    .page-hero {
        padding: 60px 0;
    }

    .page-hero-title {
        font-size: clamp(2.45rem, 12vw, 3.6rem);
        letter-spacing: -1.5px;
    }

    .page-hero-visual {
        display: none;
    }

    /* ---------- ABOUT ---------- */

    .arabic-about-box,
    .years-arabic-seo-box,
    .instructors-arabic-seo-box,
    .course-arabic-box {
        padding: 28px 22px;
        border-radius: 20px;
    }

    /* ---------- CONTACT ---------- */

    .contact-whatsapp-visual {
        display: none;
    }

    .social-contact-buttons,
    .contact-cta-buttons {
        align-items: stretch;
        flex-direction: column;

        width: 100%;
    }

    .social-contact-buttons .button,
    .contact-cta-buttons .button {
        width: 100%;
    }

    .contact-number-box {
        width: 100%;
    }

    .contact-number-box a {
        font-size: 1.2rem;
        overflow-wrap: anywhere;
    }

    /* ---------- FOOTER ---------- */

    .footer-container {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .footer-brand {
        grid-column: auto;
    }

    .site-footer {
        padding-top: 55px;
    }

    .footer-bottom {
        min-height: 68px;
    }

    /* ---------- FLOATING WHATSAPP ---------- */

    .floating-whatsapp {
        right: 14px;
        bottom: 14px;

        min-height: 50px;

        padding: 6px;
    }

    .floating-whatsapp .whatsapp-icon {
        width: 38px;
        height: 38px;
    }

    .floating-whatsapp .whatsapp-text {
        display: none;
    }

    /* ---------- YEARS PAGE ---------- */

    .years-page-hero-content h1,
    .courses-hero-content h1,
    .instructors-hero-content h1 {
        font-size: clamp(2.55rem, 12vw, 3.7rem);
        letter-spacing: -1.6px;
    }

    .year-navigation-section {
        margin-top: -30px;
        overflow: hidden;
    }

    .year-navigation {
        border-radius: 16px;
    }

    .year-navigation a {
        min-width: 118px;
        min-height: 78px;
        flex-basis: 118px;

        padding: 14px 10px;

        font-size: 0.92rem;
    }

    .academic-year-detail {
        padding: 70px 0;
    }

    .academic-year-heading {
        align-items: flex-start;

        gap: 16px;

        margin-bottom: 34px;
    }

    .academic-year-number {
        width: 66px;
        height: 66px;

        border-radius: 17px;

        font-size: 1.35rem;
    }

    .academic-year-heading h2 {
        font-size: 2rem;
    }

    .year-courses-grid {
        grid-template-columns: 1fr;
    }

    /* ---------- COURSES PAGE ---------- */

    .courses-page-hero {
        padding: 60px 0;
    }

    .courses-filter-section {
        padding: 30px 0;
    }

    .courses-search-box {
        margin-bottom: 20px;
    }

    .courses-search-box input {
        height: 56px;

        padding-right: 18px;
    }

    .course-filter-buttons {
        justify-content: flex-start;
        flex-wrap: nowrap;

        width: 100%;

        overflow-x: auto;
        overflow-y: hidden;

        padding: 0 0 8px;

        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .course-filter-button {
        flex: 0 0 auto;
    }

    .courses-catalog-heading {
        align-items: flex-start;
        flex-direction: column;

        gap: 14px;

        margin-bottom: 32px;
    }

    .courses-catalog-grid {
        grid-template-columns: 1fr;
    }

    .course-catalog-card {
        min-height: 215px;
    }

    /* ---------- INSTRUCTORS PAGE ---------- */

    .instructors-page-hero {
        padding: 60px 0;
    }

    .instructors-page-grid {
        grid-template-columns: 1fr;
    }

    .instructor-profile-content {
        padding: 22px;
    }

    /* ---------- COURSE DETAIL, IF USED ---------- */

    .course-detail-hero {
        padding: 60px 0;
    }

    .course-detail-main h1 {
        font-size: clamp(3rem, 15vw, 4.4rem);
        letter-spacing: -2px;
    }

    .course-instructor-image {
        height: auto;
        aspect-ratio: 4 / 4.5;
    }

    .course-facts-grid,
    .related-course-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   4. VERY SMALL PHONES
========================================================= */

@media (max-width: 390px) {

    .container {
        width: 90%;
    }

    .hero-title,
    .page-hero-title,
    .years-page-hero-content h1,
    .courses-hero-content h1,
    .instructors-hero-content h1 {
        font-size: 2.45rem;
    }

    .button {
        padding-inline: 18px;
    }

    .subject-card .subject-card-link {
        padding: 24px !important;
    }

    .course-catalog-card,
    .year-course-card {
        padding-left: 20px;
        padding-right: 20px;
    }

    .years-arabic-seo-box,
    .instructors-arabic-seo-box,
    .course-arabic-box,
    .arabic-about-box {
        padding: 24px 18px;
    }
}


/* =========================================================
   5. REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
