/* ═══════════════════════════════════════════════════════════════
   SOMETHING JEWISH — interactive.css
   Shared skin for the interactive pages copied into the site:
   toledot/, exile-and-return/ and ilmap/.
   Loaded after each page's own styles so these rules win.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --sj-ground: #050505;
  --sj-panel: #0d0c0a;
  --sj-panel-2: #15130f;
  --sj-ink: #F0E6C8;
  --sj-mute: rgba(240, 230, 200, 0.55);
  --sj-line: rgba(240, 230, 200, 0.12);
  --sj-line-strong: rgba(240, 230, 200, 0.24);
  --sj-gold: #ffd400;
  --sj-red: #D42B2B;
  --sj-display: 'Bebas Neue', 'Arial Black', sans-serif;
  --sj-serif: 'Libre Baskerville', Georgia, serif;
  --sj-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ─── BACK LINK (only when the page is opened on its own) ─── */
.sj-back {
  display: inline-block;
  margin: 0 0 12px;
  font-family: var(--sj-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sj-gold);
}

.sj-back:hover {
  color: var(--sj-ink);
}

.sj-embed .sj-back {
  display: none;
}

/* ─── SHARED CONTROLS ─── */
.sj button {
  font-family: var(--sj-mono);
  letter-spacing: 0.06em;
}


/* ═══ WHO RULED THE LAND? (ilmap) ═══ */
.sj-ilmap {
  --bg: var(--sj-ground);
  --panel: var(--sj-panel);
  --ink: var(--sj-ink);
  --mute: var(--sj-mute);
  --line: var(--sj-line);
  --accent: var(--sj-gold);
}

.sj-ilmap.sj-embed {
  --bg: #0D0C08;
}

.sj-ilmap body {
  font-family: var(--sj-serif);
  font-size: 14px;
}

.sj-ilmap h1 {
  font-family: var(--sj-display);
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sj-ilmap .sub,
.sj-ilmap .foot {
  font-family: var(--sj-mono);
  font-size: 11.5px;
  line-height: 1.7;
}

.sj-ilmap.sj-embed .head {
  display: none;
}

.sj-ilmap .mapbox {
  border-radius: 2px;
}

.sj-ilmap .year {
  font-family: var(--sj-display);
  font-weight: 400;
  font-size: clamp(40px, 9vw, 64px);
  letter-spacing: 0.03em;
}

.sj-ilmap .era,
.sj-ilmap .maptag,
.sj-ilmap .ticks,
.sj-ilmap .rowkey,
.sj-ilmap .lg-h,
.sj-ilmap .chip,
.sj-ilmap .card .when {
  font-family: var(--sj-mono);
}

.sj-ilmap .maptitle,
.sj-ilmap .card h2 {
  font-family: var(--sj-serif);
  font-weight: 700;
}

.sj-ilmap .card {
  border-radius: 2px;
}

.sj-ilmap .card p {
  color: rgba(240, 230, 200, 0.82);
  line-height: 1.7;
}

/* Phones & tablets: the map stays pinned at the top of the screen while
   the controls, timeline and story text scroll underneath it.
   (Not in the page's own full-screen mode, where the map fills the screen.) */
@media (max-width: 999px) {
  .sj-ilmap body:not(.fs) .stage {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg);
    padding-bottom: 6px;
    box-shadow: 0 10px 12px -2px var(--bg);
  }
  .sj-ilmap body:not(.fs) #box1 {
    aspect-ratio: auto;
    height: min(105vw, 54vh);
    height: min(105vw, 54svh);
    min-height: 260px;
  }
}

.sj-ilmap button {
  border-radius: 0;
  font-size: 11px;
  text-transform: uppercase;
}

.sj-ilmap button.on {
  background: var(--sj-panel-2);
  border-color: var(--sj-gold);
}

.sj-ilmap button.play {
  background: var(--sj-gold);
  border-color: var(--sj-gold);
  color: #0a0900;
}

.sj-ilmap .chip {
  background: var(--sj-panel-2);
  border-radius: 0;
}

/* zoom buttons on each map (zoom.js) */
.sj-ilmap .zctl {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 2;
}

.sj-ilmap .zctl button {
  width: 32px;
  height: 32px;
  padding: 0;
  font: 400 18px/1 var(--sj-serif);
  text-transform: none;
  background: rgba(13, 12, 8, 0.78);
  border: 1px solid var(--sj-line);
  color: var(--sj-ink);
  backdrop-filter: blur(4px);
}

