/* overland-underwater.com archive – "clean" theme
   A quieter, more readable take on the original: same logo and olive/cream
   palette, but a single reading column, a top navigation bar, and serif body
   text sized for long diary entries. */

:root {
  --paper: #faf8f1;
  --card: #ffffff;
  --ink: #222;
  --muted: #6b6b60;
  --line: #e4e0d0;
  --olive: #8a8a3c;       /* from the original #CCCC98 background, deepened */
  --olive-soft: #ecebd4;
  --link: #1d4e89;
  --link-visited: #5b3a7a;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --col: 1000px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}
a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 2px; }
img { border: 0; max-width: 100%; height: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 4px 8px; z-index: 50; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: calc(var(--col) + 40px); margin: 0 auto; padding: 8px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:visited { color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 52px; height: 52px; border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font: 700 20px/1.1 var(--sans); letter-spacing: -0.3px; }
.brand-tag { font-size: 12.5px; color: var(--muted); }

.nav-toggle > summary { display: none; }
.mainnav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; align-items: center; }
.mainnav > ul > li > a,
.mainnav .dropdown > summary {
  display: block; padding: 6px 11px; border-radius: 6px;
  color: var(--ink); font-size: 15px; cursor: pointer; list-style: none;
}
.mainnav .dropdown > summary::-webkit-details-marker { display: none; }
.mainnav .dropdown > summary::after { content: " ▾"; font-size: 11px; color: var(--muted); }
.mainnav > ul > li > a:hover,
.mainnav .dropdown > summary:hover,
.mainnav .dropdown[open] > summary { background: var(--olive-soft); text-decoration: none; }
.mainnav [aria-current="page"] { background: var(--olive-soft); font-weight: 600; }

