/**
 * Gallery page — flip card back face: content stays inside the card bounds.
 * Front face (.card-front) — structural 3D only; no visual overrides here.
 */

.card-flip-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-flip-wrapper.flipped {
  transform: rotateY(180deg);
}

.card-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: inherit;
}

.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  background: #111320;
  border-radius: inherit;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  box-sizing: border-box;
}

.card-back *,
.card-back *::before,
.card-back *::after {
  box-sizing: border-box;
}

.card-back-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
}

.card-back-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(16px, 2.5vw, 22px);
  color: #e8f0fe;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex: 1;
  min-width: 0;
}

.card-back-tag {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(0, 210, 255, 0.12);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.25);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-back-artist {
  font-size: 10px;
  color: #4a5568;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-back-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 8px;
  flex: 1;
  min-height: 0;
}

.card-back-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.card-back-cell-label {
  font-family: "Century Gothic", CenturyGothic, "AppleGothic", "Gill Sans MT", Calibri, sans-serif;
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #4a5568;
}

.card-back-cell-value {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(13px, 1.8vw, 17px);
  color: #e8f0fe;
  letter-spacing: 0.04em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-back-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: rgba(0, 210, 255, 0.07);
  margin: 2px 0;
}

@media (max-width: 480px) {
  .card-back {
    padding: 12px;
  }

  .card-back-title {
    font-size: 15px;
  }

  .card-back-cell-value {
    font-size: 13px;
  }

  .card-back-tag {
    font-size: 8px;
    padding: 2px 7px;
  }
}