.sj-ilmap .zctl button:hover {
  border-color: var(--sj-gold);
  color: var(--sj-gold);
}

.sj-ilmap .zctl button.off {
  opacity: 0.4;
}

.sj-ilmap .mapbox svg {
  cursor: grab;
}

.sj-ilmap .mapbox svg.grab {
  cursor: grabbing;
}


/* ═══ EXILE & RETURN (globe) ═══ */
.sj-exile {
  --bg: var(--sj-ground);
  --ink: var(--sj-ink);
  --mute: var(--sj-mute);
  --line: var(--sj-line);
  --accent: var(--sj-gold);
}

.sj-exile body {
  font-family: var(--sj-mono);
}

.sj-exile.sj-embed header {
  display: none;
}

.sj-exile header .kicker {
  font-family: var(--sj-mono);
  font-weight: 500;
  color: var(--sj-red);
}

.sj-exile header h1 {
  font-family: var(--sj-display);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 72px);
  letter-spacing: 0.03em;
  line-height: 0.95;
  text-transform: uppercase;
}

.sj-exile header p,
.sj-exile .card .text {
  font-family: var(--sj-serif);
  font-size: 14.5px;
  line-height: 1.8;
}

.sj-exile .stage {
  border-radius: 2px;
  background: radial-gradient(ellipse at 50% 45%, #15130f 0%, #050505 70%);
}

.sj-exile .badge {
  font-family: var(--sj-display);
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0.03em;
}

.sj-exile .card h2 {
  font-family: var(--sj-serif);
  font-weight: 700;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.25;
}

/* The story column beside the globe: a little smaller than the intro text */
.sj-exile .card .text {
  font-size: 13px;
  line-height: 1.7;
}

.sj-exile .card .when {
  font-size: 12px;
}

.sj-exile .card .when,
.sj-exile .legend,
.sj-exile .fact,
.sj-exile .chip,
.sj-exile .layers label,
.sj-exile footer {
  font-family: var(--sj-mono);
}

.sj-exile .controls button.nav,
.sj-exile .zoom button {
  background: var(--sj-panel-2);
  border-radius: 0;
}

.sj-exile .controls button.play {
  background: var(--sj-gold);
  color: #0a0900;
}

.sj-exile .chip {
  background: var(--sj-panel-2);
  border-radius: 0;
  font-size: 11.5px;
}

.sj-exile .chip.on {
  background: var(--sj-ink);
  border-color: var(--sj-ink);
  color: #0a0900;
}

.sj-exile .fact {
  background: var(--sj-panel);
  border-radius: 0;
}

.sj-exile .fact b {
  font-family: var(--sj-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.03em;
}

.sj-exile .layers label {
  background: rgba(13, 12, 10, 0.85);
  border-radius: 0;
}

.sj-exile.sj-embed .wrap {
  padding-top: 14px;
}


/* ═══ TOLEDOT · GENERATIONS (family tree) ═══ */
.sj-toledot {
  --serif: var(--sj-serif);
  --sans: var(--sj-mono);
}

.sj-toledot[data-theme=night] {
  --bg: #0b0a08;
  --bg2: #16140f;
  --panel: #0e0d0a;
  --stroke: #34302a;
  --ink: #F0E6C8;
  --mute: #a39a86;
  --dim: #6d6657;
  --line: #6e6656;
  --gold: #ffd400;
  --key: #4a1717;
  --keyb: #D42B2B;
  --keyInk: #F0E6C8;
  --keySub: #e3c9bd;
  --present: #F0E6C8;
  --presentInk: #0b0a08;
  --heCal: #ffd400;
  --era: #6e6656;
  --lostInk: #a39a86;
}

.sj-toledot .title h1 {
  font-family: var(--sj-display);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sj-toledot .title .sj-back {
  display: block;
  margin-bottom: 6px;
}

.sj-toledot.sj-embed .title {
  display: none;
}

.sj-toledot .win .whead h3 {
  font-family: var(--sj-display);
  font-size: 19px;
  letter-spacing: 0.05em;
}

.sj-toledot #panel,
.sj-toledot .pop,
.sj-toledot .results {
  border-radius: 2px;
}

.sj-toledot #panel h2 {
  font-family: var(--sj-serif);
  font-size: 26px;
}

.sj-toledot .note,
.sj-toledot .mean {
  font-family: var(--sj-serif);
}

.sj-toledot .note {
  font-size: 13px;
  line-height: 1.75;
}

.sj-toledot .search input {
  border-radius: 0;
  font-family: var(--sj-mono);
}


/* ═══ INSIDE THE SITE (sj-embed) ═══ */
/* Let the card behind the frame show through */
.sj-ilmap.sj-embed,
.sj-ilmap.sj-embed body,
.sj-exile.sj-embed,
.sj-exile.sj-embed body {
  background: transparent;
}

.sj-exile.sj-embed .wrap {
  padding-bottom: 12px;
}

@media (min-width: 1100px) {
  .sj-exile.sj-embed .stage {
    height: calc(100vh - 150px) !important;
  }

  .sj-exile.sj-embed .card {
    max-height: calc(100vh - 150px);
  }
}

.sj-toledot.sj-embed header {
  background: none;
}

/* ilmap inside the site: fill the frame exactly, so it never scrolls inside */
.sj-ilmap.sj-embed .wrap {
  padding-bottom: 6px;
}

.sj-ilmap.sj-embed .foot {
  display: none;
}

@media (min-width: 1000px) {
  .sj-ilmap.sj-embed {
    --mapH: max(300px, calc(100vh - 150px));
  }
}

/* Toledot: the scientific timeline above Year 1 gets its own, cooler tint */
.sj-toledot .sci {
  fill: #5b7fd6;
  opacity: 0.08;
}

.sj-toledot[data-theme="parchment"] .sci {
  opacity: 0.12;
}

/* Toledot: "Reading the tree" has smaller, calmer text */
.sj-toledot #legend {
  font-family: var(--sj-serif);
  font-size: 10.5px;
  line-height: 1.45;
}

.sj-toledot #legend .rl,
.sj-toledot #legend .fine {
  font-size: 9.5px;
}