.dropdown { position: relative; }
.panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(40, 40, 20, .12);
  padding: 14px 16px; z-index: 30;
}
.panel a { color: var(--ink); }
.panel-head { display: block; font-weight: 600; margin-bottom: 8px; }
.panel-route ul { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 20px; width: 470px; }
.panel-route li a { display: block; padding: 2px 0; font-size: 14.5px; white-space: nowrap; }
.panel-route .n { display: inline-block; width: 22px; color: var(--muted); font-size: 12px; }
.panel-more { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 28px; }
.panel-more h3 { font: 600 11.5px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.panel-more a { display: block; padding: 2px 0; font-size: 14.5px; white-space: nowrap; }

/* ---------- page ---------- */
#rap { max-width: calc(var(--col) + 40px); margin: 0 auto; padding: 28px 20px 40px; }
#content { min-width: 0; }

.storycontent.post, #content > .storycontent {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 36px 24px;
}
.storytitle {
  font: 700 2.1rem/1.15 var(--serif);
  letter-spacing: -0.5px;
  margin: 0 0 6px;
}
.meta { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.trip-facts {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  margin: 0 0 22px; padding: 12px 16px;
  background: var(--olive-soft); border-radius: 8px;
  font-size: 14px;
}
.trip-facts div { min-width: 0; }
.trip-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.trip-facts dd { margin: 0; font-weight: 600; }
.trip-facts .num { font-weight: 400; color: var(--muted); }
.trip-header { font-size: 15px; margin: 0 0 18px; }

.body { font: 1.125rem/1.7 var(--serif); }
.body p { margin: 0 0 1.05em; }
.body::after { content: ""; display: block; clear: both; }
.body blockquote { border-left: 3px solid var(--olive); margin: 0 0 1em; padding: 0 0 0 16px; color: #444; }

/* ---------- photos ---------- */
figure.photo { margin: 6px 0 16px; }
figure.photo img { display: block; border-radius: 6px; background: var(--olive-soft); }
figure.photo figcaption { font: 13px/1.35 var(--sans); color: var(--muted); margin-top: 6px; }
figure.photo.left  { float: left;  margin: 6px 22px 12px 0; max-width: min(46%, calc(var(--w, 250px) * 1.3)); }
figure.photo.right { float: right; margin: 6px 0 12px 22px; max-width: min(46%, calc(var(--w, 250px) * 1.3)); }
figure.photo.center img { max-width: min(100%, calc(var(--w, 600px) * 1.3)); }
figure.photo.left img, figure.photo.right img { width: 100%; }
figure.photo.center { text-align: center; }
figure.photo.center img { margin: 0 auto; }

/* photos in a row share the width, but never grow past ~1.3x their real size */
.gallery {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 8px 0 22px;
}
.gallery figure.photo { margin: 0; flex: 1 1 200px; max-width: min(100%, calc(var(--w, 250px) * 1.3)); }
.gallery figure.photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
a.lightbox img { transition: opacity .15s; }
a.lightbox:hover img { opacity: .88; }

figure.missing {
  border: 1px dashed var(--line); border-radius: 6px; padding: 14px;
  color: var(--muted); font: 13px var(--sans);
}

table.data { border-collapse: collapse; margin: 8px 0 18px; font: 14px var(--sans); }
table.data td, table.data th { border: 1px solid var(--line); padding: 5px 8px; vertical-align: top; }

/* ---------- post footer ---------- */
.route-links { clear: both; margin: 26px 0 0; font-size: 14.5px; color: var(--muted); }
.post-nav {
  clear: both;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 15px;
}
.post-nav a { display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; }
.post-nav a:hover { background: var(--paper); text-decoration: none; }
.post-nav .prev { grid-column: 1; grid-row: 1; }
.post-nav .next { grid-column: 2; grid-row: 1; text-align: right; }
.post-nav .all { grid-column: 1 / -1; grid-row: 2; text-align: center; border: 0; padding: 4px; }

/* ---------- comments ---------- */
.comments { margin-top: 28px; padding: 0 4px; }
.comments h2 { font: 700 1.35rem var(--serif); margin: 0 0 2px; }
.comments-closed { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.comment {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--olive);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "from date" "text text";
  gap: 2px 12px;
}
.comment-from { grid-area: from; font-size: 0; }           /* hide "Comment from" label… */
.comment-from strong { font-size: 15px; }                   /* …keep the name */
.comment-date { grid-area: date; font-size: 13px; color: var(--muted); align-self: center; }
.comment-text { grid-area: text; font-size: 15.5px; line-height: 1.6; margin-top: 4px; overflow-wrap: anywhere; }

.credit { text-align: center; font-size: 13px; color: var(--muted); margin-top: 36px; }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 15, 10, .94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px;
}
.lb[hidden] { display: none; }
.lb img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; border-radius: 4px; }
.lb .lb-cap { color: #eee; margin-top: 12px; text-align: center; font-size: 15px; max-width: 900px; }
.lb .lb-count { color: #999; font-size: 12px; margin-top: 2px; }
.lb button {
  position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 0;
  font-size: 28px; width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
}
.lb button:hover { background: rgba(255,255,255,.22); }
.lb .lb-close { top: 12px; right: 12px; }
.lb .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb .lb-full { position: absolute; top: 22px; left: 18px; color: #bbb; font-size: 13px; }

/* ---------- tablets and phones ---------- */
@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; padding: 8px 14px; }
  .brand img { width: 42px; height: 42px; }
  .brand-tag { display: none; }
  .nav-toggle > summary {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 40px; padding: 9px; border-radius: 8px; cursor: pointer; list-style: none;
  }
  .nav-toggle > summary::-webkit-details-marker { display: none; }
  .nav-toggle > summary span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
  .nav-toggle[open] > summary { background: var(--olive-soft); }
  .topbar-inner { flex-wrap: nowrap; }
  .nav-toggle[open] .mainnav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--card); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(40, 40, 20, .1);
    max-height: calc(100vh - 60px); overflow-y: auto;
    padding: 0 14px;
  }
  .mainnav > ul { flex-direction: column; align-items: stretch; padding: 6px 0 10px; }
  .mainnav > ul > li > a, .mainnav .dropdown > summary { padding: 10px 8px; font-size: 16px; }
  .panel { position: static; box-shadow: none; border: 0; padding: 4px 8px 10px 16px; }
  .panel-route ul { width: auto; columns: 2; }
  .panel-more { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  #rap { padding: 14px 10px 30px; }
  .storycontent.post, #content > .storycontent { padding: 18px 16px 16px; border-radius: 8px; }
  .storytitle { font-size: 1.7rem; }
  .body { font-size: 1.07rem; }
  .gallery { gap: 8px; }
  .gallery figure.photo { flex-basis: 140px; }
  .gallery.album { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .prev { grid-row: 1; }
  .post-nav .next { grid-column: 1; grid-row: 2; }
  .post-nav .all { grid-row: 3; }
  .comment { grid-template-columns: 1fr; grid-template-areas: "from" "date" "text"; }
  .comment-date { align-self: start; }
}
@media (max-width: 420px) {
  figure.photo.left, figure.photo.right { float: none; max-width: 100%; margin: 6px 0 16px; }
}

/* ---------- shared bits for list pages ---------- */
.muted { color: var(--muted); font-size: 14px; }
.notice { background: var(--olive-soft); border-radius: 8px; padding: 10px 14px; font-size: 14.5px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 4px; }
#content > .storycontent + .storycontent { margin-top: 20px; }
.page .body h2, .page h2 { font: 700 1.35rem/1.3 var(--serif); margin: 1.4em 0 .5em; }

/* ---------- home ---------- */
.intro { padding: 8px 4px 26px; }
.intro-kicker { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--olive); font-weight: 600; margin: 0 0 6px; }
.intro-title { font: 700 2.4rem/1.15 var(--serif); letter-spacing: -0.5px; margin: 0 0 12px; max-width: 820px; }
.intro-text { font: 1.15rem/1.65 var(--serif); color: #333; max-width: 760px; margin: 0 0 18px; }
.intro-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.button, .button:visited {
  display: inline-block; padding: 9px 16px; border-radius: 8px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 15px;
}
.button.secondary, .button.secondary:visited { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.button:hover { text-decoration: none; opacity: .9; }

/* ---------- diary list ---------- */
.leg h2 { font: 700 1.25rem var(--serif); margin: 26px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 6px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; }
.post-list li a { font-size: 16.5px; }

/* ---------- route ---------- */
.route-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; counter-reset: r; }
.route-list li a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink); height: 100%;
}
.route-list li a:hover { background: var(--paper); text-decoration: none; }
.route-list li a::before { counter-increment: r; content: counter(r); color: var(--muted); font-size: 12px; width: 18px; }
.route-list img { width: 36px; height: auto; border: 1px solid var(--line); }
.route-name { font-weight: 600; flex: 1; }
.route-count { font-size: 12.5px; color: var(--muted); }
.title-flag { height: .8em; width: auto; margin-right: 12px; border: 1px solid var(--line); vertical-align: baseline; }
.route-posts { background: var(--paper); border-radius: 8px; padding: 12px 18px; margin: 0 0 18px; }
.route-posts h2 { font: 700 1.1rem var(--serif) !important; margin: 0 0 6px !important; }
.route-posts ul { margin: 0; padding-left: 18px; }
.route-posts li { margin: 3px 0; }
.route-photos { font-size: 15px; }

