/* ==========================================================================
   Article page — header, prose, figures, quotes, gallery, video,
   author box, related stories  →  templates/article/*.php
   ========================================================================== */

/* ---- Breadcrumb ------------------------------------------------------------ */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs);
  padding: 0;
  list-style: none;
  color: var(--color-muted);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--space-3xs);
}

.breadcrumb a:hover {
  color: var(--color-text);
}

/* ---- Article header ------------------------------------------------------- */
.article-header {
  padding-top: var(--space-xl);
  row-gap: var(--space-md);
}

.article-header > * {
  grid-column: wide;
}

.article-header__kicker {
  margin-top: var(--space-lg);
}

.article-header__title {
  font-size: var(--fs-h1);
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.article-header__title-pre {
  display: block;
  margin-bottom: 0.4em;
  font-size: clamp(1.125rem, 0.9rem + 1vw, 1.75rem);
  font-family: var(--font-serif);
  font-style: italic;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.article-header__subtitle {
  max-width: 34ch;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-md);
  padding-block: var(--space-sm);
  border-block: var(--hairline);
  font-size: var(--fs-small);
}

.byline__author {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 600;
}

.byline__author img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
}

.byline__credit {
  color: var(--color-muted);
}

.byline .meta {
  margin-left: auto;
}

/* ---- Figures ---------------------------------------------------------------- */
.figure {
  margin-block: var(--space-xl);
}

.figure figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3xs) var(--space-md);
  margin-top: var(--space-xs);
  font-size: var(--fs-small);
  color: var(--color-muted);
}

.figure.is-full figcaption {
  padding-inline: var(--gutter);
}

.figure__credit {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.article-hero {
  margin-block: var(--space-lg) 0;
}

/* ---- Prose ------------------------------------------------------------------ */
.prose {
  padding-block: var(--space-xl) var(--space-2xl);
}

.prose > p,
.prose > ul,
.prose > ol {
  margin-top: var(--space-md);
}

.prose > h2 {
  margin-top: var(--space-xl);
  font-size: var(--fs-h2);
  line-height: 1.1;
}

.prose > h3 {
  margin-top: var(--space-lg);
  font-size: var(--fs-h3);
  font-family: var(--font-serif);
  font-style: italic;
}

.prose > h2 + p,
.prose > h3 + p {
  margin-top: var(--space-sm);
}

.prose > p a,
.prose__float-group p a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.prose > p a:hover,
.prose__float-group p a:hover {
  color: var(--color-accent-hover);
}

/* Drop-cap opening paragraph */
.prose__intro::first-letter {
  float: left;
  margin: 0.06em 0.12em 0 0;
  font-family: var(--font-display);
  font-size: 4.2em;
  line-height: 0.8;
}

/* Quote with attribution (in reading column) */
.quote {
  margin-block: var(--space-lg);
  padding-left: var(--space-md);
  border-left: 2px solid var(--color-accent);
}

.quote blockquote {
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  font-style: italic;
  line-height: 1.45;
}

.quote figcaption {
  margin-top: var(--space-xs);
  color: var(--color-muted);
}

/* Pull quote (breaks out to wide) */
.pull-quote {
  margin-block: var(--space-xl);
  padding-block: var(--space-lg);
  border-block: var(--rule);
  text-align: center;
}

.pull-quote blockquote {
  max-width: 22ch;
  margin-inline: auto;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.pull-quote figcaption {
  margin-top: var(--space-md);
  color: var(--color-muted);
}

/* Inline image: stacked on small screens, floats into the left margin on wide ones */
.prose__float-group {
  display: flow-root;
}

.prose__float-group > p {
  margin-top: var(--space-md);
}

@media (min-width: 80rem) {
  .figure--inline {
    float: left;
    width: 50%;
    margin: var(--space-2xs) var(--space-lg) var(--space-sm) -8rem;
  }
}

/* ---- Gallery ---------------------------------------------------------------- */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2xs);
}

.gallery__grid > :first-child {
  grid-column: 1 / -1;
}

@media (min-width: 48rem) {
  .gallery__grid {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
  }

  .gallery__grid > :first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .gallery__grid > :first-child .media {
    height: 100%;
    aspect-ratio: auto;
  }
}

/* ---- Video embed (click-to-load, no third-party request before consent) --- */
.video-embed {
  position: relative;
  aspect-ratio: var(--ratio-hero);
  background: var(--color-inverse-bg);
  color: var(--color-inverse-text);
  overflow: hidden;
}

.video-embed img,
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.video-embed img {
  opacity: 0.7;
  transition: opacity var(--dur-base) var(--ease-out);
}

.video-embed__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-sm);
  width: 100%;
  color: inherit;
  text-align: center;
}

.video-embed__play svg {
  width: 4.5rem;
  height: 4.5rem;
  transition: transform var(--dur-base) var(--ease-out);
}

.video-embed__play:hover svg {
  transform: scale(1.06);
}

.video-embed__play:hover ~ img,
.video-embed:hover img {
  opacity: 0.55;
}

.video-embed__note {
  max-width: 34ch;
  font-size: var(--fs-small);
  color: var(--color-inverse-muted);
}

/* ---- Tags ------------------------------------------------------------------- */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-md);
  margin-top: var(--space-xl);
  padding: var(--space-md) 0 0;
  list-style: none;
  border-top: var(--hairline);
  color: var(--color-muted);
}

.article-tags a:hover {
  color: var(--color-text);
}

/* ---- Author box  →  templates/author-box.php ------------------------------- */
.author-box {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-block: var(--space-lg);
  border-block: var(--rule);
}

/* Wider than the reading column — the box closes the whole story */
.breakout > .author-box {
  grid-column: wide;
}

/* Without a photo the text must not land in the narrow photo column */
.author-box.author-box--no-photo {
  grid-template-columns: minmax(0, 1fr);
}

.author-box__bio {
  max-width: 60ch;
}

.author-box__photo {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
}

.author-box__name {
  margin-top: var(--space-3xs);
  font-size: var(--fs-h3);
}

.author-box__bio {
  margin-top: var(--space-xs);
  font-size: 1rem;
  color: var(--color-muted);
}

.author-box__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  padding: 0;
  list-style: none;
}

.author-box__links a {
  border-bottom: 1px solid currentColor;
}

@media (min-width: 48rem) {
  .author-box {
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: var(--space-lg);
  }

  .author-box.author-box--no-photo {
    grid-template-columns: minmax(0, 1fr);
  }

  .author-box__photo {
    width: 7rem;
    height: 7rem;
  }
}

/* ---- Related stories -------------------------------------------------------- */
@media (min-width: 48rem) {
  .related__item {
    grid-column: span 4;
  }

  .related__item:last-child {
    grid-column: 3 / span 4;
  }
}

@media (min-width: 64rem) {
  .related__item,
  .related__item:last-child {
    grid-column: span 4;
  }
}

/* ---- Admin preview bar ------------------------------------------------------------ */
.preview-bar {
  position: sticky;
  top: var(--header-bar-h);
  z-index: 5;
  padding: var(--space-2xs) var(--gutter);
  background: var(--color-accent);
  color: #fff;
  text-align: center;
}

.preview-bar a {
  margin-left: var(--space-sm);
  text-decoration: underline;
}
