/* ============================================================================
   ADVOKE CV — content.css
   Long-form typography for guides, about, privacy, examples.
   Readable measure, refined hierarchy, callouts, TOC, article cards.
   ============================================================================ */

/* ── 1. Article shell ─────────────────────────────────────────────────── */
.article {
  max-width: 72ch;
  margin-inline: auto;
  padding-block: clamp(2rem, 4vw, 4rem) clamp(3rem, 6vw, 6rem);
  font-size: var(--fs-lg);
  line-height: 1.75;
  color: var(--ink-2);
}

.article h1,
.article h2,
.article h3,
.article h4 {
  color: var(--ink);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.article h1 {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: var(--ls-tighter);
  line-height: 1.1;
  margin-bottom: var(--s-5);
}

.article h2 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: 1.2;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line-2);
  position: relative;
}

.article h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 56px;
  height: 2px;
  background: var(--y-500);
}

.article h3 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: var(--s-3);
}

.article h4 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  margin-top: var(--s-6);
  margin-bottom: var(--s-2);
}

.article p {
  margin-bottom: var(--s-4);
  color: var(--ink-2);
}

.article p.lede,
.article .lede {
  font-size: var(--fs-xl);
  color: var(--ink-3);
  line-height: var(--lh-snug);
  margin-bottom: var(--s-6);
}

.article strong { color: var(--ink); font-weight: var(--fw-semibold); }

.article a {
  color: var(--y-800);
  text-decoration: underline;
  text-decoration-color: var(--y-400);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.2em;
  transition: color var(--t-fast), text-decoration-color var(--t-fast);
}

.article a:hover {
  color: var(--y-900);
  text-decoration-color: var(--y-600);
}

.article ul,
.article ol {
  margin: 0 0 var(--s-4);
  padding-left: 1.4em;
}

.article ul { list-style: disc; }
.article ol { list-style: decimal; }

.article li {
  margin-bottom: 0.55em;
  padding-left: 0.25em;
}

.article li::marker {
  color: var(--y-600);
  font-weight: var(--fw-bold);
}

.article ul ul,
.article ol ol,
.article ul ol,
.article ol ul {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.article blockquote {
  margin: var(--s-6) 0;
  padding: var(--s-4) var(--s-5) var(--s-4) var(--s-6);
  border-left: 4px solid var(--y-500);
  background: var(--y-50);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--ink-2);
  font-style: italic;
  line-height: 1.65;
}

.article blockquote p:last-child { margin-bottom: 0; }

.article code {
  font-size: 0.88em;
  background: var(--paper-4);
  padding: 0.15em 0.4em;
  border-radius: var(--r-xs);
  color: var(--ink);
}

.article pre {
  margin: var(--s-5) 0;
  font-size: var(--fs-sm);
}

.article hr {
  margin: var(--s-8) 0;
  height: 1px;
  background: var(--line-2);
  border: 0;
}

.article figure {
  margin: var(--s-6) 0;
}

.article figcaption {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  text-align: center;
  margin-top: var(--s-3);
}

.article img {
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
}

/* Article header (title area) */
.article-header {
  padding-block: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line-2);
  margin-bottom: var(--s-6);
}

.article-header .eyebrow { margin-bottom: var(--s-3); }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  font-size: var(--fs-sm);
  color: var(--ink-3);
  margin-top: var(--s-4);
}

.article-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.article-meta svg { width: 15px; height: 15px; }

/* ── 2. Table of contents ─────────────────────────────────────────────── */
.toc {
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--y-500);
  border-radius: var(--r-md);
  padding: var(--s-5) var(--s-5) var(--s-5) var(--s-6);
  margin: var(--s-6) 0;
  font-size: var(--fs-sm);
}

.toc__title {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s-3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc__title svg { width: 15px; height: 15px; }

.toc ol,
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}

.toc li {
  margin-bottom: 0.35rem;
  padding-left: 0;
}

.toc li::marker { content: ""; }

.toc a {
  color: var(--ink-2);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.2rem 0;
  transition: color var(--t-fast);
}

.toc a::before {
  counter-increment: toc;
  content: counter(toc) ".";
  color: var(--y-700);
  font-weight: var(--fw-bold);
  font-size: 0.9em;
  min-width: 1.4em;
}

.toc a:hover { color: var(--y-800); }

/* Nested levels (h3 inside TOC) */
.toc ol ol {
  padding-left: 1.4rem;
  margin-top: 0.35rem;
}

.toc ol ol a::before { content: ""; counter-increment: none; min-width: 0; }

/* ── 3. Callouts ──────────────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--paper-2);
  margin: var(--s-5) 0;
  font-size: var(--fs-md);
  line-height: 1.65;
}

.callout__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-4);
  color: var(--ink-2);
}

.callout__icon svg { width: 20px; height: 20px; }

.callout__body { min-width: 0; }
.callout__body strong { color: var(--ink); }
.callout__body p:last-child { margin-bottom: 0; }

.callout-tip {
  background: var(--y-50);
  border-color: var(--y-200);
}
.callout-tip .callout__icon {
  background: var(--y-200);
  color: var(--y-800);
}

.callout-warning {
  background: var(--warning-bg);
  border-color: var(--warning-line);
  color: #78350F;
}
.callout-warning .callout__icon {
  background: #FDE68A;
  color: var(--warning);
}

.callout-danger {
  background: var(--danger-bg);
  border-color: var(--danger-line);
  color: #7F1D1D;
}
.callout-danger .callout__icon {
  background: #FECACA;
  color: var(--danger);
}

.callout-success {
  background: var(--success-bg);
  border-color: var(--success-line);
  color: #14532D;
}
.callout-success .callout__icon {
  background: #BBF7D0;
  color: var(--success);
}

.callout-info {
  background: var(--info-bg);
  border-color: var(--info-line);
  color: #1E3A8A;
}
.callout-info .callout__icon {
  background: #BFDBFE;
  color: var(--info);
}

/* ── 4. Comparison / good-vs-bad example blocks ───────────────────────── */
.example-pair {
  display: grid;
  gap: var(--s-4);
  margin: var(--s-5) 0;
}

