/* ─── 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;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.site-footer .footer-links {
  font-size: 0.85rem;
}
.site-footer .footer-links a {
  color: var(--fg-muted);
  text-decoration: none;
}
.site-footer .footer-links a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* ─── 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); }

/* Static legal pages (Privacy, Terms) --------------------------------- */
.static-page {
  max-width: var(--read-max);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  line-height: 1.6;
}
.static-page h1 {
  font-size: 1.8rem;
  margin: 0 0 0.25rem;
}
.static-page .page-updated {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin: 0 0 1.75rem;
}
.static-page h2 {
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}
.static-page h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.4rem;
  color: var(--fg-muted);
}
.static-page p { margin: 0 0 0.85rem; }
.static-page ul { margin: 0 0 0.85rem 0; padding-left: 1.4rem; }
.static-page li { margin-bottom: 0.4rem; }
.static-page .page-footer-nav {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.92rem;
}
.static-page .page-footer-nav a { color: var(--fg-muted); }
.static-page .page-footer-nav a:hover { color: var(--link); }

/* 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);
}

/* Solo-video hero block. (Photo posts use .post-gallery — see below.)
   Sits at --read-max so the player isn't oversized; centred in the
   wider --col-max container. */
.post-hero-block {
  max-width: var(--read-max);
  margin: 0 auto 1.5rem;
}
.hero-video,
.hero-video-poster {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  background: #000;
}

/* Photo gallery: feature hero + justified rows. See gallery_layout() in
   lib.php for the data model. Layout is driven by flex + aspect-ratio +
   CSS custom properties so it scales with container width naturally:
     • .gallery-hero gets flex-grow = heroW (px at reference width) and
       aspect-ratio = the photo's own w/h
     • .gallery-right gets flex-grow = rightW; its children divide the
       column height equally (flex: 1 1 0)
     • Standalone rows below the feature use aspect-ratio = aspectSum
       to set their height proportionally to the container width
     • Items inside a row use flex-grow = aspect — they all settle at
       the same height by virtue of the math, no explicit row-height
       needed; object-fit: cover hides any sub-pixel mismatch from
       gap rounding.

   The .post-gallery wrapper is itself a flex column. That lets us pin
   the "Show N more photos" button at a fixed visual position via flex
   `order` regardless of which rows are visible — when the toggle
   expands and previously-hidden rows appear, they slot in around the
   button rather than pushing it down. Desktop order: feature → desktop-
   visible standalones → button → always-hidden. Mobile order anchors
   the button at slot 3 between the first row and everything else. */
