body.content-detail-page {
  --content-right-gap: var(--content-gap);
}

body.content-detail-page .content-body {
  padding-right: var(--content-gap);
}

body.content-detail-page .page-ornament {
  margin-left: calc(50% - (var(--block-width) / 2) + var(--nav-width) + var(--content-gap));
  width: calc(100% - (50% - (var(--block-width) / 2) + var(--nav-width) + var(--content-gap)));
}

.lightbox-image {
  border-radius: 0;
  box-shadow: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

@media (max-width: 720px) {
  .secondary-text {
    column-count: 1;
  }
}

.secondary-text {
  column-count: 2;
  column-gap: 24px;
  max-width: 100%;
  margin: 8px 0 18px;
}

.secondary-text p {
  break-inside: avoid;
}

.text-breaks {
  margin: 0 0 18px;
}

.media-note {
  margin: 8px 0 18px;
  max-width: 100%;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 300;
}

.media-pair {
  display: block;
  margin: 2rem 0;
}

.media-image-frame {
  position: relative;
  display: inline-block;
  --source-x: 50%;
  --source-y: 50%;
}

.media-pair img {
  width: 260px;
  height: auto;
  border: 1px solid rgba(17, 17, 17, 0.12);
  background: rgba(255, 249, 230, 0.72);
  box-shadow: none;
}

.media-pair:not(.is-reversed) .media-image-frame {
  float: left;
  margin: 0 1.5rem 1rem 0;
}

.media-pair.is-reversed .media-image-frame {
  float: right;
  margin: 0 0 1rem 1.5rem;
}

.media-pair img:hover {
  box-shadow: none;
}

.image-source-badge {
  position: absolute;
  left: var(--source-x);
  top: var(--source-y);
  max-width: calc(100% - 20px);
  padding: 4px 8px;
  background: var(--highlight);
  color: #111;
  font-size: 11px;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0.02em;
  text-decoration: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity 220ms ease, transform 220ms ease, background 220ms ease, color 220ms ease;
  pointer-events: none;
}

.media-image-frame:hover .image-source-badge,
.media-image-frame:focus-within .image-source-badge,
.slider-card:hover .image-source-badge,
.slider-card:focus-within .image-source-badge {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 10px));
}

.image-source-badge.is-missing {
  background: #d0d0d0;
  color: #666;
}

.image-source-badge[href] {
  pointer-events: auto;
}

.media-pair::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 768px) {

  .media-pair img {
    float: none !important;
    display: block;
    width: 100%;
    margin: 0 0 1rem 0;
  }

}

.image-slider {
  position: relative;
  margin: 10px 0 36px;
  padding: 12px 40px 14px 12px;
  overflow: hidden;
  background: transparent;
}

.slider-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.slider-card {
  position: relative;
  --source-x: 50%;
  --source-y: 50%;
}

.slider-track::-webkit-scrollbar {
  height: 0;
}

.slider-track::-webkit-scrollbar-thumb {
  background: transparent;
}

.slider-track img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  scroll-snap-align: start;
  border: 1px solid rgba(17, 17, 17, 0.1);
  background: rgba(255, 249, 230, 0.68);
  box-shadow: none;
  transition: transform 220ms ease, filter 220ms ease;
  cursor: pointer;
  filter: saturate(0.98);
}

.slider-track img:hover {
  filter: grayscale(1) contrast(1.18) brightness(0.82) sepia(1) saturate(14) hue-rotate(60deg);
}

.lightbox-source {
  position: absolute;
  left: 50%;
  bottom: 22px;
  max-width: min(76vw, 760px);
  padding: 0;
  background: transparent;
  color: #fff3d6;
  font-size: 12px;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  z-index: 1;
  transform: translateX(-50%);
}

.lightbox-source.is-missing {
  color: rgba(255, 243, 214, 0.5);
  pointer-events: none;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(17, 17, 17, 0.14);
  background: rgba(255, 243, 214, 0.72);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 200ms ease, border-color 200ms ease;
}

.slider-arrow:hover {
  background: rgba(255, 243, 214, 0.92);
  border-color: rgba(17, 17, 17, 0.22);
}

.slider-arrow .material-symbols-outlined {
  color: var(--ink);
  font-size: 18px;
}

.slider-arrow-left .material-symbols-outlined {
  transform: rotate(180deg);
}

.slider-arrow-left {
  left: 8px;
}

.slider-arrow-right {
  right: 10px;
}

.slider-arrow.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  padding: 72px 16px 28px;
  background: rgba(8, 8, 10, 0.54);
  backdrop-filter: blur(14px) saturate(1.05);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 9998;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
  width: min(92vw, 1180px);
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border: none;
  box-shadow: none;
  background: transparent;
  transform: scale(0.985);
  transition: transform 220ms ease, filter 220ms ease, opacity 220ms ease;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: auto;
  height: auto;
  border-radius: 0;
  border: none;
  background: transparent;
  font-size: 34px;
  line-height: 1;
  color: #fff3d6;
  padding: 0;
  box-shadow: none;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  width: 52px;
  height: 52px;
  border-radius: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 200ms ease, background 200ms ease, border-color 200ms ease;
  opacity: 0.9;
  box-shadow: none;
}

