/* Una finestra sulla fotografia, ancorata alla copertina. */
.cover-preview {
  --preview-ivory: #faf6ed;
  --preview-muted: #d8d3ca;
  position: fixed;
  z-index: 45;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgb(255 247 231 / 25%);
  border-radius: 10px;
  background: #24211f;
  background: color-mix(in srgb, var(--work-wall) 32%, #181a18 68%);
  color: var(--preview-ivory);
  box-shadow: 0 23px 72px rgb(0 0 0 / 46%), 0 3px 13px rgb(0 0 0 / 25%);
  text-align: left;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.cover-preview[hidden] { display: none; }
.preview-art {
  position: relative;
  width: 100%;
  aspect-ratio: var(--photo-ratio, 2.1);
  max-height: min(52vh, 470px);
  overflow: hidden;
  background: #141513;
}
.preview-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform-origin: 0 0;
}
.preview-credit {
  position: absolute;
  left: 12px;
  bottom: 9px;
  padding: 3px 6px;
  color: #fff;
  background: rgb(12 13 11 / 86%);
  border-radius: 3px;
  font: 500 10px/1.3 var(--sans);
}
.preview-copy { padding: 18px 23px 15px; }
.preview-meta {
  display: flex;
  align-items: center;
  gap: .75em;
  margin: 0;
  color: #e8dfd1;
  font: 500 10px/1.3 var(--mono, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.preview-meta::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--work-accent);
}
.preview-meta span { opacity: .68; }
#preview-title {
  margin: 8px 0 4px;
  color: var(--preview-ivory);
  font: 500 clamp(30px, 3.3vw, 49px)/1.01 var(--sans);
  letter-spacing: -.06em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
#preview-title i { font: italic 400 1.03em/.98 var(--serif); letter-spacing: -.052em; }
.preview-role { margin: 0; color: var(--preview-muted); font: 450 15px/1.45 var(--sans); }
.preview-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 10px;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid rgb(245 237 220 / 23%);
}
.preview-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cover-preview :is(button,a) { touch-action: manipulation; }
.preview-actions button, .preview-project {
  display: inline-flex;
  gap: .5em;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font: 600 13px/1.15 var(--sans);
}
.preview-actions button {
  padding: 8px 14px;
  border: 1px solid rgb(252 247 236 / 48%);
  border-radius: 4px;
  color: var(--preview-ivory);
  background: transparent;
}
.preview-actions button:first-child {
  background: var(--preview-ivory);
  color: #1c1c18;
  border-color: var(--preview-ivory);
}
.preview-play { border-left: 8px solid currentColor; border-block: 5px solid transparent; }
.preview-grid {
  display: inline-block;
  width: 11px;
  height: 10px;
  border: 1px solid currentColor;
  box-shadow: -2px 2px 0 -1px currentColor;
}
.preview-project { margin-left: auto; color: var(--preview-muted); font-weight: 500; white-space: nowrap; }
.preview-project span { font-size: 16px; }
.preview-close {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  color: #faf6ed;
  background: transparent;
}
.preview-close span {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgb(255 255 255 / 54%);
  border-radius: 50%;
  background: rgb(16 17 15 / 89%);
  font: 400 22px/1 var(--sans);
}
.preview-type .preview-copy { padding-top: 33px; }
.preview-type .preview-meta { padding-right: 30px; }
.preview-type #preview-title { margin-top: 25px; }
.preview-type .preview-role { margin-bottom: 20px; }
.cover-preview :is(button,a):focus-visible { outline: 2px solid #f8db93; outline-offset: 2px; }
@media (hover:hover) {
  .preview-actions button:hover { border-color: white; }
  .preview-actions button:first-child:hover { background: white; }
  .preview-project:hover { color: white; text-decoration: underline; text-underline-offset: 4px; }
  .preview-close:hover span { background: #33342e; }
}
@media (max-width:649px) {
  .preview-copy { padding: 14px 15px 12px; }
  .preview-art { max-height: min(43vh, 270px); }
  #preview-title { font-size: clamp(30px, 7.4vw, 41px); }
  .preview-role { font-size: 14px; }
  .preview-links { margin-top: 12px; gap: 0 7px; }
  .preview-actions { gap: 5px; }
  .preview-actions button { padding-inline: 10px; }
  .preview-project { font-size: 12px; }
}
@media (max-width:380px) {
  .preview-copy { padding-inline: 12px; }
  .preview-project { gap: 2px; }
  .preview-links { column-gap: 3px; }
  .preview-actions button { padding-inline: 8px; }
}
@media (max-height:480px) {
  .preview-art { max-height: 30vh; }
  .preview-copy { padding-block: 10px; }
  .preview-links { margin-top: 7px; padding-top: 5px; }
}
