/*
 * Gallery widget styling.
 */

.wgallery {
  width: min(920px, 100%);
  margin: 14px 0;
}
.wgallery.align-left { margin-left: 0; margin-right: auto; }
.wgallery.align-center { margin-left: auto; margin-right: auto; }
.wgallery.align-right { margin-left: auto; margin-right: 0; }

.wgallery-frame {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: linear-gradient(180deg, var(--surface), var(--surface2));
  box-shadow: var(--shadow2);
  overflow: hidden;
}

.wgallery-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.wgallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transform: translateX(var(--shift, 0px));
  /* Slightly slower + smoother easing */
  transition: opacity 650ms cubic-bezier(0.2, 0.9, 0.2, 1), transform 650ms cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: opacity, transform;
}
.wgallery-img.is-active {
  opacity: 1;
  transform: translateX(0px);
}

/* Arrows: centered on the image, always above it */
.wgallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 84px;          /* larger hit area */
  height: 132px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent; /* NO circle / NO background */
  color: rgba(235,245,245,0.92);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.72;
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 6;           /* always above image */
}

html[data-theme="light"] .wgallery-arrow {
  color: rgba(18,21,34,0.92);
}

.wgallery-arrow:hover { opacity: 1; }
.wgallery-arrow:active { opacity: 0.92; }

.wgallery-arrow.prev { left: 12px; }
.wgallery-arrow.next { right: 12px; }

/* Provided arrow shape (this IS the button shape) */
.wgallery-arrow-icon{
  width: auto;
  height: 110px;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.35));
}
.wgallery-arrow-icon path{
  stroke: currentColor;
  stroke-width: 26;
  stroke-linecap: round;
  fill: none;
}
.wgallery-arrow-icon.is-left{ transform: scaleX(-1); }

.wgallery-bars {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 6px 0 6px;
}

.wgallery-bar {
  width: 20px;
  height: 3px;
  border-radius: 999px;
  border: none;
  background: rgba(235, 245, 245, 0.25);
  cursor: pointer;
  padding: 0;
}
html[data-theme="light"] .wgallery-bar { background: rgba(18, 21, 34, 0.22); }
.wgallery-bar.is-active { background: rgba(235, 245, 245, 0.70); }
html[data-theme="light"] .wgallery-bar.is-active { background: rgba(18, 21, 34, 0.65); }

.wgallery-caption {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding-top: 8px;
  min-height: 18px;
}

@media (prefers-reduced-motion: reduce){
  .wgallery-img{ transition: none !important; }
  .wgallery-arrow{ transition: none !important; }
}
