/* ─────────────────────────────────────────────────────────────
   DOCTOR PAGE — #sec-media, ALIGNED TO THE DESIGN FILE

   Figma: desktop 460:46952 / 460:46986 in frame 460:44760 (1920)
          mobile  460:75152 / 460:75294 in frame 460:75121 (390)

   DESKTOP
     heading  453,5383  1015x72  Polin Bold 62 / 72, centred, one line
     cards              871x490  radius 20, 30 apart
     row     -377,5519  2673x490 — wider than the frame
     the middle card sits at 524..1395, dead centre, and its neighbours
     bleed off both edges
     gaps: heading → row 64, row → arrows 45

   MOBILE
     heading   27,5303   337x100  Bold 42 / 50, centred, TWO lines
     cards              300x200   18 apart, middle card centred at 45..345
     gaps: heading → row 41, row → arrows 34

   What was wrong was not the card — 871x490 at radius 20 already matched.
   It was the row: the viewport stopped at the container, so the cards ran
   flush from the left edge and the second one was clipped mid-frame. The
   design centres the active card in the full width of the page.

   Centring is done with a margin on the track rather than by patching the
   slider's translateX, because the script writes that transform inline on
   every step; a margin adds to it instead of fighting it.

   One knowing difference on mobile: the design's card is 300x200, which is
   3:2, while the desktop's 871x490 is 16:9 and so is a YouTube frame. The
   card keeps 16:9 here rather than letterboxing the player into the
   designer's box.
   ───────────────────────────────────────────────────────────── */


/* The transparent layer assets/js/doctor-slider-swipe.js lays over each
   embed on phones so a swipe that starts on the video still reaches the
   slider. Removed by a tap, after which the player is live. */
.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-media-slide {
  position: relative;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-slide-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  background: transparent;
}

/* The line break the mobile frame carries in this heading. Added in
   doctor-page-fixes.php §9 and inert at every other width. */
.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-title-br-mobile {
  display: none;
}


/* ============================================================
   DESKTOP
   ============================================================ */
@media (min-width: 1025px) {

  /* The heading's margin is written inline on the element, so this needs
     the !important to reach it. */
  .dmc-dr-page-wrapper.dmc-dr-story #sec-media .dmc-dr-education-title {
    margin-bottom: 64px !important;   /* was 60 */
  }

  /* Full width of the page, not of the container — that is what lets the
     neighbouring cards show. #sec-media already clips its own overflow. */
  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-media-slider-viewport {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-media-slider-track {
    margin-left: calc((100% - 871px) / 2) !important;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-media-nav {
    margin-top: 45px !important;      /* was 50 */
  }
}


/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 767px) {

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-title-br-mobile {
    display: inline;
  }

  /* The design sets this heading on a 50px line and breaks it in two. Its
     first line measures 348px and the container leaves 335, so without the
     ten pixels back on each side the break lands one word early and the
     heading runs to three lines. The frame has 350 to play with.
     max-width has to go with it — at 100% it caps the width straight back
     to 335 and the extra twenty pixels do nothing. */
  .dmc-dr-page-wrapper.dmc-dr-story #sec-media .dmc-dr-education-title {
    line-height: 50px !important;     /* was 42 */
    margin: 0 -10px 41px -10px !important;  /* was 30 below */
    width: calc(100% + 20px) !important;
    max-width: none !important;
  }

  /* margin-bottom is set inline on the viewport at 45 and collapses with
     the arrows' own margin, so the larger of the two decided the gap —
     which is why setting only the nav left it at 45. */
  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-media-slider-viewport {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    margin-bottom: 34px !important;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-media-slider-track {
    gap: 18px !important;             /* was 30 */
    margin-left: calc((100% - min(300px, 80vw)) / 2) !important;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-media-slide {
    flex: 0 0 min(300px, 80vw) !important;
    width: min(300px, 80vw) !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-media-slide iframe {
    width: 100% !important;
    height: 100% !important;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-media-nav {
    margin-top: 0 !important;         /* the viewport above carries the 34 */
  }
}
