/* ═══════════════════════════════════════════════════════════════════
   Victorian Curio 21 – Stylesheet
   Dark, atmospheric, candlelit Victorian curiosity cabinet widget.
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=IM+Fell+English+SC&family=IM+Fell+English:ital@0;1&display=swap');

/* ─── CSS Variables ──────────────────────────────────────────────── */
.vc21-wrapper {
  --vc21-gold:       #c8a96e;
  --vc21-gold-light: #e8d4a0;
  --vc21-gold-dark:  #7a5c2e;
  --vc21-bg:         #0a0602;
  --vc21-bg-panel:   rgba(12, 7, 2, 0.96);
  --vc21-text:       #d4c098;
  --vc21-text-dim:   #8a7250;
  --vc21-border:     #3e2c10;
  --vc21-shadow:     rgba(0, 0, 0, 0.9);
  --vc21-frame-w:    6px;
  position: relative;
  font-family: 'IM Fell English', Georgia, serif;
  color: var(--vc21-text);
  background: var(--vc21-bg);
}

/* ─── Canvas Wrapper ─────────────────────────────────────────────── */
.vc21-canvas-wrap {
  position: relative;
  width: 100%;
  height: 700px;
  overflow: hidden;
  background: #050301;
  border: 1px solid var(--vc21-border);
  border-radius: 2px;
  cursor: grab;
}

.vc21-canvas-wrap:active {
  cursor: grabbing;
}

.vc21-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

/* ─── Loading Screen ─────────────────────────────────────────────── */
.vc21-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #050301;
  z-index: 10;
  gap: 24px;
}

.vc21-loading-candle {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.vc21-flame {
  width: 12px;
  height: 20px;
  background: radial-gradient(ellipse at 50% 80%, #fff8c0 0%, #ffb830 40%, #ff6200 75%, transparent 100%);
  border-radius: 50% 50% 30% 30%;
  animation: vc21-flicker 0.12s ease-in-out infinite alternate;
  filter: blur(0.5px);
  transform-origin: bottom center;
}

.vc21-wick {
  width: 2px;
  height: 6px;
  background: #4a3520;
  margin-top: 1px;
}

.vc21-body {
  width: 18px;
  height: 50px;
  background: linear-gradient(to bottom, #d4c098 0%, #b89660 40%, #8a6030 100%);
  border-radius: 2px 2px 3px 3px;
  position: relative;
  overflow: hidden;
}

.vc21-body::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(255,200,100,0.2) 0%, transparent 40%, rgba(0,0,0,0.3) 100%);
}

@keyframes vc21-flicker {
  0%   { transform: scale(1,    1   ) skewX(0deg);  opacity: 1;    }
  33%  { transform: scale(0.9,  1.1 ) skewX(3deg);  opacity: 0.95; }
  66%  { transform: scale(1.1,  0.92) skewX(-2deg); opacity: 0.98; }
  100% { transform: scale(0.95, 1.05) skewX(1deg);  opacity: 1;    }
}

.vc21-loading-text {
  font-family: 'IM Fell English SC', Georgia, serif;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--vc21-text-dim);
  text-transform: uppercase;
  animation: vc21-pulse 2s ease-in-out infinite;
  margin: 0;
}

@keyframes vc21-pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.9; }
}

/* ─── Hint Overlay ───────────────────────────────────────────────── */
.vc21-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  display: none;
}

.vc21-hint span {
  display: inline-block;
  font-family: 'IM Fell English SC', Georgia, serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--vc21-text-dim);
  background: rgba(5, 3, 1, 0.75);
  padding: 6px 18px;
  border: 1px solid var(--vc21-border);
  white-space: nowrap;
}

/* Show correct hint per device */
.vc21-hint-touch { display: none; }
@media (pointer: coarse) {
  .vc21-hint-mouse { display: none; }
  .vc21-hint-touch { display: inline-block; }
}

/* ─── Lightbox Overlay ───────────────────────────────────────────── */
.vc21-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 6, 2, 0.93);
  opacity: 0;
  transition: opacity 0.45s ease;
  padding: 20px;
  box-sizing: border-box;
}

.vc21-lightbox-overlay.vc21-lightbox-open {
  opacity: 1;
}

