/* OpenBikeComputer blog — the "expedition log". Loaded *after* docs.css and leans on
   its tokens: this file only adds the timeline index, the single-column post layout
   with breakout media, and the enhanced figures (lightbox, compare slider, 3D model). */

/* ------------------------------------------------------------------ index: layout */
.log-wrap {
  position: relative; z-index: 1;
  max-width: 780px; margin: 0 auto; padding: 0 24px;
}
.log-head { padding: 54px 0 10px; }
.log-head .eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--coral); margin: 0 0 10px;
}
.log-head h1 {
  font-family: var(--serif); font-size: clamp(34px, 5vw, 46px); line-height: 1.08;
  letter-spacing: -0.01em; margin: 0 0 12px; color: var(--ink);
}
.log-lede { font-size: 18px; color: var(--ink-soft); line-height: 1.55; max-width: 34rem; margin: 0 0 16px; }
.feed-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.03em;
  color: var(--ink-soft); text-decoration: none;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 13px;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.feed-link svg { width: 13px; height: 13px; color: var(--amber); }
.feed-link:hover { color: var(--ink); border-color: var(--forest); background: rgba(95, 125, 61, 0.08); }

/* ---------------------------------------------------------------- index: timeline */
.timeline { padding: 26px 0 30px; }
.tl-group { margin: 0 0 8px; }
.tl-label {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); padding: 14px 0 10px 34px; position: relative;
}
.tl-label::before {
  content: ""; position: absolute; left: 7px; top: 18px;
  width: 12px; height: 2px; background: var(--line-strong);
}
.tl-entries {
  list-style: none; margin: 0; padding: 2px 0 16px 33px;
  border-left: 2px solid var(--line-strong); margin-left: 12px;
}
.tl-entry { position: relative; margin: 0 0 6px; }
.tl-entry::before {
  content: ""; position: absolute; left: -40px; top: 22px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--parchment); border: 2.5px solid var(--coral);
  transition: transform .14s ease, background .14s ease;
}
.tl-entry:hover::before { transform: scale(1.3); background: var(--coral); }
.tl-link {
  display: block; text-decoration: none; color: var(--ink);
  padding: 12px 16px 13px; margin-left: -6px; border-radius: 12px;
  transition: background .14s ease;
}
.tl-link:hover { background: rgba(95, 125, 61, 0.09); color: var(--ink); }
.tl-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.tl-link h2 {
  font-family: var(--serif); font-size: 22px; line-height: 1.2; letter-spacing: -0.005em;
  margin: 5px 0 4px; color: var(--forest-deep);
}
.tl-link:hover h2 { color: var(--forest); }
.tl-teaser { margin: 2px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.tl-empty { font-family: var(--serif); font-style: italic; color: var(--ink-faint); padding: 30px 0; }

/* ------------------------------------------------------------------- post: layout */
.post-wrap {
  position: relative; z-index: 1;
  max-width: 720px; margin: 0 auto; padding: 0 24px;
}
.post { max-width: none; padding-top: 44px; }
.post-head { margin-bottom: 26px; }
.post-head .back {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); text-decoration: none;
}
.post-head .back:hover { color: var(--forest); }
.post-head h1 { font-size: clamp(32px, 4.6vw, 44px); margin: 12px 0 8px; }
/* .post .post-meta: two classes, so the meta line outranks the `.post p` body rule. */
.post .post-meta { font-family: var(--mono); font-size: 13px; color: var(--ink-faint); margin: 0; }
.post-meta .dot-sep { color: var(--coral); padding: 0 2px; }
.post p { font-size: 17px; }
.post .post-head + p { font-size: 19px; color: var(--ink-soft); }

/* Standalone images (a paragraph that is just one image) become framed exhibits. */
.post p > img:only-child {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(36, 51, 28, 0.10);
  cursor: zoom-in;
}
.post .fig img { cursor: zoom-in; }

/* Breakout: on wide screens, media stretches past the text measure. */
@media (min-width: 1000px) {
  .post p > img:only-child, .post .fig {
    width: 860px; margin-left: calc((100% - 860px) / 2);
  }
}

