/* Ascend with Ang — responsive layer.
   Mobile-first base lives in the other sheets; this adds tablet and desktop.
   Loaded last (before print). Uses :has() for per-screen layout (Chrome/Safari/
   Firefox 2023+); older browsers simply keep the mobile column. */

/* ============================ Tablet (>= 720px) ============================ */
@media (min-width: 720px) {
  #app { max-width: 760px; }

  .auth { max-width: 460px; margin-left: auto; margin-right: auto; }

  /* Explore + course grids reflow to two columns */
  .explore-row { display: grid; grid-template-columns: repeat(2, 1fr); overflow: visible; }
  .course-card { flex: initial; max-width: none; }
  .course-card-photo { aspect-ratio: 4/3; }

  .course-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 28px; }

  .course-hero { max-width: 680px; }
  .video-frame { max-width: 680px; }
}

/* ============================ Desktop (>= 1024px) ========================== */
@media (min-width: 1024px) {
  /* Public screens go full-bleed and centre their content */
  #app:has(.splash), #app:has(.onb), #app:has(.auth) { max-width: none; }
  #app:has(.screen) { max-width: 1240px; }

  .splash { align-items: center; }
  .splash-logo, .splash-body { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
  .onb { max-width: 860px; margin: 0 auto; }
  .onb-copy { max-width: 48%; }
  .auth { min-height: 100dvh; justify-content: center; max-width: 460px; }

  /* --- Screens WITH a bottom nav (Home, Courses): left sidebar + content --- */
  .inner-screen:has(.bottom-nav) {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    grid-template-areas: "nav bar" "nav body";
    height: 100dvh;
  }
  .inner-screen:has(.bottom-nav) .app-bar { grid-area: bar; }
  .inner-screen:has(.bottom-nav) .scroll-body {
    grid-area: body; overflow-y: auto;
    max-width: 980px; width: 100%; margin: 0 auto; padding: 28px 40px 56px;
  }
  .inner-screen:has(.bottom-nav) .bottom-nav {
    grid-area: nav; position: sticky; top: 0; bottom: auto; height: 100dvh;
    display: flex; flex-direction: column; gap: 4px;
    border-top: 0; border-right: 1px solid var(--border);
    padding: 28px 14px; align-items: stretch;
  }
  .inner-screen:has(.bottom-nav) .nav-item {
    flex-direction: row; justify-content: flex-start; gap: 14px;
    padding: 12px 16px; border-radius: var(--radius); font-size: 14px;
  }
  .inner-screen:has(.bottom-nav) .nav-item svg { width: 22px; height: 22px; }
  .inner-screen:has(.bottom-nav) .nav-item[aria-current="page"] { background: var(--surface-2); color: var(--moss); }

  /* --- Detail screens (course, lesson): centred reading column, no rail --- */
  .inner-screen:not(:has(.bottom-nav)) .scroll-body { max-width: 840px; margin: 0 auto; width: 100%; padding: 8px 32px 40px; }
  .inner-screen:not(:has(.bottom-nav)) .app-bar-row { max-width: 904px; margin: 0 auto; }
  .bottom-bar { max-width: 840px; margin: 0 auto; width: 100%; }

  /* Wider content grids on desktop */
  .explore-row { grid-template-columns: repeat(3, 1fr); }
  .course-list { grid-template-columns: repeat(2, 1fr); gap: 0 40px; }
  .course-hero { max-width: 760px; }
  .video-frame { max-width: 760px; }

  /* Menu drawer not needed as the primary nav on desktop, but keep it available
     (it carries Membership, Settings, etc. not in the rail). */
}
