/* ═══════════════════════════════════════════════════════════════════════════
   S/V GENNETAY — SHIP'S LOG
   A letterpress journal: cream stock, iron-gall ink, brass rule, engraved
   flourishes. IM Fell English for display, EB Garamond for running text,
   Cormorant for instrument numerals.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --paper: #f4edda;
  --paper-deep: #ece1c6;
  --paper-shade: #e4d7b8;
  --ink: #2b2a24;
  --ink-soft: #4c463a;
  --ink-faded: #7c715c;
  --navy: #1d3a53;
  --brass: #96762f;
  --brass-bright: #b18d3a;
  --oxblood: #7d2a24;
  --sea: #37556b;
  --hairline: #cbbc98;
  --rule: #a89463;
  --serif: "EB Garamond", Georgia, serif;
  --display: "IM Fell English", Georgia, serif;
  --display-sc: "IM Fell English SC", Georgia, serif;
  --numeral: "Cormorant", Georgia, serif;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

/* Paper grain is baked into the body background (no fixed overlay, no blend
   mode — Safari paints fixed blend layers unreliably and "cuts off" the page) */
body {
  margin: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.48 0 0 0 0 0.34 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% -20%, rgba(255, 252, 240, 0.9), transparent 55%),
    radial-gradient(ellipse at 50% 115%, rgba(160, 134, 84, 0.18), transparent 60%);
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--navy); text-decoration: none; border-bottom: 1px solid rgba(29, 58, 83, 0.3); }
a:hover { color: var(--oxblood); border-bottom-color: var(--oxblood); }

/* ── Page shell ──────────────────────────────────────────────────────────── */

.sheet {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ── Masthead ────────────────────────────────────────────────────────────── */

.masthead {
  text-align: center;
  padding: 2.4rem 1rem 0;
  position: relative;
}

.masthead .burgee {
  font-size: 1.5rem;
  color: var(--brass);
  letter-spacing: 0.5em;
  margin-bottom: 0.4rem;
}

.masthead h1 {
  font-family: var(--display-sc);
  font-weight: 400;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  letter-spacing: 0.12em;
  margin: 0;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.masthead .subtitle {
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-faded);
  font-size: 1.05rem;
  margin-top: 0.2rem;
  letter-spacing: 0.06em;
}

.rule-double {
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  height: 4px;
  background: transparent;
  margin: 1.3rem auto 0;
  max-width: 40rem;
}

.rule-anchor {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.6rem 0 1.8rem;
  color: var(--brass);
}
.rule-anchor::before,
.rule-anchor::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
  box-shadow: 0 3px 0 -2px var(--rule);
}

/* ── Navigation ──────────────────────────────────────────────────────────── */

nav.compassnav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.2rem 2.2rem;
  padding: 0.85rem 0;
  margin-top: 1.1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 3px double var(--rule);
  font-variant: small-caps;
  letter-spacing: 0.22em;
  font-size: 0.95rem;
}
nav.compassnav a { border-bottom: none; color: var(--ink-soft); }
nav.compassnav a:hover { color: var(--oxblood); }
nav.compassnav a.active { color: var(--navy); font-weight: 600; }
nav.compassnav a.active::before { content: "⚓ "; color: var(--brass); letter-spacing: 0; }

/* ── Headings ────────────────────────────────────────────────────────────── */

h2.section-head {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.75rem;
  text-align: center;
  letter-spacing: 0.04em;
  margin: 0 0 0.4rem;
  color: var(--navy);
}

.section-sub {
  text-align: center;
  font-style: italic;
  color: var(--ink-faded);
  margin: 0 0 1.6rem;
}

/* ── Hero stats (gauges in print) ────────────────────────────────────────── */

.gauge-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  border-top: 3px double var(--rule);
  border-bottom: 3px double var(--rule);
  margin: 1.6rem 0;
}

.gauge {
  text-align: center;
  padding: 1.05rem 0.5rem 0.9rem;
  position: relative;
}
.gauge + .gauge::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  border-left: 1px solid var(--hairline);
}

