/* ===========================================================
   ARTICLE / TUTORIAL PAGES
   Reuses design tokens from styles.css (:root). No new colors.
   =========================================================== */

/* On article pages the nav must be fully opaque: the breadcrumb
   and body scroll past beneath it, and the homepage's translucent
   treatment would let that content bleed through. Scoped to pages
   that contain .article-page so other pages keep their look. */
body:has(.article-page) nav {
  background: var(--bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.article-page {
  padding: 0 0 100px;
}

/* Constrain reading column for long-form text */
.article-wrap {
  max-width: 760px;
  margin: 0 auto;
}

/* BREADCRUMB ------------------------------------------------
   Docks as a solid bar directly beneath the sticky nav. The
   opaque background means article content scrolling past never
   bleeds through the translucent nav above it. */
.article-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  position: sticky;
  top: 84px; /* docks flush beneath the 85px sticky nav */
  z-index: 90; /* below nav (100), above article body */
  margin: 0 0 32px;
  padding: 14px 0 13px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
/* Full-bleed background so the bar spans the viewport width while
   its text stays aligned to the reading column. */
.article-breadcrumb::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  z-index: -1;
}
.article-breadcrumb a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.article-breadcrumb a:hover {
  color: var(--coral-deep);
}
.article-breadcrumb .sep {
  color: var(--rule);
}
.article-breadcrumb .current {
  color: var(--ink-soft);
}

/* HEADER ---------------------------------------------------- */
.article-header {
  margin-bottom: 40px;
}
.article-eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--coral);
  font-weight: 600;
  margin-bottom: 16px;
}
.article-header h1 {
  font-size: clamp(2rem, 4.5vw, 2.875rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  font-variation-settings: "opsz" 96;
}
.article-lead {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.article-meta .article-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.article-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-muted);
  opacity: 0.5;
}

/* BODY ------------------------------------------------------ */
.article-body > * + * {
  margin-top: 0;
}
.article-body h2 {
  font-size: 1.625rem;
  margin: 44px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  font-variation-settings: "opsz" 48;
  scroll-margin-top: 80px;
}
.article-body h3 {
  font-size: 1.25rem;
  margin: 32px 0 12px;
  font-variation-settings: "opsz" 36;
  color: var(--ink);
}
.article-body p,
.article-body ul,
.article-body ol {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.article-body ul,
.article-body ol {
  padding-left: 24px;
}
.article-body li {
  margin-bottom: 10px;
}
.article-body li > ul,
.article-body li > ol {
  margin-top: 10px;
  margin-bottom: 0;
}
.article-body strong {
  color: var(--ink);
  font-weight: 600;
}
.article-body a {
  color: var(--coral-deep);
  text-decoration: underline;
  text-decoration-color: var(--coral-soft);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.article-body a:hover {
  text-decoration-color: var(--coral);
}
.article-body code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-warm);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--coral-deep);
  word-break: break-word;
}

/* First paragraph after H1 gets a touch more presence */
.article-body > p:first-child {
  font-size: 1.125rem;
  color: var(--ink-soft);
}

/* CALLOUT / TIP --------------------------------------------- */
.article-callout {
  background: var(--bg-warm);
  border-left: 3px solid var(--coral);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
}
.article-callout p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.article-callout strong {
  color: var(--ink);
}

/* TABLES ---------------------------------------------------- */
.article-table-wrap {
  margin: 24px 0;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}
table.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 540px;
}
table.article-table thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 600;
  padding: 14px 16px;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.article-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  vertical-align: top;
  line-height: 1.45;
}
table.article-table tbody tr:last-child td {
  border-bottom: none;
}
table.article-table tbody tr:nth-child(even) {
  background: rgba(244, 237, 227, 0.35);
}
table.article-table td code,
table.article-table th code {
  background: var(--bg);
  font-size: 0.8125rem;
}
table.article-table td:first-child {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink);
  white-space: nowrap;
}
/* Variation table: let the parent/child SKU structure read clearly */
table.article-table.is-variations td:first-child {
  font-weight: 500;
}

/* CTA BLOCK ------------------------------------------------- */
.article-cta {
  margin: 48px 0 8px;
  padding: 36px 36px 34px;
  background: linear-gradient(135deg, var(--bg-warm) 0%, var(--coral-soft) 140%);
  border: 1px solid var(--rule);
  border-radius: 16px;
}
.article-cta-eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--coral-deep);
  font-weight: 600;
  margin-bottom: 12px;
}
.article-cta h2 {
  border: none;
  padding: 0;
  margin: 0 0 12px;
  font-size: 1.5rem;
  font-variation-settings: "opsz" 48;
}
.article-cta p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 22px;
}
.article-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.article-cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 100px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.article-cta .btn-primary {
  background: var(--ink);
  color: #fff;
}
.article-cta .btn-primary:hover {
  background: var(--coral-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(168, 65, 47, 0.25);
}
.article-cta .btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--rule);
}
.article-cta .btn-secondary:hover {
  border-color: var(--coral);
  color: var(--coral-deep);
}
.article-cta-note {
  margin: 18px 0 0;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* RELATED ARTICLES ------------------------------------------ */
.article-related {
  max-width: 760px;
  margin: 64px auto 0;
}
.article-related-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--coral);
  font-weight: 600;
  margin-bottom: 18px;
}
.article-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.article-related-card {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  box-shadow: var(--shadow-card);
}
.article-related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--coral-soft);
}
.article-related-kicker {
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.article-related-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--ink);
  font-variation-settings: "opsz" 24;
}
.article-related-card span.go {
  margin-top: auto;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--coral-deep);
  font-family: var(--mono);
}

/* RESPONSIVE ------------------------------------------------ */
@media (max-width: 820px) {
  .article-page {
    padding: 0 0 72px;
  }
  /* Mobile nav is shorter (~77px); dock the breadcrumb to match. */
  .article-breadcrumb {
    top: 76px;
  }
  .article-cta {
    padding: 28px 24px;
  }
  .article-related-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .article-header h1 {
    font-size: 1.875rem;
  }
  .article-lead {
    font-size: 1.0625rem;
  }
  .article-body h2 {
    font-size: 1.4rem;
  }
}
