/* Camino Progress — public, read-only page. Mobile-first. */
:root {
  --bg: #faf7f2;
  --panel: #ffffff;
  --text: #2a2622;
  --muted: #6f675e;
  --line: #e6dfd4;
  --accent: #c2410c;     /* walked tracks, progress fill */
  --accent-2: #0f766e;   /* alternate day color */
  --official: #6b6560;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
  --radius: 10px;
  --text-max: 720px;     /* comfortable reading width inside full-width boxes */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1916;
    --panel: #252220;
    --text: #ece7e0;
    --muted: #a59d93;
    --line: #3a3531;
    --accent: #fb923c;
    --accent-2: #2dd4bf;
    --official: #9b958f;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
/* Test copy: a ribbon and a tinted page so it can't be mistaken for the real blog. */
.test-ribbon {
  background: #b91c1c; color: #fff; font-weight: 700; text-align: center;
  font-size: .85rem; letter-spacing: .04em; padding: 6px 12px;
}
html.test-site body { background: color-mix(in srgb, #f59e0b 10%, var(--bg)); }

/* Elements with display rules (.btn is inline-flex) must still hide. */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px 4px;
}
.top h1 { margin: 0; font-size: 1.35rem; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.version { margin: 2px 0 0; color: var(--muted); font-size: .75rem; cursor: help; }
.actions { display: flex; gap: 8px; }

.btn {
  font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px;
  min-height: 36px; display: inline-flex; align-items: center;
}
.btn:hover { border-color: var(--accent); }
.btn.small { font-size: .8rem; padding: 4px 10px; min-height: 30px; }

.progress { padding: 8px 16px 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .92rem; margin-bottom: 8px; }
.stats b { font-size: 1.05rem; }
.stats span { color: var(--muted); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .6s; }

/* Big map: full width under the header */
.map-wrap { position: relative; padding: 0 16px; }
.map {
  height: 50vh; min-height: 300px; max-height: 620px; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 0;
}
.map-btn { position: absolute; top: 10px; right: 26px; z-index: 500; box-shadow: var(--shadow); }

/* Timeline: full-width boxes, newest first */
.timeline-wrap { padding: 16px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; scroll-margin-top: 12px;
}
.card.active { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.card .when {
  color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
  text-decoration: none; display: inline-block;
}
.card .when:hover { color: var(--accent); }
.card .when + a { font-size: .8rem; }
.card h3 { margin: 2px 0 6px; font-size: 1.12rem; }
.card .text { max-width: var(--text-max); }
.card .text p { margin: 0 0 12px; }
.card .text h4 { margin: 16px 0 6px; font-size: 1rem; }
.card .text ul, .card .text ol { margin: 0 0 12px; padding-left: 1.4em; }
.card .text li { margin-bottom: 4px; }
.card .text blockquote {
  margin: 0 0 12px; padding: 4px 0 4px 14px;
  border-left: 3px solid var(--accent-2); color: var(--muted); font-style: italic;
}
.card .text blockquote p { margin: 0 0 6px; }
.card .text blockquote p:last-child { margin-bottom: 0; }
.card .text figure { margin: 4px 0 16px; }
.card .text figure img {
  display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px;
  cursor: zoom-in; background: var(--line);
}
.card .text figcaption { color: var(--muted); font-size: .85rem; margin-top: 4px; }

/* Walk block inside a post: small map + route and stats, side by side on
   wide screens, stacked on phones. */
.card .badge {
  display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--accent-2); margin-right: 6px;
}
.card.has-walk .badge { color: var(--accent); }
.walk-block {
  display: grid; grid-template-columns: 1fr; gap: 10px; align-items: start;
  margin: 4px 0 16px; padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
}
@media (min-width: 640px) {
  .walk-block { grid-template-columns: 300px minmax(0, 1fr); }
}
.walk-block .mini {
  height: 190px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; z-index: 0;
  background: var(--line);
}
.walk-block .route { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.walk-block .nums { color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; }
.walk-block a { font-size: .88rem; }
.empty { color: var(--muted); }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px;
  color: var(--muted); font-size: .8rem; padding: 0 16px 16px;
}

.dlg {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text);
  max-width: min(560px, calc(100vw - 32px)); padding: 18px 20px;
}
.dlg::backdrop { background: rgba(0, 0, 0, .45); }
.dlg h2 { margin-top: 0; font-size: 1.15rem; }
.dlg li { margin-bottom: 6px; }
.muted { color: var(--muted); font-size: .9rem; }
.key { padding: 0 4px; border-radius: 4px; color: #fff; }
.key.official { background: var(--official); }
.key.walked { background: var(--accent); }
.photo-dlg { max-width: min(1000px, calc(100vw - 32px)); padding: 10px; text-align: center; }
.photo-dlg img { max-width: 100%; max-height: 75vh; border-radius: 8px; }

/* Leaflet "we are here" marker */
.here-icon { font-size: 26px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.leaflet-tooltip.stop-tip { font-size: 12px; }

/* Small map under a photo: where it was taken */
.card .text figure .photo-map {
  height: 130px; margin-top: 6px; border-radius: 6px; border: 1px solid var(--line);
  cursor: pointer; z-index: 0; background: var(--line);
}
.photo-pin { font-size: 18px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.card .text figure.flash img { outline: 3px solid var(--accent); outline-offset: 2px; transition: outline .2s; }

/* Preferences page */
.prefs { padding: 8px 16px 32px; max-width: 640px; display: flex; flex-direction: column; gap: 12px; }
.pref {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.pref input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.pref b { display: block; margin-bottom: 2px; }
.pref .muted { display: block; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
/* With the big map turned off, small maps aren't tappable. */
.no-bigmap .mini { cursor: default; }