/* ─── Lightbox Frame ─────────────────────────────────────────────── */
.vc21-lightbox-frame {
  position: relative;
  max-width: 860px;
  width: 100%;
  background: linear-gradient(160deg, #0f0a04 0%, #0a0602 50%, #0f0a04 100%);
  border: var(--vc21-frame-w) solid var(--vc21-gold-dark);
  border-radius: 2px;
  padding: 48px 40px 40px;
  box-sizing: border-box;
  box-shadow:
    0 0 0 1px #1a0e04,
    0 0 0 8px #0a0602,
    0 0 0 9px #3e2c10,
    0 0 60px rgba(0,0,0,0.9),
    inset 0 0 30px rgba(0,0,0,0.5);
  transform: translateY(20px);
  transition: transform 0.45s cubic-bezier(.2,.8,.3,1);
  max-height: 90vh;
  overflow-y: auto;
}

.vc21-lightbox-overlay.vc21-lightbox-open .vc21-lightbox-frame {
  transform: translateY(0);
}

/* Victorian corner ornaments */
.vc21-lightbox-ornament {
  position: absolute;
  color: var(--vc21-gold);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
  opacity: 0.7;
}
.vc21-lightbox-ornament.top-left    { top: 10px;    left: 14px;  }
.vc21-lightbox-ornament.top-right   { top: 10px;    right: 14px; }
.vc21-lightbox-ornament.bottom-left { bottom: 10px; left: 14px;  }
.vc21-lightbox-ornament.bottom-right{ bottom: 10px; right: 14px; }

/* ─── Close Button ───────────────────────────────────────────────── */
.vc21-lightbox-close {
  position: absolute;
  top: 12px;
  right: 18px;
  background: none;
  border: 1px solid var(--vc21-border);
  color: var(--vc21-text-dim);
  font-size: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
  line-height: 1;
  padding: 0;
  border-radius: 1px;
  z-index: 2;
}

.vc21-lightbox-close:hover {
  color: var(--vc21-gold-light);
  border-color: var(--vc21-gold-dark);
  background: rgba(50, 30, 5, 0.5);
}

/* ─── Lightbox Inner ─────────────────────────────────────────────── */
.vc21-lightbox-inner {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}

.vc21-lightbox-img-wrap {
  flex: 0 0 auto;
  position: relative;
  width: 320px;
  max-width: 100%;
  align-self: center;
}

.vc21-lightbox-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
  border: 3px solid var(--vc21-gold-dark);
  box-shadow:
    0 0 0 1px #0a0602,
    0 0 20px rgba(0,0,0,0.8),
    inset 0 0 8px rgba(0,0,0,0.4);
  filter: sepia(0.18) brightness(0.92);
  transition: filter 0.4s;
}

.vc21-lightbox-img:hover {
  filter: sepia(0.05) brightness(1);
}

.vc21-lightbox-img-shimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(200, 169, 110, 0.08) 50%,
    transparent 70%
  );
  animation: vc21-shimmer 4s ease-in-out infinite;
}

@keyframes vc21-shimmer {
  0%, 100% { opacity: 0;   background-position: -200% 0; }
  50%       { opacity: 0.7; background-position:  200% 0; }
}

/* ─── Lightbox Meta ──────────────────────────────────────────────── */
.vc21-lightbox-meta {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.vc21-lightbox-divider {
  text-align: center;
  color: var(--vc21-gold-dark);
  font-size: 14px;
  letter-spacing: 4px;
  opacity: 0.8;
  line-height: 1;
}

.vc21-lightbox-title {
  font-family: 'Cinzel Decorative', 'IM Fell English SC', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--vc21-gold-light);
  text-align: center;
  margin: 0;
  line-height: 1.4;
  letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(200, 169, 110, 0.4);
}

.vc21-lightbox-description {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.75;
  color: var(--vc21-text);
  text-align: center;
  margin: 0;
  opacity: 0.88;
}

/* ─── Responsive – Tablet ────────────────────────────────────────── */
@media (max-width: 900px) {
  .vc21-canvas-wrap {
    height: 520px;
  }
  .vc21-lightbox-inner {
    flex-direction: column;
    align-items: center;
  }
  .vc21-lightbox-img-wrap {
    width: 100%;
    max-width: 420px;
  }
  .vc21-lightbox-frame {
    padding: 40px 28px 32px;
  }
}

/* ─── Responsive – Mobile ────────────────────────────────────────── */
@media (max-width: 600px) {
  .vc21-canvas-wrap {
    height: 380px;
  }
  .vc21-lightbox-frame {
    padding: 36px 18px 24px;
    border-width: 4px;
  }
  .vc21-lightbox-title {
    font-size: 15px;
  }
  .vc21-lightbox-description {
    font-size: 13px;
  }
  .vc21-lightbox-ornament {
    font-size: 13px;
  }
}

/* ─── Scrollbar Styling (lightbox) ──────────────────────────────── */
.vc21-lightbox-frame::-webkit-scrollbar {
  width: 5px;
}
.vc21-lightbox-frame::-webkit-scrollbar-track {
  background: #0a0602;
}
.vc21-lightbox-frame::-webkit-scrollbar-thumb {
  background: var(--vc21-gold-dark);
  border-radius: 2px;
}

/* ─── Elementor Editor Placeholder ──────────────────────────────── */
.elementor-editor-active .vc21-canvas-wrap {
  min-height: 300px;
}
