/* ISO teaching styles, mapped from quality-lab/dist/style.css.
   Load after geography.css, lesson-typography.css and ui-foundation.css.
   Scoped to chapter teaching: question pages and source model internals keep
   their own layout and sizing. */

/* ISO .demo-guide and .demo-guide .quality-art -> geography .guide-row. */
.geo-session > .chapter-lesson .guide-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  flex: 0 0 auto;
  min-width: 0;
}
.geo-session > .chapter-lesson .guide-row .quality-art {
  width: 86px;
  height: 80px;
  flex: 0 0 86px;
}

/* ISO .guide-speech and its pointer -> geography .speech. The ISO minimum
   bubble height is omitted so short prompts do not crowd out the diagram. */
.geo-session > .chapter-lesson .guide-row .speech {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 12px 18px;
  border: 2px solid var(--maqua-blue40, #99e5ef);
  border-bottom: 4px solid var(--maqua-blue60, #66d8e6);
  border-radius: 19px;
  background: #fff;
  color: #4b4b4b;
  overflow-wrap: anywhere;
}
.geo-session > .chapter-lesson .guide-row .speech::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 45%;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  background: #fff;
  border: 0;
  border-left: 2px solid var(--maqua-blue40, #99e5ef);
  border-bottom: 2px solid var(--maqua-blue40, #99e5ef);
}

/* ISO .visual-case -> the existing model stage. Keep source viewBoxes,
   canvases, internal diagrams and aspect-ratio rules untouched. Unlike ISO's
   fixed three-column illustration, this shell has no fixed image ratio. */
.geo-session > .chapter-lesson .chapter-model {
  min-width: 0;
  max-width: 100%;
  border-radius: 24px;
  background: var(--maqua-blue20, #ccf2f7);
}

/* ISO .case-switch and .selected -> geography's variant and observation
   buttons. Wrapping accommodates translated labels and narrow phones. */
.geo-session > .chapter-lesson .chapter-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0;
  min-width: 0;
  flex: 0 0 auto;
}
.geo-session > .chapter-lesson .chapter-choices > button {
  flex: 1 1 150px;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  touch-action: manipulation;
}
.geo-session > .chapter-lesson .chapter-choices > button.chosen {
  background: var(--maqua-blue20, #ccf2f7);
  border-color: var(--maqua-blue, #00bed6);
  color: #222;
}
.geo-session > .chapter-lesson .chapter-choices > button:focus-visible {
  outline: 3px solid #155962;
  outline-offset: 2px;
}

/* Keep controls and feedback in document flow, separate from the figure. */
.geo-session > .chapter-lesson :is(.guided-observation-feedback, .g70-station-feedback) {
  flex: 0 0 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.geo-session > .chapter-lesson .chapter-playback {
  flex-wrap: wrap;
  min-width: 0;
}
.geo-session > .chapter-lesson .chapter-animation-meter {
  min-width: 60px;
}

@media (max-width: 600px) {
  /* ISO phone .demo-guide, .guide-speech and .case-switch spacing. */
  .geo-session > .chapter-lesson .guide-row { gap: 8px; align-items: flex-start; }
  .geo-session > .chapter-lesson .guide-row .quality-art {
    width: 58px;
    height: 60px;
    flex-basis: 58px;
  }
  .geo-session > .chapter-lesson .guide-row .speech {
    padding: 10px 13px;
    border-radius: 16px;
  }
  .geo-session > .chapter-lesson .chapter-model { border-radius: 18px; }
  .geo-session > .chapter-lesson .chapter-choices { gap: 8px; }
  .geo-session > .chapter-lesson .chapter-choices > button {
    flex-basis: 125px;
    padding: 10px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .geo-session > .chapter-lesson .chapter-choices > button { transition: none; }
}
/* An observation choice receives immediate, local feedback. */
.geo-session .chapter-lesson .chapter-choices > .observation-right{border-color:#58a961;background:#e5f6e4;color:#275d32}
.geo-session .chapter-lesson .chapter-choices > .observation-retry{border-color:#e5a459;background:#fff4e7;color:#814f23}
.geo-session .chapter-lesson .chapter-choices > .observation-right::after{content:' ✓';font-weight:900}
.geo-session .chapter-lesson .chapter-choices > .observation-retry::after{content:' ↺';font-weight:900}
.geo-session .g54-web-focus{display:flex;flex-direction:column;min-height:0;width:100%;align-items:center}
.geo-session .g54-web-focus>svg:first-child{min-height:140px;max-width:100%;flex:1 1 auto}
.geo-session .g54-food-timeline{display:block;width:100%;max-width:600px;max-height:75px;flex:0 0 auto}
.geo-session .volcano-hazard-paths{position:relative;width:min(100%,calc(100cqh * 1.43));height:auto;aspect-ratio:1100/770;margin:auto}
.geo-session .chapter-model:has(.volcano-hazard-paths){container-type:size}
.geo-session .volcano-hazard-paths > :is(img,svg){display:block;width:100%;height:100%;position:absolute;inset:0;object-fit:contain}
@media (max-width:430px) and (max-height:740px) {
 .geo-session > .chapter-lesson {gap:6px;padding-bottom:8px}
 .geo-session > .chapter-lesson h1 {line-height:1.26;margin:0}
 .geo-session > .chapter-lesson .guide-row .quality-art {width:44px;height:46px;flex-basis:44px}
 .geo-session > .chapter-lesson .guide-row .speech {padding:6px 9px}
 .geo-session > .chapter-lesson .chapter-choices {gap:5px}
 .geo-session > .chapter-lesson .chapter-choices > button {flex-basis:calc(50% - 5px);padding:5px 6px;min-height:44px}
 .geo-session > .chapter-lesson .chapter-playback {gap:5px}
}
@media (max-width:430px) and (max-height:740px) {
 .geo-session .chapter-lesson .chapter-model:has(>.loss-pair){min-height:185px!important;flex-basis:185px}
 .geo-session .chapter-lesson .loss-focus-picker > button{min-height:44px}
 .geo-session .chapter-lesson .chapter-choices > button:only-child{min-height:44px}
}
.geo-session .chapter-lesson[data-topic="G70-2"] .chapter-model:has(>.g67-focus){container-type:size}
.geo-session .chapter-lesson[data-topic="G70-2"] .g67-focus{height:100%;width:100%;display:grid;place-items:center;min-height:0}
.geo-session .chapter-lesson[data-topic="G70-2"] .g67-focus svg{max-height:100%;max-width:100%;width:auto;height:100%}

/* Keep the same lesson usable when the device renders a section instead of 3D. */
.geo-session .chapter-model :is(.hillslope-fallback,.reclamation-fallback,.human-landscape-fallback){opacity:1}
.geo-session .chapter-model :is(.hillslope-live,.reclamation-live,[data-human-landscape-3d]):not(:has(canvas)){visibility:hidden}
.geo-session .chapter-model :is(.hillslope-3d-scene,.reclamation-3d-scene,.human-landscape-3d-scene):has(canvas) > :is(.hillslope-fallback,.reclamation-fallback,.human-landscape-fallback){display:none}
.geo-session .chapter-model :is(.hillslope-3d-scene,.reclamation-3d-scene,.human-landscape-3d-scene):not(:has(canvas)) > .hk-model-note{display:none}
.geo-session .chapter-lesson:not(:has(#chapter-model canvas)) :is([data-action="erosion-camera-toggle"],[data-action="erosion-camera-reset"],[data-action="reclamation-camera-toggle"],[data-action="reclamation-camera-reset"],[data-action="human-landscape-camera-toggle"],[data-action="human-landscape-camera-reset"]){display:none}
.geo-session .hillslope-fallback svg{max-width:100%}
@media (max-width:600px) {
 .geo-session .chapter-lesson:has(.hillslope-controls) .chapter-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 .geo-session .chapter-lesson:has(.hillslope-controls) .chapter-choices > button{padding:4px;min-height:44px}
 .geo-session .hillslope-controls > button{min-height:44px}
}
.geo-session .geo-prediction-art{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;width:100%;max-width:680px;margin:auto}
.geo-session .geo-prediction-art > svg{display:block;width:100%;height:clamp(60px,17dvh,135px);object-fit:contain}
.geo-session .river-order-activity .river-order-join{display:block;width:min(150px,70%);height:clamp(30px,8dvh,66px);margin:auto}
.geo-session .chapter-scenario-select{display:none}
@media (max-width:430px) and (max-height:740px) {
 .geo-session > .chapter-lesson {--lesson-title-size:23px;scrollbar-gutter:auto}
 .geo-session > .chapter-lesson .chapter-choices-many{display:none}
 .geo-session .chapter-scenario-select{display:flex;align-items:center;gap:7px;flex:0 0 auto;color:#31545b}
 .geo-session .chapter-scenario-select select{min-width:0;flex:1 1 0;min-height:44px;padding:5px 8px;border:2px solid #99e5ef;border-radius:11px;background:white;color:#253d42}
}