.gauge .value {
  font-family: var(--numeral);
  font-weight: 600;
  font-size: 2.15rem;
  line-height: 1;
  color: var(--navy);
  font-variant-numeric: lining-nums;
}
.gauge .value small {
  font-size: 1.05rem;
  color: var(--brass);
  font-weight: 500;
  margin-left: 0.15rem;
}
.gauge .label {
  font-variant: small-caps;
  letter-spacing: 0.24em;
  font-size: 0.78rem;
  color: var(--ink-faded);
  margin-top: 0.35rem;
}
/* The same gauge for the last 24 hours — an annotation, never competing with
   the season figure above it. */
.gauge .gauge-24h {
  font-family: var(--numeral);
  font-size: 0.85rem;
  font-variant-numeric: lining-nums;
  color: var(--brass);
  opacity: 0.85;
  margin-top: 0.2rem;
}

/* ── Chart frame (maps & canvases) ───────────────────────────────────────── */

.chart-frame {
  position: relative;
  border: 1px solid var(--rule);
  outline: 1px solid var(--rule);
  outline-offset: 4px;
  background: var(--paper-deep);
  margin: 5px;
  box-shadow: inset 0 0 40px rgba(120, 96, 50, 0.18);
}

.chart-frame .frame-label {
  position: absolute;
  z-index: 500;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.1rem 1.1rem;
  font-variant: small-caps;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.map {
  height: 24rem;
  background: var(--paper-deep);
  z-index: 1;
}
.map.tall { height: 30rem; }

/* Sepia chart look for tiles */
.leaflet-tile-pane { filter: sepia(0.55) saturate(0.55) brightness(1.04) contrast(0.92); }
.leaflet-container { font-family: var(--serif); background: var(--paper-deep); }
.leaflet-control-attribution {
  background: rgba(244, 237, 218, 0.8) !important;
  color: var(--ink-faded);
  font-size: 0.62rem;
}
.leaflet-control-zoom a {
  background: var(--paper) !important;
  color: var(--navy) !important;
  border-color: var(--rule) !important;
}
.anchor-marker {
  font-size: 1.25rem;
  color: var(--oxblood);
  text-shadow: 0 0 3px var(--paper), 0 0 6px var(--paper);
  line-height: 1;
}

/* Where she lies now. */
.boat-marker { position: relative; }
.boat-marker .dot,
.boat-marker .halo {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.boat-marker .dot {
  width: 11px;
  height: 11px;
  background: var(--brass-bright);
  border: 2px solid var(--paper);
  box-shadow: 0 0 4px rgba(43, 42, 36, 0.55);
}
.boat-marker .halo {
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--brass-bright);
  animation: boat-pulse 2.6s ease-out infinite;
}
@keyframes boat-pulse {
  0%   { opacity: 0.85; transform: translate(-50%, -50%) scale(0.55); }
  70%  { opacity: 0;    transform: translate(-50%, -50%) scale(1.25); }
  100% { opacity: 0;    transform: translate(-50%, -50%) scale(1.25); }
}
@media (prefers-reduced-motion: reduce) {
  .boat-marker .halo { animation: none; opacity: 0.7; }
}

.last-fix {
  text-align: center;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  color: var(--ink-faded);
  margin: 0 0 0.7rem;
}
.last-fix b {
  font-variant: normal;
  letter-spacing: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink);
}
.track-legend {
  text-align: center;
  font-variant: small-caps;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  color: var(--ink-faded);
  margin: 0.6rem 0 0;
}
.track-legend .swatch {
  display: inline-block;
  width: 2rem;
  height: 3px;
  vertical-align: middle;
  margin-right: 0.35rem;
}
.track-legend .swatch.sail { background: #2a5f8a; }
.track-legend .swatch.motor { background: #a3271c; }
.track-legend .swatch.archive { background: var(--brass); opacity: 0.65; }
.track-legend .swatch.pin {
  width: auto;
  height: auto;
  background: none;
  color: var(--oxblood);
  font-style: normal;
}
.track-legend .swatch.photo {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brass-bright);
  box-shadow: 0 0 0 1px var(--brass);
}
.track-legend .photo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  letter-spacing: 0.16em;
}
.track-legend .photo-toggle input {
  accent-color: var(--brass);
  width: 0.8rem;
  height: 0.8rem;
  cursor: pointer;
}

/* ── Charts page ─────────────────────────────────────────────────────────── */

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 2rem;
  justify-content: center;
  align-items: center;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 1.4rem 0 0;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--navy);
}
.chart-toolbar .toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  align-items: center;
}
.chart-toolbar .toolbar-legend {
  color: var(--ink-faded);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
}
.chart-toolbar label { display: flex; gap: 0.4rem; align-items: center; cursor: pointer; }
.chart-toolbar label:has(input:disabled) { opacity: 0.4; cursor: default; }

