/* Editorial article reading layout — complements doc.css collection shell */

.article-page {
  background:
    radial-gradient(circle at 92% 4%, rgba(138, 43, 226, 0.1), transparent 28%),
    radial-gradient(circle at 6% 96%, rgba(255, 255, 255, 0.04), transparent 32%),
    var(--ws-bg-base, #0f0f10);
  color: var(--ws-text-primary, #ececf1);
}

html[data-theme="light"] .article-page {
  background:
    radial-gradient(circle at 92% 4%, rgba(138, 43, 226, 0.06), transparent 28%),
    radial-gradient(circle at 6% 96%, rgba(15, 15, 16, 0.03), transparent 32%),
    var(--ws-bg-base, #f7f7f8);
  color: var(--ws-text-primary, #17171a);
}

/* Do not use padding shorthand here — it would override .site-main
   padding-top: var(--ws-nav-height) from layout.css (homepage contract). */
.article-main.site-main {
  padding-top: var(--ws-nav-height);
  padding-bottom: 4rem;
}

.article-shell {
  max-width: 42rem;
  padding-top: clamp(1.25rem, 3vw, 2.5rem);
}

.article-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--ws-text-muted, #a5a5b4);
}

.article-breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.55rem;
  opacity: 0.55;
}

.article-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.article-breadcrumb a:hover,
.article-breadcrumb a:focus-visible {
  color: var(--ws-link, #9ec5ff);
  text-decoration: underline;
}

.article-header {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.article-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ws-accent-soft, #d6b8ff);
}

html[data-theme="light"] .article-kicker {
  color: #6b21a8;
}

.article-title {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.article-dek {
  margin: 0;
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
  line-height: 1.65;
  color: var(--ws-text-secondary, #cfcfda);
}

html[data-theme="light"] .article-dek {
  color: #4b4b57;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.85rem;
  font-size: 0.92rem;
  color: var(--ws-text-muted, #a5a5b4);
}

.article-author {
  color: var(--ws-link, #9ec5ff);
  font-weight: 600;
  text-decoration: none;
}

html[data-theme="light"] .article-author {
  color: #5b21b6;
}

.article-author:hover,
.article-author:focus-visible {
  text-decoration: underline;
}

.article-cover {
  margin: 0 0 1rem;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  place-items: center;
  min-width: 0;
}

html[data-theme="light"] .article-cover {
  border-color: rgba(15, 15, 16, 0.08);
  background: rgba(15, 15, 16, 0.03);
}

.article-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(42dvh, 26rem);
  object-fit: contain;
  object-position: center;
}

.article-toc {
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="light"] .article-toc {
  border-color: rgba(15, 15, 16, 0.08);
  background: rgba(15, 15, 16, 0.03);
}

.article-toc__title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-toc ol {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
}

.article-toc a {
  color: inherit;
  text-decoration: none;
}

.article-toc a:hover,
.article-toc a:focus-visible {
  color: var(--ws-link, #9ec5ff);
  text-decoration: underline;
}

.article-toc__item--nested {
  list-style-type: circle;
}

.article-body {
  margin-bottom: 2rem;
}

.article-body :is(h2, h3, h4)[id] {
  scroll-margin-top: calc(var(--ws-nav-height, 5.5rem) + 0.75rem);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.article-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(185, 131, 255, 0.35);
  background: rgba(138, 43, 226, 0.12);
  font-size: 0.78rem;
  font-weight: 600;
}

html[data-theme="light"] .article-tag {
  border-color: rgba(107, 33, 168, 0.25);
  background: rgba(107, 33, 168, 0.08);
}

.article-sources {
  margin: 0 0 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .article-sources {
  border-top-color: rgba(15, 15, 16, 0.08);
}

.article-sources h2,
.article-related h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.article-sources ul,
.article-related__list {
  margin: 0;
  padding-left: 1.2rem;
}

.article-sources__publisher {
  margin-left: 0.35rem;
  opacity: 0.75;
  font-size: 0.88rem;
}

.article-related {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .article-related {
  border-top-color: rgba(15, 15, 16, 0.08);
}

.article-related__list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.article-related__link {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  text-decoration: none;
  color: inherit;
}

html[data-theme="light"] .article-related__link {
  border-color: rgba(15, 15, 16, 0.08);
  background: rgba(15, 15, 16, 0.02);
}

.article-related__link:hover,
.article-related__link:focus-visible {
  border-color: rgba(158, 197, 255, 0.45);
}

.article-related__title {
  font-weight: 700;
  line-height: 1.35;
}

.article-related__summary {
  font-size: 0.92rem;
  color: var(--ws-text-muted, #a5a5b4);
  line-height: 1.55;
}

.article-site-footer {
  margin-top: auto;
  border-top: 1px solid var(--ws-border-subtle, var(--color-divider, #2a2a2b));
  background: var(--ws-bg-shell, var(--color-panel, #1a1a1b));
}

.article-site-footer__inner {
  width: min(100% - 1.5rem, 88rem);
  margin: 0 auto;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 1.4rem 0;
  text-align: center;
}

.article-site-footer img {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
}

.article-site-footer p {
  margin: 0;
  color: var(--ws-text-muted, var(--color-muted-text, #caced3));
  font-size: 0.85rem;
}

.article-site-footer__links {
  display: flex;
  gap: 0.85rem;
}

.article-site-footer__links a {
  color: var(--ws-text-secondary, var(--color-text, #e5e7eb));
  font-size: 1.15rem;
}

.article-site-footer__links a:hover,
.article-site-footer__links a:focus-visible {
  color: var(--ws-accent, var(--color-primary, #8a2be2));
}

@media (min-width: 1024px) {
  .article-site-footer__inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    text-align: left;
    justify-items: start;
  }

  .article-site-footer__inner p {
    justify-self: center;
  }

  .article-site-footer__links {
    justify-self: end;
  }
}

/* Collection page (article index) editorial list */
.article-index-page .article-index-header {
  margin-bottom: 2rem;
}

.article-index-featured {
  margin-bottom: 2rem;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="light"] .article-index-featured {
  border-color: rgba(15, 15, 16, 0.08);
  background: rgba(15, 15, 16, 0.02);
}

.article-feed {
  display: grid;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-feed__item {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

html[data-theme="light"] .article-feed__item {
  border-bottom-color: rgba(15, 15, 16, 0.07);
}

.article-feed__link {
  display: grid;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
}

.article-feed__link--with-media {
  grid-template-columns: 88px 1fr;
  align-items: start;
  gap: 0.85rem;
}

.article-feed__media {
  border-radius: 0.65rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .article-feed__media {
  border-color: rgba(15, 15, 16, 0.08);
}

.article-feed__thumb {
  display: block;
  width: 88px;
  height: 66px;
  object-fit: cover;
}

.article-index-list__title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ws-text-muted, #a5a5b4);
}

.article-index-featured__eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ws-accent-soft, #d6b8ff);
}

.article-index-featured__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.25;
}

.article-index-featured__title a {
  color: inherit;
  text-decoration: none;
}

.article-index-featured__title a:hover,
.article-index-featured__title a:focus-visible {
  color: var(--ws-link, #9ec5ff);
}

.article-index-featured__summary {
  margin: 0;
  line-height: 1.65;
  color: var(--ws-text-secondary, #cfcfda);
}

html[data-theme="light"] .article-index-featured__summary {
  color: #4b4b57;
}

.article-feed__link:hover .article-feed__title,
.article-feed__link:focus-visible .article-feed__title {
  color: var(--ws-link, #9ec5ff);
}

.article-feed__title {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
  line-height: 1.3;
}

.article-feed__summary {
  margin: 0;
  color: var(--ws-text-secondary, #cfcfda);
  line-height: 1.65;
}

html[data-theme="light"] .article-feed__summary {
  color: #4b4b57;
}

.article-feed__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.86rem;
  color: var(--ws-text-muted, #a5a5b4);
}

@media (max-width: 639px) {
  .article-shell {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-feed__link,
  .article-related__link,
  .article-breadcrumb a,
  .article-author {
    transition: none;
  }
}
