.author-section {
  padding-block: var(--fono-space-12);
  border-bottom: 1px solid var(--fono-border);
  background: var(--fono-surface);
}

.author-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  grid-template-areas: "rail copy";
  align-items: start;
  gap: var(--fono-space-12);
}

.author-note-rail {
  grid-area: rail;
  display: grid;
  align-content: start;
  gap: var(--fono-space-8);
}

.author-note-heading,
.author-note-copy {
  display: grid;
  gap: var(--fono-space-4);
}

.author-note-heading h2 {
  scroll-margin-top: var(--fono-space-16);
}

.author-title-phrase {
  white-space: nowrap;
}

.author-note-copy {
  grid-area: copy;
  max-width: 74ch;
}

.author-inline-link {
  text-decoration: underline;
  text-decoration-color: var(--fono-border);
}

.author-inline-link:hover {
  text-decoration-color: currentColor;
}

.author-gallery {
  display: grid;
  gap: var(--fono-space-5);
}

.author-screenshot {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--fono-border);
  border-radius: var(--fono-radius);
  background: var(--fono-night);
}

.author-screenshot-link {
  display: grid;
  gap: var(--fono-space-2);
  padding: var(--fono-space-3);
}

.author-screenshot-link:hover {
  background: var(--fono-surface-raised);
}

.author-screenshot-link:focus-visible {
  outline-offset: -3px;
}

.author-screenshot-frame {
  display: grid;
  height: 180px;
  place-items: center;
}

.author-screenshot-frame img {
  width: 100%;
  height: 100%;
  max-height: 180px;
  object-fit: contain;
}

.author-screenshot-action {
  color: var(--fono-electric-soft);
  font-size: var(--fono-type-sm);
  text-align: right;
}

.author-screenshot figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--fono-space-2);
  padding: var(--fono-space-3) var(--fono-space-4);
  border-top: 1px solid var(--fono-border-soft);
  font-size: var(--fono-type-sm);
}

.author-screenshot figcaption span {
  color: var(--fono-muted);
}

.screenshot-dialog {
  width: min(var(--fono-container), calc(100vw - var(--fono-space-8)));
  max-width: none;
  max-height: calc(100dvh - var(--fono-space-8));
  padding: 0;
  border: 1px solid var(--fono-border);
  border-radius: var(--fono-radius);
  background: var(--fono-night);
  color: var(--fono-text);
  box-shadow: var(--fono-shadow);
}

.screenshot-dialog::backdrop {
  background: color-mix(in srgb, var(--fono-night) 88%, transparent);
}

.screenshot-dialog-content {
  display: grid;
  gap: var(--fono-space-4);
  padding: var(--fono-space-5);
}

.screenshot-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fono-space-4);
}

.screenshot-dialog-heading h3 {
  font-size: var(--fono-type-lg);
}

.screenshot-close {
  display: grid;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--fono-border);
  border-radius: var(--fono-radius-sm);
  background: var(--fono-surface);
  color: var(--fono-secondary);
}

.screenshot-close:hover {
  border-color: var(--fono-electric-soft);
  color: var(--fono-text);
}

.screenshot-close svg {
  width: 20px;
  height: 20px;
}

.screenshot-dialog-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 12rem);
  margin-inline: auto;
  object-fit: contain;
}

.screenshot-original {
  justify-self: start;
  font-size: var(--fono-type-sm);
}

html.screenshot-dialog-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}

@media (max-width: 900px) {
  .author-note {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "heading" "copy" "gallery";
    gap: var(--fono-space-6);
  }

  .author-note-rail {
    display: contents;
  }

  .author-note-heading {
    grid-area: heading;
  }

  .author-gallery {
    grid-area: gallery;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .author-section {
    padding-block: var(--fono-space-8);
  }

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

  .screenshot-dialog-content {
    padding: var(--fono-space-3);
  }
}
