/* ==========================================================================
   ECONNECT SCHOOL — RESPONSIVE STYLESHEET
   Carefully tuned for 320px, 360px, 375px, 390px, 414px, 480px, 768px, 1024px, 1280px, 1440px, 1920px
   Zero horizontal overflow • Manrope Typographic Hierarchy • Editorial Precision
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Large Desktops & Widescreen (1440px - 1920px)
   -------------------------------------------------------------------------- */
@media (min-width: 1440px) {
  :root {
    --container-max: 1320px;
  }
}

/* --------------------------------------------------------------------------
   2. Desktops & Laptops (up to 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .hero-grid {
    gap: var(--space-8, 2rem);
  }
  
  .footer-top-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: var(--space-6);
  }

  .progression-timeline {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Header & Desktop Navigation Compact Fitting (1025px - 1280px) */
@media (min-width: 1025px) and (max-width: 1280px) {
  .site-logo-img {
    height: 40px !important;
    max-width: 185px !important;
  }
  .nav-menu {
    gap: 0.15rem !important;
  }
  .nav-link {
    font-size: 0.90625rem !important; /* 14.5px - comfortable, never cramped */
    padding: 0.45rem 0.55rem !important;
  }
  .header-cta-btn {
    padding: 0.55rem 1rem !important;
    font-size: 0.875rem !important;
  }
}


/* --------------------------------------------------------------------------
   3. Tablets & Small Laptops (max-width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  /* Navigation switch to mobile */
  .desktop-nav {
    display: none;
  }
  .header-cta-btn {
    display: none;
  }
  .mobile-nav-toggle {
    display: flex;
  }
  
  /* Hero Section Tablet Layout */
  .hero-panoramic-section {
    min-height: auto;
    padding: 40px 0 50px 0;
  }
  .hero-panoramic-bg {
    display: none;
  }
  .hero-mobile-image-container {
    display: block;
    width: 100%;
    max-width: 540px;
    margin: 16px 0 24px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(10, 33, 62, 0.08);
  }
  .hero-mobile-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
  }
  .hero-panoramic-container {
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 0 24px;
    min-height: auto;
  }
  .hero-panoramic-left {
    width: 100%;
    max-width: 580px;
    align-items: center;
    text-align: center;
    padding: 0;
  }
  .hero-panoramic-desc {
    max-width: 500px;
  }
  .hero-panoramic-actions {
    justify-content: center;
  }
  .hero-feature-row {
    justify-content: center;
  }
  .hero-panoramic-right {
    width: 100%;
    max-width: 580px;
  }
  .hero-choice-card {
    width: 100%;
    margin-right: 0;
  }

  .languages-showcase-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .skills-matrix {
    grid-template-columns: repeat(2, 1fr);
  }

  .editorial-split {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .courses-layout {
    grid-template-columns: 1fr;
  }
  .filter-sidebar {
    position: static;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-top-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.25rem 2rem;
  }
  .footer-brand-col {
    grid-column: span 2;
    max-width: 520px;
    margin-bottom: 0.5rem;
  }
}

