.tm-clean-gallery {
  --tm-gallery-ink: #263029;
  --tm-gallery-sage: #4e5d4d;
  --tm-gallery-paper: #fffdf9;
  --tm-gallery-blush: #f6eae5;
  --tm-gallery-line: #dddcd4;
  box-sizing: border-box;
  width: min(100%, 1240px);
  margin-inline: auto;
  padding: clamp(48px, 7vw, 90px) clamp(18px, 4vw, 40px);
  color: var(--tm-gallery-ink);
  scroll-margin-top: 20px;
}

.tm-clean-gallery *, .tm-clean-gallery *::before, .tm-clean-gallery *::after { box-sizing: border-box; }
.tm-clean-gallery .tm-clean-gallery__intro { margin-bottom: clamp(18px, 3vw, 32px); }
.tm-clean-gallery .tm-clean-gallery__intro h2 {
  margin: 0;
  font: 400 clamp(36px, 5.8vw, 66px)/1 Georgia, "Times New Roman", serif;
  letter-spacing: -.04em;
}
.tm-clean-gallery .tm-clean-gallery__intro em { color: var(--tm-gallery-sage); }
.tm-clean-gallery .tm-clean-gallery__intro p { margin: 12px 0 0; color: var(--tm-gallery-sage); line-height: 1.5; }
.tm-clean-gallery .tm-clean-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 32px);
}
.tm-clean-gallery .tm-clean-gallery__item {
  min-width: 0;
  margin: 0;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid var(--tm-gallery-line);
  border-radius: 24px;
  background: var(--tm-gallery-paper);
}
.tm-clean-gallery .tm-clean-gallery__item h3 {
  margin: 0 0 12px;
  font: 400 clamp(22px, 3vw, 30px)/1.2 Georgia, "Times New Roman", serif;
}
.tm-clean-gallery .tm-clean-gallery__frame {
  --tm-gallery-reveal: 50%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 16px;
  background: var(--tm-gallery-blush);
}
.tm-clean-gallery .tm-clean-gallery__frame--drag {
  cursor: ew-resize;
  touch-action: pan-y;
  touch-action: pan-y pinch-zoom;
}
.tm-clean-gallery .tm-clean-gallery__layer { position: absolute; inset: 0; pointer-events: none; }
.tm-clean-gallery .tm-clean-gallery__layer img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tm-clean-gallery .tm-clean-gallery__layer--before { clip-path: inset(0 calc(100% - var(--tm-gallery-reveal)) 0 0); }
.tm-clean-gallery .tm-clean-gallery__tag {
  position: absolute;
  top: 12px;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--tm-gallery-ink);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tm-clean-gallery .tm-clean-gallery__layer--before .tm-clean-gallery__tag { left: 12px; }
.tm-clean-gallery .tm-clean-gallery__layer--after .tm-clean-gallery__tag { right: 12px; }
.tm-clean-gallery .tm-clean-gallery__divider {
  position: absolute;
  inset-block: 0;
  left: clamp(1px, var(--tm-gallery-reveal), calc(100% - 1px));
  width: 2px;
  transform: translateX(-50%);
  background: white;
  pointer-events: none;
}
.tm-clean-gallery .tm-clean-gallery__handle {
  position: absolute;
  top: 50%;
  left: clamp(24px, var(--tm-gallery-reveal), calc(100% - 24px));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--tm-gallery-line);
  border-radius: 50%;
  background: var(--tm-gallery-paper);
  color: var(--tm-gallery-sage);
  box-shadow: 0 4px 16px #26302938;
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
.tm-clean-gallery .tm-clean-gallery__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
  touch-action: pan-y pinch-zoom;
}
.tm-clean-gallery .tm-clean-gallery__range:disabled,
.tm-clean-gallery .tm-clean-gallery__frame--drag .tm-clean-gallery__range { pointer-events: none; }
.tm-clean-gallery .tm-clean-gallery__range::-webkit-slider-thumb { width: 44px; height: 44px; appearance: none; }
.tm-clean-gallery .tm-clean-gallery__range::-moz-range-thumb { width: 44px; height: 44px; border: 0; }
.tm-clean-gallery .tm-clean-gallery__frame:has(.tm-clean-gallery__range:focus-visible),
.tm-clean-gallery .tm-clean-gallery__controls button:focus-visible { outline: 3px solid var(--tm-gallery-sage); outline-offset: 3px; }
.tm-clean-gallery .tm-clean-gallery__controls:not([hidden]) { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.tm-clean-gallery .tm-clean-gallery__controls button {
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid var(--tm-gallery-line);
  border-radius: 99px;
  background: var(--tm-gallery-blush);
  color: var(--tm-gallery-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.tm-clean-gallery .tm-clean-gallery__controls button:hover { border-color: var(--tm-gallery-sage); }
.tm-clean-gallery .tm-clean-gallery__controls button[aria-pressed="true"] {
  border-color: var(--tm-gallery-sage);
  background: var(--tm-gallery-sage);
  color: white;
}

@media (max-width: 640px) {
  .tm-clean-gallery .tm-clean-gallery__grid { grid-template-columns: minmax(0, 1fr); }
}
