/* Two physical faces turning at the same position, size and shape. */
.card-turner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 736ms cubic-bezier(.22, .72, .18, 1);
}
.card-wrapper.is-flipped .card-turner { transform: rotateY(180deg); }
.card-side {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(.15px);
}
.card-side-back { transform: rotateY(180deg) translateZ(.15px); }

/* Both faces are laid out on the card's own design canvas and scaled together,
   so turning never changes the aspect ratio or the height of the reverse. */
.card-layout {
  width: calc(var(--face-w, 300) * 1px);
  height: calc(var(--face-h, 400) * 1px);
  transform: scale(var(--face-scale, 1));
  transform-origin: 0 0;
}
.title-card .card-layout { width: 100%; height: 100%; transform: none; }
.card-side .playing-card { pointer-events: auto; cursor: grab; }
.card-wrapper.is-dragging .playing-card { cursor: grabbing; }
.card-side-back a { -webkit-user-drag: none; }

/* The reverse is the same stock: the print stays, dimmed, under what is
   written about it. */
.card-back { justify-content: flex-end; }
.card-back-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* Fit the reverse to the physical face. Metadata keeps its space; a long
   caption uses whatever remains instead of pushing the panel off the stock. */
.card-side-back .card-layout { container-type: size; }
.card-back .tc-information {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 100%;
  padding: 9px 11px;
}
.card-back .tc-information > * { flex-shrink: 0; }
.card-back .tc-information .tc-header { padding-bottom: 4px; margin-bottom: 5px; }
.card-back .tc-text-box {
  flex-shrink: 1;
  min-height: 0;
  padding: 6px 0 3px;
  overflow: hidden;
}
.card-back .dossier-description { max-height: 100%; }
.card-back .dossier-specs { padding-top: 6px; gap: 6px 12px; }
.card-back .tc-footer { padding-top: 5px; }
.card-back .tc-type-line { overflow-wrap: anywhere; }

/* Wide prints have room to put the four camera facts on one row. Queries use
   the face's design canvas, so resizing the table preserves the same printing. */
@container (min-width: 400px) {
  .card-back .dossier-specs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container (max-height: 250px) {
  .card-back .dossier-description { -webkit-line-clamp: 3; line-clamp: 3; }
}
.card-back .tc-title { color: #d3d6d6; font-size: 14px; }
.card-back .dossier-description { font-size: 12px; }
/* The frame reference, printed small the way a negative is numbered. */
.card-back .tc-reference {
  color: #7f888c;
  font-size: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .card-turner { transition: none; }
}