.mode-toggle { display: flex; border: 1px solid var(--rule); background: var(--paper); }
.mode-toggle button {
  font-family: var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  color: var(--ink-faded);
  background: none;
  border: 0;
  padding: 0.22rem 0.9rem;
  cursor: pointer;
}
.mode-toggle button + button { border-left: 1px solid var(--rule); }
.mode-toggle button.active { background: var(--navy); color: var(--paper); }

/* Sits in the toolbar rather than under it — the chart wants the vertical room
   more than the figure does, and the two belong together anyway: this number is
   the answer to whatever the ticks above are asking. */
.charts-readout {
  flex: 0 0 auto;
  margin: 0;
  padding-left: 1.4rem;
  border-left: 1px solid var(--rule);
  line-height: 1.15;
  text-align: right;
}
.charts-readout .readout-figure {
  font-family: var(--numeral);
  font-weight: 600;
  font-size: 1.7rem;
  font-variant-numeric: lining-nums;
  color: var(--oxblood);
  margin-right: 0.2rem;
}
.charts-readout .readout-unit {
  font-variant: small-caps;
  letter-spacing: 0.16em;
  color: var(--ink-faded);
  font-size: 0.85rem;
}
/* The gesture isn't discoverable — plain scrolling deliberately passes through
   to the page, so without a word here the chart just looks like it won't zoom. */
.charts-legend .map-hint {
  font-style: italic;
  font-variant: normal;
  letter-spacing: 0.02em;
  opacity: 0.75;
}

/* The chart wants the whole window, not the 62rem measure the prose is set to. */
.full-bleed {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-left: 0;
  border-right: 0;
  outline: 0;
}
.map.full { height: min(86vh, 1050px); }

/* A photograph's position, not the photograph — the picture loads on click.
   See the note in charts-map.js: the originals are ~7 MB each. */
.photo-pin { cursor: pointer; }
.photo-pin .photo-pin-dot {
  display: block;
  width: 10px;
  height: 10px;
  margin: 3px;
  border-radius: 50%;
  background: var(--brass-bright);
  border: 1.5px solid var(--paper);
  box-shadow: 0 0 0 1px var(--brass), 0 1px 3px rgba(60, 45, 20, 0.5);
}
.photo-pin:hover .photo-pin-dot { background: var(--oxblood); }

.photo-popup .leaflet-popup-content-wrapper {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.photo-popup .leaflet-popup-tip { background: var(--paper); }
.chart-plate { margin: 0; }
.chart-plate img {
  width: 100%;
  height: auto;
  /* Portrait shots are far taller than the chart frame; without a ceiling the
     popup runs off the top and Leaflet's auto-pan cannot recover it. */
  max-height: 45vh;
  object-fit: contain;
  display: block;
  border: 1px solid var(--rule);
}
.chart-plate figcaption {
  font-family: var(--serif);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-faded);
  margin-top: 0.4rem;
  line-height: 1.35;
}
.chart-plate figcaption a { white-space: nowrap; }

.charts-legend { margin-top: 0.8rem; }
.charts-legend span { margin: 0 0.7rem; white-space: nowrap; }

.charts-note {
  max-width: 40rem;
  margin: 1.4rem auto 0;
  text-align: center;
  font-style: italic;
  color: var(--ink-faded);
  font-size: 0.92rem;
}

@media (max-width: 62rem) {
  .charts-readout {
    flex-basis: 100%;
    padding-left: 0;
    border-left: 0;
    text-align: center;
  }
}
@media (max-width: 40rem) {
  .chart-toolbar { gap: 0.5rem 1.1rem; font-size: 0.9rem; }
  .map.full { height: 70vh; }
  .charts-readout .readout-figure { font-size: 1.5rem; }
  .charts-legend span { display: inline-block; margin: 0.15rem 0.5rem; }
}

.photo-marker img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--brass), 0 2px 6px rgba(60, 45, 20, 0.45);
  cursor: pointer;
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 400;
  background: var(--paper-deep);
}
.map-fallback svg { width: 90%; height: 90%; }
.map-fallback .no-track {
  font-style: italic;
  color: var(--ink-faded);
}

