/* St. John Almanac: the night sky, the page's own layout. Its parts sit under the prefix "sk-".
   The page's colours are the site's tokens. The sky itself is drawn in its own colours (draw.js), the same by day
   and by night, since it is a picture of the night; the words laid over it use the tokens made for words on a picture. */

/* Parts that only a script can fill stay out of sight until the script is running. */
html:not(.sk-on) .sk-js { display: none; }

/* ----- the sky is the head of the page ----- */
.sk-head { min-height: clamp(22rem, 72svh, 48rem); background: var(--forest); }
.sk-view { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.sk-view canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.sk-view canvas:active { cursor: grabbing; }
.sk-view canvas:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: -3px; }
.sk-head.sk-free .sk-view canvas { touch-action: none; }      /* the reader has asked for one finger to look every way */
.sk-head::after, .sk-head .page-head-in { pointer-events: none; }      /* the title lies over the sky and lets the hand through to it */
.sk-head::after { background: linear-gradient(180deg, rgba(var(--photo-shade), 0) 62%, rgba(var(--photo-shade), 0.55) 100%); }

/* the words laid over the sky */
.sk-over { position: absolute; inset: 0; pointer-events: none; overflow: hidden; font-family: var(--text); }
.sk-over span { position: absolute; transform: translate(-50%, -50%); font-size: 0.74rem; font-weight: 600; line-height: 1; white-space: nowrap; color: var(--on-photo); opacity: 0.86; text-shadow: 0 0 4px rgba(var(--photo-shade), 0.9), 0 0 2px rgba(var(--photo-shade), 0.9); }
.sk-over .sk-o-star { transform: translate(0.55rem, -50%); font-weight: 500; opacity: 0.78; }
.sk-over .sk-o-planet { transform: translate(0.6rem, -50%); color: var(--gold-bright); opacity: 1; font-weight: 700; }
.sk-over .sk-o-moon { transform: translate(-50%, 1.1rem); opacity: 1; font-weight: 700; }
.sk-over .sk-o-con { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--on-forest-soft); opacity: 0.7; }
.sk-over .sk-o-way { font-size: 0.82rem; font-weight: 700; opacity: 0.95; }
.sk-over .sk-o-way.sk-o-q { font-size: 0.7rem; font-weight: 600; opacity: 0.7; }
.sk-over .sk-o-pick { width: 1.5rem; height: 1.5rem; border: 2px solid var(--gold-bright); border-radius: 50%; opacity: 1; }

/* ----- under the sky: the hour, the switches, the card ----- */
.sk-under { display: flex; flex-direction: column; gap: 0.9rem; padding-block: 1.1rem 1.4rem; }
.sk-under > * { margin: 0; }
.sk-timeline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; }
.sk-timeline label { display: flex; flex-direction: column; gap: 0.25rem; }
.sk-time { width: 100%; min-height: 2.75rem; accent-color: var(--accent); }
.sk-clock { font-family: var(--display); font-size: var(--step-2); min-width: 5.2ch; text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.sk-clock small { font-family: var(--text); font-size: 0.55em; font-weight: 600; margin-left: 0.15em; }
.sk-timeline .button { padding: 0.55rem 0.9rem; min-height: 2.75rem; min-width: 7.5rem; }
@media (max-width: 30rem) {      /* on a phone the slider takes a row of its own */
  .sk-timeline { grid-template-columns: minmax(0, 1fr) auto; }
  .sk-timeline label { grid-column: 1 / -1; grid-row: 1; }
}
.sk-extras { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: end; }
.sk-extras .button { padding: 0.5rem 0.8rem; min-height: 2.75rem; font-size: var(--step--1); }
.sk-extras .button[aria-pressed="true"] { border-color: var(--ink); background: var(--land); }
.sk-datefield { display: flex; flex-direction: column; gap: 0.2rem; }
.sk-date { font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px; padding: 0.45rem 0.6rem; min-height: 2.75rem; }
.sk-time:focus-visible, .sk-date:focus-visible, .sk-extras .button:focus-visible, .sk-timeline .button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sk-missing { font-size: var(--step--1); color: var(--ink-soft); }

/* the card for what was pressed: over the foot of the sky, where the reader is looking; the title gives way to it while it shows */
.sk-head.sk-carding .page-head-in { visibility: hidden; }
.sk-card { position: absolute; z-index: 1; left: var(--gutter-l, 16px); right: var(--gutter-r, 16px); bottom: 0.9rem; max-width: 34rem; max-height: 62%; overflow: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 0.3rem; padding: 0.8rem 2.9rem 0.85rem 0.95rem; border-radius: 10px; border-left: 4px solid var(--gold-bright);
  background: rgba(var(--photo-shade), 0.84); color: var(--on-photo); box-shadow: 0 6px 24px rgba(var(--photo-shade), 0.5); }
.sk-card[hidden] { display: none; }
.sk-card h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: var(--step-2); line-height: 1.15; }
.sk-card p { margin: 0; font-size: var(--step--1); line-height: 1.45; }
.sk-card .sk-card-kind { font-weight: 700; color: var(--gold-bright); }      /* not in capitals: a star's Greek letter must stay itself */
.sk-card .sk-card-when { font-weight: 600; }
.sk-card .fineprint { color: var(--on-forest-soft); font-weight: 400; }
.sk-card-close { position: absolute; top: 0.35rem; right: 0.35rem; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 8px; background: transparent; color: var(--on-photo); font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.sk-card-close:hover { background: rgba(var(--photo-shade), 0.6); }
.sk-card-close:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: -3px; }

/* ----- tonight from here, and the spot ----- */
.sk-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem 2rem; padding-block: 1.25rem 1.5rem; }
@media (min-width: 54rem) { .sk-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); align-items: start; } }
.sk-stage h2 { font-size: var(--step-2); margin-bottom: 0.6rem; }
.sk-panel { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.sk-where { font-family: var(--display); font-weight: 400; font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.01em; }
.sk-coords, .sk-status { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.sk-status { min-height: 1.3em; }
.sk-figures.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.sk-figures .tile-n { font-size: clamp(1.5rem, 1.6vw + 1.1rem, 2.1rem); }
.sk-figures .tile-n small { font-size: 0.5em; }

.sk-body { display: flex; flex-direction: column; gap: clamp(2rem, 4vw, 3rem); padding-block: clamp(1.75rem, 4vw, 2.75rem); }
.sk-body section { display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }
.sk-body section > p { max-width: var(--measure); margin: 0; }
.sk-body h2 { font-size: var(--step-2); }
/* A number column with a column of words after it: the shell's rule for a number column leaves no room on its right, which
   suits a last column; here the next column's words would run on from the figure ("19°15 February"). */
.sk-body table.data td.n:not(:last-child), .sk-body table.data th.n:not(:last-child) { padding-right: 1.5rem; }
