/* ─── Tesla Tripping — minimal mobile-first stylesheet ─────────────────── */

:root {
  --col-max: 1080px;       /* page content column */
  --read-max: 720px;       /* narrower max for long-form reading + hero photo */
  --gap: 1.25rem;
  --radius: 10px;
  --fg: #1c1c1e;
  --fg-muted: #6b6b73;
  --bg: #ececef;          /* light grey page */
  --bg-card: #ffffff;     /* white card */
  --bg-soft: #f6f6f8;     /* slightly off page bg, for subtle blocks */
  --border: #d8d8dd;
  --link: #0b5cad;
  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #f2f2f7;
    --fg-muted: #a1a1aa;
    --bg: #121214;          /* dark page */
    --bg-card: #1f1f22;     /* card stands out */
    --bg-soft: #18181b;
    --border: #2c2c2e;
    --link: #76b3ff;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout chrome ──────────────────────────────────────────────────── */

/* Header — caricature on the left, content (name/bio/search/filters) on the right.
   Mobile: stacks (caricature on top centered). Wide: side-by-side, caricature
   stretches to fill the header's height. */
.site-header {
  background: linear-gradient(180deg, #fff 0%, var(--bg-card) 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
}
@media (prefers-color-scheme: dark) {
  .site-header {
    background: linear-gradient(180deg, #25252a 0%, var(--bg-card) 100%);
  }
}
@media (min-width: 640px) {
  .site-header {
    /* Caricature column width matches the card image cell, and the header's
       horizontal padding equals the (container 1rem + card 0.85rem) inset
       used by the rows below — so the header's right column lines up
       horizontally with the text column of every card. */
    grid-template-columns: 260px 1fr;
    gap: 0.85rem;
    max-width: var(--col-max);
    margin: 0 auto;
    padding: 1.5rem calc(1rem + 0.85rem);
  }
}
@media (min-width: 900px) {
  .site-header {
    grid-template-columns: 300px 1fr;
  }
}

.site-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}
.site-brand:hover { text-decoration: none; }

/* Brand area is just the link wrapper around the caricature image. The
   image itself fills the brand column width and grows vertically at
   natural aspect — no panel/border framing needed. */

.site-caricature {
  /* Mobile: portrait pill, centered above content */
  width: 96px;
  height: 120px;
  object-fit: cover;
  object-position: center 18%;          /* keep face in frame */
  border-radius: 14px;
  border: 2px solid var(--bg-card);
  box-shadow: var(--shadow);
  display: block;
}
@media (min-width: 640px) {
  .site-caricature {
    /* Wide: fill the full brand column width (260/300 px) and grow vertically
       at the image's natural 3508:4961 portrait aspect. The header row's
       height is now driven by the caricature; content (name/bio/search/
       filters) sits centred vertically next to it. */
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 3508 / 4961;
    object-fit: cover;
    border-radius: 16px;
  }
}

.site-header-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;            /* mobile: centered */
  text-align: center;
}
@media (min-width: 640px) {
  .site-header-content {
    align-items: flex-start;       /* wide: left-aligned to caricature */
    text-align: left;
    justify-content: center;        /* vertically centre name/bio/search/filters in column */
  }
}

.site-name {
  font-weight: 700;
  font-size: 1.55rem;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.01em;
  line-height: 1;
}
.site-name:hover { color: var(--link); text-decoration: none; }
@media (min-width: 640px) {
  .site-name { font-size: 2rem; }
}

/* Site subtitle — sits directly under the name, lighter weight, slightly
   muted. Used for the "Formerly: Tesla Tripping" tagline; rendered only
   when Setting.siteSubtitle is set. */
.site-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--fg-muted);
  font-style: italic;
}
@media (min-width: 640px) {
  .site-subtitle { font-size: 1rem; }
}

/* Compact variant for post / search / 404 — smaller caricature, tighter
   padding, no bio/filters. Doesn't align with card rows because these pages
   don't have a card list to align with. */
.site-header-compact {
  padding: 1rem;
}
.site-header-compact .site-caricature {
  width: 72px;
  height: 90px;
}
@media (min-width: 640px) {
  .site-header-compact {
    grid-template-columns: auto 1fr;          /* override main 260px column */
    gap: 1rem;
    padding: 1rem 1.5rem;
  }
  .site-header-compact .site-caricature {
    width: auto;
    height: 100%;
    aspect-ratio: 3508 / 4961;
    min-height: 80px;
    max-height: 110px;
  }
  .site-header-compact .site-name { font-size: 1.5rem; }
}

