@import url("fonts.css");
@import url("story-notes.css?v=20261119230422");

/* Focused multilingual story comparison window */
:root {
  --sc-ink: #0b2a3d;
  --sc-ink-soft: #3a5a6e;
  --sc-line: rgba(0, 78, 140, 0.14);
  --sc-blue: #0069b4;
  --sc-blue-soft: #dff2ff;
  --sc-gold: #c99b3b;
  --sc-bg: #ffffff;
  --sc-panel: #eaf5ff;
  --sc-font-ui: "Source Sans 3", "Segoe UI", sans-serif;
  --sc-font-display: "Source Serif 4", Georgia, serif;
  --sc-cols: 2;
  --sc-toolbar-btn-height: 2.05rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  background: #fff;
  color: var(--sc-ink);
  font-family: var(--sc-font-ui);
}

body.sc-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.sc-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.75rem 0.85rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--sc-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(232, 245, 255, 0.88));
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 78, 140, 0.08);
}

.sc-toolbar__brand-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  max-width: min(34vw, 22rem);
  margin-right: auto;
  align-self: center;
}

.sc-pager {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.18rem 0.28rem;
  border-radius: 999px;
  background: rgba(243, 248, 252, 0.94);
  box-shadow: 0 0 0 1px rgba(0, 78, 140, 0.1);
}

.sc-pager[hidden] {
  display: none !important;
}

.sc-pager__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--sc-toolbar-btn-height);
  min-width: var(--sc-toolbar-btn-height);
  height: var(--sc-toolbar-btn-height);
  min-height: var(--sc-toolbar-btn-height);
  padding: 0;
  border: 1px solid rgba(0, 105, 180, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--sc-ink);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.sc-pager__btn:hover:not(:disabled),
.sc-pager__btn:focus-visible:not(:disabled) {
  border-color: rgba(0, 105, 180, 0.42);
  background: #fff;
  outline: none;
}

.sc-pager__btn:focus-visible {
  outline: 2px solid rgba(0, 105, 180, 0.35);
  outline-offset: 2px;
}

.sc-pager__btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.sc-pager__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* Fits "#### / ####" without clipping or scroll. */
  width: calc(11ch + 1.1rem);
  min-width: calc(11ch + 1.1rem);
  max-width: calc(11ch + 1.1rem);
  height: var(--sc-toolbar-btn-height);
  min-height: var(--sc-toolbar-btn-height);
  padding: 0 0.55rem;
  border: 1px solid rgba(0, 105, 180, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--sc-ink);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}

.sc-pager__status:focus {
  outline: none;
  border-color: rgba(0, 105, 180, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 105, 180, 0.12);
}

.sc-pager__status:disabled {
  opacity: 0.5;
}

.sc-toolbar__globe {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  object-fit: contain;
  background: transparent;
  cursor: zoom-in;
  pointer-events: auto;
  -webkit-user-drag: none;
  user-select: none;
  transition: box-shadow 0.18s ease;
}

.sc-toolbar__globe:hover,
.sc-toolbar__globe:focus-visible,
.sc-globe-button.is-expanded .sc-toolbar__globe {
  position: fixed;
  left: max(0.75rem, env(safe-area-inset-left));
  top: max(0.75rem, env(safe-area-inset-top));
  z-index: 60;
  width: min(376px, calc((100vw - 1.5rem) * 0.3));
  height: min(376px, calc((100vh - 1.5rem) * 0.3));
  max-width: 376px;
  max-height: 376px;
  object-fit: contain;
  outline: none;
  cursor: zoom-out;
  background: rgba(243, 248, 252, 0.96);
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(0, 78, 140, 0.12),
    0 22px 48px rgba(0, 40, 80, 0.28);
}

@media (prefers-reduced-motion: reduce) {
  .sc-toolbar__globe {
    transition: none;
  }
}

