/* Shared course layout corrections, verified against every published French/English page.
   Keep wide tables in their existing scroll containers; never conceal page overflow. */
body :is(.premium-lesson-container, .premium-topic-card, .lesson-mini-card,
  .topic-heading > div, .roulette-panel, .roulette-result-zone, .roulette-dialogue-card,
  .guesswho-panel, .guesswho-wheel-card, .guesswho-current-card, .guesswho-list-card,
  .guesswho-history-card, .weather-deck-card, .weather-wheel-card) { min-width: 0; }
body .premium-lesson-container { grid-template-columns: minmax(0, 1fr); }
body :is(.grid, .lesson-grid, .student-grid, .role-grid, .roulette-play-area, .weather-play-grid) > * { min-width: 0; }
body :is(.premium-topic-card, .panel, .student-card, .topic-heading) :is(h2, h3, p, strong, button, summary),
body :is(h1, .section-title, .student-card) { overflow-wrap: anywhere; }
body .guesswho-rule-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
body .guesswho-play-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); }
body :is(.guesswho-wheel, .roulette-wheel, .weather-wheel) { max-width: 100%; }
body.basic2-page .immersive-basic-hero { margin-inline: 0; }
@media (max-width: 991px) {
  body .roulette-play-area { grid-template-columns: minmax(0, 1fr); }
  body .weather-play-grid { grid-template-columns: minmax(0, 1fr); }
  body .topic-heading { align-items: flex-start; }
}
@media (max-width: 575px) {
  /* Bootstrap's g-5 gutter is wider than the phone container's side padding. */
  body .container > .row.g-5 { --bs-gutter-x: 1.5rem; }
  body .lesson-grid { grid-template-columns: minmax(0, 1fr); }
  body .guesswho-rule-list { grid-template-columns: minmax(0, 1fr); }
  body .guesswho-wheel-header, body .guesswho-list-header,
  body .guesswho-history-header, body .weather-wheel-header { flex-wrap: wrap; }
  body .global-course-switcher details > nav {
    top: auto; bottom: calc(100% + .5rem); max-height: calc(100dvh - 100px); overflow-y: auto;
  }
}
body .game-layout > * { min-width: 0; }
body .weather-wheel-zone { min-width: 0; grid-template-columns: minmax(0, 1fr); }
body .weather-wheel { height: auto; aspect-ratio: 1; }
body .global-course-switcher details > nav { max-height: calc(100dvh - 160px); overflow-y: auto; }
body :is(.template-card, .lesson-next-section, .lesson-next-card) { min-width: 0; }
body .template-line { overflow-wrap: anywhere; }
body .mm-settings select { width: 100%; min-width: 0; }
.course-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.course-table-scroll .chart-table { min-width: 640px; }
.course-table-scroll:focus-visible { outline: 3px solid #1f4e8c; outline-offset: 4px; }
@media (max-width: 640px) {
  body .news-section-head { flex-direction: column; align-items: stretch; }
  body .news-section-head > div { flex: auto; width: 100%; }
}
@media (max-width: 575px) {
  body .global-course-switcher details > nav { max-height: calc(100dvh - 100px); }
}
body .premium-lesson-container > .lesson-next-section { width: 100%; max-width: 100%; padding-inline: 0; }
/* A course menu must fit a short landscape viewport as well as a tall phone. */
body .jl-course-panel {
  --jl-course-panel-top: clamp(12px, calc(var(--jl-navbar-bottom, 72px) + 8px), calc(100dvh - 160px));
  top: var(--jl-course-panel-top);
  max-height: calc(100dvh - var(--jl-course-panel-top) - 12px);
}
@media (max-width: 1199px) {
  body :is(.site-header, .navbar.fixed-top, .navbar.sticky-top) { position: relative !important; inset: auto !important; }
  body.jl-intermediate2-auth .site-header .jaralingua-auth-nav.jl-auth-floating { position: static !important; }
}
@media (min-width: 992px) and (max-width: 1199px) {
  /* A tablet cannot fit a brand, every desktop link and the course selector in one row. */
  body .navbar-expand-lg > .container,
  body .navbar-expand-lg > .container-fluid { flex-wrap: wrap !important; }
  body .navbar-expand-lg .navbar-collapse { flex-basis: 100%; order: 100; min-width: 0; }
  body .navbar-expand-lg .navbar-nav { flex-wrap: wrap; }
}

/* Design review 2026-10-25: shared geometry, with each course's palette intact. */
body.trust-page :is(.trust-container, .trust-panel, .trust-table-wrap) { min-width: 0; max-width: 100%; box-sizing: border-box; }
body.trust-page .trust-table-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
body.trust-page .trust-table { width: 100%; min-width: 0; table-layout: fixed; }
body.trust-page .trust-table :is(th, td) { overflow-wrap: anywhere; }
body.trust-page .trust-hero .eyebrow { color: #0b2454; background: #eef3fb; }
body :is(h1, .section-title) { overflow-wrap: normal; word-break: normal; hyphens: manual; text-wrap: balance; }
body .jl-page-qr-host h1 { overflow-wrap: normal; }
body .site-header .jaralingua-auth-nav.jl-auth-floating { position: static !important; inset: auto !important; }
.jl-navigation-auth-slot { display: flex; align-items: center; flex: 0 0 auto; margin-left: auto; order: 98; }
body .navbar > :is(.container, .container-fluid) { min-width: 0; }
body :is(.action-button, .coach-button, .speed-btn, .games-btn, .games-btn-soft,
  .intermediate2-button, .btn-main, .btn-soft) { min-height: 44px; }
body :is(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid #3575ba; outline-offset: 3px; }
body :is(button, input, select, textarea) { touch-action: manipulation; }
body :is(.action-button, .coach-button, .speed-btn, .games-btn):disabled { cursor: not-allowed; }
body .speed-btn:is(.active, [aria-pressed="true"]) { box-shadow: inset 0 0 0 2px currentColor; }
@media (max-width: 991px) {
  body .site-header .navbar { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; align-items: center; gap: 8px; padding-block: 10px !important; }
  body .site-header .navbar > .brand { flex: 0 0 auto; margin: 0; }
  body .site-header .brand img { width: 44px !important; height: 44px !important; object-fit: contain; }
  body .site-header .nav-links { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; width: auto !important; flex: 1 1 220px; gap: 6px !important; padding: 0; margin: 0 !important; }
  body .site-header .nav-links > li { width: auto !important; flex: 0 0 auto; }
  body .site-header .nav-links > li > a { min-height: 40px; display: flex; align-items: center; padding: 8px 12px; }
  body .navbar > :is(.container, .container-fluid) { flex-wrap: wrap; gap: 8px; }
  body .navbar .jl-navigation-auth-slot { margin-left: auto; order: 2; }
  body .navbar .navbar-toggler { order: 3; min-width: 44px; min-height: 44px; }
  body .navbar .navbar-collapse { order: 100; }
  body :is(.basic-course-hero, .intermediate-course-hero) { display: flex; flex-direction: column; gap: 16px; padding-block: 24px; }
  body :is(.basic-course-hero, .intermediate-course-hero) > :is(.basic-hero-content, .intermediate-hero-content) { order: 0; width: 100%; }
  body :is(.basic-course-hero, .intermediate-course-hero) > :is(.basic-hero-image, .intermediate-hero-image) { order: 1; width: 100%; }
  body :is(.basic-hero-image, .intermediate-hero-image) img { max-height: 280px; width: 100%; object-fit: cover; }
  body :is(.home-hero, .intermediate2-hero) { padding-block: 24px; }
  body :is(.home-hero, .basic-hero-content, .intermediate-hero-content, .intermediate2-hero) h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
}
@media (min-width: 992px) {
  body :is(.basic-course-hero, .intermediate-course-hero) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  body :is(.basic-hero-content, .intermediate-hero-content, .french-hero-content, .english-hero-panel) { min-width: 0; }
}
@media (max-width: 480px) {
  body .site-header .navbar { width: calc(100% - 24px); }
  body .site-header .nav-links { flex-basis: 210px; }
  body .jl-navigation-auth-slot .auth-trigger { min-height: 44px; max-width: 180px; }
  body .jl-navigation-auth-slot .auth-trigger > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 991px) {
  body .navbar-collapse.show { max-height: calc(100dvh - 140px); overflow-y: auto; overscroll-behavior-y: contain; }
  body > header.hero { padding-block: 32px; }
  body .home-hero-logo { max-height: 96px; width: auto; object-fit: contain; }
  body .ie2-unit1-hero h1 { max-width: 100%; font-size: clamp(1.75rem, 5vw, 2.5rem); }
}
body .section-title { overflow-wrap: anywhere; }
@media (max-width: 991px) {
  body.hangman-page .site-header,
  body.hangman-page .site-header .container { max-height: none; }
  body.hangman-page .site-header .container { flex-wrap: wrap; }
  body.hangman-page .navbar-collapse { flex-basis: 100%; }
  body.hangman-page .site-header .jaralingua-auth-nav .auth-trigger { min-height: 44px !important; }
}
@media (prefers-reduced-motion: reduce) {
  body :is(.home-hero-copy, .home-visual-stage) { animation: none; }
}
body .navbar .auth-trigger { min-height: 44px !important; max-width: 200px; }
body .navbar .auth-trigger > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body .jl-intermediate2-auth-panel .jl-auth-panel-dismiss { width: 44px; height: 44px; }

body:is(.basic2-page, .basic2-index-page) .site-header .jaralingua-auth-nav .auth-trigger { min-height: 44px !important; }

body.home-page .navbar > .global-course-switcher { position: relative; inset: auto; order: 3; z-index: 20; }
body.home-page .navbar .global-course-switcher details > nav { top: calc(100% + .5rem); bottom: auto; max-height: calc(100dvh - 200px); }
