/*
  Article reading layout and author profile.

  Reading this as: an editorial article and author profile in the existing
  directory reference language (ivory canvas, charcoal reading text, one
  restrained vermilion accent, Bricolage display type),
  dial ENERGY 2 / RHYTHM 2 / MOTION 1.

  The reading column is the focal point: 18px prose in a 740px measure with a
  220px contents rail on wide desktop, one column with a native "On this page"
  disclosure on phones, and hover/focus motion only.

  Loaded after content.css and scoped under .article-view or .author-page.
  Accent text uses --accent-text, the accent meant for text on a surface;
  --accent-ink is the dark ink drawn on accent surfaces on public pages.
*/

.article-view .article-wrap {
  width: min(100% - 32px, 1080px);
}

.article-view .article-header {
  width: min(100%, 820px);
  padding-bottom: 26px;
}

.article-view .article-header h1 {
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.06;
}

.article-view .content-detail-lede {
  max-width: 62ch;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: 16px 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.article-byline__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-byline a {
  color: var(--ink);
  font-weight: 650;
}

.article-byline a:hover {
  color: var(--accent-text, var(--accent-ink));
}

.article-byline time {
  font-variant-numeric: tabular-nums;
}

/* The whole cover stays visible at every width, so its height follows the
   column instead of a fixed cap and nothing is cropped. */
.article-view .article-feature {
  max-height: none;
  margin-top: 24px;
}

.article-view .article-feature img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

.article-view .article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 30px;
}

.article-view .article-main {
  min-width: 0;
  width: 100%;
  max-width: 740px;
  justify-self: center;
}

.article-view .article-prose {
  max-width: 100%;
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.75;
}

.article-view .article-prose > :first-child {
  margin-top: 0;
}

.article-view .article-prose h2,
.article-view .article-prose h3,
.article-view .article-prose h4 {
  scroll-margin-top: 96px;
}

.article-view .article-prose h2 {
  margin: 2.4em 0 0.6em;
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
}

.article-view .article-prose h3 {
  margin: 2em 0 0.5em;
  font-size: clamp(1.25rem, 2vw, 1.45rem);
}

.article-view .article-prose h4 {
  margin: 1.7em 0 0.4em;
  font-size: 1.12rem;
}

.article-view .article-prose p {
  margin: 1.1em 0;
}

.article-view .article-prose a {
  color: var(--accent-text, var(--accent-ink));
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.article-view .article-prose a:hover {
  text-decoration-thickness: 2px;
}

.article-view .article-prose ul,
.article-view .article-prose ol {
  margin: 1.1em 0;
  padding-left: 1.4em;
}

.article-view .article-prose li {
  margin: 0.45em 0;
}

.article-view .article-prose li > ul,
.article-view .article-prose li > ol {
  margin: 0.45em 0;
}

.article-view .article-prose blockquote {
  margin: 1.9em 0;
  padding: 0.2em 0 0.2em 22px;
  border-left: 3px solid var(--accent);
  color: var(--ink-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.article-view .article-prose blockquote > :first-child {
  margin-top: 0;
}

.article-view .article-prose blockquote > :last-child {
  margin-bottom: 0;
}

.article-view .article-prose code {
  padding: 0.12em 0.4em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-sunken);
  font-family: var(--mono);
  font-size: 0.9em;
}

.article-view .article-prose pre {
  margin: 1.9em 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-sunken);
  overflow-x: auto;
  font: 0.9rem/1.6 var(--mono);
}

.article-view .article-prose pre code {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
}

.article-view .article-prose hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid var(--line-strong);
}

.article-view .article-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.article-view .article-prose figure {
  margin: 1.8em 0;
}

