:root {
  --ink: #16242b;
  --muted: #5d7079;
  --bg: #fbfaf7;
  --card: #ffffff;
  --line: #e7e3da;
  --sea: #1f6f8b;
  --sea-deep: #15505f;
  --sand: #e9b44c;
  --maxw: 1140px;
  --prose: 700px;
}
* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.3rem; }
a { color: var(--sea); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ---------- masthead ---------- */
.masthead { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.3rem; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 40px; width: 40px; border-radius: 10px; object-fit: cover; display: block; box-shadow: 0 1px 4px rgba(20,40,50,.2); }
.nav { display: flex; gap: 1.2rem; font-size: .92rem; font-weight: 500; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--sea); text-decoration: none; }

/* ---------- hero band ---------- */
.hero-band {
  background:
    linear-gradient(180deg, rgba(13,32,42,.45), rgba(13,32,42,.66)),
    url("/assets/poster.jpg") center 60% / cover no-repeat;
  color: #fff; padding: 5.5rem 0 5rem; margin-bottom: 2.4rem;
}
.hero-title { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: clamp(2.3rem, 5.5vw, 3.4rem); margin: 0; letter-spacing: -.01em; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.hero-tagline { margin: .55rem 0 0; font-size: 1.12rem; opacity: .95; text-shadow: 0 1px 12px rgba(0,0,0,.4); }

/* ---------- card grid ---------- */
.card-grid {
  display: grid; gap: 1.6rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  padding-bottom: 3.5rem;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20,40,50,.10); }
.card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #d4e6f1; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-placeholder { display: block; width: 100%; height: 100%; background: #d4e6f1; }
.card-puffin { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; }
.card-body { padding: 1rem 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.card-title { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.22rem; line-height: 1.25; margin: .1rem 0 0; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--sea); text-decoration: none; }
.card-date { color: var(--muted); font-size: .82rem; margin: 0; }
.card-excerpt { color: var(--muted); font-size: .92rem; margin: .1rem 0 0; }


