/* Article reading navigation only; article content and card business data are unchanged. */
.article-detail .article-content :is(h2, h3, h4) {
  scroll-margin-top: var(--article-reader-offset, 110px);
}

/* Desktop: a fixed-size reading companion, never a full table of contents. */
.article-chapter-dock {
  --article-section-progress: 0%;
  position: sticky;
  inset-block-start: var(--article-reader-offset, 110px);
  align-self: start;
  min-width: 0;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(15, 34, 74, .06);
}
.article-chapter-body {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  height: 198px;
}
.article-chapter-progress {
  position: relative;
  min-height: 0;
}
.article-chapter-progress-line,
.article-chapter-progress-fill {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 50%;
  width: 1px;
  border-radius: 999px;
  transform: translateX(-50%);
}
.article-chapter-progress-line {
  inset-block-end: 0;
  background: color-mix(in srgb, var(--line) 78%, transparent);
}
.article-chapter-progress-fill {
  height: var(--article-section-progress);
  background: color-mix(in srgb, var(--brand-900) 54%, var(--line));
  transition: height 180ms ease;
}
.article-chapter-progress-node {
  position: absolute;
  inset-block-start: var(--article-node-position);
  inset-inline-start: 50%;
  width: 5px;
  height: 5px;
  border: 1px solid color-mix(in srgb, var(--muted) 62%, transparent);
  border-radius: 50%;
  background: var(--card);
  transform: translate(-50%, -50%);
  transition: width 160ms ease, height 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
html[dir="rtl"] .article-chapter-progress-line,
html[dir="rtl"] .article-chapter-progress-fill,
html[dir="rtl"] .article-chapter-progress-node {
  transform: translate(50%, -50%);
}
html[dir="rtl"] .article-chapter-progress-line,
html[dir="rtl"] .article-chapter-progress-fill {
  transform: translateX(50%);
}
.article-chapter-progress-node.is-complete {
  width: 6px;
  height: 6px;
  border-color: color-mix(in srgb, var(--brand-900) 58%, var(--muted));
  background: color-mix(in srgb, var(--brand-900) 58%, var(--muted));
}
.article-chapter-progress-node.is-current {
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 2px solid var(--card);
  background: var(--brand-900);
  box-shadow: 0 0 0 1px var(--brand-900);
}
.article-chapter-context {
  display: grid;
  grid-template-rows: 50px 90px 50px;
  gap: 4px;
}
.article-chapter-neighbor,
.article-chapter-current {
  position: relative;
  min-width: 0;
}
.article-chapter-neighbor {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 140ms ease;
}
.article-chapter-neighbor[hidden] {
  display: flex;
  visibility: hidden;
  pointer-events: none;
}
.article-chapter-neighbor:hover,
.article-chapter-neighbor:focus-visible {
  color: var(--text);
}
.article-chapter-current {
  display: flex;
  align-items: center;
  color: var(--text);
}
.article-chapter-current strong {
  display: -webkit-box;
  color: var(--brand-900);
  font-size: 17.5px;
  font-weight: 850;
  line-height: 1.65;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.article-chapter-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: var(--soft);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.article-chapter-open:hover { color: var(--brand-900); }

/* Shared full navigator: compact dialog on desktop, bottom sheet on mobile. */
.article-section-navigator {
  position: fixed;
  inset: 50% auto auto 50%;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(430px, calc(100vw - 40px));
  max-height: min(70svh, 620px);
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(8, 20, 40, .2);
  overflow: hidden;
  transform: translate(-50%, -50%);
}
.article-section-navigator[open] { display: grid; }
.article-section-navigator::backdrop { background: rgba(8, 20, 40, .42); }
.article-section-navigator-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.article-section-navigator-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}
.article-section-navigator-head button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 24px;
  cursor: pointer;
}
.article-section-navigator nav {
  position: relative;
  min-height: 0;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.article-navigator-link {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.article-navigator-link:hover { background: var(--soft); color: var(--text); }
.article-navigator-node {
  display: grid;
  width: 8px;
  height: 8px;
  margin-inline: auto;
  place-items: center;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: var(--card);
  color: var(--card);
  font-size: 10px;
  line-height: 1;
}
.article-navigator-link.is-complete {
  color: color-mix(in srgb, var(--muted) 86%, transparent);
}
.article-navigator-link.is-complete .article-navigator-node {
  width: 17px;
  height: 17px;
  border-color: color-mix(in srgb, var(--brand-900) 60%, var(--muted));
  background: color-mix(in srgb, var(--brand-900) 60%, var(--muted));
}
.article-navigator-link.is-complete .article-navigator-node::after {
  content: '\2713';
}
.article-navigator-link.is-current {
  border-inline-start: 2px solid var(--brand-900);
  background: var(--soft);
  color: var(--brand-900);
  font-weight: 800;
}
.article-navigator-link.is-current .article-navigator-node {
  width: 13px;
  height: 13px;
  border: 2px solid var(--card);
  background: var(--brand-900);
  box-shadow: 0 0 0 1px var(--brand-900);
}
.article-chapter-neighbor:focus-visible,
.article-chapter-open:focus-visible,
.article-section-pill:focus-visible,
.article-navigator-link:focus-visible,
.article-section-navigator-head button:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

.article-section-pill { display: none; }
.article-detail .public-breadcrumbs {
  max-width: 1040px;
  margin: 0 auto clamp(26px, 3vw, 38px);
  overflow-wrap: anywhere;
}
.article-detail-header {
  max-width: 920px;
  margin: 0 auto clamp(28px, 4vw, 40px);
}
.article-detail-header h1 {
  margin-bottom: 18px;
  font-size: clamp(36px, 5.2vw, 60px);
  line-height: 1.14;
  text-wrap: balance;
}
.article-detail-header .article-detail-excerpt {
  max-width: 780px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.8;
  text-wrap: pretty;
}
.article-detail-information {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 22px;
  max-width: 860px;
  margin-inline: auto;
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
}
.article-detail-byline,
.article-detail-facts,
.article-detail-fact {
  display: flex;
  align-items: center;
}
.article-detail-byline {
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.article-detail-facts {
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.article-detail-fact {
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.article-detail-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  color: currentColor;
}
.article-detail-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.article-hero-image {
  width: min(100%, 1040px);
  aspect-ratio: 16 / 8.5;
  margin: 0 auto 24px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 24px;
  background: var(--soft);
  box-shadow: 0 16px 40px rgba(15, 34, 74, .09);
}
.article-hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-post-content {
  width: min(100%, 1040px);
  margin: clamp(54px, 7vw, 82px) auto 0;
}
.article-post-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 36%);
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--card) 92%, var(--soft));
  overflow: hidden;
}
.article-feedback-placeholder {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 86px;
  padding: 18px 24px;
}
.article-feedback-placeholder > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.article-feedback-placeholder h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}
.article-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.article-feedback-actions button {
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.article-feedback-actions button:is(:hover, :focus-visible),
.article-feedback-actions button.is-active {
  border-color: color-mix(in srgb, var(--brand-500) 60%, var(--line));
  color: var(--brand-900);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 12%, transparent);
}
.article-feedback-actions button:disabled { cursor: wait; opacity: .65; }
.article-engagement-toolbar {
  border-inline-start: 1px solid var(--line);
}
.article-engagement-toolbar ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.article-engagement-toolbar li {
  display: grid;
  min-width: 0;
}
.article-engagement-toolbar li:not([hidden]) + li:not([hidden]) { border-inline-start: 1px solid var(--line); }
.article-engagement-item {
  display: grid;
  min-width: 0;
  min-height: 86px;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 10px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.article-engagement-item--stat { cursor: default; }
.article-engagement-item strong { color: var(--text); font-size: 12px; }
.article-engagement-item:is(button):is(:hover, :focus-visible),
.article-engagement-item.is-active { color: var(--brand-900); background: color-mix(in srgb, var(--brand-500) 7%, transparent); }
.article-engagement-item:is(button):focus-visible { outline: 2px solid var(--brand-500); outline-offset: -3px; }
.article-engagement-item:disabled { cursor: wait; opacity: .65; }
.article-engagement-item .article-detail-icon {
  width: 22px;
  height: 22px;
  color: var(--brand-900);
}
.article-comments-placeholder {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.article-comments-placeholder-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.article-comments-placeholder-head .article-detail-icon {
  color: var(--brand-900);
}
.article-comments-placeholder h2 {
  margin: 0;
  font-size: 18px;
}
.article-comments-intro {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.article-comments-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
}
.article-comment {
  padding: 16px 0;
  border-block-start: 1px solid var(--line);
}
.article-comment > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.article-comment strong { color: var(--text); font-size: 13px; }
.article-comment time { color: var(--muted); font-size: 11px; }
.article-comment p {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-wrap;
}
.article-comments-empty {
  margin: 0;
  padding: 14px 0;
  border-block-start: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.article-comment-form {
  display: grid;
  gap: 18px;
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--card) 94%, var(--soft));
}
.article-comment-identity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.article-comment-form label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
.article-comment-form :is(input, textarea) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.article-comment-form input {
  min-height: 44px;
  padding: 9px 12px;
}
.article-comment-form textarea {
  min-height: 132px;
  padding: 12px;
  line-height: 1.7;
  resize: vertical;
}
.article-comment-form :is(input, textarea):focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 16%, transparent);
}
.article-comment-form textarea::placeholder { color: var(--muted); }
.article-comment-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.article-comment-submit small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.article-comment-submit .btn {
  flex: 0 0 auto;
  min-width: 132px;
}
.article-card--related {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.article-card--related:hover,
.article-card--related:focus-within {
  border-color: color-mix(in srgb, var(--brand-500) 38%, var(--line));
  box-shadow: 0 12px 30px rgba(15, 34, 74, .08);
  transform: translateY(-2px);
}
.article-card--related .article-img {
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
  border-radius: 12px;
}
.article-card--related h3 {
  margin: 0;
  color: var(--brand-900);
  font-size: 17px;
  line-height: 1.55;
}
.article-card--related .article-card-compact-meta {
  position: static;
  width: auto;
  max-width: none;
  margin-top: 9px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  opacity: 1;
  transform: none;
}

@media (max-width: 992px) {
  .article-layout.article-layout--reader { grid-template-columns: minmax(0, 1fr); }
  .article-chapter-dock { display: none; }
  .article-section-pill:not([hidden]) {
    --article-section-progress: 0%;
    position: fixed;
    z-index: 90;
    inset-block-end: calc(14px + env(safe-area-inset-bottom));
    inset-inline: 0;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: min(420px, calc(100vw - 28px));
    min-height: 54px;
    margin-inline: auto;
    padding: 8px 14px 11px;
    border: 1px solid color-mix(in srgb, #fff 18%, transparent);
    border-radius: 999px;
    background: var(--brand-900);
    color: #fff;
    font: inherit;
    box-shadow: 0 10px 30px rgba(8, 20, 40, .24);
    cursor: pointer;
  }
  .article-section-pill-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
    text-align: start;
  }
  .article-section-pill-copy small {
    color: color-mix(in srgb, #fff 68%, transparent);
    font-size: 10px;
    font-weight: 650;
    line-height: 1.3;
  }
  .article-section-pill [data-article-pill-title] {
    display: block;
    min-width: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .article-section-pill-list {
    color: color-mix(in srgb, #fff 82%, transparent);
    font-size: 15px;
    line-height: 1;
  }
  .article-section-pill-progress {
    position: absolute;
    inset-inline: 14px;
    inset-block-end: 5px;
    height: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, #fff 18%, transparent);
    overflow: hidden;
  }
  .article-section-pill-progress span {
    display: block;
    width: var(--article-section-progress);
    height: 100%;
    border-radius: inherit;
    background: color-mix(in srgb, #fff 78%, transparent);
    transition: width 180ms ease;
  }
  .article-layout--reader .article-content { padding-block-end: 86px; }
  .article-section-navigator {
    inset: auto 0 0;
    width: 100%;
    max-width: 640px;
    max-height: min(76svh, 640px);
    margin: 0 auto;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    transform: none;
  }
  .article-section-navigator nav { padding: 8px 12px 12px; }
  .article-navigator-link { min-height: 48px; font-size: 14px; }
}

@media (max-width: 720px) {
  .article-detail .public-breadcrumbs { margin-bottom: 24px; }
  .article-detail-header { margin-bottom: 26px; }
  .article-detail-header h1 {
    margin-bottom: 14px;
    font-size: clamp(31px, 9vw, 42px);
  }
  .article-detail-header .article-detail-excerpt {
    margin-bottom: 20px;
    font-size: 17px;
    line-height: 1.75;
  }
  .article-detail-information {
    align-items: stretch;
    gap: 12px;
    padding-top: 15px;
  }
  .article-detail-byline,
  .article-detail-facts { justify-content: center; }
  .article-hero-image {
    aspect-ratio: 4 / 3;
    margin-bottom: 18px;
    border-radius: 16px;
  }
  .article-post-content {
    margin-top: 48px;
  }
  .article-post-actions {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 13px;
  }
  .article-feedback-placeholder {
    min-height: 78px;
    padding: 16px 18px;
  }
  .article-engagement-toolbar {
    border-block-start: 1px solid var(--line);
    border-inline-start: 0;
  }
  .article-engagement-item {
    min-height: 64px;
    padding-inline: 3px;
    font-size: 10px;
  }
  .article-engagement-item .article-detail-icon {
    width: 20px;
    height: 20px;
  }
  .article-comments-placeholder {
    margin-top: 28px;
    padding-top: 20px;
  }
  .article-comment-form {
    gap: 16px;
    margin-top: 16px;
    padding: 16px;
    border-radius: 13px;
  }
  .article-comment-identity { grid-template-columns: minmax(0, 1fr); }
  .article-comment-submit {
    align-items: stretch;
    flex-direction: column;
  }
  .article-comment-submit .btn { width: 100%; }
  .article-card--related .article-card-link {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 5px 12px;
  }
  .article-card--related.article-card--without-image .article-card-link {
    grid-template-columns: minmax(0, 1fr);
  }
  .article-card--related .article-img {
    grid-row: 1 / span 2;
    aspect-ratio: 1;
    margin: 0;
  }
  .article-card--related h3 { font-size: 15px; }
  .article-card--related .article-card-compact-meta { margin-top: 0; }
}
