/* ============================================
   RARITY House — Articles (article page + journal hub)
   "The Gilded Control Room": editorial luxury, machine precision.
   Scoped entirely under .articles-page; tokens mirror style.css.
   ============================================ */

:root {
  --article-max-width: 680px;
  --article-hairline: 32px;
  --article-rule: 1px;
  --article-rule-color: color-mix(in srgb, var(--gold, #b8964e) 45%, transparent);
  --article-number-color: var(--gold, #b8964e);
  --article-meta-color: color-mix(in srgb, var(--black, #0a0a0a) 72%, transparent);
  --article-journal-max: 1120px;
  --article-label-color: var(--gold-dark, #8c6e34);
  --article-body-color: color-mix(in srgb, var(--black, #0a0a0a) 90%, transparent);
  --article-muted-color: var(--steel, #777777);
}

/* ─── Page base ─── */

.articles-page {
  color: var(--black, #0a0a0a);
  background: var(--white, #ffffff);
}

.articles-page :focus-visible {
  outline: 2px solid var(--gold, #b8964e);
  outline-offset: 3px;
}

/* ─── Article shell ─── */

.articles-page .article-shell {
  width: min(var(--article-max-width), calc(100% - var(--article-hairline)));
  margin-inline: auto;
  padding-block: 40px 72px;
}

/* ─── Breadcrumb ─── */

.articles-page .article-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: var(--article-hairline);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel, #777777);
}

.articles-page .article-breadcrumb a {
  color: inherit;
  text-decoration: none;
  transition: color 150ms ease;
}

.articles-page .article-breadcrumb a:hover,
.articles-page .article-breadcrumb a:focus-visible {
  color: var(--article-label-color);
}

.articles-page .article-breadcrumb .bc-sep {
  color: var(--gold, #b8964e);
}

/* ─── Article head ─── */

.articles-page .article-eyebrow {
  display: block;
  color: var(--article-number-color);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
}

.articles-page .article-title {
  margin: 26px 0 16px;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-align: center;
}

.articles-page .article-deck {
  margin: 0 0 24px;
  font-family: var(--font-display, Georgia, serif);
  font-size: var(--text-md, 1.125rem);
  font-style: italic;
  line-height: 1.55;
  color: var(--slate, #3d3d3d);
  text-align: center;
}

.articles-page .article-meta {
  display: grid;
  gap: 6px;
  margin: 22px auto 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--article-meta-color);
  justify-content: center;
}

.articles-page .article-meta .meta-item {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.articles-page .article-meta .meta-label {
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--article-label-color);
}

.articles-page .article-meta time {
  font-variant-numeric: tabular-nums;
}

/* ─── Hero figure ─── */

.articles-page .article-hero {
  margin: 36px 0 8px;
}

.articles-page .article-hero img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--article-rule) solid var(--article-rule-color);
}

/* ─── Shared label (uppercase discipline) ─── */

.articles-page .article-label {
  margin: 0 0 12px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--article-label-color);
}

/* ─── Short answer ─── */

.articles-page .article-answer {
  margin-block: 36px;
  padding: 26px 30px;
  border-left: 4px solid var(--gold, #b8964e);
  background: var(--ivory, #f8f8f6);
}

.articles-page .article-answer > :last-child {
  margin-bottom: 0;
  font-family: var(--font-display, Georgia, serif);
  font-size: var(--text-md, 1.125rem);
  font-style: italic;
  line-height: 1.6;
}

/* ─── Takeaways ─── */

.articles-page .article-takeaways {
  margin-block: 36px;
  padding: 26px 30px;
  background: var(--ivory, #f8f8f6);
}

.articles-page .article-takeaways ol {
  margin: 0;
  padding-left: 26px;
  font-family: var(--font-display, Georgia, serif);
  font-size: var(--text-md, 1.125rem);
  line-height: 1.5;
}

.articles-page .article-takeaways li + li {
  margin-top: 12px;
}

.articles-page .article-takeaways li::marker {
  color: var(--article-number-color);
  font-style: italic;
}

/* ─── Prose ─── */

.articles-page .article-prose {
  max-width: var(--article-max-width);
  font-size: 1rem;
  line-height: 1.78;
  color: var(--article-body-color);
}

.articles-page .article-prose p {
  margin: 0 0 1.4em;
}

.articles-page .article-prose a {
  color: var(--gold-dark, #8c6e34);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--gold, #b8964e) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

.articles-page .article-prose a:hover,
.articles-page .article-prose a:focus-visible {
  color: var(--black, #0a0a0a);
  text-decoration-color: var(--gold, #b8964e);
}

.articles-page .article-prose h2,
.articles-page .article-prose h3,
.articles-page .article-prose h4 {
  position: relative;
  margin: 0 0 18px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--black, #0a0a0a);
  scroll-margin-top: 96px;
  text-wrap: balance;
  text-align: center;
}

.articles-page .article-prose h2 {
  margin-top: 56px;
  padding-top: 24px;
  font-size: clamp(28px, 3.4vw, 40px);
}

.articles-page .article-prose h2::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 48px;
  height: 2px;
  background: var(--gold, #b8964e);
  content: "";
  transform: translateX(-50%);
}

.articles-page .article-prose h3 {
  margin-top: 44px;
  padding-top: 20px;
  font-size: clamp(23px, 2.6vw, 30px);
}

.articles-page .article-prose h3::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 40px;
  height: 2px;
  background: var(--gold, #b8964e);
  content: "";
  transform: translateX(-50%);
}

.articles-page .article-prose h4 {
  margin-top: 36px;
  font-size: var(--text-lg, 1.333rem);
}

.articles-page .article-prose ul,
.articles-page .article-prose ol {
  margin: 0 0 1.4em;
  padding-left: 1.6em;
}

.articles-page .article-prose li {
  margin: 0 0 0.5em;
}

.articles-page .article-prose li::marker {
  color: var(--gold-dark, #8c6e34);
}

.articles-page .article-prose blockquote {
  margin: 40px 0;
  padding: 6px 0 6px 28px;
  border-left: 2px solid var(--gold, #b8964e);
  font-family: var(--font-display, Georgia, serif);
  font-style: italic;
  font-size: var(--text-lg, 1.333rem);
  line-height: 1.45;
  color: color-mix(in srgb, var(--black, #0a0a0a) 82%, transparent);
}

/* Tables */

.articles-page .article-prose table {
  width: 100%;
  min-width: 560px;
  margin: 28px 0;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
}

.articles-page .article-prose th,
.articles-page .article-prose td {
  padding: 12px 14px;
  border-bottom: var(--article-rule) solid
    color-mix(in srgb, var(--black, #0a0a0a) 30%, transparent);
  text-align: left;
  vertical-align: top;
}

.articles-page .article-prose th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel, #777777);
}

/* Figures (in-body images) */

.articles-page .article-prose .article-figure {
  margin: 40px 0;
}

.articles-page .article-prose .article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--article-rule) solid var(--article-rule-color);
}

.articles-page .article-prose .article-figure figcaption {
  margin-top: 10px;
  font-family: var(--font-display, Georgia, serif);
  font-style: italic;
  font-size: 0.95rem;
  text-align: center;
  color: var(--steel, #777777);
}

/* Rich blocks: key takeaway / callout / citation / experience */

.articles-page .article-prose .article-key-takeaway,
.articles-page .article-prose .article-callout,
.articles-page .article-prose .article-citation,
.articles-page .article-prose .article-experience {
  margin: 40px 0;
  padding: 24px 28px;
  border: var(--article-rule) solid var(--article-rule-color);
  border-left: 3px solid var(--gold, #b8964e);
  background: var(--ivory, #f8f8f6);
}

.articles-page .article-prose .article-callout--warning {
  border-left-color: var(--black, #0a0a0a);
}

.articles-page .article-prose .article-callout--insight {
  border-left-color: var(--gold-dark, #8c6e34);
}

.articles-page .article-prose .article-key-takeaway h4,
.articles-page .article-prose .article-experience h4 {
  margin: 0 0 8px;
  font-size: var(--text-md, 1.125rem);
  padding-top: 0;
}

.articles-page .article-prose .article-key-takeaway > :last-child,
.articles-page .article-prose .article-callout > :last-child,
.articles-page .article-prose .article-citation > :last-child,
.articles-page .article-prose .article-experience > :last-child {
  margin-bottom: 0;
}

.articles-page .article-prose .article-experience .experience-org {
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel, #777777);
}

/* ─── Sections (sources / author / related / cta) ─── */

.articles-page .article-sources,
.articles-page .article-author,
.articles-page .article-related,
.articles-page .article-cta {
  margin-top: 56px;
  padding-top: var(--article-hairline);
  border-top: var(--article-rule) solid var(--article-rule-color);
}

.articles-page .article-sources h2,
.articles-page .article-author h2,
.articles-page .article-related h2,
.articles-page .article-cta h2 {
  margin: 0 0 22px;
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-align: center;
}

.articles-page .article-sources ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.articles-page .article-sources li {
  padding: 14px 0;
  border-bottom: var(--article-rule) solid var(--border-light, #e8e8e8);
  font-size: 0.95rem;
  line-height: 1.6;
}

.articles-page .article-sources li:first-child {
  padding-top: 0;
}

.articles-page .article-sources a {
  color: var(--gold-dark, #8c6e34);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--gold, #b8964e) 55%, transparent);
  text-underline-offset: 3px;
}

.articles-page .article-sources a:hover,
.articles-page .article-sources a:focus-visible {
  color: var(--black, #0a0a0a);
}

/* ─── Author ─── */

.articles-page .article-author {
  padding: 32px;
  border: var(--article-rule) solid var(--article-rule-color);
}

.articles-page .article-author > p:not(.article-label):not(.article-author-role) {
  margin: 0;
}

.articles-page .article-author-role {
  margin: 0 0 16px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--article-label-color);
}

.articles-page .article-author-list {
  margin-top: 20px;
}

.articles-page .article-author-list ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.articles-page .article-author-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.92rem;
}

.articles-page .article-author-list li::before {
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--gold, #b8964e);
  content: "";
  transform: translateY(-1px) rotate(45deg);
}

/* ─── Related ─── */

.articles-page .article-related {
  padding: 32px;
  background: var(--ivory, #f8f8f6);
}

.articles-page .article-related-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.articles-page .article-related-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 24px;
  background: var(--white, #ffffff);
  border: var(--article-rule) solid var(--article-rule-color);
}

.articles-page .article-related-card .pill {
  justify-self: start;
  padding: 4px 10px;
  border: var(--article-rule) solid var(--gold, #b8964e);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-dark, #8c6e34);
}

.articles-page .article-related-card h3 {
  margin: 4px 0 0;
  font-size: var(--text-lg, 1.333rem);
  line-height: 1.2;
}

.articles-page .article-related-card h3 a {
  color: var(--black, #0a0a0a);
  text-decoration: none;
  transition: color 150ms ease;
}

.articles-page .article-related-card h3 a:hover,
.articles-page .article-related-card h3 a:focus-visible {
  color: var(--gold-dark, #8c6e34);
  text-decoration: underline;
  text-decoration-color: var(--gold, #b8964e);
  text-underline-offset: 4px;
}

/* ─── CTA ─── */

.articles-page .article-cta {
  text-align: center;
}

.articles-page .cta-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px 30px;
  border: var(--article-rule) solid var(--black, #0a0a0a);
  background: var(--black, #0a0a0a);
  color: var(--white, #ffffff);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 180ms ease;
}

.articles-page .cta-button::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, var(--gold-light, #d4b87a), var(--gold, #b8964e));
  content: "";
  transform: translateX(-101%);
  transition: transform 540ms cubic-bezier(0.65, 0, 0.35, 1);
}

.articles-page .cta-button .cta-label {
  position: relative;
  z-index: 1;
}

.articles-page .cta-button:hover,
.articles-page .cta-button:focus-visible {
  color: var(--black, #0a0a0a);
}

.articles-page .cta-button:hover::before,
.articles-page .cta-button:focus-visible::before {
  transform: translateX(0);
}

.articles-page .cta-filed {
  display: block;
  margin-top: 14px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel, #777777);
}

.articles-page .article-end-rule {
  margin-top: 64px;
  height: var(--article-rule);
  background: var(--article-rule-color);
  border: 0;
}

/* ============================================
   Journal hub (/articles/)
   ============================================ */

.articles-page .journal-head-row {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  justify-items: center;
  width: min(var(--article-journal-max), calc(100% - 48px));
  margin-inline: auto;
  padding-block: 72px 40px;
  text-align: center;
}

.articles-page .journal-title {
  margin: 0;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-align: center;
}

.articles-page .journal-deck {
  margin: 18px 0 0;
  font-family: var(--font-display, Georgia, serif);
  font-style: italic;
  font-size: var(--text-md, 1.125rem);
  line-height: 1.55;
  color: var(--slate, #3d3d3d);
  text-align: center;
}

.articles-page .journal-issue {
  margin: 22px 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel, #777777);
  text-align: center;
}

.articles-page .journal-band {
  padding: 56px 24px 72px;
  background: var(--ivory, #f8f8f6);
}

.articles-page .journal-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  width: min(var(--article-journal-max), 100%);
  margin-inline: auto;
  padding: 0;
  list-style: none;
}

.articles-page .journal-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 28px;
  background: var(--white, #ffffff);
  border: var(--article-rule) solid var(--article-rule-color);
}

.articles-page .journal-card .pill {
  justify-self: start;
  padding: 4px 10px;
  border: var(--article-rule) solid var(--gold, #b8964e);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-dark, #8c6e34);
}

.articles-page .journal-card h3 {
  margin: 2px 0 0;
  font-size: var(--text-lg, 1.333rem);
  line-height: 1.2;
}

.articles-page .journal-card h3 a {
  color: var(--black, #0a0a0a);
  text-decoration: none;
  transition: color 150ms ease;
}

.articles-page .journal-card h3 a:hover,
.articles-page .journal-card h3 a:focus-visible {
  color: var(--gold-dark, #8c6e34);
  text-decoration: underline;
  text-decoration-color: var(--gold, #b8964e);
  text-underline-offset: 4px;
}

.articles-page .journal-card .meta {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--steel, #777777);
}

.articles-page .journal-card .deck {
  margin: 0;
  font-family: var(--font-display, Georgia, serif);
  font-size: var(--text-base, 1rem);
  line-height: 1.5;
  color: color-mix(in srgb, var(--black, #0a0a0a) 85%, transparent);
}

.articles-page .journal-card .cta {
  justify-self: start;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark, #8c6e34);
  text-decoration: none;
  transition: color 150ms ease;
}

.articles-page .journal-card .cta:hover,
.articles-page .journal-card .cta:focus-visible {
  color: var(--black, #0a0a0a);
  text-decoration: underline;
  text-decoration-color: var(--gold, #b8964e);
  text-underline-offset: 4px;
}

.articles-page .journal-pull {
  max-width: 720px;
  margin: 56px auto 0;
  font-family: var(--font-display, Georgia, serif);
  font-style: italic;
  font-size: var(--text-lg, 1.333rem);
  line-height: 1.4;
  text-align: center;
  color: color-mix(in srgb, var(--black, #0a0a0a) 80%, transparent);
}

.articles-page .journal-cta-row {
  margin-top: 44px;
  text-align: center;
}

.articles-page .journal-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px 30px;
  border: var(--article-rule) solid var(--black, #0a0a0a);
  background: var(--black, #0a0a0a);
  color: var(--white, #ffffff);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 180ms ease;
}

.articles-page .journal-cta::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, var(--gold-light, #d4b87a), var(--gold, #b8964e));
  content: "";
  transform: translateX(-101%);
  transition: transform 540ms cubic-bezier(0.65, 0, 0.35, 1);
}

.articles-page .journal-cta .cta-label {
  position: relative;
  z-index: 1;
}

.articles-page .journal-cta:hover,
.articles-page .journal-cta:focus-visible {
  color: var(--black, #0a0a0a);
}

.articles-page .journal-cta:hover::before,
.articles-page .journal-cta:focus-visible::before {
  transform: translateX(0);
}

/* ─── Reveal (fade-in) ─── */

/* ─── Reveal (fade-in) ─── */

.articles-page [data-fade-in]:not(.is-visible) {
  opacity: 0;
  transform: translateY(8px);
}

.articles-page.js [data-fade-in] {
  transition: opacity 220ms ease, transform 220ms ease;
}

.articles-page [data-fade-in][class~="is-visible"] {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Breakpoints ─── */

@media (max-width: 640px) {
  .articles-page .article-prose .article-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .articles-page .article-prose .article-table-wrap table {
    min-width: 560px;
  }
}

@media (min-width: 760px) {
  .articles-page .article-shell {
    padding-block: 64px 96px;
  }

  .articles-page .article-answer,
  .articles-page .article-takeaways {
    padding: 30px 34px;
  }

  .articles-page .article-prose {
    font-size: 1.08rem;
  }

  .articles-page .article-prose p {
    text-align: justify;
    hyphens: auto;
  }

  .articles-page .article-related-grid {
    gap: 28px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .articles-page .journal-head-row {
    padding-block: 96px 56px;
  }

  .articles-page .journal-band {
    padding-block: 72px 88px;
  }

  .articles-page .journal-grid {
    gap: 28px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ─── Reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
  .articles-page .cta-button,
  .articles-page .journal-cta,
  .articles-page .cta-button::before,
  .articles-page .journal-cta::before {
    transition: none;
  }

  .articles-page .cta-button:hover,
  .articles-page .cta-button:focus-visible,
  .articles-page .journal-cta:hover,
  .articles-page .journal-cta:focus-visible {
    background: var(--gold, #b8964e);
    color: var(--black, #0a0a0a);
  }

  .articles-page .cta-button:hover::before,
  .articles-page .cta-button:focus-visible::before,
  .articles-page .journal-cta:hover::before,
  .articles-page .journal-cta:focus-visible::before {
    transform: none;
  }

  .articles-page [data-fade-in] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .articles-page .article-breadcrumb a,
  .articles-page .article-prose a,
  .articles-page .article-related-card h3 a,
  .articles-page .journal-card h3 a,
  .articles-page .journal-card .cta {
    transition: none;
  }
}
