/* ==========================================================================
   Advoke CV — Long-form content (guides, examples, legal)
   Reading measure, headings, callouts, tables, TOC, progress bar,
   related links, print-friendliness.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. READING LAYOUT
   -------------------------------------------------------------------------- */
.article-hero {
  padding-top: calc(var(--header-h-mobile) + var(--sp-8));
  padding-bottom: var(--sp-6);
  background: linear-gradient(180deg, var(--c-white) 0%, var(--c-neutral-50) 100%);
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 768px) {
  .article-hero {
    padding-top: calc(var(--header-h-desktop) + var(--sp-10));
    padding-bottom: var(--sp-8);
  }
}

.article-hero__inner {
  max-width: var(--container-text);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.article-hero__title {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tighter);
  line-height: 1.15;
  margin-bottom: var(--sp-4);
  text-wrap: balance;
}

.article-hero__lead {
  font-size: var(--fs-lg);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--sp-5);
}

.article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
}

.article-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.article-hero__meta-item svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   2. ARTICLE GRID (content + sticky TOC sidebar)
   -------------------------------------------------------------------------- */
.article-layout {
  padding-block: var(--sp-10) var(--section-y-md);
}

.article-layout__inner {
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
}

@media (min-width: 1024px) {
  .article-layout__inner {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: var(--sp-12);
    align-items: start;
  }
}

/* --------------------------------------------------------------------------
   3. ARTICLE BODY
   -------------------------------------------------------------------------- */
.article {
  max-width: var(--container-text);
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
  color: var(--text-secondary);
}

.article > * + * {
  margin-top: var(--sp-5);
}

.article h2 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tighter);
  color: var(--text-primary);
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  scroll-margin-top: calc(var(--header-h-mobile) + var(--sp-6));
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 768px) {
  .article h2 {
    scroll-margin-top: calc(var(--header-h-desktop) + var(--sp-6));
  }
}

.article h3 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
  scroll-margin-top: calc(var(--header-h-mobile) + var(--sp-6));
}

@media (min-width: 768px) {
  .article h3 {
    scroll-margin-top: calc(var(--header-h-desktop) + var(--sp-6));
  }
}

.article h4 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-2);
}

.article p {
  margin: 0;
}

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

.article a {
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article ul,
.article ol {
  padding-left: 1.4em;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.article li {
  margin: 0;
  line-height: var(--lh-relaxed);
}

.article li::marker {
  color: var(--interactive-accent);
}

.article blockquote {
  border-left: 3px solid var(--interactive-accent);
  padding: var(--sp-4) var(--sp-6);
  margin: var(--sp-6) 0;
  background: var(--interactive-accent-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: normal;
}

.article blockquote p {
  margin: 0;
  line-height: var(--lh-relaxed);
}

.article blockquote p + p {
  margin-top: var(--sp-3);
}

.article code {
  font-size: 0.92em;
  padding: 2px 6px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.article pre {
  padding: var(--sp-5);
  background: var(--c-navy-950);
  color: var(--c-neutral-100);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
}

.article pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}

.article hr {
  margin: var(--sp-10) 0;
  border: none;
  border-top: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   4. ARTICLE TABLE
   -------------------------------------------------------------------------- */
.article table {
  width: 100%;
  font-size: var(--fs-sm);
  margin: var(--sp-6) 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.article thead th {
  background: var(--c-navy-900);
  color: var(--c-white);
  font-weight: var(--fw-semibold);
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  border: none;
}

.article tbody td {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border-subtle);
  vertical-align: top;
  color: var(--text-secondary);
  line-height: var(--lh-snug);
}

.article tbody tr:nth-child(even) td {
  background: var(--surface-sunken);
}

@media (max-width: 640px) {
  .article table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------------------
   5. TABLE OF CONTENTS
   -------------------------------------------------------------------------- */
.toc {
  display: none;
}

@media (min-width: 1024px) {
  .toc {
    display: block;
    position: sticky;
    top: calc(var(--header-h-desktop) + var(--sp-6));
    max-height: calc(100vh - var(--header-h-desktop) - var(--sp-12));
    overflow-y: auto;
  }
}

.toc__title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-3);
}

.toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border-subtle);
}

.toc__item {
  margin: 0;
}

.toc__link {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: var(--lh-snug);
  transition:
    color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard);
}

.toc__link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.toc__link.is-active {
  color: var(--text-accent);
  border-left-color: var(--interactive-accent);
  font-weight: var(--fw-semibold);
}

.toc__link--sub {
  padding-left: var(--sp-5);
  font-size: var(--fs-xs);
}

.toc__progress {
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}

.toc__progress-label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-2);
}

/* --------------------------------------------------------------------------
   6. ARTICLE CALLOUTS
   -------------------------------------------------------------------------- */
.article .callout {
  margin: var(--sp-6) 0;
}

.article .callout__body > * + * {
  margin-top: var(--sp-2);
}

.article .callout strong {
  color: inherit;
}

/* --------------------------------------------------------------------------
   7. KEY TAKEAWAY BOX
   -------------------------------------------------------------------------- */
.takeaways {
  padding: var(--sp-6);
  background: var(--c-navy-900);
  color: var(--c-white);
  border-radius: var(--radius-lg);
  margin: var(--sp-8) 0;
}

.takeaways__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--sp-4);
}

.takeaways__title svg {
  width: 18px;
  height: 18px;
  color: var(--c-blue-300);
}

.takeaways ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.takeaways li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
}