/* Toledot: slim scrollbars that match the dark panels */
.sj-toledot * {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 212, 0, 0.35) transparent;
}

.sj-toledot ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.sj-toledot ::-webkit-scrollbar-track {
  background: transparent;
}

.sj-toledot ::-webkit-scrollbar-thumb {
  background: rgba(255, 212, 0, 0.35);
  border-radius: 3px;
}

.sj-toledot ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 212, 0, 0.6);
}

/* Exile & Return, wide screens: the story column is as tall as the globe.
   Title on top, the two fact boxes pinned at the bottom, only the story text scrolls (if it must). */
@media (min-width: 1100px) {
  .sj-exile .card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 210px);
    min-height: 420px;
    max-height: none;
    overflow: hidden;
    padding-right: 0;
  }

  .sj-exile.sj-embed .card {
    height: calc(100vh - 150px);
    max-height: none;
  }

  .sj-exile .card .head {
    flex: none;
  }

  .sj-exile .card > div:last-child {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .sj-exile .card .text {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 10px;
    padding-bottom: 22px;
    overscroll-behavior: contain;
    /* soft fade where the text runs under the fact boxes; the bottom padding keeps the last line clear */
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
  }

  .sj-exile .card .facts {
    flex: none;
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--sj-line);
  }
}

/* Exile & Return: a slim, quiet scrollbar that warms to gold on hover.
   Chrome/Safari use the ::-webkit rules (no arrow buttons); Firefox gets the standard ones. */
@supports not selector(::-webkit-scrollbar) {
  .sj-exile .card .text {
    scrollbar-width: thin;
    scrollbar-color: rgba(236, 230, 218, 0.18) transparent;
  }

  .sj-exile .card .text:hover {
    scrollbar-color: rgba(255, 212, 0, 0.5) transparent;
  }
}

.sj-exile .card .text::-webkit-scrollbar-button {
  display: none;
}

.sj-exile .card .text::-webkit-scrollbar {
  width: 5px;
}

.sj-exile .card .text::-webkit-scrollbar-track {
  background: transparent;
}

.sj-exile .card .text::-webkit-scrollbar-thumb {
  background: rgba(236, 230, 218, 0.18);
  border-radius: 3px;
}

.sj-exile .card .text:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 212, 0, 0.5);
}