.site-bio {
  width: 100%;
  color: var(--fg-muted);
  font-size: 0.95rem;
}
.site-bio summary {
  cursor: pointer;
  list-style: none;
  text-align: center;
  line-height: 1.45;
}
@media (min-width: 640px) {
  .site-bio summary { text-align: left; }
}
.site-bio summary::-webkit-details-marker { display: none; }
.site-bio summary::after {
  content: " more ▾";
  font-size: 0.85em;
  color: var(--link);
}
.site-bio[open] summary::after { content: " less ▴"; }
.site-bio-long { margin-top: 0.85rem; line-height: 1.55; }
.site-bio-long p { margin: 0 0 0.7em; }

/* Header search box */
.site-search {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 480px;
}
.site-search input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--bg-soft);
  color: var(--fg);
  font: inherit;
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
}
.site-search input[type="search"]:focus {
  outline: 2px solid var(--link);
  outline-offset: -1px;
  background: var(--bg-card);
}
.site-search button {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--link);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--link);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.site-search button:hover { filter: brightness(0.95); }

/* Exit-search button — only shown on the search results page, gives a
   clear "back to browsing" affordance with a generous tap target. */
.search-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  margin-left: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--fg-muted);
  font-size: 1.6rem;
  line-height: 1;
  text-decoration: none;
}
.search-exit:hover {
  background: var(--border);
  color: var(--fg);
  text-decoration: none;
}

.search-summary {
  margin: 0 0 1rem;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.site-maps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  margin-top: 0.5rem;
}
.site-maps-label {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-right: 0.15rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;        /* keep individual chips at their natural height
                                 even when a tag-group sits taller in the row */
  gap: 0.5rem;
  width: 100%;
}
@media (min-width: 640px) {
  .filters { justify-content: flex-start; }
}
.chip {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;
}
.chip:hover { background: var(--border); text-decoration: none; }
.chip-active {
  background: var(--link);
  color: #fff;
  border-color: var(--link);
}
.chip-active:hover { background: var(--link); color: #fff; }

/* Topic-tag chips — slightly warmer/secondary tone to differentiate from
   the year chips that they sit beneath. */
.filters-tags { margin-top: 0.4rem; }
.chip-tag {
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
}
.chip-tag.chip-active {
  background: #b56a3a;
  border-color: #b56a3a;
}
@media (prefers-color-scheme: dark) {
  .chip-tag.chip-active {
    background: #d68a55;
    border-color: #d68a55;
  }
}

/* Parent chips show a subtle chevron hint that they expand to children */
.chip-parent::after {
  content: " ▾";
  opacity: 0.55;
  font-size: 0.85em;
}
.chip-parent.chip-active::after { content: " ▴"; }

/* Tag group — wraps a parent chip together with its expanded children inside
   a tinted rounded panel so the relationship is unambiguous. */
.tag-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border-radius: 999px;
  background: rgba(181, 106, 58, 0.08);
  border: 1px solid rgba(181, 106, 58, 0.30);
}
@media (prefers-color-scheme: dark) {
  .tag-group {
    background: rgba(214, 138, 85, 0.12);
    border-color: rgba(214, 138, 85, 0.35);
  }
}

/* Children render inline next to their parent inside the tag-group.
   Smaller and lighter so they read as subordinate. */
.chip-child {
  font-size: 0.78rem;
  padding: 0.22rem 0.55rem;
  background: var(--bg-card);
  border-color: var(--border);
}

/* Counts inside chips — small, dim, but readable on hover/active */
.chip-count {
  font-size: 0.85em;
  font-weight: 400;
  opacity: 0.6;
  margin-left: 0.15em;
}
.chip-active .chip-count { opacity: 0.85; }

/* ─── Date-range slider ───────────────────────────────────────────────────
   Two overlaid range inputs over a histogram backdrop. The inputs are
   transparent except for their thumbs (pointer-events trick). Track + fill
   are sibling divs that the JS positions. */
