/**
 * Keep-page content (P5.1).
 *
 * Room pages follow Raum Vorlage: media and caption centred in the
 * scrolling column. Zeit / Info / Initiativen stay a left-aligned
 * document flow (P2.7 dropped the Dreamweaver tables; the 18 table pages
 * now use the ported original layout, legacy.css, P5.9). Photos use the
 * original HTML embed box, not the file's pixel size; room pages show it 1.5× (D14).
 */

.page {
  color: var(--color-text);
  padding: var(--space-5) 0 var(--space-6);
}

/* D14 (user, 2026-11-10): room media at 1.5× the original embed size, for
   modern screens. Every component multiplies its original box by
   --media-scale and is capped to the column width and to the window height
   minus room for the caption (--media-max-h). Text stays at its size. */
[data-section="raeume"] .page--center {
  --media-scale: 1.5;
  --media-max-h: calc(100svh - 7rem);
}

@media (min-width: 768px) {
  .page--center {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    padding-top: 0;
    padding-bottom: 0;
  }
}

.page-body p {
  margin: 0 0 var(--space-3);
}

.page-body p:last-child {
  margin-bottom: 0;
}

.page-body img {
  display: inline-block;
  vertical-align: top;
}

.page--center .page-body {
  max-width: 100%;
}

/* D14: photos from the page text (embed size in --w / --h) on room pages. */
[data-section="raeume"] .page--center .page-body img[style*="--w"] {
  width: min(calc(var(--w) * var(--media-scale, 1) * 1px), calc(var(--media-max-h, 100000px) * var(--w) / var(--h)));
  max-width: 100%;
  height: auto;
  /* Keep the original embed box (some differ slightly from the file). */
  aspect-ratio: var(--w) / var(--h);
}

/* 1hof2: a year under each photo (original &nbsp; row), not one shared caption. */
.photo-pair {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1.25em;
  margin: 0;
}

.photo-pair-item {
  margin: 0;
}

.photo-pair-item img {
  display: block;
  vertical-align: top;
  width: min(calc(var(--w) * var(--media-scale, 1) * 1px), calc(var(--media-max-h, 100000px) * var(--w) / var(--h)));
  max-width: 100%;
  height: auto;
  /* Keep the original embed box (some differ slightly from the file). */
  aspect-ratio: var(--w) / var(--h);
}

.photo-pair-item figcaption {
  margin-top: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-2);
}

.page--portrait .portrait-strip-figure {
  float: left;
  margin: 0 var(--space-4) var(--space-4) 0;
}

.page--portrait .page-body::after {
  content: "";
  display: table;
  clear: both;
}

.img-swap {
  position: relative;
  display: inline-block;
}

.img-swap-over {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
}

.img-swap:hover .img-swap-over,
.img-swap:focus-visible .img-swap-over,
.page:has([data-img-hover]:hover) .img-swap-over,
.page:has([data-img-hover]:focus-visible) .img-swap-over {
  opacity: 1;
}

.media-missing {
  margin: 0;
}

.media-missing-box {
  width: min(calc(var(--w) * var(--media-scale, 1) * 1px), calc(var(--media-max-h, 100000px) * var(--w) / var(--h)));
  max-width: 100%;
  aspect-ratio: var(--w) / var(--h);
  background: var(--color-bg);
}

.media-missing-caption {
  margin-top: var(--space-1);
  font-family: var(--font-body);
  font-size: var(--font-size-2);
}

/* D16: credit under a stand-in video. */
.media-credit-video {
  max-width: 30em;
  margin: var(--space-1) auto 0;
  font-family: var(--font-body);
  font-size: var(--font-size-1);
  color: var(--color-gray-66);
}

/* Restoration notes (P5.7). Not an original page; same type, slightly narrower measure. */
.page--colophon {
  max-width: 36em;
}

.page--colophon h1 {
  margin: 0 0 var(--space-4);
}

.page--colophon h2 {
  margin: var(--space-5) 0 var(--space-2);
}

.page--colophon ul {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-4);
}

.page--colophon li {
  margin-bottom: var(--space-1);
}

.page--colophon li:last-child {
  margin-bottom: 0;
}

/* Impressum / Datenschutz: a field still empty in _data/legal.json. */
.legal-missing {
  color: #000;
  background: #ff6633;
  padding: 0 0.2em;
}