/* ── Entry page ──────────────────────────────────────────────────────────── */

.entry-date {
  text-align: center;
  font-variant: small-caps;
  letter-spacing: 0.3em;
  color: var(--brass);
  font-size: 0.95rem;
  margin: 2.2rem 0 0.2rem;
}

h1.entry-title {
  font-family: var(--display);
  font-weight: 400;
  text-align: center;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  margin: 0.1rem 0 0.5rem;
  color: var(--ink);
}

.entry-conditions {
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.entry-passage-times {
  text-align: center;
  font-variant: small-caps;
  letter-spacing: 0.18em;
  color: var(--ink-faded);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
.entry-passage-times b { color: var(--navy); font-weight: 600; letter-spacing: 0.1em; }

.summary-lede {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 38rem;
  margin: 1.6rem auto;
  text-align: center;
}

blockquote.forecast {
  margin: 1.8rem auto;
  max-width: 36rem;
  border: none;
  padding: 0.9rem 1.4rem;
  background: linear-gradient(rgba(180, 152, 90, 0.1), rgba(180, 152, 90, 0.16));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-style: italic;
  color: var(--ink-soft);
  position: relative;
}
blockquote.forecast .fz {
  display: block;
  font-style: normal;
  font-variant: small-caps;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  color: var(--brass);
  margin-bottom: 0.25rem;
}
blockquote.forecast .warnflag {
  color: var(--oxblood);
  font-variant: small-caps;
  font-style: normal;
  letter-spacing: 0.12em;
}

/* ── Share control ───────────────────────────────────────────────────────── */

.entry-head { position: relative; }

.share-row {
  display: inline-flex;
  gap: 0.9rem;
  align-items: baseline;
}

/* On an entry, tucked onto the date line rather than given a row of its own —
   quiet enough to ignore, close enough to the title to find. Elsewhere it sits
   in the flow, under the page's own subtitle. */
.entry-head .share-row {
  position: absolute;
  right: 0;
  top: 0;
}

.share-line {
  text-align: center;
  margin: -0.5rem 0 1.6rem;
}

.share-btn,
.share-story-btn {
  font-family: var(--display-sc);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--ink-faded);
  background: transparent;
  border: none;
  padding: 0.1rem 0;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.share-btn::before { content: "⤴"; margin-right: 0.35rem; letter-spacing: 0; }
/* The second control deals in the picture itself, so it carries a plate rather
   than an arrow. */
.share-story-btn::before { content: "▤"; margin-right: 0.35rem; letter-spacing: 0; }
.share-btn:hover,
.share-story-btn:hover {
  color: var(--oxblood);
  border-bottom-color: var(--rule);
}
.share-btn:focus-visible,
.share-story-btn:focus-visible { outline: 1px dotted var(--brass); outline-offset: 3px; }
.share-btn[hidden],
.share-story-btn[hidden] { display: none; }

/* Narrow sheets: the date can run close to the edge, so drop the control back
   into the flow under the title rather than let the two collide. */
@media (max-width: 32rem) {
  .entry-head .share-row {
    position: static;
    display: flex;
    justify-content: center;
    margin: 0.3rem auto 0;
  }
}

/* ── Folds (the numbers, the forecast) ───────────────────────────────────── */
/* Native <details>, so these still open without JavaScript and are reachable
   from the keyboard for free. */

.fold {
  max-width: 38rem;
  margin: 1.4rem auto 0;
  border-top: 1px solid var(--rule);
}
.fold + .fold { margin-top: 0; }

.fold-head {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.55rem 0.2rem;
  font-variant: small-caps;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--brass);
}
.fold-head::-webkit-details-marker { display: none; }
.fold-head::after {
  content: "▸";
  margin-left: auto;
  font-size: 0.7rem;
  letter-spacing: 0;
  color: var(--rule);
  transition: transform 0.15s ease;
}
.fold[open] > .fold-head::after { transform: rotate(90deg); }
.fold-head:hover { color: var(--brass-bright); }
.fold-head:focus-visible { outline: 1px dotted var(--brass); outline-offset: 3px; }

/* Inside a fold the label already sits on the summary, so the inner blocks
   lose their own top framing. */
.fold .summary-recap { border: none; margin: 0; padding: 0 0 0.6rem; }
.fold .summary-recap .summary-lede { margin-top: 0; }
.fold blockquote.forecast { margin-top: 0.2rem; }

.entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(15rem, 1fr);
  gap: 2rem;
  align-items: start;
  margin: 2rem 0;
}
@media (max-width: 46rem) {
  .entry-grid { grid-template-columns: 1fr; }
}

