/* ==========================================================================
   Blog - shared article pieces, layered on top of styles.css (.doc layout).
   Individual posts may add their own <style> for one-off art direction.
   ========================================================================== */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.crumbs a {
  color: inherit;
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink);
}

.crumbs span[aria-hidden] {
  opacity: 0.6;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.byline a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.byline a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------- figures --- */

.figure {
  margin: 0;
}

.figure img {
  width: 100%;
  height: auto;
  border-radius: var(--r-card);
  background: var(--surface-2);
}

.figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.figure figcaption a {
  color: inherit;
}

.figure--hero {
  margin-bottom: 2.75rem;
}

.figure--hero img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.figure--phone {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 1rem;
  justify-content: start;
}

.figure--phone img {
  border-radius: 28px;
  border: 1px solid var(--line);
}

.figure--phone figcaption {
  grid-column: 1 / -1;
}

/* ------------------------------------------------------------- toc --- */

.toc {
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface);
  padding: 1.25rem 1.5rem;
}

.toc p {
  font-weight: 600;
  color: var(--ink) !important;
}

.toc ol {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
}

/* ----------------------------------------------------------- steps --- */

.doc__body ol.steps {
  margin: 0.9rem 0 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 0.55rem;
}

.doc__body ol.steps li::marker {
  color: var(--accent);
  font-weight: 600;
}

.path {
  font-family: var(--mono);
  font-size: 0.875em;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ----------------------------------------------------------- stats --- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.doc__body .stat {
  border-radius: var(--r-control);
  background: var(--field);
  color: #fff;
  padding: 1.1rem 1.2rem 1.2rem;
}

.doc__body .stat strong {
  display: block;
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.doc__body .stat span {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 560px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------ misc --- */

/* Grid children default to min-width:auto, so a wide table would stretch
   the whole column on phones. */
.doc__body > * {
  min-width: 0;
}

/* styles.css only spaces p + p; posts mix lists, callouts, and figures. */
.doc__body section > * + * {
  margin-top: 0.9rem;
}

.doc__body section > .stats,
.doc__body section > .callout,
.doc__body section > .figure,
.doc__body section > .table-wrap {
  margin-top: 1.25rem;
}

.doc__body .stat {
  margin: 0;
}

.doc__body .faq {
  margin-top: 1rem;
}

.sources {
  font-size: 0.875rem;
}

.sources ol {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.5rem;
}

/* --------------------------------------------------------- listing --- */

.post-list {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-card {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.post-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--r-control);
}

.post-card h2 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}

.post-card:hover h2 {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.post-card p {
  margin-top: 0.5rem;
  color: var(--ink-soft);
}

.post-card time {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  .post-card {
    grid-template-columns: 1fr;
  }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.pagination__prev,
.pagination__next {
  font-size: 0.9375rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.pagination__prev:hover,
.pagination__next:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.pagination__pages {
  display: flex;
  gap: 0.4rem;
  font-size: 0.9375rem;
}

.pagination__pages a,
.pagination__pages span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: var(--r-control);
  color: var(--ink-soft);
  text-decoration: none;
}

.pagination__pages a:hover {
  color: var(--ink);
  background: var(--line);
}

.pagination__pages span[aria-current="page"] {
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 600;
}

@media (max-width: 480px) {
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
}

/* ------------------------------------------------------------ related --- */

.related ul {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.doc__body .related a {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.doc__body .related a:hover {
  border-color: var(--ink);
}

.related strong {
  color: var(--ink);
}

.related span {
  font-size: 0.875rem;
  color: var(--ink-soft);
}