/* ---------- chips / tags ---------- */
.chip {
  align-self: flex-start; display: inline-block; font-size: .72rem; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase; color: var(--sea-deep);
  background: #e8f1f3; padding: .2rem .6rem; border-radius: 999px;
}
.chip:hover { text-decoration: none; background: #d8e9ed; }

/* ---------- post page ---------- */
.post-hero {
  height: clamp(220px, 42vw, 440px); background-size: cover; background-position: center;
  background-color: #dfe6e4;
}
.post-hero--nophoto { display: flex; align-items: center; justify-content: center; background: #d4e6f1; }
.post-hero--nophoto img { height: 100%; width: auto; max-width: 100%; object-fit: contain; display: block; }
.post-wrap { max-width: var(--prose); }
.post-head { padding: 2rem 0 1rem; }
.post-head h1 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: clamp(1.8rem, 4.4vw, 2.6rem); line-height: 1.18; margin: .6rem 0 .4rem; letter-spacing: -.01em; }
.post-meta { color: var(--muted); font-size: .9rem; margin: 0; }
.prose { font-size: 1.06rem; }
.prose p { margin: 1.15rem 0; }
.prose img { border-radius: 10px; margin: 1.6rem 0; width: 100%; }
.prose h2, .prose h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; margin-top: 2rem; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
/* missing-photo slots — auto-restore by dropping the named file into images/ */
.photo-slot { margin: 1.7rem 0; }
.photo-slot object { display: block; width: 100%; }
.photo-missing {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  min-height: 190px; padding: 1.5rem; text-align: center; border-radius: 10px;
  border: 2px dashed #cdd6cf;
  background: repeating-linear-gradient(45deg, #f7f5f0, #f7f5f0 13px, #f1eee6 13px, #f1eee6 26px);
}
.photo-missing-ico { font-size: 1.7rem; opacity: .7; }
.photo-missing-name { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88rem; color: var(--sea-deep); word-break: break-all; }
.photo-missing-hint { font-size: .76rem; color: #a39c8c; }
/* ---------- diary day titles + phases ---------- */
.day { scroll-margin-top: 84px; }
.prose .phase {
  margin: 3rem 0 .4rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .12em; color: var(--sea);
}
.day:first-of-type .phase { margin-top: 1rem; border-top: 0; padding-top: 0; }
.prose .day-h {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .65rem;
  margin: 1.5rem 0 .9rem; font-family: "Fraunces", Georgia, serif; line-height: 1.15;
}
.day-h-date { font-size: 1.55rem; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.day-h-place { font-size: 1rem; font-weight: 500; color: var(--muted); }

/* ---------- post with itinerary rail ---------- */
/* NB: do NOT use align-items:start — the rail column must stretch to full
   height so its position:sticky child can travel the length of the article. */
.post--rail .post-shell {
  display: grid; gap: 2.6rem; justify-content: center; align-items: stretch;
  grid-template-columns: 244px minmax(0, var(--prose));
}
.post-main { min-width: 0; }
.post-rail { font-family: "Inter", sans-serif; }
.rail-inner {
  position: sticky; top: 84px; max-height: calc(100vh - 104px);
  overflow: auto; overscroll-behavior: contain; padding-right: .3rem;
}
.rail-map { margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #d2e3e8; }
.rail-map svg { width: 100%; height: auto; display: block; }
.itinerary-nav ol { list-style: none; margin: 0; padding: 0; }
.itinerary-nav .leg {
  margin: 1rem 0 .35rem; font-family: "Fraunces", Georgia, serif;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--sea);
}
.itinerary-nav .leg:first-child { margin-top: 0; }
.itinerary-nav a {
  display: flex; gap: .55rem; align-items: baseline; padding: .3rem .55rem;
  border-left: 2px solid transparent; border-radius: 0 7px 7px 0;
  font-size: .87rem; line-height: 1.3; color: var(--muted); text-decoration: none;
}
.itinerary-nav a:hover { color: var(--ink); background: #f1f4f3; text-decoration: none; }
.itinerary-nav a .d {
  flex: 0 0 auto; min-width: 3.3em; font-size: .76rem; font-weight: 600;
  color: var(--sea-deep); font-variant-numeric: tabular-nums;
}
.itinerary-nav a .pl { flex: 1; }

@media (max-width: 1000px) {
  .post--rail .post-shell { display: block; }
  .post-rail { display: none; }
  .post-main { max-width: var(--prose); margin: 0 auto; }
}

/* title + big animated map at the top of the post */
.post-top { max-width: 900px; margin-inline: auto; }
.trip-map--top { margin: 1.4rem 0 0; }

/* route maps (overview at top is inline <svg>, day locators are <img>) */
.trip-map { margin: 2rem 0; }
.trip-map img, .trip-map svg {
  width: 100%; height: auto; display: block; border-radius: 12px;
  border: 1px solid var(--line); background: #d2e3e8;
}
.trip-map figcaption { margin: .55rem 0 0; font-size: .85rem; color: var(--muted); text-align: center; }

/* per-day "you are here" locator under each day title */
.day-map { margin: .1rem 0 1.4rem; max-width: 380px; }
.day-map img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 10px; background: #d2e3e8;
}

/* multi-photo rows inside a post */
.photo-row { display: grid; gap: .6rem; margin: 1.6rem 0; grid-template-columns: repeat(2, 1fr); }
.photo-row.n3 { grid-template-columns: repeat(3, 1fr); }
.photo-row img { width: 100%; height: 100%; margin: 0; border-radius: 10px; object-fit: cover; aspect-ratio: 3 / 2; }
@media (max-width: 560px) { .photo-row, .photo-row.n3 { grid-template-columns: repeat(2, 1fr); } }

.post-tags { margin: 2.2rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { font-size: .85rem; color: var(--muted); background: #f0efe9; padding: .25rem .6rem; border-radius: 6px; }
.tag:hover { text-decoration: none; color: var(--sea); }
.post-back { margin: 2.5rem 0 4rem; }

/* ---------- archive (category/tag) ---------- */
.archive-head { padding: 2.4rem 0 1.6rem; }
.archive-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--sea); font-weight: 600; margin: 0; }
.archive-head h1 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: clamp(1.9rem, 4.5vw, 2.7rem); margin: .3rem 0 .2rem; }
.archive-count { color: var(--muted); margin: 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 2rem 0; margin-top: 2rem; }
.site-footer p { color: var(--muted); font-size: .85rem; margin: 0; }

@media (max-width: 600px) {
  .nav { gap: .85rem; font-size: .85rem; }
  .nav a { display: inline-block; padding: .35rem 0; }
  .masthead-inner { height: auto; padding-top: .6rem; padding-bottom: .6rem; }
}

@media (max-width: 380px) {
  .wrap { padding: 0 1rem; }
}

/* ---- lightbox / photo gallery ---- */
.prose .lb-thumb { cursor: zoom-in; }
body.lb-lock { overflow: hidden; }
.lb {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(16, 26, 31, .94);
  -webkit-user-select: none; user-select: none;
}
.lb.is-open { display: flex; }
.lb-stage { margin: 0; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.lb-img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); object-fit: contain; }
.lb-cap { color: #e7e3da; font-size: .9rem; text-align: center; max-width: 70ch; }
.lb-count { position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); color: #cdd6da; font-size: .85rem; letter-spacing: .03em; }
.lb-close, .lb-nav {
  position: absolute; background: rgba(255,255,255,.08); color: #fff; border: 0;
  cursor: pointer; line-height: 1; border-radius: 50%; transition: background .15s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.2); }
.lb-close { top: 1rem; right: 1.2rem; width: 2.6rem; height: 2.6rem; font-size: 1.8rem; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; font-size: 2.2rem; }
.lb-prev { left: 1.2rem; }
.lb-next { right: 1.2rem; }
.lb--single .lb-nav, .lb--single .lb-count { display: none; }
@media (max-width: 560px) {
  .lb-nav { width: 2.4rem; height: 2.4rem; font-size: 1.7rem; }
  .lb-prev { left: .4rem; } .lb-next { right: .4rem; }
  .lb-close { top: .5rem; right: .6rem; }
}
