/* The logbook (log/, ru/log/, made by scripts/build_log.py), on top of style.css. The top bar and the type
   are the landing page's; the rest is kept quiet on purpose, so the text and the screenshots do the talking:
   one column, pictures with a thin frame and a plain caption, no tape, no tilt, no hard shadows. */

.log { max-width: 760px; margin: 0 auto; padding: clamp(28px, 5vw, 64px) var(--gutter) clamp(48px, 7vw, 96px); }
.log a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- the head of a week ---------- */

.log-head { display: grid; gap: 12px; margin-bottom: clamp(24px, 4vw, 36px); }
.log-back { justify-self: start; font-size: var(--fs-small); font-weight: 700; color: var(--ink-2) !important; text-decoration: none; }
.log-back::before { content: "← "; }
.log-back:hover { text-decoration: underline; }
.log-kicker { font-size: var(--fs-small); color: var(--ink-2); }
.log-kicker b { color: var(--ink); }
.log-title { font: 800 clamp(2rem, 1.4rem + 2.6vw, 3.2rem)/1.05 var(--font-ui); letter-spacing: -0.01em; text-wrap: balance; }

.log-cover { margin: 0 0 clamp(28px, 4vw, 44px); }
.log-cover .log-pic { margin: 0; }

/* ---------- the text ---------- */

.log-text > p,
.log-text > ul,
.log-text > blockquote { font-size: 1.125rem; line-height: 1.65; }
.log-text > p { margin: 0 0 1em; }
.log-text b { font-weight: 700; }

.log-entry {
  margin: 2.4em 0 0.8em;
  font: 800 0.9rem/1.2 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--red);
}
.log-text > .log-entry:first-child { margin-top: 0; }
.log-h2 { margin: 2.2em 0 0.6em; font: 800 1.5rem/1.2 var(--font-ui); }
.log-h2:first-child { margin-top: 0; }

.log-text blockquote { margin: 0 0 1em; padding-left: 16px; border-left: 3px solid var(--line-2); color: var(--ink-2); }
.log-list-plain { margin: 0 0 1em; padding-left: 1.2em; list-style: disc; }

/* ---------- screenshots ---------- */

.log-pic { margin: 1.6em 0 1.8em; }
.log-pic img,
.log-pic video {
  width: 100%; height: auto;
  border: 1px solid var(--line-2); border-radius: 10px; background: #15161a;
}
.log-pic figcaption { margin-top: 8px; font-size: var(--fs-small); line-height: 1.4; color: var(--ink-2); }
.log-pic figcaption b { color: var(--ink); }

.log-tall { max-width: 380px; margin-inline: auto; }

.log-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 1.6em 0 1.8em; }
.log-pair .log-pic { margin: 0; }

/* ---------- galleries: bento blocks, pictures and clips together ---------- */

.log-gallery { margin: 1.8em 0 2em; }
.log-gallery-title { margin: 0 0 10px; font: 800 1.05rem/1.3 var(--font-ui); }
.g-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(92px, 12.5vw, 128px);
  grid-auto-flow: dense; gap: 10px;
}
.g-tile { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--line-2); border-radius: 10px; background: #15161a; }
.g-tile img, .g-tile video { display: block; width: 100%; height: 100%; object-fit: cover; }
.g-big { grid-column: span 2; grid-row: span 2; }
.g-wide { grid-column: span 2; }
.g-tall { grid-row: span 2; }
.g-tile figcaption {
  position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 3px 7px; border-radius: 6px;
  background: rgba(20, 21, 26, 0.64); color: #fff; font-size: 0.76rem; line-height: 1.3;
  width: fit-content; max-width: calc(100% - 12px);
}
img[data-zoom] { cursor: zoom-in; }

/* ---------- a moment of insight, and his words set large ---------- */