/* ---------- photo albums ---------- */
.album-group h2 { font: 700 1.4rem var(--serif); margin: 28px 0 10px; }
.album-group h3 { font: 600 1rem var(--sans); color: var(--muted); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .05em; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 14px; }
.album-card { display: flex; flex-direction: column; color: var(--ink); }
.album-card:visited { color: var(--ink); }
.album-card:hover { text-decoration: none; }
.album-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; background: var(--olive-soft); }
.album-card:hover img { opacity: .88; }
.album-empty { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 2; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-size: 13px; }
.album-title { font-weight: 600; margin-top: 6px; }
.album-count { font-size: 13px; color: var(--muted); }
.gallery.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); }
.gallery.album figure.photo { max-width: none; }
.gallery.album figure.missing { display: flex; flex-direction: column; justify-content: center; aspect-ratio: 3 / 2; }
.video-link { display: inline-block; margin-top: 3px; font-weight: 600; }
.video-gone { color: #999; font-style: italic; }

@media (max-width: 640px) {
  .intro-title { font-size: 1.75rem; }
  .intro-text { font-size: 1.05rem; }
  .post-list li { display: block; }
  .post-list li .muted { display: block; }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--olive); margin-right: 8px; min-width: 92px; }
@media (max-width: 640px) { .tag { display: block; min-width: 0; margin: 0; } }
