/* ============================================================================
   Digitour — guides.css
   Guides index cards and the long-form article template.
   ========================================================================== */

/* ── Index ───────────────────────────────────────────────────────────────── */
.guidegrid { display: grid; gap: 20px; margin-top: 24px; }
@media (min-width: 768px)  { .guidegrid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 28px; } }

.guidecard {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-1);
  transition: box-shadow var(--dur-2) ease, transform var(--dur-2) var(--ease), opacity var(--dur-2) ease;
  animation: card-in .45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.guidecard:hover { box-shadow: var(--sh-3); transform: translateY(-3px); }
.guidecard:hover img { transform: scale(1.04); }
.guidecard[hidden] { display: none; }
.guidecard__media { display: block; border-radius: 0; }
.guidecard__body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.guidecard__meta { display: flex; align-items: center; gap: 10px; font-size: .75rem; color: var(--muted); }
.guidecard h2 a { text-decoration: none; }
.guidecard h2 a:hover { color: var(--g700); }
.guidecard__author {
  display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted);
}
.guidecard__avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; }
.guidecard__avatar img { filter: grayscale(1); object-position: top center; }
.guidegrid__empty { padding: 48px 0; text-align: center; color: var(--muted); }

/* ── Article header ──────────────────────────────────────────────────────── */
.article__cat { margin-top: 16px; }
.article__title { margin: 12px 0 20px; max-width: 24ch; text-wrap: balance; }
.article__byline { display: flex; align-items: center; gap: 12px; font-size: .8125rem; color: var(--g100); }
.article__avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
.article__avatar img { filter: grayscale(1); object-position: top center; }
.article__byline b { color: #fff; }
.article__dates { color: var(--on-dark-2); font-size: .75rem; }

/* ── Article layout ──────────────────────────────────────────────────────── */
.article__layout { display: grid; gap: 32px; padding-block: 36px 64px; }
@media (min-width: 1024px) {
  .article__layout { grid-template-columns: 250px minmax(0, 1fr); gap: 64px; padding-block: 56px 88px; align-items: start; }
}

.article__toc { display: grid; gap: 16px; }
@media (min-width: 1024px) { .article__toc { position: sticky; top: calc(var(--header-h) + 20px); } }
.article__toc ol { display: grid; gap: 1px; counter-reset: toc; margin-top: 10px; }
.article__toc a {
  display: flex; align-items: center; min-height: 40px; padding: 8px 0 8px 13px;
  border-left: 2px solid var(--line);
  font-size: .8125rem; color: var(--muted); text-decoration: none; line-height: 1.45;
  transition: color var(--dur-1) ease, border-color var(--dur-1) ease;
}
.article__toc a:hover { color: var(--g700); }
.article__toc a.is-active { color: var(--g700); font-weight: 600; border-color: var(--g700); }

/* ── Prose ───────────────────────────────────────────────────────────────── */
/* min-width:0 — without it a wide table inside makes this grid column refuse
   to shrink and the whole page scrolls sideways on a phone. */
.prose { max-width: 74ch; min-width: 0; }
.article__toc { min-width: 0; }
.prose .tablewrap { max-width: 100%; }
.prose__lead {
  font-size: 1.0625rem; line-height: 1.7; color: var(--ink);
  padding-bottom: 26px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.prose section { margin-top: 40px; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h2 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.1875rem, 2.6vw, 1.4375rem);
  line-height: 1.3; margin-bottom: 16px;
}
.prose p { font-size: .9375rem; line-height: 1.82; color: var(--muted); }
.prose p + p { margin-top: 16px; }
.prose strong { color: var(--ink); }

.prose__list { display: grid; gap: 10px; margin: 18px 0; }
.prose__list li { display: flex; gap: 10px; font-size: .9375rem; line-height: 1.7; color: var(--muted); }
.prose__list .i { flex-shrink: 0; margin-top: 4px; color: var(--g600); }

.prose__ol { display: grid; gap: 12px; margin: 18px 0; counter-reset: n; }
.prose__ol li {
  position: relative; padding-left: 38px; font-size: .9375rem; line-height: 1.7; color: var(--muted);
  counter-increment: n;
}
.prose__ol li::before {
  content: counter(n);
  position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--g100); color: var(--g700);
  display: grid; place-items: center;
  font-size: .75rem; font-weight: 700; font-family: var(--sans);
}

.prose__note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--g50); border-left: 3px solid var(--g600);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 16px 18px; margin: 24px 0;
}
.prose__note .i { flex-shrink: 0; margin-top: 2px; color: var(--g600); }
.prose__note p { font-size: .875rem; line-height: 1.7; color: var(--ink); }

.prose .tablewrap { margin: 24px 0; }
.dtable--prose { min-width: 520px; font-size: .8125rem; }

.prose__cta {
  margin-top: 48px; padding: 26px;
  background: var(--g100); border-radius: var(--r-lg);
}
.prose__cta .t-body { margin: 10px 0 20px; }

/* One link per guide card: the heading carries it and stretches over the card,
   so the image is not a second, identical destination in the tab order. */
.guidecard { position: relative; }
.guidecard h2 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.guidecard__author, .guidecard__meta { position: relative; z-index: 2; }

.dtable caption {
  caption-side: top; text-align: left;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-size: .75rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); background: var(--ivory);
}
