.post-hero {
  margin: 0 0 2rem;
}

.post-hero-media {
  position: relative;
  isolation: isolate;
  border-radius: 0.6rem;
  background: #25231f;
}

.post-hero-media > a {
  display: block;
  border-radius: inherit;
}

.post-hero-media img {
  display: block;
  width: 100%;
  height: clamp(18rem, 42vw, 27rem);
  object-fit: cover;
  border-radius: inherit;
}

.post-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(transparent 15%, rgb(0 0 0 / 85%));
}

.post-hero h1 {
  position: absolute;
  inset-inline: 2rem;
  bottom: 1.6rem;
  z-index: 1;
  margin: 0;
  max-width: 20ch;
  color: white;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  font-weight: 620;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgb(0 0 0 / 45%);
  pointer-events: none;
}

.post-hero figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.68rem;
  line-height: 1.5;
}

.post-tools {
  min-width: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.72rem;
  line-height: 1.5;
}

.post-tools h2 {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-tools button,
.post-tools > a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 44px;
  padding: 0.3rem 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.post-tools button:hover,
.post-tools > a:hover { color: var(--link-hover); text-decoration: underline; }
.post-tools button:focus-visible,
.post-tools > a:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.post-tools [hidden] { display: none; }
.post-tools-hint { color: var(--muted); font-size: 0.65rem; }
.post-tools-status:empty { display: none; }
.post-link-fallback input { width: 100%; color: var(--text); background: var(--surface); font: inherit; border: 1px solid var(--line); }
.post-print-url { display: none; }

.scroll-to-top {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  white-space: nowrap;
}

@media (min-width: 1100px) {
  .post-layout-with-tools {
    grid-template-columns: 96px minmax(0, 652px);
    column-gap: 1.5rem;
  }
  .post-layout-with-tools.has-reference-sidebar {
    grid-template-columns: 96px minmax(0, 1fr) 180px;
  }
  .post-layout-with-tools > .post { grid-column: 2; grid-row: 1; min-width: 0; }
  .post-layout-with-tools > .post-version-sidebar { grid-column: 3; grid-row: 1; }
  .post-tools {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: var(--header-offset, 6rem);
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 720px) {
  .post-hero h1 { inset-inline: 1rem; bottom: 1.2rem; }
  .post-hero-media img { height: 20rem; }
}

@media print {
  @page { margin: 18mm; }
  :root, :root[data-theme] { color-scheme: light; --bg: white; --text: black; --muted: #444; --link: black; --line: #ccc; }
  body, .site-header { background: white !important; color: black !important; }
  body { font-size: 12pt; }
  .site-header, .site-footer, .post-tools, .post-version-sidebar, .post-toc,
  .scroll-to-top, .image-viewer, #image-viewer, #comments, .tag-row, .meta a { display: none !important; }
  .wrap, .page, .has-sidebar .page { width: auto; max-width: none; margin: 0; padding: 0; }
  .post-layout, .post-layout-with-tools { display: block; }
  .page { animation: none; opacity: 1; transform: none; }
  .post-hero-media { background: none; }
  .post-hero-media::after { display: none; }
  .post-hero-media img { height: auto; max-height: 70mm; object-fit: contain; }
  .post-hero h1 { position: static; margin-top: 1rem; max-width: none; color: black; font-size: 26pt; text-shadow: none; }
  .post-print-url { display: block; font: 9pt var(--sans); overflow-wrap: anywhere; }
  .content, .summary { font-size: 12pt; }
  h1, h2, h3, h4 { break-after: avoid; }
  figure, img, pre { break-inside: avoid; }
  .content a { color: black; }
  .content pre { white-space: pre-wrap; }
}
