/* EncausticGallery v1.0.0 – Stylesheet */

/* ─── Reset & root ─── */
.encaustic-gallery-widget {
  position: relative;
  font-family: 'Georgia', 'Times New Roman', serif;
  color: #e8d8b0;
  user-select: none;
}

/* ─── Controls bar ─── */
.enc-controls-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1a1008 0%, #2a1f0a 100%);
  border: 1px solid #5a3e1a;
  border-bottom: none;
  padding: 10px 16px;
  border-radius: 8px 8px 0 0;
  flex-wrap: wrap;
}

.enc-temp-display {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 140px;
}

.enc-temp-icon { font-size: 16px; }
.enc-temp-value {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: bold;
  color: #f5a623;
  min-width: 48px;
}

.enc-temp-bar {
  width: 80px;
  height: 6px;
  background: #3a2a10;
  border-radius: 3px;
  overflow: hidden;
}
.enc-temp-fill {
  height: 100%;
  width: 0%;
  background: #f5a623;
  border-radius: 3px;
  transition: width 0.3s ease, background 0.5s ease;
}

.enc-tool-buttons {
  display: flex;
  gap: 6px;
}

.enc-btn {
  background: #2e1f0a;
  border: 1px solid #5a3e1a;
  border-radius: 6px;
  color: #c8a87a;
  font-size: 16px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.enc-btn:hover {
  background: #3e2a0a;
  border-color: #f5a623;
  color: #fff;
}
.enc-btn--active {
  background: #5a3200;
  border-color: #f5a623;
  box-shadow: 0 0 8px rgba(245,166,35,0.4);
  color: #fff;
}
.enc-btn:active { transform: scale(0.95); }

.enc-layer-counter {
  font-size: 12px;
  color: #8a7060;
  margin-left: auto;
}
.enc-layer-counter strong { color: #f5a623; }

.enc-btn--gallery {
  font-size: 12px;
  padding: 7px 14px;
  letter-spacing: 0.04em;
}

/* ─── Canvas wrap ─── */
.encaustic-canvas-wrap {
  position: relative;
  width: 100%;
  background: #0d0905;
  cursor: crosshair;
  overflow: hidden;
}

.enc-main-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* ─── Temperature chart ─── */
.enc-temp-chart {
  position: absolute;
  bottom: 60px;
  right: 12px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 6px;
  padding: 4px;
  pointer-events: none;
}
.enc-chart-canvas { display: block; }
.enc-chart-label {
  font-size: 9px;
  color: rgba(245,166,35,0.6);
  text-align: center;
  margin-top: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Wax palette ─── */
.enc-palette {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
}

.enc-palette-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.enc-palette-swatch:hover {
  transform: scale(1.15);
  border-color: rgba(255,255,255,0.5);
}
.enc-palette-swatch.active {
  border-color: #f5a623;
  box-shadow: 0 0 10px rgba(245,166,35,0.6);
  transform: scale(1.2);
}

.enc-swatch-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 0 0 50% 50%;
}

/* ─── Hint text ─── */
.enc-hint {
  position: absolute;
  bottom: 12px;
  right: 190px;
  font-size: 11px;
  color: rgba(200,168,122,0.55);
  pointer-events: none;
  letter-spacing: 0.02em;
  text-align: right;
}

/* ─── Lightbox ─── */
.enc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.enc-lightbox--open {
  pointer-events: auto;
  opacity: 1;
}

.enc-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(245,224,176,0.94);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.enc-lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-width: min(900px, 92vw);
  width: 100%;
  background: #1a1008;
  border: 1px solid #6a4820;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(245,166,35,0.15),
    0 24px 80px rgba(0,0,0,0.5),
    0 0 40px rgba(245,166,35,0.08);
  max-height: 90vh;
  overflow-y: auto;
}

.enc-lightbox-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 10;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  color: #f5a623;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.enc-lightbox-close:hover {
  background: rgba(90,50,0,0.8);
  border-color: #f5a623;
}