/* --------------------------------------------------------------------------
   4. Portrait Tablets & Mobile Devices (max-width: 768px)
   Deliberate Mobile Typography: Hero H1 (40–46px), Page H1 (38–44px),
   Section H2 (32–38px), Section H3 (23–27px), Intro (17–18px), Body (16–17px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --header-height: 72px;
    --space-20: 3.5rem;
    --space-16: 2.75rem;
    --space-12: 2.25rem;
  }

  .site-logo-img {
    height: 40px;
    max-width: 175px;
  }

  /* Mobile Stacking for Panoramic Hero Section */
  .hero-panoramic-section {
    padding: 30px 0 40px;
    min-height: auto;
  }

  .hero-panoramic-container {
    flex-direction: column;
    padding: 0 var(--space-4, 1rem);
    gap: 28px;
    min-height: auto;
  }

  .hero-panoramic-left {
    width: 100%;
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
    padding: 0;
  }

  .hero-eyebrow-pill {
    margin-bottom: 14px;
    font-size: 11.5px !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    padding: 5px 10px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .hero-title-line {
    display: inline;
    white-space: normal;
  }

  .hero-panoramic-title {
    font-size: 42px !important;
    line-height: 1.08 !important;
    letter-spacing: -0.035em !important;
    margin-bottom: 14px !important;
    max-width: 100% !important;
  }

  .hero-panoramic-desc {
    font-size: 16.5px !important;
    line-height: 1.60 !important;
    margin-bottom: 22px !important;
    max-width: 100% !important;
  }

  .hero-panoramic-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
    margin-bottom: 24px;
  }

  .btn-pill-primary,
  .btn-pill-secondary {
    width: 100%;
    justify-content: center;
    font-size: 15px !important;
    padding: 12px 20px;
  }

  .hero-feature-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    width: 100%;
    border-top: 1px solid #E2E8F0;
    padding-top: 16px;
  }

  .hero-feat-item {
    font-size: 11.5px !important;
    white-space: normal;
    line-height: 1.35;
  }

  .hero-feat-sep {
    display: none;
  }

  /* Mobile Image & Card Stacking */
  .hero-mobile-image-container {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 16px 0 24px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(10, 33, 62, 0.08);
  }

  .hero-mobile-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
  }

  .hero-panoramic-right {
    width: 100%;
    max-width: 100%;
  }

  .hero-choice-card {
    width: 100%;
    margin-right: 0;
    border-radius: 16px;
    padding: 18px 16px;
  }

  .choice-name {
    font-size: 15px !important;
  }

  .choice-desc {
    font-size: 11.5px !important;
  }

  /* Universal Section Headings on Mobile (Prompt Spec 3) */
  /* Page H1: 38–44px */
  .page-hero .section-title,
  .page-hero h1,
  .page-title {
    font-size: 40px !important;
    line-height: 1.10 !important;
    letter-spacing: -0.03em !important;
    font-weight: 700 !important;
  }

  /* Section H2: 32–38px */
  h2,
  .section-title,
  .reasons-main-title {
    font-size: 34px !important;
    line-height: 1.14 !important;
    letter-spacing: -0.025em !important;
    font-weight: 700 !important;
  }

  /* Section H3: 24–28px */
  h3,
  .reason-title,
  .skill-item-title,
  .lang-card-title,
  .footer-cta-heading {
    font-size: 25px !important;
    line-height: 1.22 !important;
    letter-spacing: -0.015em !important;
    font-weight: 700 !important;
  }

  /* H4: 20–23px */
  h4 {
    font-size: 21px !important;
    line-height: 1.28 !important;
    font-weight: 600 !important;
  }

  /* Large introductory text: 17–18px */
  .section-subtitle,
  .page-subtitle,
  .reasons-main-desc {
    font-size: 17.5px !important;
    line-height: 1.60 !important;
    font-weight: 400 !important;
  }

  /* Normal Body: 16–17px */
  p,
  .reason-desc,
  .skill-item-text,
  .testimonial-quote {
    font-size: 16.5px !important;
    line-height: 1.65 !important;
    font-weight: 400 !important;
  }

  /* Small Labels / Eyebrows: 11–12px */
  .section-eyebrow,
  .reasons-eyebrow,
  .footer-cta-eyebrow,
  .reason-tag {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    white-space: normal !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .languages-showcase-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .skills-matrix {
    grid-template-columns: 1fr;
  }

  .progression-timeline {
    grid-template-columns: 1fr;
  }

  .finder-options-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-cta-banner {
    padding: var(--space-10) 0;
    overflow: hidden;
  }
  .footer-cta-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-6);
  }
  .footer-cta-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }
  .footer-cta-actions .btn,
  .footer-cta-actions .btn-cta-gold,
  .footer-cta-actions .btn-cta-primary {
    width: 100%;
    justify-content: center;
  }

  .footer-top-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1.5rem;
  }
  .footer-brand-col {
    grid-column: span 2;
    max-width: 100%;
    margin-bottom: 0.5rem;
  }

  .founders-preview-grid,
  .profile-dossier-layout {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* --------------------------------------------------------------------------
   5. Compact Mobile Screens (max-width: 640px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .hero-panoramic-title,
  .hero-headline {
    font-size: 38px !important;
    line-height: 1.08 !important;
    letter-spacing: -0.03em !important;
  }

  .page-hero .section-title,
  .page-hero h1,
  .page-title {
    font-size: 36px !important;
  }

  .section-title,
  .reasons-main-title {
    font-size: 30px !important;
  }

  .finder-options-grid {
    grid-template-columns: 1fr;
  }

  .faq-trigger {
    padding: 1rem;
    font-size: 16.5px !important;
  }
  .faq-panel {
    padding: 0 1rem 1rem 1rem;
    font-size: 15px !important;
  }

  .form-card {
    padding: var(--space-5);
  }

  .founder-card {
    padding: var(--space-6) var(--space-5);
  }

  .profile-section-card {
    padding: var(--space-6) var(--space-5) !important;
  }

  .profile-section-title {
    font-size: 1.125rem !important;
    gap: var(--space-2) !important;
  }

  .profile-sidebar-sticky {
    position: static;
  }

  .founder-spec-pill {
    font-size: 0.75rem;
    padding: 3px 8px;
  }

  .profile-hero-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-5);
  }

  .profile-portrait-wrap {
    width: 130px;
    height: 130px;
  }

  .founder-card-photo-wrap--lg {
    width: 72px;
    height: 72px;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 1.875rem;
  }
  .footer-brand-col {
    grid-column: span 1;
    max-width: 100%;
    margin-bottom: 0;
  }
  .footer-about-text {
    max-width: 100%;
  }
  .footer-link {
    padding: 3px 0;
    min-height: 32px;
    display: flex;
    align-items: center;
  }
  .footer-contact-link {
    padding: 2px 0;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    white-space: normal;
    word-break: break-all;
  }
}

