/* ---------------------------------------------------------------------------
   Naïve Weekly
   --------------------------------------------------------------------------- */

/* ABC Solar (Dinamo) — trial, used as an article body option */
@font-face {
  font-family: "ABC Solar";
  src: url("../fonts/Solar/ABCSolar-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ABC Solar";
  src: url("../fonts/Solar/ABCSolar-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "ABC Solar";
  src: url("../fonts/Solar/ABCSolar-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ABC Solar";
  src: url("../fonts/Solar/ABCSolar-BoldItalic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --black: #000;
  --white: #fff;
  --ground: #e4d9c4; /* earthy dirt — the streets are the page itself */
  --accent: rgb(255, 178, 0);

  /* Places map — adjust freely */
  --map-land: #eee;  /* light bluish-grey landmasses */
  --map-ocean: #9bd6f3; /* the ocean (defaults to the page ground) */

  --border: 1px solid var(--black);
  --pad: 40px;
  --nav-height: 120px;

  /* Sun shadow — offset/length set from the time of day by JS */
  --shadow-x: 4px;
  --shadow-y: 5px;
  --shadow-blur: 4px;
  --shadow-alpha: 0.22;
}

.sun-shadow {
  filter: drop-shadow(var(--shadow-x) var(--shadow-y) var(--shadow-blur) rgba(0, 0, 0, var(--shadow-alpha)));
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* saved to the home screen the status bar is translucent (the ground shows
     through the notch); pad the top by the safe-area inset so nothing hides
     beneath it */
  padding: max(var(--pad), env(safe-area-inset-top)) var(--pad) calc(var(--nav-height) + var(--pad));
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.25;
  color: var(--black);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  /* full-bleed wide images use 100vw; clip any resulting horizontal overflow */
  overflow-x: clip;
}


a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* on touch screens a quick tap on a button/link shouldn't be read as a
   double-tap-to-zoom (pinch zoom still works) */
a,
button {
  touch-action: manipulation;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Sun position label ---------------------------------------------------- */

.sun-label {
  position: fixed;
  right: var(--pad);
  margin-right: 3px;
  /* aligned to the nav's bottom baseline */
  bottom: var(--pad);
  font-size: 13px;
  line-height: 1;
  color: #000;
  z-index: 15;
  pointer-events: none;
  /* a page-coloured chip so it reads over any content behind it */
  background: var(--ground);
  padding: 1px 4px;
}
.sun-label:empty { padding: 0; }

/* the sun label stays home — hidden on the individual detail pages */
.page--site .sun-label,
.page--article .sun-label,
.page--book .sun-label,
.page--place .sun-label {
  display: none;
}

/* --- Corner illustration (link home) -------------------------------------- */

.corner {
  position: fixed;
  left: var(--pad);
  /* vertically centered against the 128px-tall nav */
  bottom: calc(var(--pad) + 36px);
  width: 56px;
  height: 56px;
  z-index: 15;
}

.corner__fig,
.corner__shadow {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left bottom;
}

/* Shadow = a mirrored, skewed, stretched, blurred copy cast on the floor.
   Sun direction/length come from --sun-skew / --sun-scaleY, set by JS. */
.corner__shadow {
  transform-origin: left bottom;
  transform: scaleY(var(--sun-scaleY)) skewX(var(--sun-skew));
  filter: brightness(0) blur(1.6px);
  opacity: var(--shadow-alpha);
}

.corner:hover .corner__fig {
  opacity: 0.6;
}

/* Bigger buoy on the homepage */
.page--home .corner {
  width: 110px;
  height: 110px;
}

/* --- Bottom section nav ---------------------------------------------------- */

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--pad);
  display: flex;
  justify-content: center;
  z-index: 30; /* the house sits above everything else on the page */
}

.nav__plan {
  position: relative;
  display: inline-block;
}

/* hamburger + dimmed backdrop + relocated links: mobile only (see media query) */
.nav__burger,
.nav__backdrop,
.nav__extra { display: none; }

/* Door — on every detail page it replaces the floor plan and leads back to
   the parent section */
.nav__door { display: none; }

.page--site .nav__plan,
.page--article .nav__plan,
.page--book .nav__plan,
.page--place .nav__plan { display: none; }

.page--site .nav__door,
.page--article .nav__door,
.page--book .nav__door,
.page--place .nav__door {
  display: block;
  position: fixed;
  left: var(--pad);
  bottom: var(--pad);
  width: 34px;
  height: 50px;
  padding: 0;
  border: 1px solid #000;
  background: var(--ground); /* same as the page background */
  cursor: pointer;
  z-index: 21;
  /* hinged on the left — it swings open slightly in perspective on hover */
  transform-origin: left center;
  transition: transform 0.35s ease;
}

.nav__door:hover {
  transform: perspective(240px) rotateY(-26deg);
}

/* doorknob on the right side — a small solid black circle */
.nav__door::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 5px;
  width: 4px;
  height: 4px;
  transform: translateY(-50%);
  background: #000;
  border-radius: 50%;
}

.nav__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible; /* let the walker break out of the floor plan */
  pointer-events: none;
}

/* a single glowing orb (one blurred circle, see #orb-blur) that follows the
   cursor through the floor plan, fading in on enter and out on leave */
.nav__orb {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.nav__orb .orb__body { opacity: 0.9; }

.nav__grid {
  display: grid;
  grid-template-columns: repeat(4, 84px);
  grid-template-rows: 84px 44px;
  /* walls are drawn by the SVG overlay so the hover fill shows through openings */
  background: var(--ground); /* the house floor matches the page ground */
}

.nav__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  background: transparent;
}

.nav__cell:hover {
  text-decoration: none;
  /* per-section room colour set in the Panel, falling back to the accent */
  background: var(--room, var(--accent));
}

.nav__cell.is-active {
  font-weight: bold;
}

.nav__cell--sites  { grid-column: 1; grid-row: 1 / span 2; }
.nav__cell--books  { grid-column: 2; grid-row: 1; }
.nav__cell--people { grid-column: 3; grid-row: 1; }
.nav__cell--places { grid-column: 4; grid-row: 1 / span 2; }
.nav__home         { grid-column: 2 / span 2; grid-row: 2; }

/* (Outer doors are opened by the people passing through — handled in JS.) */

/* --- Home ----------------------------------------------------------------- */

/* the view toggle is its own block in the top-right of the neighbourhood grid */
.home-tools {
  grid-column: -2 / -1;
  grid-row: 1;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: transparent;
}

.view-toggle {
  border: none;
  background: none;
  color: #000; /* Safari defaults button text to blue otherwise */
  font: inherit;
  cursor: pointer;
  padding: 0;
  width: 100%;
  height: 100%;
}

/* in list view the toggle sits above the list as a "Neighborhood" button */
.grid.is-list .home-tools {
  display: flex;
  justify-content: flex-end;
  border: none;
  background: none;
  margin: 0 0 1em;
  padding: 0;
}

/* in list view the toggle is a small square holding a hand-drawn rock */
.grid.is-list .view-toggle {
  border: var(--border);
  background: transparent;
  padding: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.view-toggle__rock,
.view-toggle__rock svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* a little hover fill so the rock reads as clickable */
/* only on real hover devices — otherwise a tap leaves it stuck orange */
@media (hover: hover) {
  .grid.is-list .view-toggle:hover {
    background: var(--accent);
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  grid-auto-rows: 172px;
  grid-auto-flow: dense;
  gap: 42px; /* streets running between the blocks */
  position: relative;
  /* breathing room below the last row before the nav band */
  margin-bottom: 60px;
}

/* A garden of flowers grows in the gaps, behind the blocks */
.garden {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* a drawn wildflower / grass tuft; the svg origin (stem base) sits on the
   planted point via the negative margins */
.flower {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -12px 0 0 -8px;
  transition: transform 0.3s ease;
  will-change: transform;
}

.flower svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* white dashed centre line down every street (the grey page is the asphalt) */
.navflower {
  transition: transform 0.3s ease;
}

/* boulders scattered between the ruins */
.rock {
  position: absolute;
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
}

/* the rock layer floats above the blocks, so boulders can sit on top of the
   coloured ones (they still avoid walls and text when placed) */
.garden--rocks {
  z-index: 2;
}

/* flowers likewise float above the blocks, so the clumps growing along the
   block edges spill over onto the coloured ones instead of being clipped */
.garden--flowers {
  z-index: 2;
}

.card {
  position: relative;
  z-index: 1;
  display: block;
  border: none;
  /* uncoloured blocks sit flush in their cell; coloured blocks are padded below */
  padding: 0;
  color: var(--black);
  background: transparent;
  overflow: visible;
}

/* Varied block sizes → a neighbourhood of different buildings */
.card--w { grid-column: span 2; }
.card--t { grid-row: span 2; }
.card--l { grid-column: span 2; grid-row: span 2; }
/* smaller blocks that leave more garden/road around them */
.card--compact { margin: 6px 12px; }

.card__blurb {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  line-height: 1.2;
}

/* classifieds sit among the articles as ordinary blocks — only the title
   leans, so a shout-out reads a little differently from an article */
.card--classified .card__blurb {
  font-style: italic;
}

/* an optional line under a classified's title */
.card__note {
  display: block;
  margin-top: 6px;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.25;
}

.card:hover {
  text-decoration: none;
}

/* hovering anywhere on a ruin (rocks and flowers included — they don't catch
   the pointer) underlines its title */
.card:hover .card__blurb {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* coloured blocks have no border (and no door — handled in JS), and keep
   their inner padding so the text isn't flush against the fill */
.card--color {
  border: none;
  padding: 12px 14px;
}

/* an orange rolling down a street (Oranges season) */
.orange {
  position: absolute;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: #ffa64d;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

/* an empty plot in the garden — wildflowers, rocks, a ruin */
.plot {
  position: absolute;
  pointer-events: none;
}
.plot svg {
  display: block;
  width: 100%;
  height: 100%;
}

.card__media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.card__blurb,
.card__note,
.card__date {
  position: relative;
  z-index: 1;
}

.card__date {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 1;
}

/* the classifieds' "classified" corner label */
.card--classified .card__date {
  font-size: 13px;
}

/* uncoloured blocks sit flush: the date loses its padding too, matching the
   flush title (coloured blocks keep the 14px/12px inset) */
.card:not(.card--color) .card__date {
  left: 0;
  bottom: 0;
}

.card--image {
  color: var(--white);
}

.card--image .card__blurb,
.card--image .card__date {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* List view toggle */
.grid.is-list {
  display: block;
  /* the body's --pad provides the list's left/right padding; pull the top
     up a little so there's less dead space above the button, and leave a
     little breathing room under the last row */
  margin: calc(-0.5 * var(--pad)) 0 40px;
  padding: 0;
}

/* the neighbourhood (garden, roads, flowers) never shows behind the list —
   except while orienting, when the rows fade away and the garden returns */
.grid.is-list .garden {
  display: none;
}
body.is-orienting .grid.is-list .garden {
  display: block;
}

.grid.is-list .card {
  aspect-ratio: auto;
  min-height: 0;
  border: var(--border); /* black border around every list item */
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

/* collapse shared edges so the rows read as one bordered table */
.grid.is-list .card + .card {
  margin-top: -1px;
}

.grid.is-list .card__media {
  display: none;
}

.grid.is-list .card {
  color: var(--black);
  background: transparent; /* rows stay see-through; only neighbourhood boxes are filled */
}

.grid.is-list .card__date {
  position: static;
  white-space: nowrap;
}

/* ruin-style divider between list rows (built by JS in list view) */
.list-divider {
  display: none;
}

/* the solid item borders separate the rows now, so the ruin divider stays off */
.grid.is-list .list-divider {
  display: none;
}

/* --- Sites ---------------------------------------------------------------- */

.sites {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.site-chip {
  display: inline-flex;
  align-items: center;
  border: var(--border);
  padding: 8px 12px;
  background: transparent;
  position: relative;
}

/* --- Books ---------------------------------------------------------------- */

.shelf {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border-bottom: var(--border);
  min-height: 320px;
  padding: 0 2px;
}

.book {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  border: var(--border);
  width: 46px;
  min-height: 200px;
  margin-bottom: -1px; /* sit the spines onto the shelf line */
  padding: 14px 12px;
  display: flex;
  align-items: flex-start;
  background: var(--white);
  color: var(--black);
}

.book:hover {
  text-decoration: none;
}

/* a spine that toggles a list of articles is a button — strip its chrome */
button.book {
  font: inherit;
  cursor: pointer;
  appearance: none;
}

/* the clicked spine stays pressed while its table is open */
.book.is-open {
  transform: translateY(-4px);
}

/* a book's little table, revealed beneath the shelf on click */
.book-panel {
  max-width: 520px;
  margin: 44px auto 40px;
}

.book-panel__title {
  font-style: italic;
  margin-bottom: 10px;
}

/* the book's info list sits right under its title/blurb, not 2.8em away */
.book-panel .site-info {
  margin-top: 0.6em;
}

.book-panel__blurb {
  margin: 0 0 12px;
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  line-height: 1.3;
}

.book-panel .info-table {
  width: 100%;
}

.book-panel .info-table a {
  text-decoration: underline;
}

/* --- People --------------------------------------------------------------- */

.alphabet {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  margin-bottom: 60px;
  font-size: 18px;
}

.alphabet button,
.alphabet a {
  display: inline-block;
  border: none;
  background: none;
  color: #000;
  cursor: pointer;
  font: inherit;
  line-height: 26px;   /* match the height so the glyph centres vertically */
  width: 26px;
  height: 26px;
  border-radius: 50%;
  padding: 0;
  text-align: center;
  text-decoration: none;
}
.alphabet a:hover { text-decoration: none; }

.alphabet button:disabled,
.alphabet .is-disabled {
  opacity: 0.25;
  cursor: default;
}

.alphabet button.is-active,
.alphabet a.is-active {
  background: var(--accent);
}

/* people page wrapper — a positioning context so the shuffle button can be
   pinned top-right on mobile (see the mobile block) */
.people-page {
  position: relative;
}

/* stack + up/down arrows, centred together */
.deck {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 32px;
  margin: 0 auto 30px;
}

/* custom slider: a thin line with a draggable block that scrubs the stack */
.deck-slider {
  position: relative;
  width: 1px;
  background: #000;
  flex: 0 0 auto;
  margin-top: 4px;
  cursor: pointer;
  touch-action: none;
}
.deck-slider__handle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border: var(--border);
  border-radius: 50%;
  background: var(--ground);
  cursor: grab;
}
.deck-slider__handle:active { cursor: grabbing; }

.people-stack {
  position: relative;
  width: 480px;
  max-width: 100%;
  min-height: 120px;
}

/* all cards share one height — the tallest card's content, measured by JS
   into --card-h (capped there); anything taller scrolls inside. Every card
   is a 1px-outlined index card with empty space below its fields. */
.person-card {
  background: var(--ground);
  border: var(--border);
  height: var(--card-h, auto);
  overflow-y: auto;
  overflow-x: hidden; /* the table edge tucks under the outline — never a h-scrollbar */
}

/* pull the table's outer border under the card's outline so the two 1px
   lines overlap instead of doubling; full height so the filler row can
   stretch and keep the label column's line running to the card bottom */
.person-card .person-table {
  margin: -1px -1px 0;
  width: calc(100% + 2px);
  height: calc(100% + 1px);
}
.person-table__fill th,
.person-table__fill td {
  height: 100%;          /* soaks up all the leftover card height */
  border-bottom: none;   /* the card outline already draws the bottom edge */
}

/* the first five cards recede in a stack (positioned/offset by JS) */
.people-stack .person-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

/* --- People 2: one card per page, up/down chevrons instead of the slider --- */
/* the stack holds the front card plus a few receding outlines behind it */
.person2-stack {
  position: relative;
  width: 480px;
  max-width: 100%;
  /* room for the receding cards' 8px-per-step offsets below the front card */
  margin-bottom: 40px;
}
.person2-card {
  position: relative;
  z-index: 10;
}
/* the next people's real cards, receding down-right behind the front one */
.person2-behind {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* every sibling's card, rendered invisibly so JS can measure the tallest and
   give the front card the deck's uniform --card-h height */
.person2-measure {
  position: absolute;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
}

/* the little pagination box that replaces the slider */
.person2-nav {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  align-self: flex-start;
  border: var(--border);
  margin-top: 4px;
}
.person2-nav__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #000;
  text-decoration: none;
}
.person2-nav__btn:hover {
  background: var(--accent);
  text-decoration: none;
}
.person2-nav__btn + .person2-nav__btn {
  border-top: var(--border);
}

/* hand-drawn-thin chevrons: two 1px strokes in the current ink */
.person2-chev {
  width: 8px;
  height: 8px;
  border-left: 1px solid currentColor;
  border-top: 1px solid currentColor;
}
.person2-chev--up {
  transform: rotate(45deg);
  margin-top: 3px;
}
.person2-chev--down {
  transform: rotate(225deg);
  margin-bottom: 3px;
}

.person-table,
.place-table,
.info-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

/* people cards sit directly on the page ground, no white fill */
.person-table {
  background: transparent;
}

.person-table th,
.person-table td,
.place-table th,
.place-table td,
.info-table th,
.info-table td {
  border: var(--border);
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
}

.person-table th,
.place-table th,
.info-table th {
  font-style: italic;
  font-weight: normal;
  width: 33%;
  white-space: nowrap;
}

/* people card: the label column only as wide as its (short) labels */
.person-table th {
  width: 1%;
  padding-right: 22px;
}

.person-table a,
.place-table a,
.info-table a {
  text-decoration: underline;
}

/* --- Article (entry detail page) ----------------------------------------- */

.article {
  max-width: 520px;
  margin: 0 auto;
  padding-top: 9vh;
}

/* with a lead image the picture sits flush at the top instead of the usual
   top padding */
.article--lead {
  padding-top: 0;
}

.article__title {
  font-size: inherit;
  font-weight: bold;
  margin: 0 0 2.4em;
}

/* an optional preface shown above the library card — same typography as the
   article body (and follows the font toggle); see the .article__body rules */
.article__preface {
  margin: 0 0 2.4em;
}
.article__preface p { margin: 0 0 0.6em; }
.article__preface p:last-child { margin-bottom: 0; }

.article__meta {
  position: fixed;
  top: var(--pad);
  right: var(--pad);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  color: var(--black);
  z-index: 20;
}

.article__meta a {
  color: var(--black);
  text-decoration: underline;
}

.article__body p {
  margin: 0 0 1em;
}

.article__body h1,
.article__body h2,
.article__body h3 {
  font-size: inherit;
  font-weight: bold;
  margin: 1.6em 0 0.5em;
}

.article__body a {
  text-decoration: underline;
}

.article__body ul,
.article__body ol {
  margin: 0 0 1em;
  padding-left: 1.1em;
}

.article__body li {
  margin: 0;
  padding-left: 0.2em;
  line-height: inherit; /* items flow with the same rhythm as paragraph lines */
}

/* Kirbytext wraps each list item's content in a <p>; drop its 1em margin so
   items sit one line-height apart, matching the paragraph rhythm */
.article__body li p {
  margin: 0;
}

.article__body blockquote {
  margin: 1.6em 0;
  padding-left: 14px;
  border-left: 2px solid var(--black);
}

.article__body blockquote cite,
.fig figcaption cite {
  font-style: italic;
}

/* media figures */
.fig {
  margin: 1.8em 0;
}

.fig img,
.fig video {
  display: block;
  width: 100%;
}

.fig audio {
  display: block;
  width: 100%;
}

.fig figcaption {
  font-size: 13px;
  color: #999;
  margin-top: 0.5em;
}

/* a classified inserted into the article body — the home shout-out card, at
   full article width: italic title, "classified" corner, same fonts/sizes */
.classified-block {
  display: block;
  position: relative;
  margin: 2em 0;
  min-height: 130px;
  padding: 12px 14px;
  /* boxed all the way round, a heavier top edge */
  border: 1px solid var(--black);
  border-top-width: 2px;
  color: var(--black);
  text-decoration: none;
}
.classified-block__title {
  display: block;
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  font-style: italic;
  line-height: 1.2;
}
.classified-block__note {
  display: block;
  margin-top: 6px;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.25;
}
/* the corner label, pinned bottom-left — always Arial, even as the article
   font toggles */
.classified-block__tag {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}
/* never underline the classified's text, even on hover */
.classified-block:hover,
.classified-block:hover .classified-block__title {
  text-decoration: none;
}

/* the big lead image at the top of an article: it breaks out of the text
   column, centred, up to a maximum width */
.article__lead {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 2 * var(--pad)), 1200px);
  margin: 0 0 3em;
}
.article__lead img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  /* never taller than the screen — scales down keeping its aspect ratio */
  max-height: 100vh;
  width: auto;
  height: auto;
}

.embed {
  position: relative;
}

.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* wide media breaks out of the text column: flush to the viewport's left/right
   edges, capped at a max-width and centred once the screen is wider than that */
.fig--wide {
  width: 100vw;
  max-width: 1400px;
  margin-left: 50%;
  transform: translateX(-50%);
}

.fig--wide figcaption {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Library card (detail-page sidebar) ---------------------------------- */

/* Narrow: a ground-coloured card between the title and the body. Wide: the
   article becomes a two-column grid and the card sits beside the body,
   top-aligned with the first line of content. */
.library-card {
  max-width: 340px;
  margin: 0 auto 2.4em;
}

/* the "more" row + button only appear on mobile (below the sidebar breakpoint) */
.info-table__more { display: none; }

/* the whole cell is the click target (handler on the row), so it reads as one
   tappable "more" row without changing its height */
.info-table__more td { cursor: pointer; }
.info-table__more-btn {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* Mobile/tablet: the card stacks (metadata table, then tools). The metadata
   shows the first four rows; "more" reveals the rest AND the tools. */
@media (max-width: 1159px) {
  .library-card {
    display: block;
    max-width: 520px;
  }

  .library-card .info-table { width: 100%; }
  .library-card .info-table td { overflow-wrap: anywhere; }
  .library-card .library-card__tools { margin-top: 10px; }

  .info-table--meta .info-table__extra { display: none; }
  .info-table--meta.is-expanded .info-table__extra { display: table-row; }
  .info-table__more { display: table-row; }
  .info-table--meta.is-expanded .info-table__more { display: none; }

  /* the font switcher / save-as-pdf tools stay hidden until "more" is tapped */
  .library-card__tools { display: none; }
  .info-table--meta.is-expanded ~ .library-card__tools { display: table; }
  /* revealed inline on mobile: a plain 1px divider, not the desktop card's
     heavy 2px top edge */
  .library-card__tools { border-top-width: 1px; }
}

@media (max-width: 600px) {
  .library-card { max-width: none; }
}

.info-table {
  background: var(--ground);
  border-top: 2px solid var(--black);
}

/* single column: label + value share each cell, small and dense (colophon size) */
.info-table td {
  padding: 5px 8px;
  font-size: 13px;
  line-height: 1.3;
  width: auto;
  white-space: normal;
}

.info-table__label {
  font-weight: bold;
  margin-right: 2px;
}

/* previous / next table at the foot of an article — same styling as the aside */
.article-nav {
  margin: 3em auto 0;
}

/* a small square of each neighbour's block colour, in its own cell at the
   row's right edge */
.article-nav__swatch {
  width: 1px;            /* shrink the column to just the square */
  padding: 0 4px 0 8px;
  vertical-align: middle;
}
.article-nav__square {
  display: block;
  width: 13px;
  height: 13px;
  border: 1px solid var(--black);
}

/* sidebar tools table — a second info-table below the metadata, with a gap */
.library-card__tools {
  margin-top: 10px;
}

/* the tools sit in table cells as plain text buttons */
.font-opt,
.hl-opt,
.print-btn {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

/* "save as pdf" on the left, the "images" checkbox pushed to the right */
.print-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.print-noimg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
}
/* checkbox styled like the rest of the site: a 1px black square, × when on.
   min/max + aspect-ratio lock it square — iOS Safari otherwise imposes its
   own control size and the box comes out a stretched rectangle */
.print-noimg__box {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  max-width: 12px;
  max-height: 12px;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  border: 1px solid #000;
  border-radius: 0;
  background: transparent no-repeat center / 100% 100%;
  margin: 0;
  cursor: pointer;
}
/* the × is a background image, so ticking never changes the box's size,
   baseline or position */
.print-noimg__box:checked {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><path d="M2 2l6 6M8 2l-6 6" stroke="black" stroke-width="1.1"/></svg>');
}

/* font + highlight options: the active one is bold, hovering underlines */
.font-opt.is-active,
.hl-opt.is-active {
  font-weight: bold;
}

.font-opt:hover,
.hl-opt:hover,
.print-btn:hover {
  text-decoration: underline;
}

/* a "Rocks & flowers" block — a strip of the site's ground, planted by JS
   wherever K drops the block in the article */
.article-scatter {
  display: block;
  margin: 1.4em 0;
}
.article-scatter__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* editor highlights in the article body (toggled off from the sidebar).
   The colour matches the article's chosen block colour, white if none. */
.article__body .hl {
  background: var(--hl-color, #fff);
  color: var(--hl-text, inherit);
  padding: 0 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

:root[data-hl="off"] .article__body .hl {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* share-a-highlight: a little envelope in the left margin of the highlight,
   shown while hovering it (always faintly there on touch screens). Clicking
   it turns the quote into a story-sized image (drawn by JS). */
.article__body {
  position: relative; /* the envelopes are placed against the body */
}
.hl-share {
  position: absolute;
  left: -34px;
  width: 16px;
  height: 13px;
  padding: 0;
  border: none;
  background: none;
  color: var(--black);
  cursor: pointer;
}
.hl-share svg {
  display: block;
  width: 100%;
  height: 100%;
}
/* highlights toggled off — nothing to share */
:root[data-hl="off"] .hl-share {
  display: none;
}

/* the envelope's menu: two options. Desktop drops them under the envelope;
   mobile takes over the screen. No animation. */
.hl-menu {
  z-index: 60;
}
.hl-menu__opt {
  display: block;
  padding: 0;
  border: none;
  background: none;
  color: var(--black);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
/* desktop: just the two lines, right-aligned to the envelope out in the left
   margin (no box); underline on hover */
.hl-menu:not(.hl-menu--overlay) .hl-menu__panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.hl-menu:not(.hl-menu--overlay) .hl-menu__opt {
  text-align: right;
}
.hl-menu:not(.hl-menu--overlay) .hl-menu__opt:hover {
  text-decoration: underline;
}

/* mobile: a full-screen centred takeover, like the nav overlay */
.hl-menu--overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hl-menu--overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ground);
  opacity: 0.93;
}
.hl-menu--overlay .hl-menu__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: calc(100vw - 2 * var(--pad));
}
/* the quote boxed above the options, with the highlight colour hugging the
   text just like on the page */
.hl-menu__quote {
  max-width: 100%;
  padding: 14px 16px;
  border: var(--border);
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.7;
  text-align: left;
}
.hl-menu__hl {
  padding: 0 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.hl-menu--overlay .hl-menu__opt {
  font-size: 19px;
  text-align: center;
  text-decoration: underline; /* underlined, no hover on touch */
}
/* the close X, boxed in the corner */
.hl-menu__close {
  position: absolute;
  top: var(--pad);
  right: var(--pad);
  width: 30px;
  height: 30px;
  padding: 4px;
  border: var(--border);
  background: none;
  color: var(--black);
  cursor: pointer;
}
.hl-menu__close svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* article body (and preface) swap between Arial and Times New Roman via the toggle */
.article__body,
.article__preface {
  font-family: Arial, Helvetica, sans-serif;
}

:root[data-font="serif"] .article__body,
:root[data-font="serif"] .article__preface {
  font-family: "Times New Roman", Times, serif;
  font-size: 19px;
  line-height: 1.45;
}

:root[data-font="solar"] .article__body,
:root[data-font="solar"] .article__preface {
  font-family: "ABC Solar", Georgia, serif;
  font-size: 17px;
  line-height: 1.5;
}

.library-card .info-table th {
  text-transform: lowercase;
}

/* Wide: the article column stays centred on the page; the card hangs in its
   left margin and the tools (font, highlights, print) in its right margin.
   Both sit in the flow right before the body, so with no `top` set their
   absolute position IS the body's first line — they always start exactly
   where the content starts. */
@media (min-width: 1160px) {
  .article {
    position: relative;
  }

  .article .library-card {
    position: absolute;
    right: calc(100% + 30px);
    width: 250px;
    max-width: none;
    margin: 0;
  }
}

/* the body's first element carries no top margin, so the content's first
   line meets the aside's top edge */
.article__body > :first-child {
  margin-top: 0;
}

/* Site detail page: its own layout — a centred column, no sidebar, metadata
   listed inline under small headers */
.site-page {
  max-width: 520px;
  margin: 0 auto;
  padding-top: 9vh;
}

/* screenshots section: a bold little header above the slideshow */
.site-shots__head {
  font-size: inherit;
  font-weight: bold;
  margin: 2.4em 0 0.8em;
}

/* slideshow — a little screen that scrolls left/right like a bus-stop poster */
.slideshow__frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: var(--border);
  background: var(--ground);
}

.slideshow__track {
  display: flex;
  flex-direction: row;
  height: 100%;
}

.slide {
  flex: 0 0 100%;
  height: 100%;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: alias;
}

.slideshow__bar {
  display: flex;
  /* top-align so the count + arrows stay on the first line when the caption
     wraps to two */
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
}

/* count + arrows grouped on the right of the bar */
.slideshow__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* a little space between the count and the arrow pair; line-height:1 so the
   digits sit centred against the arrow buttons; never wraps ("1 / 2" stays
   on one line even when the bar gets tight) */
.slideshow__nav .slideshow__count {
  margin-right: 4px;
  line-height: 1;
  white-space: nowrap;
  flex: none;
}

.slideshow__prev,
.slideshow__next {
  width: 20px;
  height: 20px;
  padding: 0;
  border: var(--border);
  background: transparent;
  color: var(--black);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.slideshow__prev svg,
.slideshow__next svg {
  display: block;
  width: 10px;
  height: 10px;
}

.slideshow__prev:hover,
.slideshow__next:hover {
  background: var(--accent);
}

.slideshow__caption {
  color: var(--black);
}

.slideshow__caption a {
  text-decoration: underline;
}

.site-info {
  margin: 2.8em 0 0;
}

.site-info dt {
  font-weight: bold;
  margin-top: 1.2em;
}

.site-info dd {
  margin: 0.15em 0 0;
}

.site-info dd a {
  text-decoration: underline;
}

/* a very small dithered screenshot shown beside a website link */
.site-info__thumb,
.info-table__thumb {
  display: inline-block;
  width: 34px;
  height: auto;
  vertical-align: middle;
  margin-right: 7px;
  border: var(--border);
}
.info-table__thumb {
  width: 30px;
  height: 15px;
  object-fit: cover;
  object-position: top;
  margin-right: 5px;
}

/* Site detail page (legacy info table) */
.detail {
  max-width: 480px;
  margin: 40px auto 0;
}

/* Places table sits below the map */
.place-table {
  max-width: 960px;
  margin: 40px auto 0;
}

.shuffle {
  display: block;
  width: fit-content;
  /* sit just above the top-right corner of the centred card stack: the stack
     (480px) plus the slider+gap on its left put its right edge ~256px right of
     centre (mobile overrides this to a simple right-align) */
  margin: 0 calc(50% - 256px) 16px auto;
  border: var(--border);
  background: transparent;
  color: #000;
  font: inherit;
  padding: 5px 14px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.shuffle:hover {
  background: var(--accent);
  text-decoration: none;
}

/* --- Places (MapLibre map) ------------------------------------------------- */

/* full-bleed: break out of the body padding to fill the viewport width, and
   run the map the full height of the first screen */
.places-map-wrap {
  position: relative;
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 0;
  border: none;
}

.places-map {
  width: 100%;
  height: 100vh;
  min-height: 420px;
  background: var(--map-ocean); /* shows through when the earth layer is hidden */
  /* fade the whole map in once its first frame is ready (JS adds .is-ready) */
  opacity: 0;
  transition: opacity 0.9s ease;
}
.places-map.is-ready { opacity: 1; }

/* a firefly that occasionally drifts across the map (JS positions it) */
.map-firefly {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 3;
}
.map-firefly__dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 150, 0.95) 0%, rgba(240, 210, 70, 0.55) 42%, rgba(240, 210, 70, 0) 72%);
  opacity: var(--fly-op, 0.8);
}

/* toggle to hide the map tiles (earth) while keeping the place labels */
.map-toggle {
  position: absolute;
  top: var(--pad);
  left: var(--pad);
  z-index: 5;
  border: var(--border);
  background: var(--ground);
  color: #000; /* Safari defaults button text to blue otherwise */
  font: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
}

.map-toggle:hover {
  background: var(--accent);
}

/* MapLibre zoom (+/-) styled like the map toggle — square, bordered, no
   shadow. MapLibre's own stylesheet loads after this one (in the places
   template), so these need the !important to actually win. */
.places-map .maplibregl-ctrl-group {
  border: var(--border);
  border-radius: 0;
  box-shadow: none !important;
  background: var(--ground);
}

.places-map .maplibregl-ctrl-group button {
  width: 28px;
  height: 28px;
  background: var(--ground);
}

.places-map .maplibregl-ctrl-group button + button {
  border-top: var(--border);
}

.places-map .maplibregl-ctrl-group button:hover {
  background: var(--accent);
}

/* hairline, square-cut +/- glyphs instead of MapLibre's chunky rounded ones
   (same drawing dark mode uses, in black ink) */
.places-map .maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon,
.places-map .maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
  filter: none !important;
  background-size: 100% 100%;
}
.places-map .maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29 29"><path d="M14.5 8v13M8 14.5h13" stroke="black" stroke-width="1"/></svg>') !important;
}
.places-map .maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29 29"><path d="M8 14.5h13" stroke="black" stroke-width="1"/></svg>') !important;
}

/* space markers: a dot with the venue name always visible beside it */
.place-marker {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.place-marker__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: var(--border);
  flex: 0 0 auto;
}

.place-marker__name {
  font-size: 13px;
  color: var(--black);
  background: var(--ground);
  padding: 1px 5px;
  border: var(--border);
}


/* popup overlay styled like the rest of the site */
.place-popup .maplibregl-popup-content {
  border: var(--border);
  border-radius: 0;
  background: var(--ground);
  padding: 12px 14px;
  box-shadow: var(--shadow-x) var(--shadow-y) var(--shadow-blur) rgba(0, 0, 0, 0.18);
  font-family: inherit;
}

.place-popup .maplibregl-popup-tip {
  display: none;
}

/* hide the bottom-right control cluster (attribution) */
.maplibregl-ctrl-bottom-right {
  display: none;
}

.place-popup__title {
  font-weight: bold;
  text-decoration: none;
}

.place-popup__title:hover {
  text-decoration: underline;
}

.place-popup__table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13px;
}

.place-popup__table th,
.place-popup__table td {
  border: 1px solid #000;
  padding: 3px 6px;
  text-align: left;
  vertical-align: top;
}

.place-popup__table td {
  overflow-wrap: anywhere;
}

/* links inside the popup: plain underlines, no focus outline box */
.place-popup a {
  outline: none;
  text-decoration: underline;
}

.place-popup__table th {
  font-style: italic;
  font-weight: normal;
  white-space: nowrap;
  width: 1%;
}

.place-popup__blurb {
  margin: 6px 0;
}

.place-popup__link {
  text-decoration: underline;
}

/* --- Ocean page ------------------------------------------------------------ */

.ocean-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.ocean-scene svg {
  display: block;
  width: 100%;
  height: 100%;
}

.page--sea {
  overflow: hidden; /* the scene fills the viewport; nothing scrolls */
}

/* ocean sound toggle, top-right corner */
.sound-toggle {
  position: fixed;
  top: var(--pad);
  right: var(--pad);
  border: none;
  background: none;
  /* iOS renders button text in its accent blue unless a colour is set */
  color: var(--black);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  z-index: 31;
}

.sound-toggle:hover {
  text-decoration: underline;
}

/* back to the hills — bottom-right of the sea, above the sun label.
   Same page-coloured chip as the other footer links. */
.hills-link {
  position: fixed;
  bottom: calc(var(--pad) + 20px);
  right: var(--pad);
  margin-right: 3px;
  font-size: 13px;
  line-height: 1;
  color: #000;
  text-decoration: none;
  background: var(--ground);
  padding: 1px 4px;
  z-index: 31;
}

.hills-link:hover {
  text-decoration: underline;
}

/* the 1px padding prevents margin-collapse with the sections inside, so the
   below-the-fold JS measurement stays exact */
.page-foot {
  padding-top: 1px;
  position: relative;
}

/* --- Colophon page: newsletter + colophon ---------------------------------- */

/* positioned so the newsletter garden (JS) can grow around the sections */
.colophon-page {
  position: relative;
  padding-top: 1px;
}

/* the old logo, centred above the about text */
.colophon-logo {
  display: block;
  width: 140px;
  height: auto;
  margin: 7vh auto 0;
  position: relative;
  z-index: 1;
}

/* the about text sits above the colophon lines with clear air between them */
.colophon-about {
  max-width: 520px;
  margin: 6vh auto 0;
  position: relative;
  z-index: 1;
}
.colophon-about p { margin: 0 0 1em; }
.colophon-page .colophon {
  margin-top: 10vh;
}

/* rocks & flowers drifting in around the newsletter (drawn by JS) */
.newsletter-garden {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.newsletter,
.colophon {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  scroll-margin-top: 60px;
  position: relative;
  z-index: 1; /* keep the content above the garden */
}

.newsletter {
  margin-top: 24vh;
  margin-bottom: 24vh;
}

.colophon {
  margin-top: 24vh;
  margin-bottom: 28vh;
  text-align: left;
  font-size: 13px;
  line-height: 1.3;
}

.colophon p {
  margin: 5px 0;
}

.colophon a {
  text-decoration: underline;
}

/* full-width black divider between each line */
.colophon-div {
  width: 100%;
  height: 0;
  margin: 5px 0;
  border: 0;
  border-top: 1px solid #000;
}

.newsletter__intro {
  margin: 0 0 1.4em;
}

.newsletter__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.newsletter__field {
  width: 100%;
  border: var(--border);
  background: transparent;
  color: #000; /* explicit — UA default is white in mobile dark mode */
  font: inherit;
  padding: 10px 12px;
}

.newsletter__note {
  resize: vertical;
}

.newsletter__submit {
  border: var(--border);
  background: transparent;
  color: #000; /* explicit — UA default is white in mobile dark mode */
  font: inherit;
  padding: 10px 26px;
  cursor: pointer;
}

.newsletter__submit:hover {
  background: var(--accent);
}

.newsletter__msg {
  margin: 4px 0 0;
  font-style: italic;
}

/* fixed jump-links, styled like the sun label but mirrored to the bottom-left
   (the sun label sits bottom-right) */
.foot-jump {
  position: fixed;
  left: var(--pad);
  margin-left: 3px;
  bottom: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1;
  /* above the full-width .nav band (z 30), which otherwise swallows clicks */
  z-index: 31;
}

.foot-jump a {
  color: #000;
  text-decoration: none;
  width: fit-content; /* only the text is the hit target, not the full row */
  /* a page-coloured chip so each link reads over content behind it */
  background: var(--ground);
  padding: 1px 4px;
}

.foot-jump a:hover {
  text-decoration: underline;
}

/* the orientation trigger sits in .foot-jump, styled like its links */
.orientation-toggle {
  border: none;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  color: #000;
  cursor: pointer;
  width: fit-content;
  background: var(--ground);
  padding: 1px 4px;
  text-align: left;
}
.orientation-toggle:hover { text-decoration: underline; }

/* the orientation link (used on every non-home page) — same chip as the
   foot-jump links */
.orientation-link {
  color: #000;
  text-decoration: none;
  background: var(--ground);
  padding: 1px 4px;
}
.orientation-link:hover { text-decoration: underline; }

/* mobile only: a 1px edge + roomier padding on the footer link chips */
@media (max-width: 600px) {
  .foot-jump a,
  .orientation-toggle,
  .orientation-link,
  .sea-link,
  .hills-link {
    border-right: 1px solid var(--black);
    border-bottom: 1px solid var(--black);
    padding: 4px 7px;
  }
}

/* --- Orientation: fading texts over a cleared home ------------------------ */
/* full-screen, transparent layer that catches taps to advance; sits above the
   faded blocks but below the nav (z30) and corner controls (z31) */
.orientation {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10vh var(--pad);
  text-align: center;
  cursor: pointer;
}
/* display:flex above would defeat the hidden attribute (UA display:none loses
   to authored rules) — without this, an invisible full-screen layer swallows
   every click on the home page */
.orientation[hidden] { display: none; }
.orientation__text {
  max-width: 640px;
  margin: 0;
  /* same as an article body: Arial, 16px, 1.25 */
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.25;
  color: #000;
  opacity: 0;
  /* slow, unhurried fades between the texts (JS bumps the very first one even
     slower via --first-fade) */
  transition: opacity 1.4s ease;
}
.orientation__text.is-visible { opacity: 1; }

/* a firefly that now and then drifts over to hover around the text */
.orientation-firefly {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 2;
}

/* the blocks + list toggle fade out while orienting — the garden, nav and the
   rest stay put. The transition lives on the elements themselves so they fade
   BOTH ways (out on enter, back in on exit). */
.card,
.home-tools {
  transition: opacity 1.5s ease;
}
body.is-orienting .card,
body.is-orienting .home-tools {
  opacity: 0;
  pointer-events: none;
}

/* orientation sound toggle — top-right, like the sea's */
.orientation__sound {
  position: fixed;
  top: var(--pad);
  right: var(--pad);
  border: none;
  background: var(--ground);
  color: var(--black);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  z-index: 31;
}
.orientation__sound:hover { text-decoration: underline; }

/* "Visit the sea" — bottom-right, just above the sun-direction label */
.sea-link {
  position: fixed;
  right: var(--pad);
  margin-right: 3px;
  /* sun-label (15px tall) + a 6px gap to match the foot-jump spacing */
  bottom: calc(var(--pad) + 21px);
  font-size: 13px;
  line-height: 1;
  color: #000;
  text-decoration: none;
  /* a page-coloured chip so it reads over content behind it */
  background: var(--ground);
  padding: 1px 4px;
  /* above the full-width .nav band (z 30) so it stays clickable */
  z-index: 31;
}

.sea-link:hover {
  text-decoration: underline;
}

/* hidden on the sea itself and on the detail pages (like the sun label) */
.page--sea .sea-link,
.page--site .sea-link,
.page--article .sea-link,
.page--book .sea-link,
.page--place .sea-link {
  display: none;
}

/* --- Utility -------------------------------------------------------------- */

.empty {
  color: #999;
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  :root {
    --pad: 20px;
  }
  /* less dead space above the article / site page on small screens */
  .article,
  .site-page {
    padding-top: 3vh;
  }
  /* screenshot slideshow: proper finger-sized arrows */
  .slideshow__prev,
  .slideshow__next {
    width: 34px;
    height: 34px;
  }
  .slideshow__prev svg,
  .slideshow__next svg {
    width: 15px;
    height: 15px;
  }
  /* neighbourhood: two columns that can shrink (minmax 0 stops long words
     from expanding a track and overflowing), shorter rows and tighter gaps */
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 128px;
    gap: 22px;
  }
  .card__blurb {
    font-size: 16px;
  }
  .card__date {
    font-size: 14px;
  }
  /* list runs flush to the screen edges with no border around the items */
  .grid.is-list {
    margin-left: calc(-1 * var(--pad));
    margin-right: calc(-1 * var(--pad));
  }
  .grid.is-list .card,
  .grid.is-list .card + .card {
    border: none;
    margin-top: 0;
    padding: 10px 16px;
  }
  /* the flush list pulls the rock to the screen edge — give it room */
  .grid.is-list .view-toggle {
    margin-right: var(--pad);
  }
  .people-stack {
    width: 100%;
  }

  /* on mobile the share-envelope sits inline right after the highlight */
  .hl-share--inline {
    position: static;
    display: inline-block;
    width: auto;
    height: auto;
    margin: 0 8px 0 6px;
    padding: 0;
    vertical-align: middle;
    opacity: 1;
  }
  .hl-share--inline svg {
    width: 17px;
    height: 13px;
  }

  /* --- Books on mobile: the shelf runs to the screen edges and side-scrolls
     when the spines overflow, instead of squeezing them ---------------------- */
  .shelf {
    overflow-x: auto;
    margin-left: calc(-1 * var(--pad));
    margin-right: calc(-1 * var(--pad));
    padding-left: var(--pad);
    padding-right: var(--pad);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .shelf::-webkit-scrollbar { display: none; }
  .shelf .book {
    flex: 0 0 auto;
  }

  /* --- People page on mobile ------------------------------------------------ */
  /* the deck view fills the screen and does not scroll; long cards scroll
     inside themselves instead */
  body.page--people,
  body.page--person { overflow: hidden; }

  /* the A–Z index: one straight row that runs off the screen edges and
     side-scrolls, rather than wrapping */
  .page--people .alphabet,
  .page--person .alphabet {
    font-size: 16px;
    gap: 4px 6px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    /* break out of the body padding so letters reach the viewport edges */
    margin-left: calc(-1 * var(--pad));
    margin-right: calc(-1 * var(--pad));
    padding-left: var(--pad);
    padding-right: var(--pad);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .page--people .alphabet::-webkit-scrollbar,
  .page--person .alphabet::-webkit-scrollbar { display: none; }
  .page--people .alphabet button,
  .page--person .alphabet a,
  .page--person .alphabet .is-disabled {
    width: 24px;
    height: 24px;
    line-height: 24px;
    flex: 0 0 auto;
  }

  /* shuffle sits top-right, above the cards and below the letters */
  .page--people .shuffle,
  .page--person .shuffle {
    margin: 0 0 14px auto;
    padding: 6px 14px;
  }

  /* People 2 on mobile: tighten the gap and let the single card shrink to fit
     beside the arrow box instead of overflowing */
  .page--person .deck {
    gap: 14px;
  }
  .page--person .person2-stack {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* a fat invisible touch strip over the thin slider, plus a bigger handle,
     so it's easy to grab and drag on a touchscreen */
  .deck-slider::before {
    content: "";
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: -16px;
    right: -16px;
  }
  .deck-slider__handle {
    width: 28px;
    height: 28px;
  }

  .corner {
    width: 40px;
    height: 40px;
    bottom: calc(var(--pad) + 44px);
  }

  /* --- Mobile navigation: a little wordless floor-plan icon opens the full
     house centred over a dimmed page (the full-width house would otherwise
     collide with the corner links). ------------------------------------- */
  /* the corner links now live inside the menu; the button sits a little up */
  .nav {
    bottom: calc(var(--pad) + 8px);
  }
  .nav__burger {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start; /* the marquee track aligns to the left edge */
    width: 13.5em;          /* fixed so the 200% track clips to one label */
    height: auto;
    padding: 12px 24px;
    border: var(--border);
    background: var(--ground);
    color: #000;
    font: inherit;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    overflow: hidden;       /* clip the marquee text as it slides */
  }
  /* bus-stop marquee: a two-label track that slides linearly (JS-driven).
     flex:none keeps it 200% wide so it overflows and the button clips to
     exactly one label at a time. */
  .nav__burger-track {
    display: flex;
    flex: none;
    width: 200%;
    will-change: transform;
  }
  .nav__burger-label {
    flex: 0 0 50%;
    text-align: center;
    white-space: nowrap;
  }

  /* the plan is hidden until the button opens it */
  .nav__plan { display: none; }

  /* detail pages use the door, not the house — no burger there */
  .page--site .nav__burger,
  .page--book .nav__burger,
  .page--place .nav__burger { display: none; }

  /* on mobile the corner links move into the menu (under the house); hide the
     originals at their corners until JS relocates them */
  body > .foot-jump,
  body > .hills-link,
  body > .sea-link,
  body > .sun-label { display: none; }

  /* the relocated links, shown stacked under the house when the menu is open */
  /* links laid out left/right under the house, mirroring the page corners.
     The row spans the viewport (not just the house) so the labels don't wrap. */
  .nav__extra {
    display: none;
    width: calc(100vw - 2 * var(--pad));
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
  }
  /* a flex column like the right box, so bare links (back to the hills) sit
     on the same baselines as the right rows — no inline line-box leading */
  .nav__extra-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-align: left;
  }
  .nav__extra-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    text-align: right;
  }
  .nav__extra .foot-jump,
  .nav__extra .hills-link,
  .nav__extra .sea-link,
  .nav__extra .sun-label {
    position: static;
    inset: auto;
    margin: 0;
    background: transparent;
    padding: 0;
    z-index: auto;
    font-size: inherit;
  }
  /* flatten the chips inside the overlay too (no box padding), so the left
     and right columns' rows sit on exactly the same baselines */
  .nav__extra .foot-jump a,
  .nav__extra .orientation-toggle {
    background: transparent;
    padding: 0;
    font-size: inherit;
  }
  .nav__extra .foot-jump {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  /* …but the footer chips (and the sun label) do get inner padding (overrides
     the flatten above, which zeroes it) */
  .nav__extra .foot-jump a,
  .nav__extra .orientation-toggle,
  .nav__extra .orientation-link,
  .nav__extra .sea-link,
  .nav__extra .hills-link,
  .nav__extra .sun-label {
    padding: 4px 7px;
  }

  /* open: lift the whole nav above the corner links, dim the page, float the
     house + its links (the sheet) in the centre */
  .nav.is-open { z-index: 50; }
  .nav.is-open .nav__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    /* the site background, slightly see-through */
    background: var(--ground);
    opacity: 0.93;
  }
  .nav.is-open .nav__sheet {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    /* full height so the house can sit vertically centred; the links are
       pinned lower, in the space between the house and the close button */
    top: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(100vw - 2 * var(--pad));
    max-width: calc(100vw - 2 * var(--pad));
  }
  /* the house is the only in-flow child, so it centres vertically; the
     bottom margin nudges it a little above true centre */
  .nav.is-open .nav__plan { flex: 0 0 auto; display: block; margin-bottom: 14vh; }
  /* links sit at the very bottom of the viewport (no close button below them) */
  .nav.is-open .nav__extra {
    display: flex;
    position: absolute;
    left: 0;
    bottom: var(--pad);
    width: 100%;
    align-items: flex-start;
  }
  /* no close button while open — tapping any empty space closes the menu */
  .nav.is-open .nav__burger {
    display: none;
  }
}