.sc-toolbar__brand {
  margin: 0;
  font-family: var(--sc-font-display);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sc-ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-toolbar__brand span {
  background: linear-gradient(135deg, var(--sc-blue) 10%, #2e9fd4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sc-langs {
  position: relative;
  z-index: 7;
  flex: 0 0 auto;
  align-self: flex-end;
  min-width: 0;
  max-width: min(42vw, 28rem);
}

.sc-toolbar__group,
.sc-views__group,
.sc-langs__group,
.sc-views .story__action-group {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  flex: 0 0 auto;
}

.sc-pager-group {
  align-self: flex-end;
}

.sc-langs__toggles {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  box-sizing: border-box;
  padding: 0.18rem 0.28rem;
  min-height: calc(var(--sc-toolbar-btn-height) + 0.36rem);
  border-radius: 999px;
  background: rgba(243, 248, 252, 0.94);
  box-shadow: 0 0 0 1px rgba(0, 78, 140, 0.1);
}

.sc-views {
  flex: 0 0 auto;
  align-self: flex-end;
  display: inline-flex;
  align-items: flex-end;
  gap: 0.45rem;
}

.sc-toolbar .tools-bar__label {
  display: block;
  margin: 0;
  padding-inline: 0.1rem;
  width: 100%;
  height: calc(0.72rem * 1.2);
  min-height: calc(0.72rem * 1.2);
  flex: 0 0 calc(0.72rem * 1.2);
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(52, 95, 134, 0.78);
  line-height: calc(0.72rem * 1.2);
  text-align: center;
  white-space: nowrap;
}

.sc-toolbar .tools-bar__views {
  display: inline-flex;
  align-items: stretch;
  padding: 0.15rem;
  border: 1px solid rgba(0, 78, 140, 0.14);
  border-radius: 999px;
  background: rgba(229, 244, 251, 0.7);
  box-shadow: 0 1px 2px rgba(0, 78, 140, 0.05) inset;
  gap: 0.15rem;
}

.sc-toolbar .tools-bar__view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  gap: 0.35rem;
  height: var(--sc-toolbar-btn-height);
  min-height: var(--sc-toolbar-btn-height);
  padding: 0 0.65rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sc-ink-soft);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.sc-toolbar .tools-bar__view-btn:hover {
  color: var(--sc-blue);
}

.sc-toolbar .tools-bar__view-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--sc-blue), #2e9fd4);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 90, 154, 0.22);
}

.sc-toolbar .tools-bar__view-btn--icon {
  width: var(--sc-toolbar-btn-height);
  min-width: var(--sc-toolbar-btn-height);
  padding-inline: 0;
}

.sc-toolbar .tools-bar__glyph {
  display: block;
  flex: 0 0 auto;
}

body.sc-page[data-sc-show-text="false"] .sc-col__title,
body.sc-page[data-sc-show-text="false"] .sc-col__title-row,
body.sc-page[data-sc-show-text="false"] .sc-col__text,
body.sc-page[data-sc-show-text="false"] .sc-col__prose,
body.sc-page[data-sc-show-text="false"] .sc-col__moral-slot,
body.sc-page[data-sc-show-text="false"] .sc-col__source-slot,
body.sc-page[data-sc-show-text="false"] .sc-col__moral,
body.sc-page[data-sc-show-text="false"] .sc-col__source {
  display: none !important;
}

body.sc-page[data-sc-show-illus="false"] .sc-col__figure,
body.sc-page[data-sc-show-illus="false"] .sc-col__figure-slot {
  display: none !important;
}

