.torelh-slider-gallery {
  width: var(--torelh-gallery-width, 100%);
  max-width: 100%;
  color: inherit;
  margin: 2rem auto;
}
.torelh-slider-gallery__stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--torelh-gallery-ratio, 16 / 9);
  overflow: hidden;
  border-radius: 10px;
  background: #111;
  isolation: isolate;
}
.torelh-slider-gallery__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transition: opacity 420ms cubic-bezier(.22, 1, .36, 1);
  -webkit-transition: opacity 420ms cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.torelh-slider-gallery__image.is-active { opacity: 1; }
.torelh-slider-gallery__controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
}
.torelh-slider-gallery__counter {
  flex: 0 0 auto;
  min-width: 64px;
  font: 700 11px/1.2 Arial, sans-serif;
  letter-spacing: .12em;
}
.torelh-slider-gallery__range,
.torelh-slider-gallery-editor__range {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  accent-color: #ff4b35;
  cursor: pointer;
}
.torelh-slider-gallery__range {
  appearance: none;
  -webkit-appearance: none;
  height: 3px;
  border: 0;
  border-radius: 0;
  background: rgba(128,128,128,.5);
}
.torelh-slider-gallery__range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #ff4b35;
}
.torelh-slider-gallery__range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #ff4b35;
}
.torelh-slider-gallery-empty {
  padding: 24px;
  border: 1px dashed #888;
}
@media (prefers-reduced-motion: reduce) {
  .torelh-slider-gallery__image { transition: none; -webkit-transition: none; }
}

/* Block editor preview */
.editor-styles-wrapper .torelh-slider-gallery-editor {
  padding: 18px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  background: #f7f7f7;
  color: #222;
}
.torelh-slider-gallery-editor__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.torelh-slider-gallery-editor__stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: #111;
  border-radius: 6px;
}
.torelh-slider-gallery-editor__stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.torelh-slider-gallery-editor__count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 9px;
  border-radius: 3px;
  color: white;
  background: rgba(0,0,0,.7);
  font: 700 11px Arial, sans-serif;
}
.torelh-slider-gallery-editor__range { display: block; margin: 14px 0; }
.torelh-slider-gallery-editor__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.torelh-slider-gallery-editor__thumb {
  width: 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.torelh-slider-gallery-editor__thumb button:first-child {
  display: block;
  padding: 2px;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
}
.torelh-slider-gallery-editor__thumb button.is-selected { border-color: #ff4b35; }
.torelh-slider-gallery-editor__thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.torelh-slider-gallery-editor__empty {
  padding: 24px;
  border: 1px dashed #999;
  background: #fff;
}

/* Gutenberg block wrapper: keep the block easy to select and edit. */
.editor-styles-wrapper .torelh-slider-gallery-block {
  display: block;
  max-width: 100%;
  cursor: pointer;
}
.editor-styles-wrapper .torelh-slider-gallery-block.is-selected > .torelh-slider-gallery-editor,
.editor-styles-wrapper .torelh-slider-gallery-block.has-child-selected > .torelh-slider-gallery-editor {
  outline: 1px solid rgba(255,75,53,.55);
  outline-offset: 3px;
}