.takeaways li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 8px;
  border-radius: var(--radius-full);
  background: var(--c-blue-400);
}

/* --------------------------------------------------------------------------
   8. NUMBERED STEP LIST
   -------------------------------------------------------------------------- */
.steps-list {
  list-style: none;
  padding: 0;
  counter-reset: steplist;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  margin: var(--sp-6) 0;
}

.steps-list > li {
  position: relative;
  padding-left: 3rem;
  counter-increment: steplist;
  margin: 0;
}

.steps-list > li::before {
  content: counter(steplist);
  position: absolute;
  left: 0;
  top: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--c-white);
  background: var(--interactive-accent);
  border-radius: var(--radius-full);
}

.steps-list > li strong {
  display: block;
  font-size: var(--fs-md);
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}

/* --------------------------------------------------------------------------
   9. COMPARISON TABLE (before / after)
   -------------------------------------------------------------------------- */
.article .compare-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--sp-6) 0;
  font-size: var(--fs-sm);
}

.compare-table__head {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}

.compare-table__head--bad {
  background: var(--c-red-50);
  color: var(--text-danger);
}

.compare-table__head--good {
  background: var(--c-green-50);
  color: var(--text-success);
}

.compare-table__cell {
  padding: var(--sp-4);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}

.compare-table__cell--bad {
  background: #fffafa;
}

.compare-table__cell--good {
  background: #fafefb;
}

/* --------------------------------------------------------------------------
   10. ARTICLE FOOTER & RELATED LINKS
   -------------------------------------------------------------------------- */
.article-footer {
  margin-top: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border-subtle);
}

.article-footer__cta {
  padding: var(--sp-6);
  background: linear-gradient(135deg, var(--c-navy-900) 0%, var(--c-navy-800) 100%);
  color: var(--c-white);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
}

.article-footer__cta h3 {
  font-size: var(--fs-xl);
  color: var(--c-white);
  margin: 0;
}

.article-footer__cta p {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.78);
  line-height: var(--lh-relaxed);
  margin: 0;
}

.article-footer__actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}

.related-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

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

.related-list__title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-4);
  grid-column: 1 / -1;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  background: var(--c-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition:
    border-color var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard),
    transform var(--dur-base) var(--ease-standard);
}

.related-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  text-decoration: none;
}

.related-card__tag {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--text-accent);
}

.related-card__title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
  line-height: var(--lh-snug);
}

.related-card__desc {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  line-height: var(--lh-snug);
}

/* --------------------------------------------------------------------------
   11. HUBS (guides.html, examples.html)
   -------------------------------------------------------------------------- */
.hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}

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

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

.hub-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-6);
  background: var(--c-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition:
    border-color var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard),
    transform var(--dur-base) var(--ease-standard);
}

.hub-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  text-decoration: none;
}

.hub-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--interactive-accent-soft);
  color: var(--text-accent);
  border-radius: var(--radius-md);
  flex: none;
}

.hub-card__icon svg {
  width: 22px;
  height: 22px;
}

.hub-card__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
  line-height: var(--lh-snug);
}

.hub-card__desc {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  line-height: var(--lh-relaxed);
  flex: 1 1 auto;
}

.hub-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}

.hub-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

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

/* --------------------------------------------------------------------------
   12. RESUME EXAMPLE EMBED
   -------------------------------------------------------------------------- */
.example-embed {
  margin: var(--sp-8) 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-sunken);
}

.example-embed__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-white);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.example-embed__title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.example-embed__toolbar-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.example-embed__stage {
  padding: var(--sp-6);
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.example-embed__paper {
  width: 794px;
  min-height: 1123px;
  background: var(--surface-paper);
  box-shadow: var(--shadow-paper);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transform: scale(0.72);
  transform-origin: top center;
  flex: none;
}

@media (max-width: 900px) {
  .example-embed__paper {
    transform: scale(0.48);
  }
  .example-embed__stage {
    padding: var(--sp-3);
    min-height: 560px;
  }
}

@media (max-width: 480px) {
  .example-embed__paper {
    transform: scale(0.4);
  }
  .example-embed__stage {
    min-height: 470px;
  }
}

/* --------------------------------------------------------------------------
   13. LEGAL PAGES
   -------------------------------------------------------------------------- */
.legal-page {
  padding-top: calc(var(--header-h-mobile) + var(--sp-8));
  padding-bottom: var(--section-y-md);
}

@media (min-width: 768px) {
  .legal-page {
    padding-top: calc(var(--header-h-desktop) + var(--sp-10));
  }
}

.legal-page__inner {
  max-width: var(--container-text);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.legal-page h1 {
  font-size: var(--fs-4xl);
  margin-bottom: var(--sp-3);
  letter-spacing: var(--ls-tighter);
}

.legal-page__updated {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  padding-bottom: var(--sp-6);
  margin-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border-subtle);
}

.legal-page h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-subtle);
}

.legal-page h3 {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-2);
}

.legal-page p,
.legal-page li {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}

.legal-page p + p {
  margin-top: var(--sp-4);
}

.legal-page ul,
.legal-page ol {
  padding-left: 1.4em;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
}

/* --------------------------------------------------------------------------
   14. READING PROGRESS BAR (top of article pages)
   -------------------------------------------------------------------------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  z-index: calc(var(--z-header) + 1);
  pointer-events: none;
}

.reading-progress__bar {
  height: 100%;
  background: var(--interactive-accent);
  width: 0;
  transition: width 80ms linear;
}