/* Content-driven bridges between the existing phone and desktop compositions. */
@media (min-width: 761px) {
  .hero-real .hero-copy { max-width: 780px; }
  .hero.hero-real .hero-detail { max-width: 58ch; }
}

/* A tablet needs a readable demonstration, with copy above the full-width frame. */
@media (min-width: 761px) and (max-width: 1000px) {
  .learning.wrap { padding-inline: 56px; }
  .learning .story-row, .learning .story-row.reverse {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px;
  }
  .learning .story-copy, .learning .reverse .story-copy,
  .learning .learning-capture, .learning .reverse .learning-capture {
    grid-column: 1; grid-row: auto; width: 100%; max-width: none;
  }
  .learning .story-copy { order: 0; }
  .learning .learning-capture { order: 1; }
  .learning .learning-step { margin-bottom: 12px; }
  .learning .story-copy h3 { font-size: clamp(28px, 3.6vw, 36px); max-width: 28ch; }
  .learning .story-copy p { max-width: 62ch; margin-top: 16px; }
  .chapter-feedback .feedback > header,
  .parent-typography .parent-copy { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .parent-perspective.parent-typography #parent-view[data-parent-content="compact"] .pt-description {
    text-align: left; justify-self: start;
  }
  .chapter-feedback .feedback .fb-gallery { gap: 24px; }
  .chapter-feedback .feedback .fb-panel { min-height: 0; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .chapter-courses .course-content { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .chapter-courses .course-description {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 40px; align-items: start; padding-top: 0;
  }
  .chapter-courses .course-description h3 { max-width: none; }
  .chapter-courses .course-description h4 { grid-column: 2; grid-row: 1; margin-top: 0; }
  .chapter-courses .course-description #selected-focus { grid-column: 2; grid-row: 2 / span 3; }
  .chapter-courses .course-coverage { grid-column: 1; }
  .chapter-courses .sample-lesson-label { grid-column: 1; margin-top: 16px; }
  .chapter-courses .sample-lesson { grid-column: 1; justify-self: start; margin-top: 12px; }
  .chapter-courses .faculty-carousel { height: clamp(360px, 43vw, 460px); }
  .courses .course-teachers[data-count="1"] { margin-inline: 0; max-width: 560px; }
  .chapter-courses .courses-heading { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .chapter-courses .courses-heading p { max-width: 58ch; }
  .course-navigation { display: block; padding-bottom: 0; }
  .courses .subject-switch { margin-top: 16px; }
  .subject-indicator { bottom: -1px; }
}

/* Tablets share the desktop composition: real laptop at left, copy at right.
   Copy sets the section height; the photo keeps its original aspect ratio. */
@media (min-width: 761px) and (max-width: 900px),
       (min-width: 901px) and (max-width: 1180px) and (orientation: portrait) {
  .hero.hero-real { height: auto; min-height: 720px; padding: 0; background: #fff; }
  .hero-real .hero-copy {
    position: relative; inset: auto; width: 43%; max-width: none;
    margin: 0 3% 0 54%; padding: 128px 0 96px;
  }
  .hero.hero-real .hero-audience { font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
  .hero.hero-real h1 { font-size: clamp(32px, 4.1vw, 48px); line-height: 1.12; }
  .hero.hero-real .hero-description { font-size: clamp(18px, 1.9vw, 22px); line-height: 1.4; margin-top: 20px; }
  .hero.hero-real .hero-detail { font-size: 16px; line-height: 1.5; margin-top: 14px; }
  .hero.hero-real .hero-cta { font-size: 16px; min-height: 50px; margin-top: 20px; padding: 14px 24px; }
  .hero-real .hero-proof { margin-top: 24px; max-width: none; }
  .hero-real .hero-proof-grid { gap: 12px; }
  .hero-real .hero-proof-item dd { font-size: clamp(22px, 2.4vw, 28px); }
  .hero-real .hero-proof-item dt { font-size: 11px; }
  .hero-real .hero-scene {
    top: auto; bottom: 0; transform-origin: 0 100%;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%);
    mask-image: linear-gradient(to bottom, transparent, #000 18%);
  }
}

/* Short landscape windows should scroll naturally with legible type. */
@media (min-width: 761px) and (max-height: 500px) {
  .hero.hero-real h1 { font-size: clamp(32px, 3.5vw, 48px); }
  .hero-real .hero-copy { padding-top: 104px; }
  .hero.hero-real .hero-description { font-size: 20px; }
  .hero.hero-real .hero-detail { font-size: 16px; }
  .learning-introduction .journey-next { padding-block: 64px 40px; }
  .learning-introduction .journey-next h2 { font-size: 42px; }
}
@media (min-width: 901px) and (max-height: 500px) {
  .hero-real .hero-copy { top: 108px; padding-top: 0; }
}

/* Unfolded phones still use the established phone flow; avoid oversized media. */
@media (min-width: 540px) and (max-width: 760px) {
  .hero.hero-real h1 { font-size: 38px; }
  .hero.hero-real .hero-description { max-width: 40ch; }
  .learning .learning-capture-frame { max-width: 600px; margin-inline: auto; }
}

/* Controls must remain discoverable on touch laptops and landscape tablets. */
@media (hover: none), (pointer: coarse) {
  .family-carousel .family-controls { opacity: 1; }
  .family-carousel .family-controls button { pointer-events: auto; }
  .courses .subject-switch button, .pv-folder-tabs button { min-height: 48px; }
}