.article-view .article-prose figcaption {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* The renderer wraps article tables in .article-table-scroll, which owns the
   horizontal scroll; a bare table from an older body still scrolls through
   content.css. */
.article-view .article-prose :where(
  .article-table-scroll,
  .table-scroll,
  .content-table-scroll,
  .content-facts-scroll
) {
  max-width: 100%;
  margin: 1.9em 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  scrollbar-width: thin;
}

.article-view .article-prose :where(
  .article-table-scroll,
  .table-scroll,
  .content-table-scroll,
  .content-facts-scroll
) > table {
  display: table;
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
}

.article-view .article-prose :where(
  .article-table-scroll,
  .table-scroll,
  .content-table-scroll,
  .content-facts-scroll
):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.article-view .article-prose table {
  border-collapse: collapse;
}

.article-view .article-prose th,
.article-view .article-prose td {
  padding: 11px 13px;
  min-width: 7rem;
  overflow-wrap: normal;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-view .article-prose thead th {
  background: var(--surface-sunken);
  font-size: 0.82rem;
  font-weight: 700;
}

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

.article-view .article-prose tbody tr:nth-child(even) th,
.article-view .article-prose tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-sunken) 42%, var(--surface));
}

.article-toc-details {
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.article-toc-details > summary {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 12px 16px;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.article-toc-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.article-toc-details > nav {
  padding: 8px 16px 14px;
}

.article-toc__list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-toc__list a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
}

.article-toc__list a:hover {
  color: var(--accent-text, var(--accent-ink));
}

.article-toc {
  display: none;
  margin-bottom: 20px;
}

.article-toc__title {
  margin: 0 0 10px;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

@media (min-width: 1100px) {
  .article-view .article-layout {
    grid-template-columns: minmax(0, 740px) 220px;
    justify-content: center;
    gap: 40px;
  }

  .article-view .article-layout--single {
    grid-template-columns: minmax(0, 740px);
    justify-content: center;
  }

  .article-toc-details {
    display: none;
  }

  .article-toc {
    display: block;
  }

  .article-view .article-aside {
    align-self: stretch;
    padding-top: 6px;
  }
}

/* Catalogue descriptions repeat across rows, so the article trims them to
   three lines here. The full text stays on the listing page. */
.article-view .content-listing-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.article-view .article-footer {
  display: grid;
  gap: 22px;
  margin-top: 40px;
  padding-top: 22px;
}

.article-author {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-sunken);
}

/* The initials are the author's identity mark; no portrait is invented. */
.article-author__mark {
  width: 56px;
  height: 56px;
  font-family: "Bricolage Grotesque", var(--sans);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.article-author__name {
  margin: 0;
  font-family: "Bricolage Grotesque", var(--sans);
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.article-author__role {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.article-author__bio {
  max-width: 70ch;
  margin: 9px 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.article-author__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 4px;
  color: var(--accent-text, var(--accent-ink));
  font-weight: 650;
}

.article-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
}

.article-view .article-footer__nav a {
  color: var(--accent-text, var(--accent-ink));
}

.author-page {
  width: 100%;
  padding: 0 0 64px;
  color: var(--ink);
}

.author-page .author-wrap {
  width: min(100% - 32px, 860px);
}

.author-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  padding: 10px 0 30px;
  border-bottom: 1px solid var(--line-strong);
}

/* The same initials mark the byline, the author note and this page. */
.author-mark {
  width: 84px;
  height: 84px;
  font-family: "Bricolage Grotesque", var(--sans);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-text, var(--accent-ink));
}

.author-name {
  margin: 0;
  font-family: "Bricolage Grotesque", var(--sans);
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.author-role {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
  font-weight: 650;
}

.author-bio {
  max-width: 68ch;
  margin: 14px 0 0;
  color: var(--ink-muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.author-section {
  margin-top: 36px;
}

.author-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 6px;
}

.author-section__head h2 {
  margin: 0;
  font-family: "Bricolage Grotesque", var(--sans);
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
  letter-spacing: -0.04em;
}

.author-section__count {
  color: var(--ink-muted);
  font-size: 0.86rem;
}

/* Article titles sit one level under the section heading, so they reuse the
   content row type scale from content.css at h3. */
.author-page .content-article-row h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", var(--sans);
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.author-page .content-article-row h3 a {
  color: var(--ink);
  text-decoration: none;
}

.author-page .content-article-row h3 a:hover {
  color: var(--accent-text, var(--accent-ink));
}

.article-view .resource-kicker a,
.author-page .resource-kicker a,
.author-page .content-article-row__read {
  color: var(--accent-text, var(--accent-ink));
}

@media (max-width: 560px) {
  .author-hero {
    gap: 14px;
  }

  .author-mark {
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
  }
}