.lightbox-nav:hover {
  opacity: 1;
  background: transparent;
}

.lightbox-prev {
  left: 4px;
}

.lightbox-next {
  right: 4px;
}

.lightbox-nav .material-symbols-outlined {
  color: #fff3d6;
  font-size: 20px;
  line-height: 1;
}

.lightbox-prev .material-symbols-outlined {
  transform: rotate(180deg);
}

.content-quote {
  margin: 32px 0 36px;
  padding: 22px 26px 22px 28px;
  font-size: 28px;
  font-style: italic;
  font-weight: 300;
  max-width: 720px;
  position: relative;
  background: linear-gradient(90deg, rgba(255, 243, 214, 0.32), rgba(255, 243, 214, 0));
  z-index: 0;
  overflow-wrap: anywhere;
  transform-origin: left center;
}

.content-quote-text {
  display: inline;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.content-quote-mark {
  display: inline-block;
  color: var(--highlight);
  line-height: 0.8;
  vertical-align: baseline;
  animation: none;
}

.content-quote-mark-open {
  margin-right: 0.18em;
  font-size: 1.9em;
}

.content-quote-mark-close {
  margin-left: 0.12em;
  font-size: 1.4em;
  opacity: 0.85;
}

.video-embed {
  position: relative;
  margin: 12px 0 36px;
  padding: 0;
  width: 100%;
  max-width: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: hidden;
  border-radius: 0;
}

.video-embed video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
  background: #000;
  box-shadow: none;
  cursor: pointer;
  border-radius: 0;
}

.video-embed video::-webkit-media-controls {
  display: none !important;
}

.audio-embed {
  margin: 12px 0 36px;
  width: 100%;
  max-width: 100%;
  position: relative;
}

.audio-embed audio {
  display: none;
}

.media-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff3d6;
  background: rgba(0, 0, 0, 0.6);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
  z-index: 5;
  gap: 2px;
}

.media-error-face {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.media-error-text {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
}

.video-embed .media-error,
.audio-embed .media-error {
  border-radius: 8px;
}

.video-embed.has-error .media-error,
.audio-embed.has-error .media-error {
  opacity: 1;
}

.video-embed.has-error .video-overlay {
  opacity: 0;
  pointer-events: none;
}

.audio-header {
  padding: 8px 12px 10px;
  background: #000;
  border-radius: 8px 8px 0 0;
}

.audio-controls {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #000;
  border-radius: 0 0 8px 8px;
}

.audio-btn {
  border: 0;
  background: #000;
  color: #fff3d6;
  padding: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.audio-btn:active {
  transform: translate(2px, 2px);
}

.audio-icon {
  font-variation-settings: "opsz" 24, "wght" 500, "FILL" 1, "GRAD" 0;
  font-size: 20px;
  line-height: 1;
}

.audio-time {
  color: #fff3d6;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.audio-title {
  color: #fff3d6;
  font-size: 20px;
  letter-spacing: 0.04em;
  font-weight: 400;
}

.audio-progress {
  position: relative;
  height: 18px;
  background: #2b2b2b;
  cursor: pointer;
}

.audio-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--highlight);
  transition: width 120ms linear;
}

.audio-progress:focus-visible {
  outline: 2px dashed #fff3d6;
  outline-offset: 3px;
}

.audio-volume-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.audio-volume-range {
  width: 0;
  height: 16px;
  background: transparent;
  appearance: none;
  cursor: pointer;
  opacity: 0;
  transition: width 240ms ease, opacity 240ms ease;
}

.audio-volume-group:hover .audio-volume-range,
.audio-volume-group:focus-within .audio-volume-range {
  width: 120px;
  opacity: 1;
}

.audio-volume-range::-webkit-slider-runnable-track {
  height: 6px;
  background: #111;
  border: 1px solid #fff3d6;
}

.audio-volume-range::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--highlight);
  border: 1px solid #fff3d6;
  margin-top: -4px;
}

.audio-volume-range::-moz-range-track {
  height: 6px;
  background: #111;
  border: 1px solid #fff3d6;
}

.audio-volume-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--highlight);
  border: 1px solid #fff3d6;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  background-position: center;
  background-size: cover;
  opacity: 1;
  transition: opacity 360ms ease;
  z-index: 2;
  border-radius: 8px;
}

.video-embed.has-played .video-overlay {
  opacity: 0;
  pointer-events: none;
}

.video-overlay-play {
  width: 72px;
  height: 72px;
  border: 2px solid #fff3d6;
  background: rgba(0, 0, 0, 0.6);
  color: #fff3d6;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 10px;
}

.video-icon-lg {
  font-size: 40px;
}

.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #000;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 360ms ease, opacity 360ms ease;
  z-index: 3;
  border-radius: 0 0 8px 8px;
}

