/* ============================================================
   Medium Motion 3D — Three.js Viewer Styles
   Add these to your theme's main.css or enqueue separately
   ============================================================ */

/* ── Viewer canvas cursor ─────────────────────────────────── */
.card[data-model] canvas {
  cursor: grab;
}
.card[data-model] canvas:active {
  cursor: grabbing;
}

/* ── Loading overlay ──────────────────────────────────────── */
.mm3d-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: inherit;
  z-index: 10;
  transition: opacity 0.4s ease;
}

.mm3d-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 140px;
}

.mm3d-loader-bar {
  width: 100%;
  height: 1px;
  background: rgba(0, 229, 204, 0.15);
  position: relative;
  overflow: hidden;
}

.mm3d-loader-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--cyan, #00e5cc);
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(0, 229, 204, 0.6);
}

/* Animated shimmer for indeterminate state */
.mm3d-loader-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: mm3d-shimmer 1.4s ease-in-out infinite;
}

@keyframes mm3d-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(200%); }
}

.mm3d-loader-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0, 229, 204, 0.5);
  animation: mm3d-pulse 1.8s ease-in-out infinite;
}

@keyframes mm3d-pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1;   }
}

/* ── Drag hint ────────────────────────────────────────────── */
.mm3d-hint {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'DM Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 5;
}

/* ── Error state ──────────────────────────────────────────── */
.mm3d-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: rgba(10, 10, 10, 0.9);
  z-index: 10;
}

.mm3d-error-icon {
  font-size: 1.4rem;
  color: rgba(229, 64, 64, 0.8);
}

.mm3d-error-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  color: var(--grey, #888);
  letter-spacing: 0.1em;
  text-align: center;
  line-height: 1.8;
}

/* ── Viewer badge (optional — shows "3D" on card) ─────────── */
.card[data-model]::after {
  content: '3D';
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--cyan, #00e5cc);
  background: rgba(0, 229, 204, 0.08);
  border: 1px solid rgba(0, 229, 204, 0.2);
  padding: 0.2rem 0.5rem;
  z-index: 6;
  pointer-events: none;
}

/* ── Responsive — reduce quality hints on mobile ──────────── */
@media (max-width: 768px) {
  .mm3d-hint {
    font-size: 0.45rem;
  }
}

/* ============================================================
   Sketchfab Embed Card Styles
   ============================================================ */

.sketchfab-card {
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
  aspect-ratio: 1;
  cursor: default;
}
.sketchfab-card.featured {
  aspect-ratio: auto;
}

/* iframe fills the entire card */
.sketchfab-embed-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.sketchfab-embed-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Overlay sits at the bottom, slides up on hover */
.sketchfab-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 45%);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}
.sketchfab-card:hover .sketchfab-overlay {
  transform: translateY(0);
}

/* Badge */
.sketchfab-card::after {
  content: 'SF';
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--cyan, #00e5cc);
  background: rgba(0, 229, 204, 0.08);
  border: 1px solid rgba(0, 229, 204, 0.2);
  padding: 0.2rem 0.5rem;
  z-index: 3;
  pointer-events: none;
}

/* Mobile — always show overlay on Sketchfab cards too */
@media (max-width: 768px) {
  .sketchfab-card { aspect-ratio: 4/3; }
  .sketchfab-overlay { transform: translateY(0); }
}

/* ============================================================
   Image / Screenshot Card Styles
   ============================================================ */

.image-card {
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
  aspect-ratio: 1;
  cursor: default;
}
.image-card.featured {
  aspect-ratio: auto;
}

.image-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.6s ease;
}
.image-card:hover .image-wrap img {
  transform: scale(1.04);
}

/* No badge for image cards — clean look */
.image-card::after { display: none; }

@media (max-width: 768px) {
  .image-card { aspect-ratio: 4/3; }
  .image-card .card-overlay { transform: translateY(0); pointer-events: none; }
}