.enc-lightbox-canvas-wrap {
  position: relative;
  width: 100%;
  background: #0d0905;
}

.enc-lightbox-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 55vh;
  object-fit: contain;
}

/* ─── Wax bubbles in lightbox ─── */
.enc-wax-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.enc-bubble {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: enc-bubble-float ease-in-out infinite alternate;
}

@keyframes enc-bubble-float {
  from { transform: translate(0, 0) scale(1); opacity: 0.7; }
  to   { transform: translate(4px, -8px) scale(1.15); opacity: 0.4; }
}

/* ─── Scratch traces in lightbox ─── */
.enc-scratch-traces {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      87deg,
      transparent 0px,
      transparent 18px,
      rgba(255,255,255,0.015) 18px,
      rgba(255,255,255,0.015) 19px
    ),
    repeating-linear-gradient(
      3deg,
      transparent 0px,
      transparent 32px,
      rgba(255,255,255,0.01) 32px,
      rgba(255,255,255,0.01) 33px
    );
}

/* ─── Lightbox info ─── */
.enc-lightbox-info {
  padding: 24px 28px;
  background: #1a1008;
}

.enc-lightbox-title {
  font-size: 22px;
  font-weight: normal;
  color: #e8d8b0;
  margin: 0 0 10px;
  letter-spacing: 0.03em;
}

.enc-lightbox-desc {
  font-size: 13px;
  color: #8a7060;
  line-height: 1.7;
  margin: 0 0 16px;
  font-style: italic;
}

.enc-lightbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.enc-meta-tag {
  font-size: 11px;
  background: #2e1f0a;
  border: 1px solid #5a3e1a;
  border-radius: 4px;
  padding: 3px 10px;
  color: #c8a87a;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.enc-lightbox-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.enc-btn-next-layer,
.enc-btn-export {
  background: linear-gradient(135deg, #5a3200 0%, #3a1f00 100%);
  border: 1px solid #f5a623;
  border-radius: 6px;
  color: #f5a623;
  font-size: 13px;
  padding: 10px 20px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.2s, box-shadow 0.2s;
}
.enc-btn-next-layer:hover,
.enc-btn-export:hover {
  background: linear-gradient(135deg, #7a4400 0%, #5a3200 100%);
  box-shadow: 0 0 12px rgba(245,166,35,0.4);
}

.enc-btn-export {
  background: #1a1a0a;
  border-color: #6a6a3a;
  color: #c8c87a;
}
.enc-btn-export:hover {
  background: #2a2a12;
  box-shadow: 0 0 12px rgba(200,200,122,0.3);
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .enc-controls-bar {
    padding: 8px 10px;
    gap: 8px;
  }
  .enc-temp-bar { width: 50px; }
  .enc-hint { display: none; }
  .enc-palette-swatch { width: 28px; height: 28px; }
  .enc-lightbox-info { padding: 16px; }
  .enc-lightbox-title { font-size: 18px; }
}

/* ─── Elementor editor ─── */
.elementor-editor-active .encaustic-gallery-widget {
  pointer-events: none;
}
.elementor-editor-active .encaustic-canvas-wrap::after {
  content: 'EncausticGallery – Vorschau im Editor eingeschränkt';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  background: rgba(26,16,8,0.85);
  color: #f5a623;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  letter-spacing: 0.04em;
  border: 1px solid #f5a623;
  pointer-events: none;
}

/* ─── Accessibility ─── */
@media (prefers-reduced-motion: reduce) {
  .enc-bubble { animation: none; }
  .enc-lightbox { transition: none; }
  .enc-btn { transition: none; }
}

.enc-lightbox-close:focus-visible,
.enc-btn:focus-visible,
.enc-palette-swatch:focus-visible,
.enc-btn-next-layer:focus-visible,
.enc-btn-export:focus-visible {
  outline: 2px solid #f5a623;
  outline-offset: 2px;
}