.date-slider {
  width: 100%;
  max-width: 520px;
  margin-top: 0.5rem;
}
@media (min-width: 640px) {
  .date-slider { margin-left: 0; margin-right: auto; }
}
.date-slider-readout {
  display: flex;
  align-items: baseline;
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 0.25rem;
  /* From-label sits at the start (over the left handle); to-label is
     pushed to the end (over the right handle); Clear sits to the right
     of the to-label when active. */
}
.date-slider-from-label,
.date-slider-to-label {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.date-slider-to-label { margin-left: auto; }
.date-slider-active .date-slider-from-label,
.date-slider-active .date-slider-to-label { color: var(--link); }
.date-slider-clear {
  margin-left: 0.6rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}
.date-slider-clear:hover { color: var(--link); }

/* Track is the positioning context for histogram, rail, fill, and inputs. */
.date-slider-track {
  position: relative;
  height: 52px;
  padding: 0;
}

/* Histogram bars sit at the bottom of the track, behind the rail+thumbs.
   Each bar's height is set inline (% of available bar area). */
.date-slider-histogram {
  position: absolute;
  left: 0; right: 0;
  bottom: 18px;
  height: 32px;
  display: flex;
  align-items: flex-end;
  gap: 1px;
}
.date-slider-bar {
  flex: 1 1 0;
  min-width: 1px;
  background: var(--border);
  border-radius: 1px 1px 0 0;
}
/* When a date filter is active, dim out-of-range bars; JS doesn't currently
   recompute these on drag — they reflect the server-rendered active range. */

/* Rail: thin horizontal line for the slider track. */
.date-slider-rail {
  position: absolute;
  left: 0; right: 0;
  bottom: 14px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}
/* Fill: between the two thumbs, in link colour. */
.date-slider-fill {
  position: absolute;
  left: 0; right: 0;
  bottom: 14px;
  height: 4px;
  background: var(--link);
  border-radius: 2px;
}

/* The two inputs share the same horizontal area. They are transparent
   (no native track/thumb visuals). Their thumbs are the only interactive
   surface, exposed via pointer-events on the thumb pseudo-element. */
.date-slider-input {
  position: absolute;
  left: 0; right: 0;
  bottom: 6px;
  width: 100%;
  height: 20px;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.date-slider-input:focus { outline: none; }

/* WebKit — track invisible, thumb circular and interactive. */
.date-slider-input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border: none;
}
.date-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--link);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  margin-top: -7px;
  cursor: grab;
}
.date-slider-input:active::-webkit-slider-thumb { cursor: grabbing; }
.date-slider-input:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.35);
}

/* Firefox */
.date-slider-input::-moz-range-track {
  height: 4px;
  background: transparent;
  border: none;
}
.date-slider-input::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--link);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: grab;
}
.date-slider-input:active::-moz-range-thumb { cursor: grabbing; }
.date-slider-input:focus::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(11, 92, 173, 0.35);
}

.date-slider-noscript p {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: 0.4rem 0 0;
}

.container {
  max-width: var(--col-max);
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.site-footer {
  text-align: center;
  color: var(--fg-muted);
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* ─── Card list (homepage) ───────────────────────────────────────────── */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.post-card {
  display: grid;
  grid-template-columns: 1fr;       /* mobile-first: stacked */
  gap: 0.85rem;
  padding: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.post-card:hover {
  text-decoration: none;
  box-shadow: var(--shadow);
}
.post-card:hover .card-title { color: var(--link); }

@media (min-width: 640px) {
  .post-card {
    grid-template-columns: 260px 1fr;
    align-items: stretch;
  }
  .post-card.no-media {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 900px) {
  .post-card {
    grid-template-columns: 300px 1fr;
  }
  .post-card.no-media {
    grid-template-columns: 1fr;
  }
}

/* media block */
.card-media {
  border-radius: 8px;
  overflow: hidden;
  background: var(--border);
  aspect-ratio: 4 / 3;
  display: grid;
  gap: 3px;
}
.card-media .media-cell {
  position: relative;
  overflow: hidden;
  background: var(--border);
}

/* Source tier badge (HQ / FB) — small overlay on each rendered image
   so Tom can see at a glance which tier the site is serving. */
.src-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  font: 600 10px/1 -apple-system, system-ui, sans-serif;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  pointer-events: none;
  z-index: 2;
}
.src-tag.src-hq { background: rgba(34, 136, 68, 0.78); }
.src-tag.src-fb { background: rgba(170, 100, 0, 0.78); }
.lightbox-stage .src-tag { top: 12px; right: 12px; font-size: 12px; padding: 3px 7px; }

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 1-photo: single fill */
.media-1 { grid-template-columns: 1fr; }

/* 2-photo: two columns */
.media-2 { grid-template-columns: 1fr 1fr; }

/* 3-photo: 1 large + 2 small */
.media-3 {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.media-3 .media-cell:first-child { grid-row: 1 / 3; }

/* "+N more" overlay */
.media-cell.has-overlay::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  pointer-events: none;
}
.more-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 1.5rem;
  z-index: 1;
}

/* text block — fills card height; excerpt grows to fill remaining space */
.card-text {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
}

.card-title {
  font-size: 1.15rem;
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
}
.card-excerpt {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  flex: 1 1 0;             /* grow to fill space the image leaves */
  min-height: 0;
  overflow: hidden;
  /* Soft fade at the bottom rather than a hard clip + ellipsis. Lets the
     text fill the whole available height; the bottom 1.5em fades out so it
     reads as "more content below" without ever hitting a line-count limit. */
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 1.5em), transparent 100%);
          mask-image: linear-gradient(to bottom, black calc(100% - 1.5em), transparent 100%);
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  align-items: baseline;
  color: var(--fg-muted);
  font-size: 0.85rem;
  flex: 0 0 auto;
}
.card-date { color: inherit; }
.card-place {
  position: relative;
  padding-left: 0.6em;
}
.card-place::before {
  content: "·";
  position: absolute;
  left: 0;
  opacity: 0.7;
}