.post-gallery {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gallery-feature           { order: 1; }
.post-gallery > .gallery-row--standalone:not(.gallery-desktop-visible):not(.gallery-always-hidden) { order: 1; }
.gallery-desktop-visible   { order: 2; }
.gallery-more              { order: 3; }
.gallery-always-hidden     { order: 4; }

/* Always-hidden rows: hidden until the <details> toggle opens. Use the
   general sibling combinator since the rows sit AFTER the toggle in
   DOM. Specificity bumped via .gallery-row so the rule beats the base
   .gallery-row { display: flex } declaration further down. */
.gallery-row.gallery-always-hidden { display: none; }
.gallery-more[open] ~ .gallery-row.gallery-always-hidden { display: flex; }

.gallery-feature {
  display: flex;
  gap: 6px;
}
.gallery-hero {
  flex: var(--hero-flex) 1 0;
  min-width: 0;
  aspect-ratio: var(--aspect);
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--border);
  cursor: zoom-in;
}
.gallery-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-right {
  flex: var(--right-flex) 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gallery-right .gallery-row {
  flex: 1 1 0;
  min-height: 0;
}

.gallery-row {
  display: flex;
  gap: 6px;
  min-width: 0;
}
.gallery-row.gallery-row--standalone {
  aspect-ratio: var(--row-aspect);
}
/* Partial row (final row that didn't fill the container): hold items at
   the target row height, packed left, instead of stretching them to
   full width which can balloon a single tall photo. */
.gallery-row.gallery-row--partial {
  aspect-ratio: auto;
  height: 220px;
  justify-content: flex-start;
}
.gallery-row--partial .gallery-item {
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  aspect-ratio: var(--aspect);
}

.gallery-item {
  flex: var(--aspect) 1 0;
  min-width: 0;
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--border);
  cursor: zoom-in;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-hero:hover img,
.gallery-item:hover img { opacity: 0.92; }

/* Solo-photo post: hero sits inside .post-hero-block (capped at
   --read-max) with its natural aspect — no aspect-ratio variable
   needed, the image's intrinsic dimensions drive the box. */
.gallery-hero--solo {
  flex: none;
  aspect-ratio: auto;
}
.gallery-hero--solo img {
  width: 100%;
  height: auto;
}

/* "Show N more photos" expand/collapse for galleries with more than
   3 row-equivalents. Native <details>/<summary> — no JS. The summary
   acts as the button; the hidden rows are siblings (not inside <details>)
   and are revealed via the general-sibling combinator on [open], so the
   button itself stays anchored in place (via flex `order`) and revealed
   rows fill in around it instead of pushing it. Label swaps via two
   <span>s + sibling selectors. */
.gallery-more-button {
  display: block;
  cursor: pointer;
  text-align: center;
  padding: 0.75rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
  color: var(--fg);
  user-select: none;
  list-style: none;            /* hide the default disclosure triangle */
}
.gallery-more-button::-webkit-details-marker { display: none; }
.gallery-more-button:hover { background: var(--border); }
.gallery-more-button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
/* Label-swap: "Show N more photos" when closed, "Hide additional photos"
   when open. Counts differ between desktop and mobile (mobile additionally
   hides the 2nd right-row of the feature block + the desktop-visible
   standalone row), so two closed-state labels are emitted and CSS picks
   one per breakpoint. */
.gallery-more-label--open    { display: none; }
.gallery-more-label--mobile  { display: none; }   /* desktop default: hide mobile label */
.gallery-more[open] .gallery-more-label--closed { display: none; }
.gallery-more[open] .gallery-more-label--open   { display: inline; }

/* If <details> only exists for mobile-collapse purposes (no
   desktop-hidden content), hide the entire button on desktop. Mobile
   media query below brings it back. */
.gallery-more--mobile-only { display: none; }

/* Mobile: flatten the feature block (display: contents on the wrappers
   makes the hero + right-rows into direct flex children of .post-gallery)
   so flex `order` can sequence them in mobile-specific positions. The
   button anchors at order 3, between row 1 (visible-when-closed) and
   row 2 (visible only when expanded). Partial rows stretch at narrow
   widths — single tall photos look OK on a phone. */
@media (max-width: 720px) {
  .gallery-feature,
  .gallery-right { display: contents; }

  .gallery-hero,
  .gallery-right > .gallery-row {
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
  }
  .gallery-right > .gallery-row {
    aspect-ratio: var(--row-aspect);
  }
  .gallery-row--partial {
    height: auto;
    aspect-ratio: var(--row-aspect);
  }
  .gallery-row--partial .gallery-item {
    flex: var(--aspect) 1 0;
    height: auto;
    width: auto;
    aspect-ratio: auto;
  }

  /* Mobile slot order: hero / row1 / button / row2 / desktop-only / hidden. */
  .gallery-hero                              { order: 1; }
  .gallery-right > .gallery-row:first-child  { order: 2; }
  .gallery-more                              { order: 3; }
  .gallery-right > .gallery-row:nth-child(2) { order: 4; }
  .gallery-desktop-visible                   { order: 5; }
  .gallery-always-hidden                     { order: 6; }

  /* Mobile preview: hide the 2nd right-row and the desktop-visible
     standalone(s); revealed when the toggle opens. */
  .gallery-right > .gallery-row:nth-child(2) { display: none; }
  .gallery-desktop-visible                   { display: none; }
  .post-gallery:has(.gallery-more[open]) .gallery-right > .gallery-row:nth-child(2) {
    display: flex;
  }
  .gallery-more[open] ~ .gallery-desktop-visible {
    display: flex;
  }

  /* Label-swap for mobile: hide desktop label, show mobile label. */
  .gallery-more-label--desktop { display: none; }
  .gallery-more-label--mobile.gallery-more-label--closed { display: inline; }

  /* Mobile-only <details> (no desktop-hidden content): show the button. */
  .gallery-more--mobile-only { display: block; }
}

/* 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;
}

/* ─── 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 ol,
.post-body ul {
  margin: 0 0 1.05em;
  padding-left: 1.6em;
  font-size: 1.05rem;
  line-height: 1.65;
}
.post-body li { margin-bottom: 0.4em; }
.post-body li > ol,
.post-body li > ul { margin: 0.4em 0 0; }
.post-body a { word-break: break-word; }

.post-videos video {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  margin-bottom: 1rem;
  background: #000;
  /* If poster aspect ≠ .mp4 aspect, letterbox the smaller side rather
     than crop. The element box is sized via inline aspect-ratio when
     known (set in post.php from the poster's dimensions). */
  object-fit: contain;
}
.hero-video {
  object-fit: contain;
}

