/* Long-form content pages (theory article, subtype pages).
   Layered over theme.css + polish.css; reuses the --atlas-* tokens defined there. */

.skip-link { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 12px; background: var(--atlas-paper); color: var(--atlas-ink); }
.skip-link:focus { top: 12px; }
.reading-section { margin: 44px auto; }
.reading-section h2 { margin: 8px 0 12px; font-size: clamp(1.4rem, 3vw, 2rem); }
.reading-intro { max-width: 760px; color: var(--atlas-ink-soft); margin-bottom: 24px; }
.reading-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.reading-card { display: block; padding: 26px; border: 1px solid var(--atlas-line); border-radius: var(--atlas-radius-md); background: var(--atlas-paper); color: var(--atlas-ink); text-decoration: none; box-shadow: var(--atlas-shadow-soft); }
.reading-card:hover { color: var(--atlas-forest); border-color: var(--atlas-sage); }
.reading-card h3, .reading-card strong { display: block; margin: 10px 0; font-size: 1.15rem; }
.reading-card p { color: var(--atlas-ink-soft); margin: 12px 0 20px; }
.reading-card > span:last-child { color: var(--atlas-forest); font-weight: 700; }
.related-subtypes { margin: 42px 0; }
.result-reading-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 24px 0; }
.result-reading-links a { color: var(--atlas-forest); font-weight: 700; text-underline-offset: 4px; }
.enneagram-page .result-reading-links a { color: #e4bd6c; }
.enneagram-page .result-reading-links a:hover { color: #fff0ca; }
.content-page .site-nav-inner { flex-wrap: wrap; padding: 16px 0; }
.article-body { min-width: 0; overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; }
@media (max-width: 600px) {
  .reading-grid { grid-template-columns: minmax(0, 1fr); }
  .site-actions { flex-wrap: wrap; justify-content: flex-end; }
  .content-page .nav-links { flex-wrap: wrap; }
  .reading-card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

html:lang(zh-Hant) body,
html:lang(zh-Hant) h1,
html:lang(zh-Hant) h2,
html:lang(zh-Hant) h3,
html:lang(zh-Hant) h4 {
  font-family: 'Noto Sans TC', 'Noto Sans SC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-link {
  color: var(--atlas-ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--atlas-forest);
  text-decoration: underline;
  text-underline-offset: 6px;
}

.article-page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

/* Hero */
.article-hero {
  position: relative;
  padding: clamp(34px, 6vw, 64px);
  overflow: hidden;
  border-radius: var(--atlas-radius-lg);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.09), transparent 45%),
    var(--atlas-ink);
  box-shadow: var(--atlas-shadow);
  color: var(--atlas-paper);
}

.article-hero::after {
  position: absolute;
  right: -120px;
  bottom: -220px;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.article-hero > * {
  position: relative;
  z-index: 1;
}

.breadcrumb-trail {
  display: flex;
  margin: 0 0 22px;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 253, 248, 0.6);
  font-size: 0.78rem;
  list-style: none;
}

.breadcrumb-trail li + li::before {
  margin-right: 8px;
  content: "›";
}

.breadcrumb-trail a {
  color: rgba(255, 253, 248, 0.78);
  text-decoration: none;
}

.breadcrumb-trail a:hover {
  color: white;
  text-decoration: underline;
}

.article-hero h1 {
  max-width: 880px;
  margin: 0;
  font-family: Georgia, 'Noto Serif TC', 'Noto Serif SC', serif;
  font-size: clamp(1.9rem, 4.6vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.28;
}

.article-lede {
  max-width: 760px;
  margin: 22px 0 0;
  color: rgba(255, 253, 248, 0.78);
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.9;
}

.article-meta {
  display: flex;
  margin: 28px 0 0;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.article-meta li {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 253, 248, 0.8);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Layout */
.article-layout {
  display: grid;
  margin-top: 34px;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: start;
  gap: 44px;
}

.article-toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  padding: 22px 20px;
  overflow-y: auto;
  border: 1px solid var(--atlas-line);
  border-radius: var(--atlas-radius-md);
  background: rgba(255, 253, 248, 0.82);
}

.article-toc h2 {
  margin: 0 0 12px;
  color: #7b867f;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.article-toc ol {
  display: grid;
  gap: 2px;
  list-style: none;
}

.article-toc a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--atlas-ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
  text-decoration: none;
}

.article-toc a:hover {
  background: var(--atlas-mint);
  color: var(--atlas-forest);
}

/* Body typography */
.article-body {
  min-width: 0;
  max-width: 800px;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid var(--atlas-line);
  border-radius: var(--atlas-radius-lg);
  background: var(--atlas-paper);
  box-shadow: var(--atlas-shadow-soft);
  color: #2c3d36;
  font-size: 1.05rem;
  line-height: 1.95;
}

.article-body section + section {
  margin-top: 56px;
  padding-top: 44px;
  border-top: 1px solid var(--atlas-line);
}

.article-body h2 {
  margin: 0 0 22px;
  color: var(--atlas-ink);
  font-family: Georgia, 'Noto Serif TC', 'Noto Serif SC', serif;
  font-size: clamp(1.5rem, 3.2vw, 1.95rem);
  font-weight: 600;
  line-height: 1.4;
  scroll-margin-top: 24px;
}

.article-body h3 {
  margin: 38px 0 14px;
  color: var(--atlas-ink);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.5;
  scroll-margin-top: 24px;
}

.article-body h4 {
  margin: 22px 0 8px;
  color: var(--atlas-forest);
  font-size: 0.98rem;
  font-weight: 700;
}

.article-body p {
  margin: 0 0 18px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 18px;
  padding-left: 1.5em;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body a {
  color: var(--atlas-forest);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.article-body strong {
  color: var(--atlas-ink);
  font-weight: 700;
}

.article-body .fn {
  font-family: Inter, 'Noto Sans TC', sans-serif;
  font-weight: 700;
  white-space: nowrap;
}

.callout {
  margin: 26px 0;
  padding: 20px 24px;
  border: 1px solid rgba(212, 163, 79, 0.4);
  border-left: 4px solid var(--atlas-gold);
  border-radius: var(--atlas-radius-sm);
  background: rgba(255, 250, 236, 0.8);
  color: #5d5a4c;
  font-size: 0.95rem;
  line-height: 1.85;
}

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

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

/* Type cards */
.type-card {
  margin: 28px 0;
  padding: 26px 28px;
  border: 1px solid var(--atlas-line);
  border-radius: var(--atlas-radius-md);
  background: #fbf8f0;
}

.type-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.type-badge {
  display: grid;
  width: 48px;
  height: 48px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--atlas-forest);
  color: var(--atlas-paper);
  font-family: Georgia, serif;
  font-size: 1.4rem;
}

.type-card.center-heart .type-badge {
  background: var(--atlas-coral);
}

.type-card.center-head .type-badge {
  background: var(--atlas-gold);
  color: var(--atlas-ink);
}

.type-card h3 {
  margin: 0;
}

.type-tags {
  display: flex;
  margin: 16px 0 18px;
  padding: 0;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.article-body .type-tags li {
  margin: 0;
  padding: 5px 12px;
  border: 1px solid var(--atlas-line);
  border-radius: 999px;
  background: var(--atlas-paper);
  color: var(--atlas-ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
}

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

/* Tables */
.table-wrap {
  margin: 26px 0;
  overflow-x: auto;
  border: 1px solid var(--atlas-line);
  border-radius: var(--atlas-radius-sm);
}

.article-body table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.7;
}

.article-body th,
.article-body td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--atlas-line);
  text-align: left;
  vertical-align: top;
}

.article-body thead th {
  background: var(--atlas-mint);
  color: var(--atlas-ink);
  font-weight: 700;
  white-space: nowrap;
}

.article-body tbody th {
  background: rgba(219, 232, 223, 0.35);
  color: var(--atlas-ink);
  font-weight: 700;
}

.article-body tbody tr:last-child th,
.article-body tbody tr:last-child td {
  border-bottom: 0;
}

.cell-note {
  display: block;
  color: #6b786f;
  font-size: 0.82rem;
}

/* Figure */
.article-figure {
  margin: 30px 0;
  text-align: center;
}

.article-figure svg {
  width: min(460px, 100%);
  height: auto;
}

.article-figure figcaption {
  margin-top: 10px;
  color: #6b786f;
  font-size: 0.84rem;
  line-height: 1.7;
}

.enn-ring { fill: none; stroke: var(--atlas-line); stroke-width: 1.5; }
.enn-triangle { fill: rgba(212, 163, 79, 0.08); stroke: var(--atlas-gold); stroke-width: 2.5; stroke-linejoin: round; }
.enn-hexad { fill: none; stroke: var(--atlas-forest); stroke-width: 2; stroke-linejoin: round; opacity: 0.75; }
.enn-node { stroke: var(--atlas-paper); stroke-width: 3; }
.enn-gut { fill: var(--atlas-forest); }
.enn-heart { fill: var(--atlas-coral); }
.enn-head { fill: var(--atlas-gold); }
.enn-num { fill: var(--atlas-paper); font-family: Georgia, serif; font-size: 17px; text-anchor: middle; dominant-baseline: central; }
.enn-num.on-light { fill: var(--atlas-ink); }
.enn-label { fill: var(--atlas-ink-soft); font-family: Inter, sans-serif; font-size: 14px; font-weight: 700; dominant-baseline: central; }

/* FAQ + references */
.faq-item + .faq-item {
  margin-top: 30px;
}

.faq-item h3 {
  margin-top: 0;
}

.reference-list {
  font-size: 0.92rem;
  line-height: 1.8;
}

.reference-list li {
  margin-bottom: 10px;
}

/* Footer */
.site-footer {
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--atlas-line);
  color: #6b786f;
  font-size: 0.84rem;
  line-height: 1.8;
}

.site-footer-links {
  display: flex;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
}

.site-footer a {
  color: var(--atlas-ink-soft);
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--atlas-forest);
  text-decoration: underline;
}

@media (max-width: 980px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .article-toc {
    position: static;
    max-height: none;
  }

  .article-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-body {
    max-width: none;
  }
}

@media (max-width: 600px) {
  .article-page {
    width: calc(100% - 24px);
    padding-top: 16px;
  }

  .site-nav-inner {
    width: calc(100% - 24px);
  }

  .nav-links {
    gap: 14px;
  }

  .brand-copy small {
    display: none;
  }

  .article-toc ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-body {
    font-size: 1rem;
  }

  .type-card {
    padding: 20px 18px;
  }
}
