/* ─── Post header ─────────────────────────────────────────── */

.post-header {
  padding-block: clamp(var(--space-l), 5vw, var(--space-xl));
}

/* Switcher: stacks below ~35rem container width, side-by-side above */
.post-header__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-l);
  align-items: center;
}

.post-header__inner > * {
  flex-grow: 1;
  flex-basis: calc((35rem - 100%) * 999);
  min-inline-size: 0;
}

.post-header__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.post-header__meta hgroup {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.post-header__subtitle {
  font-size: var(--step-0);
  font-style: italic;
  color: var(--color-text-muted);
}

.post-header__category {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
}

.post-header__category:hover {
  color: var(--color-text);
}

.post-header__title {
  font-size: var(--step-4);
  font-weight: 600;
}

.post-header__date {
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

.post-header__image {
  display: flex;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
}

.post-header__image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: clamp(14rem, 45svh, 28rem);
}

.post-header__image-credit {
  margin-block-start: var(--space-xs);
  font-size: var(--step--1);
  color: var(--color-text-muted);
  text-align: center;
}

.post-header__image-credit a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition:
    color 0.15s ease,
    text-decoration-thickness 0.15s ease;
}

.post-header__image-credit a:hover {
  color: var(--color-text);
  text-decoration-thickness: 2px;
}

/* ─── Lightbox trigger ────────────────────────────────────── */

.post-header__image picture,
.post-body__inner picture {
  cursor: zoom-in;
}

/* ─── Post body ───────────────────────────────────────────── */

.post-body__inner {
  max-inline-size: var(--content-max);
  margin-inline: auto;
}

/* ─── Share ───────────────────────────────────────────────── */

.post-share {
  padding-block-start: var(--space-l);
}

.post-share .container {
  display: flex;
  justify-content: center;
}

.post-share__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: none;
  border: 1px solid var(--color-text-muted);
  border-radius: 4px;
  padding: var(--space-xs) var(--space-m);
  font-size: var(--step--1);
  color: var(--color-text-muted);
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.post-share__button:hover,
.post-share__button:focus-visible,
.post-share__button:active {
  color: var(--color-text);
  border-color: var(--color-accent);
}

.post-share__button svg {
  display: block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
}

/* ─── Related posts ──────────────────────────────────────────── */

.related {
  padding-block: var(--space-xl);
}

.related__heading {
  font-size: var(--step-2);
  margin-block-end: var(--space-l);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Intrinsic grid: as many columns as fit at minimum 18rem — no breakpoints needed */
.related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
  gap: var(--space-l);
}
