:root {
  --bg: #fbfaf7;
  --fg: #1d1f21;
  --muted: #5f6368;
  --line: #e3e0d8;
  --link: #0b5c8a;
  --cruise: #0b5c8a;
  --train: #7a4b14;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #e8e6e1;
    --muted: #9aa0a6;
    --line: #2c2f33;
    --link: #7cc0ea;
    --cruise: #7cc0ea;
    --train: #e0b07a;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}
header.site, main { max-width: 42rem; margin: 0 auto; padding: 0 16px; }
header.site { padding-top: 24px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
header.site a { font-weight: 700; color: var(--fg); text-decoration: none; }
header.site span { color: var(--muted); margin-left: 0.5rem; }
a { color: var(--link); }
h1 { line-height: 1.2; }
.meta { color: var(--muted); }
.mode { font-size: 0.8em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-right: 0.4rem; }
.mode-cruise { color: var(--cruise); }
.mode-train { color: var(--train); }
ul.segments { list-style: none; padding: 0; }
ul.segments li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); display: grid; gap: 0.15rem; }
ul.segments a { font-weight: 600; }
ul.segments .places { color: var(--muted); font-size: 0.95em; }
ol.places { padding-left: 1.2rem; }
.pending { color: var(--muted); font-size: 0.9em; }
.pending-label { font-weight: 600; }
article .pending { margin: -0.5rem 0 1rem; }
ul.segments li.seg-cruise { border-left: 3px solid var(--cruise); padding-left: 0.75rem; }
ul.segments li.seg-land { border-left: 3px solid var(--train); padding-left: 0.75rem; }
ul.segments li.gap { color: var(--muted); font-style: italic; font-size: 0.9em; border-bottom: none; }
table.ports { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95em; }
table.ports th, table.ports td { text-align: left; padding: 0.35rem 0.5rem 0.35rem 0; border-bottom: 1px solid var(--line); }
table.ports th { color: var(--muted); font-weight: 600; }
section.memory h2 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.mode-ferry, .mode-bus, .mode-car, .mode-overland, .mode-stay, .mode-tour { color: var(--train); }

/* Photos: a plain list without JavaScript; gallery.js makes it a slideshow. Each photo
   keeps its own shape (landscape, 3:4, 9:16) and is never cropped. */
.gallery { margin: 2rem 0 1.5rem; }
.gallery h2 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.gallery .slides { display: grid; gap: 1.5rem; }
.gallery .slide { margin: 0; }
.gallery .slide a { display: block; }
.gallery img { display: block; width: 100%; height: auto; max-height: 75vh; object-fit: contain; }
.gallery figcaption, .gallery-caption { font-size: 0.95em; margin-top: 0.4rem; }
.gallery .where { font-weight: 600; }
.gallery .when { color: var(--muted); margin-left: 0.5rem; }
.gallery .caption { display: block; }
/* gallery.js marks <html class="js"> before the page renders, so only the current photo
   is laid out (and fetched) from the start. */
.js .gallery .slides { display: block; }
.js .gallery .slide { display: none; }
.js .gallery .slide.is-active { display: block; }
.gallery.is-carousel .slide.is-active { animation: gallery-fade 0.6s ease; }
.gallery.is-carousel figcaption { display: none; }
.gallery-caption { min-height: 3.2em; margin-bottom: 0.4rem; }
.gallery-controls { display: flex; align-items: center; gap: 0.5rem; }
.gallery-controls button {
  font: inherit;
  min-width: 2.75rem;
  padding: 0.2rem 0.8rem;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.gallery-controls button:hover { border-color: var(--muted); }
.gallery-count { margin-left: auto; color: var(--muted); font-size: 0.9em; }
@keyframes gallery-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .gallery.is-carousel .slide.is-active { animation: none; }
}
