/* ============================================================
   responsive/list.css — Course catalogue mobile breakpoints
   Base styles live in list.css  |  Tokens in tokens.css
   ============================================================ */

/* ── 1024px — trim outer padding slightly ────────────────────── */
@media (max-width: 1024px) {
  .catalog-page {
    padding: 40px 28px 80px;
  }

  .course-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
  }
}

/* ── 768px — tablet landscape ────────────────────────────────── */
@media (max-width: 768px) {
  .catalog-page {
    padding: 32px 20px 72px;
  }

  /* Header: stack title block, hide big counter */
  .catalog-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 24px;
    margin-bottom: 24px;
  }

  .catalog-header__count { display: none; }

  .catalog-header__title {
    font-size: clamp(1.5rem, 5vw, 2.25rem);
  }

  /* Filter: allow horizontal scroll on tight screens */
  .subject-filter {
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .subject-filter::-webkit-scrollbar { display: none; }

  .subject-filter__label { display: none; }

  .subject-filter__list {
    flex-wrap: nowrap;
    gap: 6px;
  }

  /* Grid: 2 columns on tablet */
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* ── 540px — phone landscape / large phone ───────────────────── */
@media (max-width: 540px) {
  .catalog-page {
    padding: var(--page-top-gap, 12px) 16px 64px;
  }

  .catalog-header {
    padding-bottom: 20px;
    margin-bottom: 20px;
  }

  /* single column grid on phones */
  .course-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* on phone the card goes horizontal: thumb left, body right */
  .course-card {
    flex-direction: row;
    align-items: stretch;
    border-radius: 5px;
  }

  .course-card__thumb-link {
    flex-shrink: 0;
    width: 100px;
  }

  .course-card__thumb {
    aspect-ratio: auto;
    height: 100%;
    border-radius: 0;
  }

  .course-card__body {
    padding: 14px 14px 8px;
    gap: 6px;
    min-width: 0; /* allow text truncation */
  }

  .course-card__title {
    font-size: 15px;
    line-height: 1.3;
    /* clamp title to 2 lines on mobile */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  /* hide description on phone — too cramped */
  .course-card__desc { display: none; }

  /* foot becomes part of the body column */
  .course-card__foot {
    padding: 0 14px 14px;
    border-top: none;
  }

  .c-btn {
    height: 34px;
    font-size: 12px;
    padding: 0 14px;
  }
}

/* ── 380px — smallest phones (SE, fold) ──────────────────────── */
@media (max-width: 380px) {
  .catalog-page { padding: 20px 12px 56px; }

  .course-card__thumb-link { width: 80px; }

  .catalog-header__title { font-size: 1.5rem; }
}

/* ── hover: none (pure touch devices) ───────────────────────────
   Remove lift effect on devices with no hover pointer
   so there's no visual stuck-state after tap.              */
@media (hover: none) {
  .course-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--hairline);
  }
  .course-card:hover .course-card__thumb img {
    transform: none;
  }
  .course-card:hover .course-card__title a {
    color: inherit;
  }
}