.log-insight { margin: 1.8em 0; padding: 14px 20px 16px; border-left: 4px solid var(--gold); border-radius: 0 10px 10px 0; background: #f4ead0; }
.log-insight > b { display: block; margin-bottom: 4px; font: 800 0.8rem/1.2 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #7a5a10; }
.log-insight p { margin: 0 0 0.6em; font-size: 1.05rem; line-height: 1.55; }
.log-insight p:last-child { margin: 0; }
.log-text .log-pull {
  margin: 1.4em 0; padding: 0; border: 0;
  font: 800 clamp(1.3rem, 1.05rem + 1vw, 1.7rem)/1.3 var(--font-ui); color: var(--ink); text-wrap: balance;
}

/* ---------- a picture opened full size ---------- */

.log-zoom { width: min(96vw, 1400px); max-width: none; max-height: none; padding: 0; border: 0; background: transparent; overflow: visible; }
.log-zoom::backdrop { background: rgba(20, 21, 26, 0.9); }
.log-zoom img { display: block; width: auto; max-width: 100%; max-height: 82vh; margin: 0 auto; border-radius: 8px; }
.log-zoom p { margin: 10px auto 0; max-width: 900px; color: #fff; text-align: center; font-size: var(--fs-small); }
.log-zoom button {
  position: fixed; top: 50%; translate: 0 -50%; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 1.4rem; cursor: pointer;
}
.log-zoom button:hover { background: rgba(255, 255, 255, 0.28); }
.log-zoom .zoom-prev { left: 12px; }
.log-zoom .zoom-next { right: 12px; }
.log-zoom .zoom-close { top: 28px; right: 12px; translate: none; }

/* ---------- the mistake of the week ---------- */

.log-note { margin: 1.8em 0; padding: 16px 20px; background: var(--note); border-radius: 10px; }
.log-note > b { display: block; margin-bottom: 4px; font-weight: 800; }
.log-note p { margin: 0 0 0.6em; font-size: 1.05rem; line-height: 1.55; }
.log-note p:last-child { margin: 0; }

/* ---------- the week in numbers ---------- */

.log-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px 24px;
  margin: 0 0 1em; padding-top: 14px; border-top: 1px solid var(--line-2);
}
.log-stats li { display: grid; gap: 2px; align-content: start; }
.log-stats b { font: 800 1.8rem/1 var(--font-ui); }
.log-stats span { font-size: var(--fs-small); line-height: 1.35; color: var(--ink-2); }

/* ---------- earlier, all, later ---------- */

.log-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  margin-top: clamp(36px, 5vw, 56px); padding-top: 18px; border-top: 1px solid var(--line-2);
  font-weight: 700;
}
.log-nav > :first-child { justify-self: start; }
.log-nav > :last-child { justify-self: end; }

/* ---------- the index ---------- */

.log-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 4px 0 8px; }
.log-count-num { font: 800 clamp(2.4rem, 1.8rem + 2.4vw, 3.4rem)/1 var(--font-ui); color: var(--red); }
.log-count-word { font-weight: 700; font-size: 1.125rem; }
.log-count-since { flex-basis: 100%; font-size: var(--fs-small); color: var(--ink-2); }
.log-lede p { margin: 0 0 0.8em; font-size: 1.125rem; line-height: 1.6; }
.log-start { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; font-weight: 700; }
.log-rss { font-size: var(--fs-small); color: var(--ink-2) !important; }

.log-strip { margin: clamp(44px, 6vw, 72px) 0 0; padding-top: 24px; border-top: 1px solid var(--line-2); }
.log-strip .log-h2 { margin: 0 0 6px; font-size: 1.5rem; }
.strip-hint { margin: 0 0 16px; font-size: var(--fs-small); color: var(--ink-2); }
.strip-hint:empty { display: none; }
/* without the script: a plain grid of frames with captions */
.strip-frames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.strip-frame img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--line-2); border-radius: 8px; }
.strip-cap { display: block; margin-top: 6px; font-size: var(--fs-small); color: var(--ink-2); }
/* with it: one big frame at a time, crossfading, a slider under it */
.log-strip.is-slider .strip-frames {
  display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: 10px; background: #15161a;
}
.log-strip.is-slider .strip-frame { position: absolute; inset: 0; opacity: 0; transition: opacity 0.45s ease; }
.log-strip.is-slider .strip-frame.is-on { opacity: 1; }
.log-strip.is-slider .strip-frame img { height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; }
.log-strip.is-slider .strip-cap { display: none; }
.strip-controls { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 14px; margin-top: 14px; }
.strip-controls[hidden] { display: none; }
.strip-play {
  grid-row: span 2; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--ink); background: var(--tile); color: var(--ink);
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.strip-play:hover { background: var(--gold); }
.strip-range { width: 100%; margin: 0; accent-color: var(--ink); cursor: pointer; }
.strip-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 0.8rem; color: var(--ink-2); }
.strip-now { grid-column: 1 / -1; margin-top: 4px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .log-strip.is-slider .strip-frame { transition: none; } }

.log-cards { display: grid; border-top: 1px solid var(--line-2); }
.log-cards > li { border-bottom: 1px solid var(--line-2); }
.log-card {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: center;
  padding: 18px 0; text-decoration: none !important;
}
.log-card-pic img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--line-2); border-radius: 8px; }
.log-card-text { display: grid; justify-items: start; gap: 4px; }
.log-card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: var(--fs-small); }
.log-fresh { color: var(--red); font-weight: 800; }
.log-card-title { font: 800 1.4rem/1.15 var(--font-ui); text-wrap: balance; }
.log-card:hover .log-card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.log-card .log-when { font-size: var(--fs-small); color: var(--ink-2); }
.log-card-summary { color: var(--ink-2); line-height: 1.45; }

/* ---------- smaller screens ---------- */

@media (max-width: 719px) {
  .log-text > p, .log-text > ul, .log-text > blockquote { font-size: 1.0625rem; }
  .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 118px; gap: 8px; }
  .log-zoom button { width: 40px; height: 40px; }
  .log-pair { grid-template-columns: minmax(0, 1fr); }
  .log-card { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .log-nav { grid-template-columns: 1fr 1fr; }
  .log-nav > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
}
@media (max-width: 420px) {
  .strip-frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