/* stat ledger — a narrow instrument column */
.ledger {
  border-top: 3px double var(--rule);
}
.ledger .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0.2rem;
  border-bottom: 1px solid var(--hairline);
}
.ledger .row .k {
  font-variant: small-caps;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  color: var(--ink-faded);
}
.ledger .row .v {
  font-family: var(--numeral);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--navy);
}
.ledger .row .v small { color: var(--brass); font-size: 0.85rem; }
.ledger .row.head {
  border-bottom: 3px double var(--rule);
  padding-top: 0.9rem;
}
.ledger .row.head .k {
  color: var(--navy);
  font-size: 0.9rem;
  letter-spacing: 0.25em;
}

.quality-flag {
  margin: 1rem auto;
  max-width: 36rem;
  text-align: center;
  color: var(--oxblood);
  border: 1px solid rgba(125, 42, 36, 0.45);
  padding: 0.5rem 1rem;
  font-size: 0.92rem;
  background: rgba(125, 42, 36, 0.05);
}
.quality-flag::before { content: "⚑ "; }

/* Captain's log body */
.log-body {
  max-width: 40rem;
  margin: 0 auto;
  font-size: 1.12rem;
}
.log-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}
.log-body h2 {
  font-family: var(--display);
  font-weight: 400;
  text-align: center;
  color: var(--navy);
  font-size: 1.6rem;
  margin-top: 2.4rem;
}
.log-body h2::before { content: "— "; color: var(--brass); }
.log-body h2::after { content: " —"; color: var(--brass); }
.log-body h3 {
  font-variant: small-caps;
  letter-spacing: 0.3em;
  font-weight: 600;
  text-align: center;
  color: var(--brass);
  font-size: 1rem;
  margin: 2rem 0 0.6rem;
}
.log-body h3::before { content: "☛ "; letter-spacing: 0; }
.log-body h3 + p::first-letter {
  font-family: var(--display);
  font-size: 3.1em;
  float: left;
  line-height: 0.85;
  padding: 0.06em 0.12em 0 0;
  color: var(--navy);
}
.log-body .no-log {
  text-align: center;
  font-style: italic;
  color: var(--ink-faded);
}

.entry-pager {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  font-variant: small-caps;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

/* ── Voyage feed (full entries, blog-style, on the home page) ───────────── */

.feed-entry {
  padding: 2.6rem 0;
  border-bottom: 3px double var(--rule);
}
.feed-entry:first-child { padding-top: 0.5rem; }
.feed-entry:last-child { border-bottom: none; }
.feed-entry .entry-date a {
  border-bottom: none;
  color: var(--brass);
}
.feed-entry .entry-date a:hover { color: var(--oxblood); }
/* The headline is the obvious thing to click through on — keep it looking like
   a headline until hover, rather than a styled link. */
.feed-entry .entry-title a {
  color: inherit;
  border-bottom: none;
}
.feed-entry .entry-title a:hover { color: var(--oxblood); }
.feed-entry .log-body { margin-top: 1.3rem; }
.feed-permalink {
  text-align: center;
  margin-top: 2rem;
  font-variant: small-caps;
  letter-spacing: 0.16em;
  font-size: 0.85rem;
}

.feed-stats {
  justify-content: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
}

/* Contact-sheet thumbnails — every photo from the day, shown small enough that
   a long day's shooting doesn't push the writing off the page. Used on both the
   voyage feed and the log index cards. */
.photo-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: 0.4rem;
  max-width: 38rem;
  margin: 1.4rem auto 0;
}
.photo-mini-grid a { border-bottom: none; display: block; }
.photo-mini-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--rule);
  filter: sepia(0.14) saturate(0.94);
  transition: filter 0.15s ease;
}
.photo-mini-grid a:hover img { filter: none; }
.entry-card .photo-mini-grid { margin: 0.9rem 0 0; max-width: none; }

/* "The Numbers" — the technical recap, demoted below the human narrative */
.summary-recap {
  max-width: 38rem;
  margin: 2rem auto 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--hairline);
}
.summary-recap .summary-lede {
  font-size: 1.05rem;
  font-style: normal;
  color: var(--ink-faded);
}