.empty { color: var(--fg-muted); text-align: center; padding: 3rem 0; }

.not-found {
  text-align: center;
  padding: 3rem 1rem;
  max-width: var(--read-max);
  margin: 0 auto;
}
.not-found h1 { font-size: 1.5rem; margin: 0 0 1rem; }
.not-found p  { color: var(--fg-muted); }

/* Prev/next pagination ------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin: var(--gap) 0;
  flex-wrap: wrap;
}
.pagination-top { margin-bottom: var(--gap); }
.pagination-bottom { margin-top: 1.5rem; }

/* Each button anchors to its natural side regardless of whether the other is
   present: older on the left (back in time), newer on the right (forward). */
.pagination .page-older { margin-right: auto; }
.pagination .page-newer { margin-left: auto; }

.page-link {
  display: inline-block;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  line-height: 1;
}
.page-link:hover {
  background: var(--border);
  text-decoration: none;
}
.page-link-home {
  background: var(--bg-soft);
  color: var(--fg-muted);
  font-weight: 400;
}

/* ─── Single post ────────────────────────────────────────────────────── */

/* The article fills the same wide column as the home-page list.
   Hero photo and inline videos are capped narrower so they don't dominate. */
.post-header,
.post-body,
.post-meta-footer,
.post-gallery {
  max-width: var(--col-max);
  margin-left: auto;
  margin-right: auto;
}
.post-hero {
  max-width: var(--read-max);
  margin: 0 auto 1.5rem;
}
.post-videos {
  max-width: 480px;          /* videos sit smaller — they have intrinsic chrome */
  margin: 2rem auto 0;
}

.post-header { margin-bottom: 1.5rem; }
.post-title {
  font-size: 1.75rem;
  margin: 0 0 0.25rem;
  line-height: 1.2;
  font-weight: 700;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  align-items: baseline;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.post-date { color: inherit; }
.post-place {
  position: relative;
  padding-left: 0.6em;
}
.post-place::before {
  content: "·";
  position: absolute;
  left: 0;
  opacity: 0.7;
}

.post-hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

/* Hero block: hero photo + thumbnail strip on the right.
   Total width matches the post body (--col-max). Hero stays at --read-max max,
   thumbs fill the remaining space as a vertical column. Mobile: stacks. */
.post-hero-block {
  max-width: var(--col-max);
  margin: 0 auto 1.5rem;
  display: grid;
  grid-template-columns: 1fr;       /* mobile: stacked */
  gap: 8px;
}
@media (min-width: 720px) {
  .post-hero-block {
    grid-template-columns: minmax(0, var(--read-max)) 1fr;
  }
  .post-hero-block.no-thumbs {
    grid-template-columns: minmax(0, var(--read-max));
    justify-content: center;
  }
}
.hero-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}
/* Mobile: thumbs in a horizontal row of squares below the hero. */
.hero-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
}
.hero-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--border);
  aspect-ratio: 1 / 1;          /* square on mobile */
}