.video-embed:hover .video-controls,
.video-embed:focus-within .video-controls {
  transform: translateY(0);
  opacity: 1;
}

.video-embed.is-fullscreen .video-controls {
  transform: translateY(0);
  opacity: 1;
}

.video-embed.is-fullscreen.is-idle .video-controls {
  transform: translateY(100%);
  opacity: 0;
}

.video-btn {
  border: 0;
  background: #000;
  color: #fff3d6;
  padding: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.video-icon {
  font-variation-settings: "opsz" 24, "wght" 500, "FILL" 1, "GRAD" 0;
  font-size: 20px;
  line-height: 1;
}

.video-btn:active {
  transform: translate(2px, 2px);
}

.video-time {
  color: #fff3d6;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.video-progress {
  position: relative;
  height: 18px;
  background: #2b2b2b;
  cursor: pointer;
}

.video-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--highlight);
  transition: width 120ms linear;
}

.video-progress:focus-visible {
  outline: 2px dashed #fff3d6;
  outline-offset: 3px;
}

.video-volume-range {
  width: 0;
  height: 16px;
  background: transparent;
  appearance: none;
  cursor: pointer;
  opacity: 0;
  transition: width 240ms ease, opacity 240ms ease;
}

.video-volume-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.video-volume-group:hover .video-volume-range,
.video-volume-group:focus-within .video-volume-range {
  width: 120px;
  opacity: 1;
}

.video-volume-range::-webkit-slider-runnable-track {
  height: 6px;
  background: #111;
  border: 1px solid #fff3d6;
}

.video-volume-range::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--highlight);
  border: 1px solid #fff3d6;
  margin-top: -4px;
}

.video-volume-range::-moz-range-track {
  height: 6px;
  background: #111;
  border: 1px solid #fff3d6;
}

.video-volume-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--highlight);
  border: 1px solid #fff3d6;
}

.video-fullscreen {
  margin-left: 4px;
}

.deck-embed {
  margin: 12px 0 36px;
  width: min(720px, 100%);
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.deck-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}

.deck-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.deck-viewer {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0d0d0d;
  transform-origin: top left;
  transform: scale(var(--deck-scale, 1));
}

.deck-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff3d6;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  gap: 6px;
  transition: opacity 240ms ease;
  z-index: 2;
}

.deck-embed.has-loaded .deck-fallback {
  opacity: 0;
  pointer-events: none;
}

.deck-fallback-face {
  font-size: 30px;
  letter-spacing: 0;
}

.deck-fallback-link {
  color: #fff3d6;
  text-decoration: none;
  border-bottom: 1px solid #fff3d6;
  padding-bottom: 2px;
}

.deck-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #000;
  border-radius: 0 0 8px 8px;
}

.deck-btn {
  border: 0;
  background: #000;
  color: #fff3d6;
  padding: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
}

.deck-btn:active {
  transform: translate(2px, 2px);
}

.deck-icon {
  font-variation-settings: "opsz" 24, "wght" 500, "FILL" 1, "GRAD" 0;
  font-size: 20px;
  line-height: 1;
}

.deck-icon-flip {
  transform: rotate(180deg);
}

.deck-slide,
.deck-zoom-level {
  color: #fff3d6;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.deck-slide {
  margin-right: auto;
}

.deck-embed.is-fullscreen .deck-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 0;
}

.reference-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
  counter-reset: reference-item;
}

.reference-item {
  padding: 5px 0 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  counter-increment: reference-item;
  border-radius: 6px;
  scroll-margin-top: 120px;
}

.reference-link {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: color 200ms ease;
}

.reference-link::before {
  content: "[" counter(reference-item) "]";
  font-size: 12px;
  color: var(--ink);
  opacity: 0.6;
}

.reference-title {
  font-size: 18px;
  font-weight: 500;
}

.reference-author {
  font-size: 14px;
  font-weight: 300;
}

.reference-link:hover {
  color: var(--highlight);
}

.reference-item:target .reference-link {
  animation: reference-text-flash 1400ms ease-out 2;
}

@keyframes reference-text-flash {
  0%,
  30% {
    color: var(--highlight);
  }
  100% {
    color: var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  .content-quote,
  .content-quote-mark {
    animation: none;
  }
}

@media (max-width: 640px) {
  .media-pair {
    grid-template-columns: 1fr;
  }

  .slider-track img {
    height: 220px;
  }

  .slider-arrow {
    width: 32px;
    height: 32px;
  }

  .slider-arrow-left {
    left: 6px;
  }

  .slider-arrow-right {
    right: 6px;
  }

  .lightbox {
    padding: 64px 16px 20px;
  }

  .lightbox-image {
    width: min(94vw, 100%);
    max-height: calc(100vh - 152px);
  }

  .lightbox-close {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
  }

  .lightbox-prev {
    left: 12px;
  }

  .lightbox-next {
    right: 12px;
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
  }

  .content-quote {
    font-size: 20px;
  }
}