/* ── Log index month grouping ────────────────────────────────────────────── */

.month-group + .month-group { margin-top: 0.5rem; }
.month-head {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--brass);
  text-align: center;
  margin: 2.2rem 0 0.6rem;
  padding-top: 1.4rem;
  border-top: 3px double var(--rule);
}
.month-group:first-child .month-head { border-top: none; padding-top: 0; }

/* ── Plates (photographs) ────────────────────────────────────────────────── */

.plates { margin-top: 2.8rem; }
.plates-head {
  font-family: var(--display);
  font-weight: 400;
  text-align: center;
  color: var(--navy);
  font-size: 1.6rem;
  margin: 0 0 1.2rem;
}
.plates-head::before { content: "— "; color: var(--brass); }
.plates-head::after { content: " —"; color: var(--brass); }
.plates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.4rem;
  max-width: 52rem;
  margin: 0 auto;
}
.plates-grid:has(> :only-child) { max-width: 30rem; }
.plate {
  margin: 3px;
  border: 1px solid var(--rule);
  outline: 1px solid var(--hairline);
  outline-offset: 3px;
  background: var(--paper-deep);
  padding: 0.55rem;
}
.plate a { border-bottom: none; display: block; }
.plate img {
  width: 100%;
  display: block;
  filter: sepia(0.14) saturate(0.94);
  transition: filter 0.2s ease;
}
.plate:hover img { filter: none; }
.plate figcaption {
  font-variant: small-caps;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: center;
  padding-top: 0.5rem;
}
.plate .plate-geo {
  display: block;
  font-variant: normal;
  letter-spacing: 0.04em;
  font-family: var(--numeral);
  color: var(--ink-faded);
  font-size: 0.8rem;
}
.plate:target {
  outline-color: var(--brass);
  border-color: var(--brass);
}

/* ── Log index cards ─────────────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  justify-content: center;
  align-items: center;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 1.4rem 0 2rem;
  font-variant: small-caps;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.filter-bar select,
.filter-bar input[type="number"] {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.2rem 0.5rem;
}
.filter-bar label { display: flex; gap: 0.45rem; align-items: center; }
.filter-bar .count { font-style: italic; color: var(--ink-faded); letter-spacing: 0; font-variant: normal; }

.entry-card {
  display: block;
  border: 1px solid var(--rule);
  outline: 1px solid var(--hairline);
  outline-offset: 3px;
  margin: 1.4rem 3px;
  padding: 1.1rem 1.4rem 1rem;
  background: linear-gradient(rgba(255, 253, 245, 0.55), rgba(255, 253, 245, 0));
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(80, 62, 30, 0.18);
  border-color: var(--brass);
  color: var(--ink);
}
.entry-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.entry-card .card-date {
  font-variant: small-caps;
  letter-spacing: 0.2em;
  color: var(--brass);
  font-size: 0.85rem;
}
.entry-card .card-title {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--navy);
}
.entry-card .card-title-fallback {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink-faded);
}
.entry-card .card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.6rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.entry-card .card-stats b {
  font-family: var(--numeral);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
}
.entry-card .card-summary {
  font-style: italic;
  color: var(--ink-faded);
  margin-top: 0.45rem;
  font-size: 0.98rem;
}
.entry-card .card-remarks {
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--hairline);
  font-size: 1.02rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.badge {
  font-variant: small-caps;
  letter-spacing: 0.15em;
  font-size: 0.72rem;
  border: 1px solid currentColor;
  padding: 0.05rem 0.5rem;
  border-radius: 2px;
}
.badge.partial { color: var(--brass); }
.badge.no-data { color: var(--ink-faded); }
.badge.suspect { color: var(--oxblood); }
.badge.log { color: var(--sea); }

/* ── Stats page ──────────────────────────────────────────────────────────── */

.year-tabs {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  margin: 1.2rem 0 0.4rem;
  font-family: var(--numeral);
  font-size: 1.35rem;
  font-weight: 600;
}
.year-tabs a {
  border-bottom: none;
  color: var(--ink-faded);
  padding: 0.1rem 0.3rem;
}
.year-tabs a.active {
  color: var(--navy);
  border-bottom: 3px double var(--brass);
}