@media (min-width: 720px) {
  .example-pair { grid-template-columns: 1fr 1fr; }
}

.example {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--paper);
  font-size: var(--fs-md);
  line-height: 1.65;
}

.example__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  margin-bottom: var(--s-3);
}

.example__label svg { width: 14px; height: 14px; }

.example--bad {
  background: var(--danger-bg);
  border-color: var(--danger-line);
}
.example--bad .example__label { color: var(--danger); }

.example--good {
  background: var(--success-bg);
  border-color: var(--success-line);
}
.example--good .example__label { color: var(--success); }

.example p:last-child { margin-bottom: 0; }

/* ── 5. Data table wrapper ────────────────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  margin: var(--s-5) 0;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  min-width: 520px;
  margin: 0;
}

.table-wrap thead th {
  background: var(--paper-3);
  position: sticky;
  top: 0;
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ── 6. Definition list ───────────────────────────────────────────────── */
.article dl {
  margin: var(--s-5) 0;
}

.article dt {
  font-weight: var(--fw-semibold);
  color: var(--ink);
  margin-top: var(--s-4);
  font-size: var(--fs-lg);
}

.article dt:first-child { margin-top: 0; }

.article dd {
  margin: var(--s-2) 0 0;
  padding-left: var(--s-5);
  border-left: 2px solid var(--line-2);
  color: var(--ink-2);
}

/* ── 7. Article grid (list of guides) ─────────────────────────────────── */
.article-grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .article-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.article-card {
  display: flex;
  flex-direction: column;
  padding: var(--s-5);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
  height: 100%;
  min-height: 100%;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--y-300);
}

.article-card__badge {
  align-self: flex-start;
  margin-bottom: var(--s-3);
}

.article-card__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: 1.3;
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--s-2);
  color: var(--ink);
}

.article-card__excerpt {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  line-height: 1.6;
  flex: 1 1 auto;
  margin-bottom: var(--s-4);
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--fs-xs);
  color: var(--ink-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line-2);
}

.article-card__meta svg { width: 14px; height: 14px; }

.article-card__cta {
  color: var(--y-800);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.article-card:hover .article-card__cta svg {
  transform: translateX(2px);
  transition: transform var(--t-base);
}

.article-card__cta svg { width: 15px; height: 15px; }

/* ── 8. Reading progress bar ─────────────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: var(--z-tooltip);
  pointer-events: none;
}

.reading-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--y-500), var(--y-600));
  transition: width 80ms linear;
  box-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
}

/* ── 9. Steps / process list ──────────────────────────────────────────── */
.steps {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  margin: var(--s-6) 0;
}

.step {
  display: flex;
  gap: var(--s-4);
  counter-increment: step;
  align-items: flex-start;
}

.step::before {
  content: counter(step);
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--y-500);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  box-shadow: 0 0 0 4px var(--y-100);
}

.step__body { min-width: 0; padding-top: 0.25rem; }

.step__title {
  font-weight: var(--fw-semibold);
  color: var(--ink);
  font-size: var(--fs-lg);
  margin-bottom: 0.35rem;
}

.step__text {
  color: var(--ink-2);
  font-size: var(--fs-md);
  line-height: 1.65;
}

/* ── 10. Inline key-value chips ──────────────────────────────────────── */
.kv {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-4) 0;
}

.kv__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  color: var(--ink-2);
}

.kv__item svg { width: 14px; height: 14px; color: var(--ink-3); }
.kv__item strong { color: var(--ink); font-weight: var(--fw-semibold); }

/* ── 11. Author / info strip ─────────────────────────────────────────── */
.info-strip {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  margin: var(--s-6) 0;
  font-size: var(--fs-sm);
}

.info-strip__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--y-100);
  color: var(--y-800);
  border-radius: var(--r-sm);
}

.info-strip__icon svg { width: 20px; height: 20px; }

.info-strip__body { min-width: 0; color: var(--ink-2); }
.info-strip__body strong { color: var(--ink); }

/* ── 12. Responsive fine-tuning ──────────────────────────────────────── */
@media (max-width: 640px) {
  .article {
    font-size: var(--fs-md);
    line-height: 1.7;
  }

  .article h1 { font-size: var(--fs-4xl); }
  .article h2 { font-size: var(--fs-2xl); margin-top: 2.5rem; }
  .article h3 { font-size: var(--fs-xl); }

  .article blockquote {
    padding: var(--s-3) var(--s-4) var(--s-3) var(--s-5);
    font-size: var(--fs-sm);
  }

  .callout { padding: var(--s-3) var(--s-4); }
  .callout__icon { width: 30px; height: 30px; }
  .callout__icon svg { width: 17px; height: 17px; }

  .toc { padding: var(--s-4); font-size: var(--fs-xs); }
}