/* Post body sub-sections (charging, etc.) ------------------------------ */

.post-section {
  max-width: var(--col-max);
  margin: 2rem auto 0;
}
.post-section h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-muted);
}
.post-section p {
  margin: 0 0 1.05em;
  font-size: 1.05rem;
  line-height: 1.65;
}

/* Coming-up sub-section: same card treatment as Links, slightly lighter */
.post-section-coming-up {
  padding: 1.25rem 1.25rem 0.75rem;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.post-section-coming-up h2 {
  margin-bottom: 0.6rem;
}
.post-section-coming-up p {
  font-size: 0.98rem;
  color: var(--fg-muted);
}

/* 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);
}
.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;
}
.post-links li.external a {
  color: var(--fg-muted);
}
.post-links .external-icon {
  display: inline-block;
  font-size: 0.85em;
  opacity: 0.7;
}
.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; }

/* Comments section ------------------------------------------------------ */

.comments {
  max-width: var(--col-max);
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.comments h2 {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
}
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.comment {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.comment-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.comment-avatar-fallback {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg-muted);
}
.comment-main {
  flex: 1 1 auto;
  min-width: 0;
}
.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.6rem;
  margin-bottom: 0.25rem;
  font-size: 0.92rem;
}
.comment-author {
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
}
.comment-author:hover { text-decoration: underline; }
.comment-source {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(24, 119, 242, 0.10);   /* FB brand blue, very soft */
  color: #1877F2;
  border: 1px solid rgba(24, 119, 242, 0.25);
  text-decoration: none;
}
.comment-source-link:hover {
  background: rgba(24, 119, 242, 0.18);
  text-decoration: none;
}
@media (prefers-color-scheme: dark) {
  .comment-source {
    background: rgba(24, 119, 242, 0.18);
    color: #76b3ff;
    border-color: rgba(118, 179, 255, 0.30);
  }
  .comment-source-link:hover {
    background: rgba(24, 119, 242, 0.28);
  }
}
.comment-when {
  color: var(--fg-muted);
  font-size: 0.85rem;
}
.comment-body {
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.comment-body a { color: var(--link); }
.comment-media {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.comment-media img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}
/* Site-author badge — used on comments authored by the Tesla Tripping
   Page itself (Tom replying on FB). Uses the site's link color so it
   reads as "this is the site owner". */
.comment-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  text-decoration: none;
}
.comment-badge-author {
  background: color-mix(in srgb, var(--link) 10%, transparent);
  color: var(--link);
  border-color: color-mix(in srgb, var(--link) 30%, transparent);
}
a.comment-badge-author:hover {
  background: color-mix(in srgb, var(--link) 22%, transparent);
  text-decoration: none;
}
/* Make Page-authored comments visually distinct: a soft accent stripe
   on the avatar side, and slightly heavier author name. Keeps the
   layout identical so the threading still aligns. */
.comment-by-site .comment-avatar {
  border-color: var(--link);
}
.comment-by-site .comment-author {
  color: var(--link);
}

/* Post-level engagement row — reactions + shares + comments-count pill,
   shown in post-meta-footer right above the "View on Facebook" link.
   Reuses .comment-reaction pill styling for visual consistency with
   per-comment reaction bars. */
.post-engagement {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0 0 0.65rem;
}
.post-engagement .comment-reactions {
  margin: 0;
}
.post-engagement a.comment-reaction {
  text-decoration: none;
  cursor: pointer;
}
.post-engagement a.comment-reaction:hover {
  background: var(--border);
}

/* Reactions bar — small inline pills for each non-zero reaction type. */
.comment-reactions {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.comment-reaction {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  line-height: 1;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--fg-muted);
}
.comment-reaction-icon {
  font-size: 0.95rem;
  line-height: 1;
}
.comment-reaction-count {
  font-variant-numeric: tabular-nums;
}

/* Replies: indented list, slightly smaller avatar. */
.comment-replies {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  gap: 1rem;
}
.comment-reply .comment-avatar {
  width: 32px;
  height: 32px;
}
.comment-reply .comment-avatar-fallback { font-size: 0.9rem; }

/* ─── Stage 3: site-native comments ──────────────────────────────────── */

/* Reply link beneath each comment. Quiet by default, accents on hover. */
.comment-actions {
  margin: .35rem 0 0;
  font-size: .85rem;
}
.comment-reply-link {
  color: var(--fg-muted);
  text-decoration: none;
}
.comment-reply-link:hover {
  color: var(--link);
  text-decoration: underline;
}

/* Flash message above the form after a redirect (?comment=pending etc.) */
.comment-flash {
  margin: 1rem 0;
  padding: .7rem 1rem;
  border-radius: 6px;
  background: #ecfdf5;
  border: 1px solid #34d399;
  color: #065f46;
}
@media (prefers-color-scheme: dark) {
  .comment-flash {
    background: #0c2a25;
    border-color: #14b8a6;
    color: #99f6e4;
  }
}

/* Comment-submit form. Centred, full-width inputs, matches existing typography. */
.comment-form {
  margin: 2rem 0;
  padding: 1.2rem 1rem;
  border-top: 1px solid var(--border);
}
.comment-form h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}
.comment-form label {
  display: block;
  margin: .8rem 0;
}
.comment-form label > span {
  display: block;
  margin-bottom: .25rem;
  font-size: .9rem;
  color: var(--fg-muted);
}
.comment-form label > span em {
  font-style: normal;
  font-size: .8em;
  color: var(--fg-muted);
  opacity: .8;
}
.comment-form input[type=text],
.comment-form input[type=email],
.comment-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--fg);
  font: inherit;
}
.comment-form textarea { resize: vertical; min-height: 5.5rem; }
.comment-form input::placeholder,
.comment-form textarea::placeholder { color: var(--fg-muted); opacity: .8; }
.comment-form input:focus,
.comment-form textarea:focus {
  outline: 2px solid var(--link);
  outline-offset: 1px;
}
.comment-form-body-label {
  display: block;
  margin: 0 0 .75rem;
}
.comment-form-note {
  font-size: .78rem;
  color: var(--fg-muted);
  margin: .75rem 0 0;
}
/* Reply-to banner. Only rendered when set; :empty fallback ensures the
   empty placeholder element never paints, regardless of how the [hidden]
   attribute is honoured by the browser/CSS reset. */