/* --------------------------------------------------------------- post: older/newer */
.post-pn {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 40px 0 6px;
}
.post-pn .pn {
  display: block; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); text-decoration: none; color: var(--ink);
  font-family: var(--serif); font-size: 16px; line-height: 1.3;
  transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease;
}
.post-pn .pn:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 10px 24px rgba(36, 51, 28, 0.1); }
.post-pn .pn span {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 5px;
}
.post-pn .newer { text-align: right; grid-column: 2; }

/* --------------------------------------------------------------------- lightbox */
.lb {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(26, 34, 20, 0.93);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.lb.open { opacity: 1; pointer-events: auto; }
.lb img {
  max-width: 94vw; max-height: 90vh; border-radius: 8px;
  cursor: grab; user-select: none; -webkit-user-drag: none;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.lb img.panning { cursor: grabbing; }
.lb .lb-cap {
  position: absolute; left: 0; right: 0; bottom: 18px; text-align: center;
  font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--parchment-2);
  padding: 0 40px; pointer-events: none;
}
.lb .lb-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: 0; color: var(--parchment-2); cursor: pointer;
  font-family: var(--mono); font-size: 26px; line-height: 1; padding: 8px;
}
.lb .lb-close:hover { color: #fff; }
.lb .lb-hint {
  position: absolute; top: 22px; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: rgba(236, 232, 207, 0.55); pointer-events: none;
}

/* --------------------------------------------------------- compare (before/after) */
.cmp .cmp-stage {
  position: relative; overflow: hidden; border-radius: 10px;
  /* pan-y: a vertical swipe starting on the slider still scrolls the page — the
     browser cancels the pointer (blog.js handles pointercancel). */
  touch-action: pan-y; cursor: ew-resize; outline: none;
}
.cmp .cmp-stage img {
  display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none;
  cursor: ew-resize;
}
.cmp .cmp-stage img + img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  clip-path: inset(0 0 0 var(--cmp, 50%));
}
.cmp .cmp-handle {
  position: absolute; top: 0; bottom: 0; left: var(--cmp, 50%);
  width: 0; border-left: 2px solid var(--parchment);
  box-shadow: 0 0 0 1px rgba(36, 51, 28, 0.35); pointer-events: none;
}
.cmp .cmp-handle::after {
  content: "\2194";
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--parchment); color: var(--forest-deep);
  border: 1.5px solid var(--forest-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(36, 51, 28, 0.3);
}
.cmp .cmp-stage:focus-visible .cmp-handle { border-left-color: var(--amber); }
.cmp .cmp-tag {
  position: absolute; top: 10px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--parchment); background: rgba(36, 51, 28, 0.72);
  padding: 3px 9px; border-radius: 999px; pointer-events: none;
}
.cmp .cmp-tag.before { left: 10px; }
.cmp .cmp-tag.after { right: 10px; }

/* --------------------------------------------------------------- 3D model viewer */
.model .model-stage {
  position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 8%, rgba(95, 125, 61, 0.10), transparent 60%),
    linear-gradient(180deg, #f7f4e6 0%, #e9e3c8 100%);
  border: 1px solid var(--line);
  cursor: grab; touch-action: none; outline: none;
}
.model .model-stage:focus-visible { border-color: var(--forest); }
.model .model-stage.dragging { cursor: grabbing; }
.model .model-stage canvas { display: block; width: 100%; height: 100%; }
.model .model-stage .model-msg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; color: var(--ink-faint);
  padding: 20px; text-align: center;
}
.model .model-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 10px;
}
.model .model-hint { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); }
.model .model-dl {
  flex-shrink: 0;
  display: inline-block; text-decoration: none;
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.03em;
  color: var(--parchment); background: var(--forest);
  padding: 6px 13px; border-radius: 8px;
  transition: background .12s ease;
}
.model .model-dl::before { content: "\2193 "; }
.model .model-dl:hover { background: var(--forest-deep); color: var(--parchment); }

/* ------------------------------------------------------------------- responsive */
@media (max-width: 700px) {
  .log-wrap, .post-wrap { padding: 0 18px; }
  .log-head { padding-top: 36px; }
  .post { padding-top: 30px; }
  .tl-entries { padding-left: 24px; margin-left: 8px; }
  .tl-entry::before { left: -31px; }
  .tl-link { padding: 10px 10px 11px; margin-left: -4px; }
  .tl-link h2 { font-size: 19.5px; }
  .post-pn { grid-template-columns: 1fr; }
  .post-pn .newer { grid-column: auto; text-align: left; }
  .model .model-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
}