/* Desktop: thumbs in a vertical column, each row sized to N-up of the hero
   height so the right column fills exactly the hero's height with no gap. */
@media (min-width: 720px) {
  .hero-thumbs {
    grid-template-columns: 1fr;
    grid-auto-rows: 1fr;
    align-self: stretch;          /* fill the row height set by hero */
    height: 100%;                 /* belt + braces for the stretch */
  }
  .hero-thumb {
    aspect-ratio: auto;           /* let the row height dictate shape */
    min-height: 0;
  }
}
.hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-thumb.has-overlay::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  pointer-events: none;
}

/* Video play-icon overlay (used on cards + hero thumbs) */
.play-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.95);
  font-size: 2.2rem;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* Make hero photo and thumbs visibly clickable */
.hero-photo, .hero-thumb { cursor: zoom-in; }
.hero-photo:hover img, .hero-thumb:hover img { opacity: 0.92; }

/* ─── Lightbox (CSS-only, :target-driven) ─────────────────────────────── */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}
/* :target = no-JS fallback (works but adds history entries per nav).
   .is-open = JS path, controlled without touching the URL hash. */
.lightbox:target,
.lightbox.is-open { display: flex; }

/* Prevent the page underneath from scrolling while the lightbox is open. */
body.lightbox-open { overflow: hidden; }

/* Click anywhere outside the image (the bg) to close */
.lightbox-bg {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}

.lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-stage img,
.lightbox-stage video {
  max-width: 95vw;
  max-height: 95vh;
  display: block;
  object-fit: contain;
  border-radius: 4px;
}

/* Controls (close, prev, next, counter). All sit above the bg. */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.45);
  transition: background .15s ease;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(0, 0, 0, 0.75);
  text-decoration: none;
}
.lightbox-close { top: 1rem; right: 1rem; font-size: 1.6rem; }
.lightbox-prev  { top: 50%; left: 1rem; transform: translateY(-50%); }
.lightbox-next  { top: 50%; right: 1rem; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute;
  z-index: 2;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.post-body p {
  margin: 0 0 1.05em;
  font-size: 1.05rem;
  line-height: 1.65;
}
.post-body a { word-break: break-word; }

.post-gallery {
  margin: 2rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

.post-videos video {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  margin-bottom: 1rem;
}

/* Curated links section ------------------------------------------------ */

.post-links {
  max-width: var(--col-max);
  margin: 2rem auto 0;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.post-links h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.post-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.post-links li {
  line-height: 1.5;
}
.link-caption {
  display: block;
  color: var(--fg-muted);
  font-size: 0.92rem;
  margin-bottom: 0.1rem;
}

.post-meta-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.92rem;
}
.post-meta-footer p { margin: 0 0 0.4em; }

/* Facebook link with inline logo */
.fb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--link);
}
.fb-link:hover { text-decoration: underline; }
.fb-icon {
  width: 1.05em;
  height: 1.05em;
  fill: #1877F2;                /* Facebook brand blue */
  flex: 0 0 auto;
}

/* Trip detail page (/trip/{slug}) */
.page-main { max-width: var(--col-max); margin: 0 auto; padding: 0 1rem; }
.trip-header { margin: 1.25rem 0 1.5rem; }
.trip-header h1 { margin: 0 0 0.3rem; font-size: 1.7rem; }
.trip-header .trip-meta { margin: 0 0 0.6rem; color: var(--fg-muted); font-size: 0.95rem; }
.trip-header .trip-description { margin: 0; line-height: 1.45; }
.empty { text-align: center; color: var(--fg-muted); padding: 2rem 0; }

/* Inline trip badge(s) on post detail pages */
.post-trips {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0.75rem;
}
.post-trips .trip-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.82rem; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--fg-muted);
  text-decoration: none; background: transparent;
}
.post-trips .trip-badge:hover { background: var(--border); color: var(--fg); }
.post-trips .trip-badge::before { content: "🗺"; font-size: 0.9em; }
.site-nav-inline {
  font-size: 0.92rem; color: var(--fg-muted); margin-top: 0.25rem;
}
.site-nav-inline a { color: var(--fg-muted); text-decoration: none; }
.site-nav-inline a:hover { text-decoration: underline; }
