/* ToR Masterclass, unit layout option 4 "Light Cone": the online reader (design/unit/option_4/unit.css).
   Loaded after assets/theme/site.css on the unit pages. The title is a spacetime diagram on Deep Field: the
   coordinate grid, an amber ct axis and a lens-blue x axis crossing at the event of the unit, the photograph
   held in the future light cone (duotone by filter), the past cone as faint lines, the title on a Deep Field
   plate to the right of the axis. The text column keeps the amber worldline at its left with the arrow of
   time at the top; every section is an event on it (amber dot, tick, number). The boxes are spines: a frame in
   the tone with a filled bar at the left carrying the kind reading downwards, the title beside it.
   Tokens from assets/theme/tokens.css; the site's Schibsted Grotesk and Wix Madefor Text. */

/* ---------------------------------------------------------------- title diagram */
.reader-hero { --ax: 22vw; --ay: 300px; position: relative; overflow: hidden; padding-top: var(--ay); background-color: var(--deep); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 48px 48px; background-position: left top; border-bottom: 1px solid var(--hair-strong); }
.reader-hero img.bg { filter: grayscale(1) sepia(1) hue-rotate(190deg) saturate(2.4) brightness(.7) contrast(1.25); opacity: .95; object-position: 30% 60%; clip-path: polygon(var(--ax) var(--ay), 0 calc(var(--ay) - var(--ax)), 0 0, calc(var(--ax) + var(--ay)) 0); pointer-events: none; }
/* the axes: ct in amber through the event, x in lens blue */
.reader-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background-image: linear-gradient(to right, transparent calc(var(--ax) - 1px), var(--ring) calc(var(--ax) - 1px), var(--ring) calc(var(--ax) + 1px), transparent calc(var(--ax) + 1px)), linear-gradient(to bottom, transparent calc(var(--ay) - 1px), rgba(142, 197, 255, .75) calc(var(--ay) - 1px), rgba(142, 197, 255, .75) var(--ay), transparent var(--ay)); }
/* the future light cone: two edges at 45 degrees from the event */
.reader-hero::after { content: ""; position: absolute; left: var(--ax); top: calc(var(--ay) - 1600px); width: 1600px; height: 1600px; box-sizing: border-box; border-left: 1px solid rgba(142, 197, 255, .8); border-bottom: 1px solid rgba(142, 197, 255, .8); transform-origin: 0 100%; transform: rotate(-45deg); z-index: 1; pointer-events: none; }
.reader-hero .wrap { position: relative; z-index: 2; margin: 0 0 0 var(--ax); max-width: 860px; padding: 24px 28px 60px 52px; background: var(--deep); }
/* the past cone, behind the title plate */
.reader-hero .wrap::before { content: ""; position: absolute; left: 0; top: 0; width: 1600px; height: 1600px; box-sizing: border-box; border-left: 1px solid rgba(142, 197, 255, .35); border-top: 1px solid rgba(142, 197, 255, .35); transform-origin: 0 0; transform: rotate(45deg); z-index: -1; pointer-events: none; }
/* the event */
.reader-hero .wrap::after { content: ""; position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--ring); }
.reader-hero .eyebrow { font: 600 14px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ring); }
.reader-hero h1 { color: #fff; margin: 14px 0 12px; max-width: 14em; font-size: clamp(32px, 4.2vw, 54px); }
.reader-hero .sub { font: 400 italic 20px/1.45 var(--sans); color: var(--star); max-width: 36em; margin-bottom: 26px; }
.reader-hero .reader-actions { padding-top: 22px; border-top: 1px solid rgba(142, 197, 255, .5); max-width: 36em; }
.reader-hero .credit { z-index: 3; color: var(--dust); }

/* ---------------------------------------------------------------- reader */
.reader { background: #fff; }
.toc .eyebrow { font: 600 13px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ring); }
.toc a { border-left: 1px solid var(--page-line); color: var(--page-muted); }
.toc a:hover, .toc a.is-active { color: var(--page-ink); border-color: var(--ring); border-left-width: 2px; }
.reader #preview.eyebrow { color: var(--page-accent); }
/* the worldline of the text column, with the arrow of time */
.unit-text { position: relative; }
.unit-text::before { content: ""; position: absolute; left: -24px; top: -40px; bottom: -50px; width: 2px; background: var(--ring); pointer-events: none; }
.unit-text::after { content: ""; position: absolute; left: -29px; top: -50px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid var(--ring); pointer-events: none; }
/* sections as events: dot on the line, tick to the heading, number left of the line */
.unit-text h2 { position: relative; border-bottom: 1px solid var(--page-line); padding-bottom: .35em; }
.unit-text h2::before { content: ""; position: absolute; left: -30px; top: .4em; width: 14px; height: 14px; border-radius: 50%; background: var(--ring); }
.unit-text h2::after { content: ""; position: absolute; left: -16px; top: calc(.4em + 6px); width: 16px; height: 1px; background: var(--page-line); }
.unit-text h2 .secno { position: absolute; right: calc(100% + 42px); top: 0; margin: 0; font: 600 .8em/1.12 var(--serif); letter-spacing: -.01em; color: var(--ring); vertical-align: 0; }
.unit-text h3 { position: relative; }
.unit-text h3::before { content: ""; position: absolute; left: -28px; top: .38em; width: 10px; height: 10px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--ring); background: #fff; }
.unit-text h3::after { content: ""; position: absolute; left: -18px; top: calc(.38em + 4px); width: 18px; height: 1px; background: var(--page-line); }
.unit-text h3 .secno { position: absolute; right: calc(100% + 42px); top: .1em; margin: 0; font: 600 .72em/1.3 var(--serif); color: var(--ring); vertical-align: 0; }
.unit-text h4 { font: 600 italic 18px/1.3 var(--sans); }
.unit-text figcaption { font: 400 15px/1.5 var(--sans); color: var(--page-muted); }
.unit-text figcaption b { color: var(--page-ink); }
.unit-text table { border: 1px solid var(--page-ink); background: #fff; }
.unit-text th { border-bottom: 1px solid var(--page-ink); background: var(--page-2); font: 600 15px/1.4 var(--sans); }

/* ---------------------------------------------------------------- boxes: spines */
.reader .box { position: relative; margin: 2em 0; padding-left: 30px; border: 1px solid var(--bx); border-radius: 0; background: #fff; }
.reader .box-keyequation, .reader .box-law, .reader .box-laws, .reader .box-keypoints, .reader .box-objectives, .reader .box-questions, .reader .box-research, .reader .box-interactive { background: var(--bx-l); }
.reader .box .box-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 14px 22px 2px 20px; background: transparent; color: var(--bx); border: 0; }
.reader .box .box-kind { position: absolute; left: -1px; top: -1px; bottom: -1px; width: 30px; box-sizing: border-box; margin: 0; padding: 14px 0; background: var(--bx); color: #fff; writing-mode: vertical-rl; font: 600 11.5px/30px var(--sans); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); }
.reader .box .box-title { font: 600 17px/1.35 var(--sans); color: var(--bx); }
.reader .box .box-body { padding: 4px 22px 6px 20px; }
.reader .box-derivation .box-title { color: var(--page-ink); }
.reader .box-derivation .box-body { font-size: .96em; }
.reader .box-excursion .box-title { font-style: italic; }
.reader .box-research .box-head { padding-top: 18px; }
.reader .box-research .box-name { font: 600 24px/1.15 var(--serif); color: var(--page-ink); }
.reader .box-research .box-inst { font: 400 italic 17px/1.3 var(--sans); color: var(--page-muted); }
.reader .box-research .box-body { padding-top: 10px; }
.reader .box-lead { font-weight: 600; color: var(--bx); }
.reader .box-keypoints .box-head { padding: 0; }
.reader .box-keypoints .box-body { padding-top: 18px; }
.reader .box-questions .box-head { padding: 14px 22px 2px 20px; }
.reader .box-questions .box-body { padding-top: 4px; }
/* the opening questions: the sentence is the title, the bar is blank */
.reader .box-objectives .box-kind, .reader .box-questions .box-kind { position: static; width: auto; padding: 0; margin: 0; background: transparent; color: var(--bx); writing-mode: horizontal-tb; font: 600 16px/1.4 var(--sans); letter-spacing: 0; text-transform: none; white-space: normal; overflow: visible; }
.reader .box-objectives::before, .reader .box-questions::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 30px; background: var(--bx); }
.reader .box-check .opt { border-color: var(--page-line); background: #fff; }
.reader .box-check .opt:hover { border-color: var(--bx); }
.reader .box-check .check-result { border-top: 1px solid rgba(142, 59, 102, .25); }
.reader .box-interactive .ia-stage { border: 1px solid var(--page-line); }
.paperlink { border-top: 1px solid var(--page-line); }
.paperlink span { font: 600 13px/1 var(--sans); letter-spacing: .04em; color: var(--page-muted); }

/* ---------------------------------------------------------------- end */
.reader-end { background: var(--deep); color: var(--star); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 48px 48px; border-top: 2px solid var(--ring); }
.unit-pager { border-top: 1px solid var(--page-line); }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1080px) {
  /* one column: the numbers return into the line, the worldline stays in the column's padding */
  .unit-text h2 .secno, .unit-text h3 .secno { position: static; display: inline-block; margin-right: .5em; }
}
@media (max-width: 860px) {
  .reader-hero { --ax: 24px; --ay: 220px; }
  .reader-hero .wrap { padding: 20px 20px 44px 22px; }
  .reader-hero h1 { font-size: 32px; }
  .reader-hero .sub { font-size: 17px; }
  .reader-hero .reader-actions { padding-top: 18px; }
}
@media (max-width: 560px) {
  .unit-text::before { left: -14px; top: -24px; bottom: -34px; }
  .unit-text::after { left: -19px; top: -34px; }
  .unit-text h2::before { left: -19px; width: 10px; height: 10px; top: .45em; }
  .unit-text h2::after, .unit-text h3::after { display: none; }
  .unit-text h3::before { left: -18px; width: 8px; height: 8px; }
  .reader .box { padding-left: 24px; }
  .reader .box .box-kind, .reader .box-objectives::before, .reader .box-questions::before { width: 24px; }
  .reader .box .box-kind { font: 600 10.5px/24px var(--sans); padding: 12px 0; }
  .reader .box-objectives .box-kind, .reader .box-questions .box-kind { width: auto; padding: 0; font: 600 15px/1.4 var(--sans); }
  .reader .box .box-head { padding: 12px 15px 2px 14px; }
  .reader .box .box-body { padding-left: 14px; padding-right: 15px; }
}
