/* St. John Almanac: Sun at your spot, the page's own layout. Its parts sit under the prefix "su-".
   The look of its figures, drawings, keys and look-out words is in parts.css, which any page showing them shares.
   Every colour is one of the site's tokens, so day and night both work. */

/* Parts that only a script can fill stay out of sight until the script is running. Written against
   the root so that it outweighs the layout rules below, and so that those rules alone decide how
   a part is laid out once it shows. */
html:not(.su-on) .su-js { display: none; }

.su-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem 2rem; padding-block: 1.25rem 1.5rem; }
@media (min-width: 54rem) { .su-stage { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; } }
.su-stage h2 { font-size: var(--step-2); margin-bottom: 0.6rem; }
.su-panel { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.su-where { font-family: var(--display); font-weight: 400; font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.01em; }
.su-coords { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.su-status { margin: 0; min-height: 1.3em; font-size: var(--step--1); color: var(--ink-soft); }

.su-dateline { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
.su-dateline label { display: flex; flex-direction: column; gap: 0.25rem; }
.su-date { font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px; padding: 0.5rem 0.6rem; min-height: 2.75rem; }
.su-days { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.su-days button {
  font: inherit; font-size: var(--step--1); font-weight: 600; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule); border-radius: 8px; padding: 0.45rem 0.7rem; min-height: 2.75rem; cursor: pointer;
}
.su-days button:hover { border-color: var(--ink); }
.su-date:focus-visible, .su-days button:focus-visible, .su-time:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

.su-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1.25rem; margin: 0; }
.su-figures > div { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; border-top: 2px solid var(--accent); padding-top: 0.45rem; }
.su-figures > div:last-child { grid-column: 1 / -1; }
.su-figures dd { margin: 0; }
.su-figures .figure-lg { font-size: clamp(1.5rem, 2.2vw + 1rem, 2.1rem); }
.su-figures .figure-lg small { font-size: 0.5em; }
.su-more { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }

.su-body { display: flex; flex-direction: column; gap: clamp(2rem, 4vw, 3rem); padding-block: clamp(1.75rem, 4vw, 2.75rem); }
.su-body section { display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }
.su-body section > p, .su-body section > ul { max-width: var(--measure); margin: 0; }
.su-body section > ul { padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; }
.su-body h2 { font-size: var(--step-2); }

/* the drawings (their look is in parts.css): a tap on the year chooses a day; a wide drawing on a wide screen, a narrow one on a phone */
.su-carpet { cursor: pointer; }
.su-narrow { display: none; flex-direction: column; gap: 0.5rem; }
.su-narrow p { margin: 0; }
@media (max-width: 43.99rem) { .su-wide { display: none; } .su-narrow { display: flex; } }

/* the keys sit in a row, not as the section's other lists do */
.su-body section > ul.su-key { flex-direction: row; gap: 0.4rem 1.25rem; padding: 0; max-width: none; }

/* the island, lit */
.su-views, .su-extras { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.su-views button {
  font: inherit; font-size: var(--step--1); font-weight: 600; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule); border-radius: 8px; padding: 0.5rem 0.8rem; min-height: 2.75rem; cursor: pointer;
}
.su-views button:hover { border-color: var(--ink); }
.su-views button[aria-pressed="true"] { background: var(--press); color: var(--on-press); border-color: var(--press); }
.su-views button:focus-visible, .su-extras .button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.su-view3d canvas:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }      /* inside the picture: its holder clips anything outside */
.su-extras .button { padding: 0.5rem 0.8rem; min-height: 2.75rem; font-size: var(--step--1); }
.su-extras .button[aria-pressed="true"] { border-color: var(--ink); background: var(--land); }
.su-lit { min-width: 0; }
.su-view3d { position: relative; border: 1px solid var(--water-edge); border-radius: 6px; overflow: hidden; background: var(--water); }
.su-view3d[hidden], .su-shadowmap[hidden] { display: none; }
.su-beside { margin: 0; font-weight: 600; }

/* the flat map and the time */
.su-shadowmap { border: 1px solid var(--water-edge); border-radius: 6px; overflow: hidden; background: var(--water); }
.su-timeline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; }
.su-time { width: 100%; min-height: 2.75rem; accent-color: var(--accent); }
.su-clock { font-family: var(--display); font-size: var(--step-2); min-width: 5.2ch; text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.su-clock small { font-family: var(--text); font-size: 0.55em; font-weight: 600; margin-left: 0.15em; }
.su-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 */
  .su-timeline { grid-template-columns: minmax(0, 1fr) auto; }
  .su-timeline label { grid-column: 1 / -1; grid-row: 1; }
}

/* ----- the island is the head of the page ----- */
.su-head { min-height: clamp(21rem, 70svh, 46rem); }
.su-head .su-view3d, .su-head .su-shadowmap { position: absolute; inset: 0; z-index: -2; border: 0; border-radius: 0; }
.su-head .su-shadowmap { display: flex; align-items: center; background: var(--water); }
.su-head .su-shadowmap[hidden] { display: none; }
.su-head .su-shadowmap > * { width: 100%; }
.su-head::after, .su-head .page-head-in, .su-head .page-head-credit { pointer-events: none; }      /* the title lies over the island and lets the hand through to it */
.su-head[data-view="flat"]::after { background: linear-gradient(180deg, rgba(var(--photo-shade), 0) 55%, rgba(var(--photo-shade), 0.62) 100%); }
.su-head .ti-view-tools { top: 0.75rem; bottom: auto; left: var(--gutter-l, 16px); }
.su-under { display: flex; flex-direction: column; gap: 0.9rem; padding-block: 1.1rem 1.4rem; }
.su-under > * { margin: 0; }
.su-missing { font-size: var(--step--1); color: var(--ink-soft); }
.su-figures.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.su-foot { display: flex; flex-direction: column; gap: 0.6rem; }

@media (min-width: 54rem) { .su-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); } }      /* the figures, then the map */