.chart-panel { padding: 1.2rem 1.2rem 0.8rem; position: relative; }
.chart-panel canvas { width: 100% !important; }

.stat-tableau {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.8rem;
  margin: 2rem 0;
}

/* ── Maintenance ─────────────────────────────────────────────────────────── */

.maint-item {
  display: grid;
  grid-template-columns: 8.5rem 1fr auto;
  gap: 1.2rem;
  align-items: baseline;
  padding: 0.85rem 0.3rem;
  border-bottom: 1px solid var(--hairline);
}
.maint-item .m-date {
  font-variant: small-caps;
  letter-spacing: 0.12em;
  color: var(--brass);
  font-size: 0.9rem;
}
.maint-item .m-title { font-size: 1.08rem; }
.maint-item .m-title a { border-bottom: none; }
.maint-item .m-hours {
  font-family: var(--numeral);
  color: var(--ink-faded);
  font-size: 0.98rem;
  white-space: nowrap;
}
.syschip {
  font-variant: small-caps;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--sea);
  border: 1px solid var(--sea);
  opacity: 0.8;
  padding: 0.02rem 0.45rem;
  border-radius: 2px;
  margin-left: 0.6rem;
  vertical-align: middle;
}
@media (max-width: 40rem) {
  .maint-item { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ── Anchorages ──────────────────────────────────────────────────────────── */

.anch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.6rem;
  margin-top: 1.8rem;
}
.anch-card {
  border: 1px solid var(--rule);
  outline: 1px solid var(--hairline);
  outline-offset: 3px;
  margin: 3px;
  padding: 1.1rem 1.2rem;
  color: var(--ink);
  background: linear-gradient(rgba(255, 253, 245, 0.55), rgba(255, 253, 245, 0));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.anch-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(80, 62, 30, 0.18);
  border-color: var(--brass);
}
.anch-card h3 {
  font-family: var(--display);
  font-weight: 400;
  margin: 0 0 0.2rem;
  color: var(--navy);
  font-size: 1.3rem;
}
.anch-card .coords {
  font-family: var(--numeral);
  font-size: 0.9rem;
  color: var(--ink-faded);
}
.anchor-rating { color: var(--brass); letter-spacing: 0.18em; font-size: 1rem; }
.anchor-rating .off { opacity: 0.25; }
.anch-card dl {
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
}
.anch-card dt {
  font-variant: small-caps;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--ink-faded);
  float: left;
  clear: left;
  width: 6.4rem;
}
.anch-card dd { margin: 0 0 0.15rem 6.8rem; }

/* Article body (maintenance/anchorage prose) */
.prose {
  max-width: 40rem;
  margin: 1.5rem auto;
  font-size: 1.1rem;
}
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}
.prose h2, .prose h3 { font-family: var(--display); font-weight: 400; color: var(--navy); }

/* ── Home flourishes ─────────────────────────────────────────────────────── */

.compass-wrap {
  display: flex;
  justify-content: center;
  margin: 0.7rem 0 0.4rem;
  color: var(--brass);
  opacity: 0.85;
}

.latest-list { margin-top: 0.4rem; }

.mini-head {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--navy);
  border-bottom: 3px double var(--rule);
  padding-bottom: 0.3rem;
  margin: 0 0 0.7rem;
}
.mini-head a { border-bottom: none; }

/* ── Footer ──────────────────────────────────────────────────────────────── */

footer.colophon {
  text-align: center;
  margin-top: 4rem;
  padding: 1.6rem 0 2.5rem;
  border-top: 3px double var(--rule);
  font-style: italic;
  color: var(--ink-faded);
  font-size: 0.92rem;
}
footer.colophon .anchor { color: var(--brass); font-style: normal; font-size: 1.1rem; }

/* ── Load animation: entries surface like pages turning ─────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.5s ease both; }
  .rise:nth-child(2) { animation-delay: 0.06s; }
  .rise:nth-child(3) { animation-delay: 0.12s; }
  .rise:nth-child(4) { animation-delay: 0.18s; }
  .rise:nth-child(5) { animation-delay: 0.24s; }
  .rise:nth-child(6) { animation-delay: 0.3s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: none; }
  }
}

/* ── Print ───────────────────────────────────────────────────────────────── */

@media print {
  nav.compassnav, .filter-bar, .entry-pager, .leaflet-control-container { display: none !important; }
  .sheet { max-width: none; }
}
