/* St. John Almanac: the sea floor. Its own parts sit under the prefix "sf-". Every colour is one of
   the site's tokens, except the key's swatches, which are the depth scale's own colours (../terrain/depth.js). */

/* 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, which alone decide how a part is laid out once it shows. */
html:not(.sf-on) .sf-js { display: none; }
.sf-hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.sf-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem 2rem; padding-block: 1.25rem 1.5rem; }
@media (min-width: 60rem) { .sf-stage { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); align-items: start; } }
.sf-main, .sf-panel { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.sf-panel h2 { font-size: var(--step-2); }

.sf-views, .sf-stops { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sf-views button, .sf-stops 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;
}
.sf-views button:hover, .sf-stops button:hover { border-color: var(--ink); }
.sf-views button[aria-pressed="true"], .sf-stops button[aria-pressed="true"] { background: var(--press); color: var(--on-press); border-color: var(--press); }
.sf-views button:focus-visible, .sf-stops button:focus-visible, .sf-drop:focus-visible, .sf-panel .button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sf-view3d canvas:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }      /* inside the picture: its holder clips anything outside */

.sf-view3d { position: relative; border: 1px solid var(--water-edge); border-radius: 6px; overflow: hidden; background: var(--water); }
.sf-view3d[hidden], .sf-flat[hidden] { display: none; }
.sf-flat { border: 1px solid var(--water-edge); border-radius: 6px; overflow: hidden; background: var(--water); }
.sf-over { position: absolute; inset: 0; pointer-events: none; overflow: hidden; font-family: var(--text); }
.sf-over span { position: absolute; transform: translate(-50%, -50%); font-size: 0.74rem; font-weight: 600; line-height: 1; white-space: nowrap; color: var(--ink); text-shadow: 0 0 3px var(--sheet), 0 0 3px var(--sheet), 0 0 2px var(--sheet); }
.sf-over .sf-over-passage { font-weight: 700; font-style: italic; }
.sf-over .sf-over-shoal { color: var(--ink-soft); }

.sf-slide { display: flex; flex-direction: column; gap: 0.3rem; }
.sf-drop { width: 100%; min-height: 2.75rem; accent-color: var(--accent); }
.sf-level { margin: 0; font-family: var(--display); font-size: var(--step-2); line-height: 1.2; }
.sf-panel .button { align-self: flex-start; padding: 0.55rem 0.9rem; min-height: 2.75rem; }
.sf-panel .button[aria-pressed="true"] { border-color: var(--ink); background: var(--land); }
.sf-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1.25rem; margin: 0; }
.sf-figures > div { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; border-top: 2px solid var(--accent); padding-top: 0.45rem; }
.sf-figures dd { margin: 0; }
.sf-figures .figure-lg { font-size: clamp(1.4rem, 1.8vw + 0.9rem, 1.9rem); }
.sf-figures .figure-lg small { font-size: 0.5em; margin-left: 0.2em; }
.sf-status { margin: 0; min-height: 1.3em; font-size: var(--step--1); color: var(--ink-soft); }
.sf-status:empty { display: none; }

.sf-key { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: 0; padding: 0; list-style: none; font-size: var(--step--1); color: var(--ink-soft); }
.sf-key li { display: flex; align-items: center; gap: 0.45rem; }
.sf-key i { display: inline-block; flex: none; width: 1.4rem; height: 0.75rem; border-radius: 2px; border: 1px solid var(--rule); }
/* the key's swatches take their colours from the depth scale itself (../terrain/depth.js), written by the script */
.sf-key .k-line { height: 0; border: 0; border-top: 2px solid var(--ink-soft); border-radius: 0; }
.sf-key .sf-key-more { flex-basis: 100%; }

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

/* ----- the sea floor is the head of the page ----- */
.sf-head { min-height: clamp(21rem, 70svh, 46rem); }
.sf-head .sf-view3d, .sf-head .sf-flat { position: absolute; inset: 0; z-index: -2; border: 0; border-radius: 0; }
.sf-head .sf-flat { display: flex; align-items: center; }
.sf-head .sf-flat[hidden] { display: none; }
.sf-head .sf-flat > * { width: 100%; }
.sf-head::after, .sf-head .page-head-in, .sf-head .page-head-credit { pointer-events: none; }      /* the title lies over the picture and lets the hand through to it */
.sf-head .ti-view-tools { top: 0.75rem; bottom: auto; left: var(--gutter-l, 16px); }
@media (min-width: 60rem) { .sf-stage { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }      /* lowering the sea and its figures, then how to look */
.sf-main h2 { font-size: var(--step-2); }
.sf-missing { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.sf-figures.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sf-figures .tile-n { font-size: clamp(1.6rem, 1.8vw + 1.1rem, 2.2rem); }
.sf-figures .tile-n small { font-size: 0.5em; }
.sf-foot { display: flex; flex-direction: column; gap: 0.6rem; }

