/* Viewing scale for the approved editorial image selection. */
:root {
  --media-wide:1160px;
  --media-entry-wide:1200px;
  --media-cover-height:720px;
  --media-landscape-height:740px;
  --media-portrait-height:660px;
  --media-pair-height:560px;
  --media-gap:24px;
}
.cover-pair--single .cover-pair__grid { max-width:var(--media-entry-wide); }
.editorial-home .cover-pair--single figure,
.editorial-home .project-card {
  width:100%;
  max-width:var(--media-entry-wide);
  margin-inline:auto;
}
.editorial-home .cover-pair--single .cover-pair__landscape>a,
.editorial-home .project-card__media {
  display:block; aspect-ratio:16/9; overflow:hidden;
}
.editorial-home .cover-pair--single .cover-pair__landscape img,
.editorial-home .project-card__media img {
  display:block; width:100%; height:100%; aspect-ratio:auto; object-fit:cover;
  object-position:50% 50%;
}
.editorial-home .project-card--landscape .project-card__media img {
  object-position:50% 25%;
}
.editorial-home .project-card:hover .project-card__media img { transform:none; }
.editorial-home .project-card__body {
  display:block; margin-top:20px; padding:0;
}
.project-card__summary { min-width:0; }
.editorial-home .project-card__title { display:block; }
.editorial-home .project-card__meta { display:block; margin-top:8px; max-width:76ch; }
.project-card__action {
  display:inline-flex; align-items:center; min-height:44px; margin-top:12px;
  padding:0; border:0; background:none; color:var(--color-text);
  font:500 1rem/1.5 var(--font-body); text-decoration:underline;
  text-decoration-thickness:1px; text-underline-offset:4px;
}
.project-card:hover .project-card__action,
.project-card:focus-visible .project-card__action {
  color:var(--color-primary);
}
.editorial-home .worlds { max-width:var(--media-wide); margin-inline:auto; }
.editorial-home .traces__grid { max-width:var(--media-wide); margin-inline:auto; }
.editorial-home .about-portrait { max-width:460px; }
.editorial-home .method-object { max-width:300px; }
.editorial-home .method-object img { width:auto; max-width:100%; height:auto; max-height:420px; margin-inline:auto; }
.editorial-inner .media-single {
  display:block;
  width:min(100%,calc(var(--media-landscape-height)*var(--image-ratio)));
  max-width:var(--media-wide);
  margin-inline:auto;
}
.editorial-inner .media-single--portrait {
  width:min(100%,calc(var(--media-portrait-height)*var(--image-ratio)));
}
.editorial-inner .media-single img,
.editorial-inner .media-gallery img {
  display:block; width:100%; height:auto; max-width:100%; max-height:none;
  aspect-ratio:auto; object-fit:contain;
}
.editorial-inner .media-single figcaption { width:auto; }
.editorial-inner main>.tale:has(img) { margin-bottom:48px; }
.editorial-inner .media-gallery {
  --media-row-height:var(--media-pair-height);
  display:grid;
  width:min(100%,calc(var(--media-row-height)*var(--media-ratio-sum) + var(--media-gap)*(var(--media-count) - 1)));
  max-width:var(--media-wide);
  grid-template-columns:var(--photo-columns);
  gap:var(--media-gap);
  margin-inline:auto;
}
.editorial-inner .media-gallery--single { --media-row-height:var(--media-landscape-height); }
.editorial-inner .media-gallery--portrait { --media-row-height:var(--media-portrait-height); }
.media-zoom {
  display:block; position:relative; width:100%; padding:0;
  text-align:left; cursor:zoom-in; line-height:0;
}
.media-zoom picture { display:block; }
.media-zoom__hint {
  position:absolute; right:12px; bottom:12px;
  padding:8px 12px;
  color:#2c2520; background:#f5f1ea;
  font:400 var(--type-label)/1.4 var(--font-body);
  opacity:0; transition:opacity .18s ease;
}
.media-zoom:hover .media-zoom__hint,
.media-zoom:focus-visible .media-zoom__hint { opacity:1; }
.gallery-dialog {
  width:min(1280px,calc(100% - 32px)); height:min(980px,calc(100svh - 32px));
  max-width:none; max-height:none; margin:auto; padding:24px;
  border:1px solid var(--color-divider);
  background:var(--color-bg); color:var(--color-text); overflow:hidden;
}
.gallery-dialog::backdrop { background:rgb(24 20 17 / .76); }
.gallery-dialog[open] { display:flex; flex-direction:column; gap:16px; }
.gallery-dialog__header { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-shrink:0; }
.gallery-dialog__title { font:400 var(--type-small)/1.4 var(--font-body); }
.gallery-dialog__counter { color:var(--color-text-muted); font:400 var(--type-small)/1.4 var(--font-body); white-space:nowrap; }
.gallery-dialog__stage { flex:1; min-height:0; display:flex; align-items:center; justify-content:center; overflow:auto; position:relative; }
.gallery-dialog__image { display:block; width:auto; height:auto; max-width:100%; max-height:100%; object-fit:contain; margin:auto; }
.gallery-dialog__stage.is-actual { align-items:flex-start; justify-content:flex-start; }
.gallery-dialog__stage.is-actual .gallery-dialog__image { max-width:none; max-height:none; flex-shrink:0; margin:0; }
.gallery-dialog__caption { flex-shrink:0; max-height:92px; overflow:auto; font:400 var(--type-small)/1.6 var(--font-body); color:var(--color-text-muted); }
.gallery-dialog__controls { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-shrink:0; }
.gallery-dialog__button { min-width:44px; min-height:44px; padding:8px 16px; border:1px solid var(--color-divider); font:400 var(--type-small)/1.3 var(--font-body); }
.gallery-dialog__button:hover { background:var(--color-surface-alt); }
.gallery-dialog__button[aria-pressed="true"] { border-color:var(--color-primary); color:var(--color-primary); }
.gallery-dialog__status { font:400 var(--type-small)/1.6 var(--font-body); text-align:center; }
.gallery-dialog__status[hidden],.gallery-dialog__image[hidden] { display:none; }
@media(max-width:700px) {
  :root {
    --media-cover-height:560px;
    --media-landscape-height:560px;
    --media-portrait-height:560px;
    --media-gap:24px;
  }
  .editorial-home .about-portrait { max-width:100%; }
  .editorial-home .method-object { max-width:260px; }
  .editorial-home .method-object img { max-height:360px; }
  .editorial-inner .media-gallery { width:100%; grid-template-columns:1fr; }
  .editorial-inner main>.tale:has(img) { margin-bottom:32px; }
  .editorial-inner .media-gallery>.gallery-item,
  .editorial-inner .media-gallery>.tale-figure {
    width:min(100%,calc(var(--media-portrait-height)*var(--image-ratio)));
    margin-inline:auto;
  }
  .gallery-dialog { width:calc(100% - 16px); height:calc(100svh - 16px); padding:12px; }
  .gallery-dialog[open] { gap:12px; }
  .gallery-dialog__button { padding-inline:12px; }
  .gallery-dialog__title { max-width:22ch; }
  .media-zoom__hint { right:8px; bottom:8px; padding:6px 8px; opacity:1; }
}
@media(max-width:360px) {
  .gallery-dialog__controls { display:grid; grid-template-columns:1fr 1fr; }
}
@media(prefers-reduced-motion:reduce) {
  .media-zoom__hint { transition:none; }
}