.sc-lang {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  gap: 0.35rem;
  margin: 0;
  height: var(--sc-toolbar-btn-height);
  min-height: var(--sc-toolbar-btn-height);
  padding: 0 0.7rem 0 0.4rem;
  border: 1px solid rgba(0, 105, 180, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: #5e7a8c;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  box-shadow: inset 0 1px 2px rgba(0, 78, 140, 0.1);
  opacity: 1;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.sc-lang:hover:not(:disabled):not([aria-pressed="true"]),
.sc-lang:focus-visible:not(:disabled):not([aria-pressed="true"]) {
  background: rgba(255, 255, 255, 0.78);
  color: var(--sc-ink-soft);
  border-color: rgba(0, 105, 180, 0.28);
}

.sc-lang:focus-visible {
  outline: 2px solid var(--sc-blue);
  outline-offset: 2px;
}

.sc-lang input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sc-lang__flag {
  width: 1.15rem;
  height: 0.8rem;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(8, 38, 59, 0.16);
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.sc-lang[aria-pressed="false"] .sc-lang__flag {
  opacity: 0.78;
  filter: saturate(0.55);
}

.sc-lang.is-on,
.sc-lang[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(135deg, var(--sc-blue), #2e9fd4);
  box-shadow: 0 4px 12px rgba(0, 90, 154, 0.22);
  color: #fff;
  font-weight: 800;
  opacity: 1;
}

.sc-lang.is-on .sc-lang__flag,
.sc-lang[aria-pressed="true"] .sc-lang__flag {
  opacity: 1;
  filter: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.sc-lang.is-on:hover:not(:disabled),
.sc-lang[aria-pressed="true"]:hover:not(:disabled) {
  color: #fff;
  filter: brightness(1.06);
}

.sc-lang.is-disabled,
.sc-lang:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.sc-lang.is-locked {
  cursor: default;
}

.sc-status {
  margin: 0;
  padding: 0.35rem 1.25rem 0;
  color: var(--sc-ink-soft);
  font-size: 0.9rem;
}

.sc-status[hidden] {
  display: none;
}

.sc-scroll {
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.75rem;
  -webkit-overflow-scrolling: touch;
}

.sc-grid {
  display: grid;
  grid-template-columns: repeat(var(--sc-cols), minmax(0, 1fr));
  gap: 0.85rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

/* Story compare: shared row tracks across language columns (subgrid).
   Rows: head | title | prose | moral | source | figure.
   Tallest prose pushes moral/source down for every column. */
.sc-grid:has(> .sc-col--align) {
  align-items: stretch;
}

.sc-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--sc-line);
  border-radius: 18px;
  background: var(--sc-panel);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 28px rgba(0, 78, 140, 0.07);
  overflow: hidden;
}

.sc-col--align {
  --story-notes-flow-gap: 0.85rem;
  --story-moral-margin-top: 0.2rem;
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 6;
  row-gap: 0.85rem;
  align-items: start;
}

body.sc-page[data-sc-show-text="false"] .sc-col--align {
  grid-row: span 2;
}

body.sc-page[data-sc-show-illus="false"] .sc-col--align {
  grid-row: span 5;
}

body.sc-page[data-sc-show-text="false"][data-sc-show-illus="false"] .sc-col--align {
  grid-row: span 1;
}

@supports not (grid-template-rows: subgrid) {
  .sc-col--align {
    display: flex;
    flex-direction: column;
    grid-row: auto;
  }
}

.sc-col__head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, #08395a 0%, var(--sc-blue) 58%, #2e9fd4 100%);
  border-bottom: 2px solid var(--sc-gold);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sc-col__head .sc-lang__flag {
  width: 1.25rem;
  height: 0.88rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
  pointer-events: none;
  -webkit-user-drag: none;
}

.sc-col__head-name {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.88;
}

.sc-col__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.05rem 1.1rem 1.25rem;
}

/* Discovery (and legacy) columns: flex stack inside the card. */
.sc-col__copy {
  --story-notes-flow-gap: var(--story-paragraph-gap);
  --story-moral-margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: var(--story-paragraph-gap);
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
}

.sc-col__title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Padded content rows for subgrid story columns (replaces .sc-col__body padding). */
.sc-col--align > .sc-col__title-row,
.sc-col--align > .sc-col__prose,
.sc-col--align > .sc-col__moral-slot,
.sc-col--align > .sc-col__source-slot,
.sc-col--align > .sc-col__figure-slot {
  min-width: 0;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}

.sc-col--align > .sc-col__title-row {
  padding-top: 1.05rem;
}

.sc-col--align > .sc-col__source-slot {
  padding-bottom: 1.25rem;
}

body.sc-page[data-sc-show-illus="true"] .sc-col--align > .sc-col__source-slot {
  padding-bottom: 0;
}

.sc-col--align > .sc-col__figure-slot {
  padding-bottom: 1.25rem;
}

.sc-col__prose {
  display: flex;
  flex-direction: column;
  gap: var(--story-paragraph-gap);
  min-width: 0;
}

.sc-col__moral-slot,
.sc-col__source-slot,
.sc-col__figure-slot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}

.sc-col__source-slot {
  align-items: stretch;
  text-align: center;
}

.sc-col--align > .sc-col__figure-slot .sc-col__figure {
  width: 100%;
}

.sc-col__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--sc-font-display);
  font-size: clamp(1.08rem, 1.7vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--sc-ink);
}

