/* erceau.com, scene "journee" (My day starts before yours): the globe, the two cities, the double 24 h ruler.
   The shared frame of the scenes (.scene-*) is in main.css. Behaviour: assets/js/scene-journee.js.
   The base state is the complete, still image: it is what shows without JavaScript and in reduced motion. */
.jn { padding-block: clamp(1.9rem, 4vw, 3rem); }
.jn--row { padding-block: .5rem 0; }
.jn-in { position: relative; display: grid; grid-template-columns: 25.625rem minmax(0, 1fr) auto; grid-template-areas: "head head freeze" "globe side side" "globe notes notes" "key key key"; gap: .625rem 3rem; }
.jn .scene-head { grid-area: head; }
.jn .scene-freeze { grid-area: freeze; align-self: start; justify-self: end; }
.jn .scene-key { grid-area: key; margin-top: .25rem; }

/* The globe: a 600 x 720 drawing, the light canvas over it with room for the halos, the two cities on top */
.jn-globe { grid-area: globe; align-self: center; position: relative; width: 100%; aspect-ratio: 600 / 720; }
.jn-gsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.jn-dots { stroke-width: 2.6; }
.jn-glow { stroke-width: 7.2; }
.jn .scene-light { left: -10%; top: -6%; width: 120%; height: 112%; }
.jn-node { position: absolute; width: 2.25rem; height: 2.25rem; margin: -1.125rem 0 0 -1.125rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.jn-nk { left: 81.83%; top: 46.46%; }
.jn-nb { left: 27.72%; top: 25.77%; }
.jn-tag { position: absolute; display: flex; flex-direction: column; padding: .1875rem .5rem; background: rgb(6 16 11 / .82); border: 1px solid rgb(122 168 234 / .22); white-space: nowrap; }
.jn-nk .jn-tag { right: 100%; top: 50%; translate: 0 -50%; margin-right: .125rem; text-align: right; }
.jn-nb .jn-tag { bottom: 100%; left: 50%; translate: -50% 0; text-align: center; }
.jn-name { font-family: var(--f-display); font-weight: 700; font-size: .875rem; line-height: 1.25; }
.jn-nk .jn-name, .jn-desk { color: var(--brass); }
.jn-nb .jn-name { color: var(--cue); }
.jn-val { font-family: var(--f-display); font-weight: 500; font-size: .8125rem; line-height: 1.25; color: var(--chalk-dim); }
.jn-val:empty { display: none; }
.jn-node[aria-pressed="true"] .jn-tag { border-color: currentColor; }
.jn-nk[aria-pressed="true"] { color: var(--brass); }
.jn-nb[aria-pressed="true"] { color: var(--cue); }
.jn-desk { position: absolute; left: 81.83%; top: 97.4%; translate: -50% 0; max-width: none; font-family: var(--f-display); font-weight: 700; font-size: .75rem; line-height: 1; }

/* The ruler: Kalasin above, Brussels below, positions in percent of the 24 hours of Kalasin */
.jn-side { grid-area: side; align-self: end; min-width: 0; }
.jn-ruler { position: relative; padding-left: 12.875rem; }
.jn-axis { position: relative; height: 5.75rem; }
.jn-rsvg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; overflow: visible; font-family: var(--f-display); font-size: .75rem; fill: var(--chalk-dim); }
.jn-rsvg .is-off { visibility: hidden; }
.jn-now-t { font-weight: 700; font-size: .8125rem; }
.jn-now-k { fill: var(--brass); }
.jn-now-b { fill: var(--cue); }
.jn-row { position: absolute; left: -12.875rem; width: 12.125rem; max-width: none; text-align: right; font-family: var(--f-display); font-weight: 700; font-size: .875rem; line-height: 1rem; }
.jn-row small { display: block; margin-top: .125rem; font-weight: 500; font-size: .75rem; line-height: .9375rem; color: var(--chalk-dim); }
.jn-rk { top: 2.3125rem; color: var(--brass); }
.jn-rb { top: 3.375rem; color: var(--cue); }
.jn-target { position: absolute; top: 0; padding: 0; border: 0; background: none; cursor: pointer; color: var(--brass); font-family: var(--f-display); font-weight: 700; font-size: .75rem; line-height: .875rem; }
.jn-target span { position: absolute; top: 0; white-space: nowrap; }
.jn-tp { left: 54.1667%; width: 37.5%; height: 4.5rem; }
.jn-tp span { left: 0; }
.jn-ts { left: 33.3333%; width: max(2rem, 8.3333%); height: 3.5rem; translate: -50% 0; }
.jn-ts span { left: 50%; translate: -50% 0; }
.jn-target[aria-pressed="true"] span { text-decoration: underline; text-underline-offset: 3px; }
.jn .scene-state { margin-top: 1.875rem; min-height: 6.875rem; }
.jn-notes { grid-area: notes; align-self: start; }
.jn-notes .scene-note { margin-top: .75rem; }
.jn-notes .jn-visitor { margin-top: .375rem; min-height: 2.9em; }

