/**
 * Educational Edge - Responsive Layout & Breakpoint Styles
 * Breakpoints tested: 1440px, 1280px, 1024px, 768px, 414px, 375px, 320px
 */

/* =======================================================
   LARGE TABLETS & DESKTOPS (<= 1200px)
   ======================================================= */
@media (max-width: 1200px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px;
  }
  .footer-grid .footer-col:last-child {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-grid .footer-col:last-child .footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }
}

/* =======================================================
   TABLETS & MEDIUM SCREENS (<= 992px)
   ======================================================= */
@media (max-width: 992px) {
  :root {
    --header-height: 74px;
  }

  /* Header Mobile Nav */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background-color: var(--color-very-light-bg);
    border: 1px solid var(--color-borders);
    color: var(--color-primary-navy);
  }

  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: var(--color-white);
    padding: 32px 24px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-xl);
    z-index: 999;
  }

  .site-nav.is-open {
    transform: translateX(0);
  }

  .nav-menu {
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }

  .nav-link {
    font-size: 1.15rem;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-borders);
    width: 100%;
  }

  .header-actions .btn {
    display: none; /* Keep header clean on mobile, move CTA into nav drawer */
  }

  .mobile-nav-cta {
    display: block !important;
    margin-top: 24px;
    width: 100%;
    text-align: center;
  }

  /* Hero Section */
  .hero-section {
    padding: 48px 0 40px;
  }

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

  .hero-media-wrapper {
    order: 2;
  }

  .hero-content {
    order: 1;
    text-align: center;
  }

  .hero-copy {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-btn-group {
    justify-content: center;
  }

  .hero-trust-row {
    justify-content: center;
  }

  /* Stats Section - 2 Columns as specified */
  .stats-card-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 28px 24px;
  }
  .stat-item:nth-child(2)::after {
    display: none;
  }

  /* Featured Intro */
  .intro-feature-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .intro-media-card {
    max-width: 600px;
    margin: 0 auto;
  }

  /* Featured Articles Layout */
  .featured-content-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Testimonials */
  .testimonial-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* CTA Banner */
  .cta-banner-box {
    grid-template-columns: 1fr;
    padding: 44px 32px;
    text-align: center;
  }
  .cta-text {
    margin-left: auto;
    margin-right: auto;
  }
  .cta-buttons {
    justify-content: center;
  }

  /* Contact Preview */
  .contact-layout-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  /* Posts Grid 3 */
  .posts-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
  .footer-brand {
    grid-column: span 2;
  }
}

/* =======================================================
   SMALL TABLETS & LARGE PHONES (<= 768px)
   ======================================================= */
@media (max-width: 768px) {
  :root {
    --font-size-3xl: 1.85rem;
    --font-size-4xl: 2.25rem;
  }

  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .category-card {
    padding: 24px 20px;
  }

  .stats-section {
    margin-top: 0;
    padding-top: 24px;
  }

  .stats-card-strip {
    grid-template-columns: repeat(2, 1fr);
    padding: 20px 16px;
    gap: 16px;
  }

  .stat-item {
    gap: 12px;
  }
  .stat-item::after {
    display: none !important;
  }

  .stat-icon-box {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .newsletter-card {
    padding: 36px 24px;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-input {
    width: 100%;
  }

  .newsletter-form .btn {
    width: 100%;
  }

  .posts-grid-3 {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* =======================================================
   MOBILE SMARTPHONES (<= 480px)
   ======================================================= */
@media (max-width: 480px) {
  .hero-btn-group {
    flex-direction: column;
    width: 100%;
  }
  .hero-btn-group .btn {
    width: 100%;
  }

  .cta-buttons {
    flex-direction: column;
    width: 100%;
  }
  .cta-buttons .btn {
    width: 100%;
  }

  .categories-grid {
    grid-template-columns: 1fr;
  }

  .stats-card-strip {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .mini-post-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .mini-thumb {
    aspect-ratio: 16 / 9;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-brand {
    grid-column: span 1;
  }

  .contact-form-box {
    padding: 24px 18px;
  }
}
