/* DRAFT-copy responsive layer (Oct 25 2026). Loaded after assets/styles.css; adds phone, tablet,
   landscape, touch/gaze (Vision Pro, AR browsers) and safe-area handling without changing the desktop design. */

html, body { max-width: 100%; overflow-x: hidden; }
.shell, .main, .workspace, .stage, .rightrail, .card { min-width: 0; }
img, video, svg, iframe { max-width: 100%; }
.topbar { padding-left: max(22px, env(safe-area-inset-left)); padding-right: max(22px, env(safe-area-inset-right)); }

/* Tablets, portrait and landscape (721–1120 px): two-column right rail already from the base CSS; keep cards readable */
@media (max-width: 1120px) {
  .rightrail { gap: 14px; }
  .modules-list { max-height: 420px; }
}

/* Phones and small tablets in portrait */
@media (max-width: 760px) {
  .shell { padding: 10px max(10px, env(safe-area-inset-left)) 90px max(10px, env(safe-area-inset-right)); gap: 12px; }
  .rightrail { grid-template-columns: minmax(0, 1fr) !important; }
  .topbar { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .brand-logo { height: 30px; width: auto; }
  .top-controls { gap: 6px; min-width: 0; }
  .top-controls .pill span, .top-controls .pill [data-i18n] { display: none; }
  .course-head { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .course-head-text { min-width: 0; flex: 1 1 200px; }
  .course-head-text h1, .course-title { font-size: 19px !important; line-height: 1.2; white-space: normal !important; }
  .lesson-title { font-size: 24px !important; line-height: 1.2; }
  .crumbs { flex-wrap: wrap; row-gap: 4px; }
  .crumb-side { flex-wrap: wrap; }
  .mod-head { flex-wrap: wrap; }
  .modules-list { max-height: none; }
  .stage { gap: 12px; }
  .side-panel { max-height: 50vh; overflow: auto; }
  .rd-article { font-size: 16.5px; line-height: 1.6; }
  .res-row, .dtx-acc > button.dtx-acc-h, .dtx-sub > button { min-height: 48px; }
}

/* Phones in landscape and short screens: keep the video in view */
@media (max-height: 520px) and (orientation: landscape) {
  .topbar { position: static; padding-top: 6px; padding-bottom: 6px; }
  /* Oct 30 2026: width:auto collapsed the player to a few pixels (the video is absolutely positioned, so it gives no width); size it from the screen height instead */
  .stage { grid-template-columns: minmax(0, 1fr); }
  .player-wrap { width: min(100%, calc((100vh - 72px) * 16 / 9)); max-height: none; margin: 0 auto; }   /* leaves the slim wheel bar on the bottom edge clear (guide.css) */
  .course-head { padding: 8px 14px; }
  .shell { padding-bottom: 70px; }
}

/* Touch screens, Vision Pro gaze-and-pinch, AR browsers: larger targets, no hover-only affordances */
@media (pointer: coarse) {
  button, .les, .res-row, .mod-head, .pager, select { min-height: 44px; }
  .les { padding-top: 10px; padding-bottom: 10px; }
  .pager { min-width: 44px; }
  :focus-visible { outline: 3px solid #ffcf6a; outline-offset: 2px; }
}
@media (hover: none) {
  .res-row:hover, .mod-head:hover { box-shadow: none; }
}

/* Very large or far-away displays (TV, spatial windows): keep line length comfortable */
@media (min-width: 2200px) {
  .rd-article { max-width: 980px; margin-left: auto; margin-right: auto; font-size: 19px; }
}

/* Respect reduced motion everywhere in the draft copy */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Reading header: let the clock and A-/A+ tools wrap under the title on narrow screens */
@media (max-width: 900px) {
  .rd-top { flex-wrap: wrap; row-gap: 8px; }
  .rd-top-right { flex-wrap: wrap; min-width: 0; max-width: 100%; justify-content: flex-start; }
}