/* Legend swatches: the colour is named in the text beside each */
.jn-sw { flex: none; width: .875rem; height: .875rem; border: 1px solid; }
.jn-sw-k { background: rgb(212 171 87 / .45); border-color: #f3dfae; box-shadow: 0 0 8px rgb(212 171 87 / .8); }
.jn-sw-b { background: rgb(122 168 234 / .45); border-color: #e2eeff; box-shadow: 0 0 8px rgb(122 168 234 / .8); }
.jn-sw-n { background: #040a07; border-color: rgb(122 168 234 / .35); }
.jn-sw-l { width: .375rem; height: .375rem; margin-left: .75rem; background: #e2eeff; border-color: #e2eeff; box-shadow: -8px 0 0 -1px rgb(212 171 87 / .8), 0 0 6px #e2eeff; }

@media (min-width: 51.3125rem) and (max-width: 68.75rem) {
  .jn-in { grid-template-columns: 21.25rem minmax(0, 1fr) auto; column-gap: 2rem; }
  .jn .scene-state { min-height: 8.25rem; } /* the narrow column: four lines and a spare one */
  .jn-rsvg .jn-h:nth-child(even) { display: none; }
}
@media (min-width: 51.3125rem) and (max-width: 62.5rem) {
  .jn-ts span { left: auto; right: 0; translate: none; } /* the short axis: the two labels side by side */
}
@media (max-width: 51.25rem) {
  .jn-in { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "freeze" "globe" "side" "notes" "key"; }
  .jn .scene-freeze { justify-self: start; }
  .jn-globe { width: min(20.625rem, 100%); justify-self: center; }
  .jn-ruler { padding-left: 0; margin-top: .375rem; }
  .jn-axis { margin-top: 1.25rem; margin-bottom: 3.625rem; }
  .jn-row { left: 0; width: auto; text-align: left; }
  .jn-rk { top: -1.25rem; }
  .jn-rb { top: calc(100% + .25rem); }
  .jn-row small { display: inline; margin-left: .375rem; }
  .jn .scene-state { margin-top: 0; min-height: 8rem; font-size: .9375rem; }
}
@media (max-width: 30rem) {
  .jn-globe { width: min(16.875rem, 100%, 82vw); } /* the light, 1.2 times as wide, never wider than the window */
  .jn-dots { stroke-width: 3.1; } /* a land point stays 1.4 px wide on the small globe */
  .jn-glow { stroke-width: 8.7; }
  /* the label ends on its band, or starts with the axis when it is too long for that */
  .jn-ts span { left: calc(1rem - (100vw - 2.5rem) / 3); right: 0; min-width: max-content; translate: none; text-align: right; }
  .jn-rsvg .jn-h:nth-child(even) { display: none; }
  .jn-row small { display: block; margin: .125rem 0 0; }
  .jn-name { font-size: .8125rem; }
  .jn-val { font-size: .75rem; }
  .jn-tag { padding: .125rem .375rem; }
}
/* The reserved heights follow the longest sentence on the narrowest screens: nothing grows when a text arrives */
@media (max-width: 20rem) {
  .jn .scene-state { min-height: 9.5rem; }
  .jn-ts { z-index: 1; }
  .jn-tp span { left: auto; right: -22.2222%; } /* ends with the axis: room for the other label */
}
@media (max-width: 18.75rem) {
  .jn .scene-state { min-height: 10.75rem; }
  .jn-notes .jn-visitor { min-height: 4.35em; }
}

/* With the script, the canvas draws the route, the two cities and the halos over the night side: their still copies step aside.
   In forced colours there is no canvas: the still image stays whole, in its own colours on its own felt. */
@media (forced-colors: none) {
  .jn.is-live .jn-over, .jn.is-live .jn-still { visibility: hidden; }
}
@media (forced-colors: active) {
  .jn-globe, .jn-axis { forced-color-adjust: none; background: var(--felt); }
  .jn-row { forced-color-adjust: auto; } /* the names of the two rows sit outside the dark band */
  .jn-desk, .jn-target span { background: var(--felt); } /* these two reach past the felt: they bring their own */
}
