/* ==========================================================================
   Tronolex Islamic Education HTML5 Boilerplate v1
   File: responsive.css
   Purpose: Responsive breakpoints and adaptive behavior.
   --------------------------------------------------------------------------
   Breakpoints used (mobile-first, min-width):
     560px  — small phones landscape / large phones
     768px  — tablets
     1024px — small desktops / landscape tablets
     1200px — standard desktops
     1440px — large desktops
   The design targets a smooth experience from 320px to 1920px with no
   horizontal scrolling.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Small phones + (>= 560px)
   -------------------------------------------------------------------------- */
@media (min-width: 560px) {
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row--2 {
    grid-template-columns: 1fr 1fr;
  }

  .info-cards {
    grid-template-columns: 1fr;
  }

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

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

/* --------------------------------------------------------------------------
   Tablets (>= 768px)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .hero__inner {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

  .hero__media {
    display: block;
  }

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

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

  .split {
    grid-template-columns: 1fr 1fr;
    gap: 56px;
  }

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

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

  .stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .checklist--two-col {
    grid-template-columns: 1fr 1fr;
  }

  .timeline {
    padding-inline-start: 40px;
  }

  .timeline-item::before {
    inset-inline-start: -40px;
  }
}

/* --------------------------------------------------------------------------
   Small desktops (>= 1024px) — section layouts only; the full nav needs
   more room (8 links + long brand), so it appears at >= 1280px and
   smaller desktops keep the hamburger + drawer (which has all links).
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .contact-grid {
    grid-template-columns: 1fr 1.4fr;
  }

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

  .footer__top {
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  }
}

/* --------------------------------------------------------------------------
   Wide desktops (>= 1280px) — show full navigation
   -------------------------------------------------------------------------- */
@media (min-width: 1280px) {
  .main-nav {
    display: block;
  }

  .nav-toggle {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Compact header (1280px–1439px) — safety margin for brand + 8 nav links
   -------------------------------------------------------------------------- */
@media (min-width: 1280px) and (max-width: 1439px) {
  .header__inner {
    gap: 12px;
  }

  .brand {
    font-size: 18px;
    gap: 10px;
  }

  .main-nav__list {
    gap: 2px;
  }

  .main-nav__link {
    padding: 10px 9px;
    font-size: 13px;
  }

  .header__actions {
    gap: 8px;
  }

  .header__actions .btn--sm {
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* --------------------------------------------------------------------------
   Standard desktops (>= 1200px)
   -------------------------------------------------------------------------- */
@media (min-width: 1200px) {
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Course cards comfortably in 3 columns */
  .grid--courses {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .gallery-grid .gallery-item:nth-child(1),
  .gallery-grid .gallery-item:nth-child(6) {
    grid-column: span 2;
  }
}

/* --------------------------------------------------------------------------
   Large desktops (>= 1440px)
   -------------------------------------------------------------------------- */
@media (min-width: 1440px) {
  .hero__title {
    font-size: 54px;
  }
}

/* --------------------------------------------------------------------------
   Tablets and below (<= 1023px) — hamburger is shown, so reclaim width
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .site-header .brand__name em {
    display: none;
  }
}

@media (max-width: 767px) {
  .header__actions .btn {
    display: none;
  }

  .announce__inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    row-gap: 6px;
    column-gap: 10px;
  }
}

/* --------------------------------------------------------------------------
   Small phones (<= 559px) — tighten header/brand so nothing overflows
   -------------------------------------------------------------------------- */
@media (max-width: 559px) {
  .header__inner {
    gap: 10px;
    height: auto;
    min-height: 68px;
    padding-block: 8px;
  }

  .site-header .brand {
    font-size: 15px;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .site-header .brand__name {
    line-height: 1.3;
    overflow-wrap: break-word;
    min-width: 0;
  }

  .site-header .brand__name em {
    display: none;
  }

  .brand--footer {
    font-size: 20px;
  }

  .brand__logo {
    width: 34px;
    height: 34px;
  }

  .nav-toggle {
    width: 40px;
    height: 40px;
  }

  .bank-detail {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .bank-detail__value {
    text-align: start;
  }

  .header__actions .btn {
    display: none;
  }

  .announce {
    font-size: 12px;
  }

  .announce__inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    row-gap: 6px;
    column-gap: 10px;
    padding-block: 10px;
  }

  .announce__msg {
    max-width: 100%;
    justify-content: center;
  }

  .announce__links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .site-header .brand {
    font-size: 14px;
  }

  .announce__links {
    font-size: 12px;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion safety (also covered in animations.css)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .drawer,
  .drawer-overlay,
  .scroll-top {
    transition: none;
  }
}