.comment-form-reply-to {
  margin: 0 0 .5rem;
  padding: .4rem .7rem;
  background: var(--bg-soft);
  border-left: 3px solid var(--link);
  font-size: .9rem;
  color: var(--fg);
}
.comment-form-reply-to:empty { display: none; }
.comment-form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Visually-hidden but accessible to screen-readers — used on the textarea's
   <span> label since the placeholder serves the visible cue. */
.comment-form .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Two-button chooser row. FB blue + neutral email button, equal-weight. */
.comment-form-choose {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin: 0;
}
.cf-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--fg);
}
.cf-btn:hover { border-color: var(--link); }
.cf-btn:disabled { opacity: .7; cursor: progress; }
.cf-btn-fb {
  background: #1877f2;
  color: #fff;
  border-color: #1877f2;
  font-weight: 600;
}
.cf-btn-fb:hover { background: #155bcc; border-color: #155bcc; }
.cf-btn-cancel {
  flex: 0 0 auto;
  background: transparent;
  color: var(--fg-muted);
  font-weight: 400;
}
.fb-login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #fff;
  color: #1877f2;
  border-radius: 50%;
  font-weight: 800;
  font-family: Georgia, serif;
  font-size: 1rem;
  line-height: 1;
  flex: 0 0 auto;
}
.cf-btn-icon {
  font-size: 1.05rem;
  color: var(--fg-muted);
  flex: 0 0 auto;
}
.cf-btn-fb .cf-btn-icon { color: rgba(255,255,255,.9); }

/* The expanded email-fields panel: tighter than the original full form. */
.comment-form-email-fields {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--border);
}
.comment-form-actions {
  display: flex;
  gap: .8rem;
  align-items: center;
  margin: .6rem 0 0;
}
.cf-btn-submit {
  flex: 0 0 auto;
  padding: .55rem 1.4rem;
  background: var(--link);
  color: #fff;
  border: 1px solid var(--link);
  border-radius: 6px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.cf-btn-submit:hover { filter: brightness(.92); }
.cf-btn-link {
  background: transparent;
  border: 0;
  color: var(--fg-muted);
  font: inherit;
  cursor: pointer;
  padding: .3rem .2rem;
}
.cf-btn-link:hover { color: var(--link); text-decoration: underline; }
