/* Content-led spacing, shared by all course languages. Existing editorial art
   keeps its natural width and aspect ratio. */
.slide-panel { min-height: 0; }
.slide-panel > h1 { text-wrap: balance; overflow-wrap: anywhere; }
.page-narration { gap: .75rem; }
.cinematic-groups { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; align-items: start; margin-block: 1.5rem; }
.cinematic-groups details { border: 1px solid #d8d2c6; border-radius: .8rem; background: #f7f4ed; overflow: hidden; }
.cinematic-groups summary { cursor: pointer; padding: 1rem; font-weight: 800; min-height: 48px; }
.cinematic-groups details[open] { grid-column: 1 / -1; background: #fff; }
.cinematic-groups details[open] > summary { background: #e2f1ef; border-bottom: 1px solid #b9d8d4; }
.cinematic-groups .module-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: .8rem; gap: .7rem; margin: 0; }
.cinematic-groups .module-list button { display: flex; gap: .75rem; align-items: center; padding: 1rem; min-width: 0; text-align: start; height: 100%; }
.cinematic-groups .module-list strong { font-size: 1rem; line-height: 1.45; display: block; text-wrap: pretty; }
.cinematic-groups .module-list small { display: block; margin-top: .5rem; color: #52667b; }
.cinematic-groups [aria-current="true"] { background: #e2f1ef; border: 2px solid #087f78; }
.cinematic-groups .module-number { display: grid; place-items: center; flex: 0 0 2.5rem; height: 2.5rem; background: #0a2035; color: #e5bd35; border-radius: 50%; }
/* The old certificate SVG repeats the complete text below in English only.
   Present the existing translated boundary and requirements directly instead. */
.certificate-layout > .programme-media { display: none; }
.certificate-layout { display: block; }
.certificate-layout > div { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.certificate-layout .boundary { grid-column: 1; grid-row: 1 / span 2; margin: 0; border-radius: .75rem; }
.certificate-layout h2 { grid-column: 2; margin: 0; font-size: 1.2rem; }
.certificate-layout .check-list { grid-column: 2; margin: 0; padding-inline-start: 1.5rem; }
.certificate-layout .check-list li { padding-block: .35rem; }
@media screen and (min-width: 721px) {
  main { padding-top: .75rem; }
  .slide-panel:not(.opening-film) { padding: clamp(1.25rem,2.2vw,2.2rem); }
  .slide-panel > .step-label { margin: 0 0 .4rem; }
  .slide-panel > h1 { font-size: clamp(1.8rem,3vw,3rem); line-height: 1.2; margin: 0 0 1rem; max-width: 36ch; }
  .slide-panel > .lead { margin: .75rem 0 1rem; max-width: 85ch; }
  .opening-copy { align-self: start; padding: 2rem; }
  .opening-copy h1 { font-size: clamp(2.5rem,4vw,4.8rem); line-height: 1.15; margin-block: .5rem 1rem; }
  .opening-film { gap: 0; align-items: start; }
  .opening-copy .hero-stats { margin-block: 1rem; }
  .page-narration { padding: .65rem .85rem; margin: .65rem 0 1rem; grid-template-columns: minmax(0,1fr) auto; }
  .page-narration .narration-status { max-width: 32ch; text-align: center; padding: .5rem .75rem; }
  .page-narration > div { min-width: 0; }
  .page-narration h2 { font-size: 1rem; margin: 0; }
  .history-hero, .royal-visual { margin-block: .75rem 1rem; }
  .slide-panel:is(.history,.map-slide,.monarchy) { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .6rem 1.5rem; align-items: start; }
  .slide-panel:is(.history,.map-slide,.monarchy) > * { grid-column: 1 / -1; }
  .slide-panel:is(.history,.map-slide,.monarchy) > .step-label { grid-column: 1; grid-row: 1; }
  .slide-panel:is(.history,.map-slide,.monarchy) > h1 { grid-column: 1; grid-row: 2; margin: 0; align-self: center; }
  .slide-panel:is(.history,.map-slide,.monarchy) > .page-narration { grid-column: 2; grid-row: 1 / span 2; margin: 0; align-self: center; grid-template-columns: 1fr; }
  .slide-panel:is(.history,.map-slide,.monarchy) .page-narration .narration-status { justify-self: start; max-width: none; }
  .map-slide .map-layout { align-items: start; }
  .map-slide .map-detail { height: auto; min-height: 0; padding: 1.25rem; }
  .map-detail > h2 { font-size: clamp(1.3rem,2vw,2rem); line-height: 1.3; }
  .language-grid { gap: .7rem; }
  .language-grid button { padding: .8rem 1rem; min-height: 90px; }
  .chooser-head { align-items: center; gap: 1rem; }
  .chooser-head h1 { font-size: clamp(1.8rem,3vw,3rem); line-height: 1.2; margin-block: .5rem; }
  .course-route > div { padding: 1rem; }
  .cinematic-library .module-video { margin-top: 1rem; }
  .cinematic-library .module-video-copy { align-self: center; }
  .cinematic-library .module-video { display: grid; grid-template-columns: minmax(240px,.7fr) minmax(0,1.3fr); gap: 1.25rem; align-items: center; }
  .cinematic-library .module-video-copy h2 { font-size: clamp(1.2rem,2vw,1.65rem); line-height: 1.4; margin-block: .6rem; }
  .player-shell .deep-lesson { display: flex; flex-direction: column; }
  .player-shell .deep-lesson > .lesson-core-grid { display: none; }
  .player-shell .lesson-reading-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; min-height: 0; flex: 1 1 0; align-items: start; align-content: center; }
  .player-shell .lesson-supporting { display: flex; flex-direction: column; gap: .65rem; min-height: 0; max-height: 100%; overflow: auto; scrollbar-gutter: stable; }
  .player-shell .lesson-supporting > * { flex: 0 0 auto; }
  .player-shell .lesson-detail-group { display: flex; flex-direction: column; gap: .65rem; min-height: 0; max-height: 100%; }
  .player-shell .lesson-detail-group > .detail-card { flex: 0 1 auto; }
  .player-shell .lesson-detail-group > .term-grid { flex: 0 0 auto; }
  .player-shell .lesson-detail-group .term-grid > section { border-top: 3px solid #1a766f; }
  .player-shell .lesson-introduction .takeaway { border-radius: .4rem 1rem; }
  .player-shell .lesson-reading-grid .detail-card { min-height: 0; max-height: 100%; overflow: auto; }
  .player-shell .lesson-sources { flex-shrink: 0; margin-top: .5rem; }
  .player-shell .deep-lesson :is(.detail-card,.lesson-introduction,.example-card,.term-grid) { align-self: start; max-height: 100%; }
  .player-shell .detail-card p { max-width: 75ch; }
  .player-shell .term-grid > section { align-self: start; }
  .player-shell .practice-slide { justify-content: center; }
  .player-shell .practice-slide > :is(h1,.step-label,.lesson-copy,.practice-context) { text-align: center; }
  .player-shell .practice-slide .choice-list { width: min(100%,1100px); align-self: center; }
  .player-shell .choice-list button { text-align: center; }
  .player-shell .slide-nav { display: flex; }
  .player-shell .slide-nav .button { flex: 0 1 auto; min-width: 120px; width: auto; }
  .player-shell .slide-nav > span { margin-inline: auto; }
  .player-shell .slide-nav #previous, .player-shell .slide-nav #next { flex: 0 0 auto; min-width: 120px; width: auto; }
}
@media screen and (max-width: 1000px) {
  .cinematic-groups { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .cinematic-groups .module-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media screen and (max-width: 720px) {
  .cinematic-groups { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cinematic-groups .module-list, .certificate-layout > div { display: block; }
  .cinematic-groups .module-list button { width: 100%; margin-bottom: .6rem; }
  .certificate-layout h2 { margin-block: 1rem .5rem; }
}
/* arrangeIntroScreen moves headings into a header. Keep those wrappers within
   the same desktop/tablet frame, with readable content and visible controls. */
@media screen and (min-width:721px) and (min-height:620px) {
  .slide-panel.intro-screen:not(.opening-film) { height:calc(100dvh - var(--intro-chrome,130px)); min-height:0; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) auto; gap:.75rem; overflow:hidden; padding:1.1rem 1.4rem; }
  .intro-screen > .intro-screen-heading { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); align-items:center; gap:1rem; grid-column:1/-1; }
  .intro-screen-heading > div { min-width:0; }
  .intro-screen .intro-screen-heading h1 { font-size:clamp(1.5rem,2.5vw,2.35rem); line-height:1.22; margin:.25rem 0; text-wrap:balance; overflow-wrap:anywhere; letter-spacing:normal; }
  .intro-screen-heading .step-label { margin:0; }
  .intro-screen-heading .page-narration { margin:0; padding:.6rem .8rem; grid-template-columns:minmax(0,1fr); gap:.35rem; }
  .intro-screen-heading .page-narration p { margin:0; font-size:.78rem; line-height:1.4; }
  .intro-screen-heading .narration-status { font-size:.75rem; justify-self:start; padding:.25rem .5rem; }
  .intro-screen > .intro-screen-body { min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; grid-column:1/-1; }
  .intro-screen > .intro-screen-controls { grid-column:1/-1; }
  .intro-screen-controls .acknowledge { margin:0 0 .5rem; padding:.65rem .8rem; }
  .intro-screen-controls .nav-actions { margin:0; display:flex; align-items:center; justify-content:space-between; gap:.75rem; }
  .intro-screen-controls .nav-actions .button { width:auto; min-height:44px; }
  .intro-screen-body .certificate-availability { margin:.75rem 0; font-size:.9rem; }
}

/* Reflow history illustrations using the same translated narrative as the page.
   Original SVG masters remain preserved; text is never cropped or line-clamped. */
.history-infographic { display:grid; grid-template-columns:minmax(12rem,.65fr) minmax(0,1.35fr); margin:1rem 0; border:1px solid #d8d2c6; border-radius:18px; overflow:hidden; background:#f7f4ed; }
.history-period-panel { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:.7rem; padding:clamp(1rem,2.5vw,2.5rem); background:#07192d; color:white; text-align:center; min-width:0; }
.history-symbol { display:grid; place-items:center; width:clamp(5rem,9vw,9rem); aspect-ratio:1; border-radius:50%; background:#1a766f; color:white; font:clamp(2.6rem,5vw,5rem) Georgia,serif; }
.history-period-panel .history-period { margin:0; color:white; font-weight:700; font-size:clamp(1.35rem,2.4vw,2.4rem); line-height:1.35; overflow-wrap:anywhere; }
.history-context { padding:clamp(1rem,2.3vw,2.25rem); min-width:0; color:#17263a; }
.history-context p { font-size:clamp(1rem,1.2vw,1.2rem); line-height:1.65; overflow-wrap:anywhere; }
.history-summary { margin:0 0 1rem; }
.history-detail { border-block-start:3px solid #d7a928; padding-block-start:.35rem; }
.history-detail p:last-child { margin-block-end:0; }
@media screen and (min-width:721px) and (min-height:620px) {
  .history-chapter .intro-screen-heading { grid-template-columns:minmax(0,1fr); }
  .history-chapter .intro-screen-body { display:block; }
  .history-chapter .intro-screen-body > .history-infographic { width:100%; margin:0 0 1rem; }
  .history-chapter .intro-screen-body > h2 { font-size:1.15rem; margin:.75rem 0 .5rem; }
}
@media screen and (max-width:720px) {
  .history-infographic { grid-template-columns:minmax(0,1fr); }
  .history-period-panel { padding:1rem; gap:.4rem; }
  .history-symbol { width:4rem; font-size:2.25rem; }
}
@media print {
  .history-infographic { display:block; overflow:visible; break-inside:avoid; }
  .history-period-panel { background:white; border-block-end:1px solid #d8d2c6; padding:.5rem; }
  .history-period-panel .history-period { color:#17263a; }
  .history-symbol { display:none; }
  .history-context { padding:1rem; }
}
/* Preserve the existing stacked video and caption controls in the fixed-height library. */
@media screen and (min-width:721px) and (min-height:620px) {
  .cinematic-library > .module-video { grid-template-columns:minmax(0,1fr); align-items:stretch; gap:.6rem; margin:0; }
}
