/* =====================================================================
   responsive.css  -  RESPONSIVE LAYOUTS
   Responsibility: ONLY media queries.
   The base files (style.css, pages.css) describe the phone layout.
   Here the layout is rebuilt as the screen gets wider (mobile-first).

   Breakpoints
     640px   large phones / small tablets
     768px   tablets
     1024px  small laptops
     1100px  full desktop navigation bar
   ===================================================================== */


/* ---------- 640px and up ---------- */
@media (min-width: 640px) {
  .section {
    padding-block: var(--space-6);
  }

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

  .section-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

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

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

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

  .filter-bar > .form-group:first-child {
    grid-column: 1 / -1;       /* search box takes the whole first row */
  }

  .modal-overlay {
    align-items: center;
    padding: 1rem;
  }

  .modal {
    border-radius: 20px;
  }

  .toast-container {
    left: 50%;
    right: auto;
    width: min(420px, calc(100% - 2rem));
    transform: translateX(-50%);
  }
}


/* ---------- 768px and up (tablets) ---------- */
@media (min-width: 768px) {
  .quick-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  /* search bar becomes one row: [scope] [text] [button] */
  .search-bar {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0.4rem 0.4rem 0.4rem 0.5rem;
  }

  .search-bar select {
    border-right: 1px solid var(--color-border);
    border-bottom: 0;
    padding-right: 1rem;
  }
}


/* ---------- 1024px and up (laptops) ---------- */
@media (min-width: 1024px) {
  .card-grid--3,
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .hero {
    padding-block: var(--space-6) var(--space-7);
  }

  /* hero: text on the left, illustration on the right */
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--space-6);
  }

  .float-card--event {
    left: -2.5rem;
    bottom: 2.5rem;
  }

  .float-card--notice {
    right: -1.5rem;
    top: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  }

  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

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

  .filter-bar > .form-group:first-child {
    grid-column: auto;
  }

  /* one row: wide search box + the other filters + Clear button */
  .filter-bar--clubs {
    grid-template-columns: 2fr 1fr auto;
  }

  .filter-bar--events {
    grid-template-columns: 2fr 1fr 1fr auto;
  }

  .stat + .stat {
    padding-left: 1.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
  }
}


/* ---------- 1100px and up (full desktop navigation) ---------- */
@media (min-width: 1100px) {
  .card-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .quick-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  /* the hamburger disappears and the menu becomes a normal row */
  .nav-toggle {
    display: none;
  }

  .nav-menu,
  .nav-menu.is-open {
    display: flex;
    position: static;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    max-height: none;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .nav-links {
    flex-direction: row;
    gap: 0.1rem;
  }

  .nav-link {
    padding: 0.55rem 0.7rem;
    font-size: 0.9375rem;
  }

  /* active page: blue text with an underline bar */
  .nav-link:hover,
  .nav-link.active {
    background: transparent;
  }

  .nav-link.active::after {
    content: "";
    position: absolute;
    right: 0.7rem;
    bottom: 0.1rem;
    left: 0.7rem;
    height: 2px;
    border-radius: 2px;
    background: var(--color-blue);
  }

  .nav-auth {
    flex-direction: row;
    align-items: center;
    margin: 0;
    padding: 0;
    border: 0;
  }
}