/* --------------------------------------------------------------------------
   6. Ultra Compact Screens (320px - 360px)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  :root {
    --header-height: 64px;
  }
  .site-logo-img {
    height: 34px;
    max-width: 145px;
  }
  .hero-panoramic-title,
  .hero-headline {
    font-size: 32px !important;
    line-height: 1.10 !important;
  }
  .page-hero .section-title,
  .page-hero h1,
  .page-title {
    font-size: 30px !important;
  }
  .btn,
  .hero-btn-primary,
  .hero-btn-secondary,
  .btn-pill-primary,
  .btn-pill-secondary {
    padding: 0.6875rem 1.25rem;
    font-size: 14.5px !important;
  }
}

/* ==========================================================================
   7. Footer Responsive Architecture (Tiers 2, 3, 4)
   ========================================================================== */

/* Tier 2: Compact Desktop / Tablet Landscape & Portrait (769px to 1199px)
   Two Rows:
   Row 1: Copyright on left, Back to Top on right
   Row 2: Legal links centered across full footer width */
@media (min-width: 769px) and (max-width: 1199px) {
  .footer-bottom-bar {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "copyright backtotop"
      "legal legal" !important;
    gap: 1.25rem 1rem !important;
    align-items: center !important;
    width: 100% !important;
  }
  .footer-bottom-copyright {
    grid-area: copyright !important;
    justify-self: start !important;
  }
  .footer-bottom-legal,
  .footer-legal-links {
    grid-area: legal !important;
    justify-self: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    text-align: center !important;
  }
  .footer-bottom-back-to-top {
    grid-area: backtotop !important;
    justify-self: end !important;
  }
}

/* Tier 3: Tablet / Large Mobile (481px to 768px)
   Stacked Column Centered:
   1. Copyright
   2. Legal links (wrap naturally, no white-space: nowrap)
   3. Back to Top */
@media (min-width: 481px) and (max-width: 768px) {
  .footer-bottom-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1.125rem !important;
    width: 100% !important;
  }
  .footer-bottom-copyright {
    order: 1 !important;
    text-align: center !important;
    width: 100% !important;
  }
  .footer-bottom-legal,
  .footer-legal-links {
    order: 2 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem 0.875rem !important;
    text-align: center !important;
    max-width: 100% !important;
  }
  .footer-bottom-back-to-top {
    order: 3 !important;
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
  }
}

/* Tier 4: Small Mobile (<= 480px)
   Fully Stacked Centered Compact:
   1. Copyright
   2. Legal links (multiline wrap, hide separators)
   3. Back to Top */
@media (max-width: 480px) {
  .footer-bottom-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1.125rem !important;
    width: 100% !important;
  }
  .footer-bottom-copyright {
    order: 1 !important;
    text-align: center !important;
    width: 100% !important;
  }
  .footer-bottom-legal,
  .footer-legal-links {
    order: 2 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem 0.875rem !important;
    max-width: 320px !important;
    margin: 0 auto !important;
    text-align: center !important;
  }
  .footer-legal-sep {
    display: none !important;
  }
  .footer-bottom-back-to-top {
    order: 3 !important;
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
  }
}

/* --------------------------------------------------------------------------
   Responsive Rules for New Homepage Sections
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .post-hero-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .course-tracks-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .audience-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .trust-standards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .post-hero-section {
    padding: var(--space-12) 0;
  }
  .post-hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .course-tracks-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .audience-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .trust-standards-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .lang-hub-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .lang-courses-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .course-finder-bridge-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-6);
  }
  .course-finder-bridge-banner .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .lang-hub-actions {
    flex-direction: column;
    gap: var(--space-2);
  }
  .level-pathways-container {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .assessment-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .assessment-result-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .assessment-result-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .match-details-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .lang-courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admissions-steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .admissions-journey-heading {
    font-size: 1.15rem;
    line-height: 1.35;
  }
  .admissions-steps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .form-row-2col {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .context-course-meta {
    grid-template-columns: 1fr;
  }
  .form-control, select.form-control {
    min-height: 46px;
  }
  .form-card {
    padding: var(--space-5);
  }
  .contact-info-panel {
    padding: var(--space-5);
  }
  .success-actions-row {
    flex-direction: column;
  }
  .success-actions-row .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}
