/* "Works wheel" photo gallery: a ring of photo cards around a title that
   blows open into a 3D drum on scroll/drag, one card facing front at a time.
   Ported from a React/Tailwind reference component into vanilla JS + CSS for
   this codebase (no React/Tailwind here) — see assets/js/tw-wheel.js for the
   behaviour. Used by partials/threatened/gallery.php. */

.tw-wheel {
  position: relative;
  width: 100%;
  min-height: 740px;
  margin-bottom: 56px;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(29, 50, 21, 0.08);
  user-select: none;
}

.tw-wheel-stage {
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: pan-x;
  outline: none;
}
.tw-wheel-stage:active { cursor: grabbing; }
.tw-wheel-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--theme-color); }

.tw-wheel-drum {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-style: preserve-3d;
}

.tw-wheel-card {
  position: absolute;
  backface-visibility: hidden;
}

.tw-wheel-card-face {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(29, 50, 21, 0.05);
  box-shadow: 0 18px 40px -18px rgba(29, 50, 21, 0.4);
}
.tw-wheel-card-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.tw-wheel-credit {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 9px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.85);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  z-index: 2;
}
.tw-wheel-credit:hover { color: #fff; }

.tw-wheel-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
  pointer-events: none;
  font-family: var(--outfit-font);
  font-weight: 700;
  font-size: clamp(22px, 3vw, 34px);
  color: var(--theme-color-3);
  letter-spacing: -0.5px;
}

.tw-wheel-title {
  position: absolute;
  top: 50%;
  left: 5%;
  max-width: 19%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0;
}
.tw-wheel-title .tw-name {
  display: block;
  font-family: var(--outfit-font);
  font-weight: 700;
  font-size: clamp(18px, 2.2vw, 26px);
  color: var(--theme-color-3);
  letter-spacing: -0.5px;
  line-height: 1.25;
}
.tw-wheel-title .tw-sci {
  display: block;
  margin-top: 8px;
  font-style: italic;
  font-size: 14px;
  color: var(--theme-color);
}

.tw-wheel-index {
  position: absolute;
  top: 7%;
  right: 3%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: right;
  line-height: 1.9;
  max-height: 72%;
  overflow: hidden;
}
.tw-wheel-index button {
  background: none;
  border: 0;
  padding: 2px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(29, 50, 21, 0.35);
  cursor: pointer;
  transition: color 0.2s ease;
}
.tw-wheel-index button:hover,
.tw-wheel-index button:focus-visible { color: rgba(29, 50, 21, 0.75); }
.tw-wheel-index button.is-active { color: var(--theme-color); }

.tw-wheel-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(29, 50, 21, 0.35);
  pointer-events: none;
  letter-spacing: 0.3px;
}

@media (max-width: 767px) {
  .tw-wheel { min-height: 420px; border-radius: 16px; }
  .tw-wheel-title { max-width: 32%; left: 5%; }
  .tw-wheel-index { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tw-wheel-card { transition: none !important; }
}
