/* Bible Tiles — a risograph print on a dark desk. */

:root {
  --paper: #f4eee1;
  --desk: #27231f;
  --navy: #2c3a73;
  --teal: #15958f;
  --red: #ec5a43;
  --yellow: #f6c522;
  --pink: #f59fac;
  --gutter: clamp(8px, 2.4vw, 34px);
  --display: "Fraunces", Georgia, serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--desk);
  overflow: hidden;
}

body {
  font-family: var(--body);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
}

/* the printed sheet */
.sheet {
  position: fixed;
  inset: var(--gutter);
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#stage.is-over { cursor: pointer; }
#stage.is-dragging { cursor: grabbing; }


/* title, printed top-left */
.masthead {
  position: absolute;
  top: 26px;
  left: 34px;
  pointer-events: none;
}
.masthead__kicker, .masthead__title, .masthead__ref { mix-blend-mode: multiply; }
/* on the scrolling story map, islands slide under a paper backing */
.sheet.is-menu .masthead {
  top: 0;
  left: 0;
  right: 0;
  padding: 26px 34px 14px;
  background: var(--paper);
  box-shadow: 0 6px 12px 4px var(--paper);
  z-index: 1;
}
.masthead__kicker {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}
/* "← All stories" link shown inside a story */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 6px;
  padding: 5px 12px 5px 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
  background: var(--paper);
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--teal);
  pointer-events: auto;
  mix-blend-mode: normal;
}
.back-link[hidden] { display: none; }
.back-link:hover { background: var(--yellow); }
.back-link:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.back-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.masthead__kicker[hidden] { display: none; }

.masthead__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 3.2vw, 40px);
  line-height: 1;
  color: var(--red);
  /* a second "drum" of navy, printed slightly out of line */
  text-shadow: 1.5px 1.5px 0 rgba(44, 58, 115, 0.35);
}
.masthead__ref {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 700;
}


/* caption bar + controls */
.caption-bar {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(680px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1.5px solid var(--navy);
  box-shadow: 5px 5px 0 var(--red);
}
.caption {
  flex: 1;
  min-width: 0;
  padding: 0 4px;
}
.caption__count {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}
.caption__text {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.btn {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1.5px solid var(--navy);
  border-radius: 50%;
  background: var(--paper);
  color: var(--navy);
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--yellow); }
.btn:active { transform: translate(1px, 1px); }
.btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn--play .icon-play { display: none; fill: currentColor; }
.btn--play.is-paused .icon-play { display: block; }
.btn--play.is-paused .icon-pause { display: none; }

/* on the story map there's no tour to control */
.sheet.is-menu .btn { display: none; }

/* the verse card that follows your cursor */
.verse-card {
  position: absolute;
  z-index: 5;
  width: min(360px, calc(100% - 24px));
  padding: 14px 16px 12px;
  background:
    radial-gradient(circle, rgba(246, 197, 34, 0.28) 35%, transparent 40%) 0 0 / 5px 5px,
    var(--paper);
  border: 1.5px solid var(--navy);
  box-shadow: 5px 5px 0 var(--teal);
  pointer-events: none;
}
.verse-card[hidden] { display: none; }
.verse-card.is-pinned {
  left: 50% !important;
  top: auto !important;
  transform: translateX(-50%);
  pointer-events: auto;
}
.vc-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--teal);
}
.vc-ref {
  margin: 2px 0 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  line-height: 1.1;
  color: var(--red);
}
.vc-sub {
  margin: -4px 0 8px;
  font-size: 14px;
  font-weight: 700;
}
.vc-summary {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}
.vc-cta {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--teal);
}
.vc-cta--soon { color: var(--red); }
.vc-verses p {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.45;
}
.vc-verses sup {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
}
.vc-note {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px dashed rgba(44, 58, 115, 0.4);
  font-size: 14px;
  line-height: 1.35;
}
.vc-note + .vc-note { border-top: 0; margin-top: 4px; padding-top: 0; }
.vc-source {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* phones */
@media (max-width: 640px) {
  .masthead { top: 18px; left: 22px; }
  .sheet.is-menu .masthead { top: 0; left: 0; padding: 18px 22px 10px; }
  .masthead__ref { font-size: 12px; }
  .caption-bar { bottom: 12px; gap: 6px; padding: 8px; box-shadow: 4px 4px 0 var(--red); }
  .caption__text { font-size: 15px; }
  .btn { width: 40px; height: 40px; }
  #btn-prev { display: none; }
}