.sc-col__text {
  margin: 0;
  color: var(--sc-ink);
  font-size: clamp(0.92rem, 1.1vw, 1.02rem);
  line-height: var(--story-line-height, 1.35);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.sc-col__figure {
  position: relative;
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  /* Shared 3:2 box (1536×1024) so every language stays the same height. */
  aspect-ratio: 3 / 2;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(223, 242, 255, 0.55), rgba(255, 255, 255, 0.2)),
    #e5f0f8;
  box-shadow: 0 0 0 1px rgba(0, 78, 140, 0.1);
}

.sc-col__figure[hidden] {
  display: none !important;
}

.sc-col__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}

/* Kyrgyz plates are baked into the bitmap. The figure stays the shared 3:2
   box. Top and bottom slices show the title and moral plates at full column
   width (uniform scale, nothing cropped). The middle slice is only the
   artwork: same width scale,
overflow hidden,
vertically centered. */
.sc-col__figure--ky {
  aspect-ratio: 3 / 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  background: #f3ecdc;
}

.sc-ky-slice {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  flex: 0 0 auto;
}

.sc-ky-slice--top {
  aspect-ratio: calc(var(--ky-w) / var(--ky-top-px));
}

.sc-ky-slice--bot {
  aspect-ratio: calc(var(--ky-w) / var(--ky-bot-px));
}

.sc-ky-slice--mid {
  flex: 1 1 0%;
  min-height: 0;
}

.sc-col__figure--ky .sc-col__image {
  position: absolute;
  inset: auto;
  left: 0;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  min-width: 0;
  object-fit: unset;
  object-position: center top;
}

.sc-ky-slice--top .sc-col__image {
  top: 0;
}

.sc-ky-slice--bot .sc-col__image {
  bottom: 0;
}

.sc-ky-slice--mid .sc-col__image {
  top: var(--ky-mid-top, 0%);
}

@media (max-width: 900px) {
  :root {
    --sc-toolbar-btn-height: 1.9rem;
  }

  .sc-toolbar {
    padding: 0.75rem 1rem;
    row-gap: 0.55rem;
    column-gap: 0.65rem;
  }
  .sc-toolbar__brand-wrap {
    flex: 1 1 100%;
    max-width: none;
    margin-right: 0;
  }
  .sc-langs {
    max-width: none;
  }
  .sc-toolbar__globe {
    width: 2rem;
    height: 2rem;
  }
  .sc-toolbar .tools-bar__view-btn {
    padding: 0 0.45rem;
    font-size: 0.78rem;
  }
  .sc-pager__btn {
    font-size: 0.84rem;
  }
  .sc-pager__status {
    width: calc(11ch + 1rem);
    min-width: calc(11ch + 1rem);
    max-width: calc(11ch + 1rem);
    font-size: 0.8rem;
  }
  .sc-scroll {
    padding: 0.85rem 1rem 1.4rem;
  }
  .sc-col__body {
    padding: 0.9rem 0.9rem 1.1rem;
  }
  .sc-col--align > .sc-col__title-row,
.sc-col--align > .sc-col__prose,
.sc-col--align > .sc-col__moral-slot,
.sc-col--align > .sc-col__source-slot,
.sc-col--align > .sc-col__figure-slot {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
  .sc-col--align > .sc-col__title-row {
    padding-top: 0.9rem;
  }
  .sc-col--align > .sc-col__source-slot {
    padding-bottom: 1.1rem;
  }
  body.sc-page[data-sc-show-illus="true"] .sc-col--align > .sc-col__source-slot {
    padding-bottom: 0;
  }
  .sc-col--align > .sc-col__figure-slot {
    padding-bottom: 1.1rem;
  }
  .sc-col__head-name {
    display: none;
  }

  /* Stack language cards on narrow viewports. Each card owns its own subgrid
     row range,
so moral/source stay in normal flow with no cross-column gaps. */
  .sc-grid:has(> .sc-col--align) {
    grid-template-columns: 1fr;
  }
}

.sc-globe-button { border: 0; padding: 0; background: transparent; display: flex; flex: 0 0 auto; align-items: center; cursor: zoom-in; }
.sc-globe-button:focus-visible { outline: 2px solid #0069b4; outline-offset: 3px; }
