.ys-gallery {
  --ys-bg: #f4efe6;
  --ys-card: #fffaf3;
  --ys-text: #1a1612;
  --ys-muted: #6d645b;
  --ys-accent: #c45c26;
  --ys-border: #e4d8c8;
  --ys-border-w: 1px;
  --ys-radius: 18px;
  --ys-pad: 28px;
  --ys-card-pad: 14px;
  --ys-gap: 20px;
  --ys-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --ys-size: 16px;
  --ys-weight: 500;
  --ys-title-size: 15px;
  --ys-columns: 3;
  --ys-slides: 3;
  --ys-aspect: 16 / 9;
  box-sizing: border-box;
  background: var(--ys-bg);
  color: var(--ys-text);
  font-family: var(--ys-font);
  font-size: var(--ys-size);
  font-weight: var(--ys-weight);
  padding: var(--ys-pad);
  border-radius: calc(var(--ys-radius) + 6px);
  line-height: 1.45;
}

.ys-gallery *,
.ys-gallery *::before,
.ys-gallery *::after {
  box-sizing: border-box;
}

.ys-heading {
  margin: 0 0 1.1em;
  font-size: 1.35em;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.ys-empty {
  margin: 0;
  padding: 2.4em 1.4em;
  text-align: center;
  color: var(--ys-muted);
  border: var(--ys-border-w) dashed var(--ys-border);
  border-radius: var(--ys-radius);
  background: color-mix(in srgb, var(--ys-card) 80%, transparent);
}

.ys-empty p {
  margin: 0;
}

.ys-shell {
  position: relative;
}

.ys-viewport {
  min-width: 0;
}

.ys-track {
  display: grid;
  gap: var(--ys-gap);
}

.ys-gallery.is-grid .ys-track {
  grid-template-columns: repeat(var(--ys-columns), minmax(0, 1fr));
}

.ys-gallery.is-carousel .ys-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ys-gallery.is-carousel .ys-viewport::-webkit-scrollbar {
  display: none;
}

.ys-gallery.is-carousel .ys-track {
  display: flex;
  grid-template-columns: none;
}

.ys-gallery.is-carousel .ys-card {
  flex: 0 0 calc((100% - (var(--ys-slides) - 1) * var(--ys-gap)) / var(--ys-slides));
  scroll-snap-align: start;
  min-width: 0;
}

.ys-card {
  margin: 0;
  background: var(--ys-card);
  border: var(--ys-border-w) solid var(--ys-border);
  border-radius: var(--ys-radius);
  padding: var(--ys-card-pad);
  min-width: 0;
}

.ys-gallery.ys-shadow-soft .ys-card {
  box-shadow: 0 10px 28px -18px rgba(48, 32, 16, 0.45);
}

.ys-gallery.ys-shadow-medium .ys-card {
  box-shadow: 0 18px 40px -20px rgba(40, 24, 10, 0.55);
}

.ys-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: calc(var(--ys-radius) - 6px);
  overflow: hidden;
  background: #2a221c;
  cursor: pointer;
  aspect-ratio: var(--ys-aspect);
}

.ys-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
  transition: transform 280ms ease, filter 280ms ease;
}

.ys-thumb:hover img,
.ys-thumb:focus-visible img {
  transform: scale(1.05);
  filter: brightness(0.86);
}

.ys-thumb:focus-visible {
  outline: 3px solid var(--ys-accent);
  outline-offset: 3px;
}

.ys-play {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  display: grid;
  place-items: center;
  color: #fffaf3;
  background: var(--ys-accent);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(28, 16, 8, 0.28);
  transition: transform 200ms ease, background 200ms ease;
}

.ys-play svg {
  margin-left: 3px;
}

.ys-thumb:hover .ys-play,
.ys-thumb:focus-visible .ys-play {
  transform: scale(1.08);
}

.ys-title {
  margin: 0.75em 0 0;
  font-size: var(--ys-title-size);
  font-weight: inherit;
  letter-spacing: -0.01em;
  color: var(--ys-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ys-gallery.is-hide-title .ys-title {
  display: none;
}

.ys-inline {
  margin-top: 0.75em;
}

.ys-inline iframe,
.ys-lightbox-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.ys-inline.is-on {
  aspect-ratio: var(--ys-aspect);
  border-radius: calc(var(--ys-radius) - 6px);
  overflow: hidden;
}

.ys-nav {
  position: absolute;
  top: 38%;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: var(--ys-border-w) solid var(--ys-border);
  border-radius: 999px;
  background: var(--ys-card);
  color: var(--ys-text);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(30, 20, 10, 0.12);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0;
}

.ys-nav:hover,
.ys-nav:focus-visible {
  background: var(--ys-accent);
  color: #fffaf3;
  border-color: var(--ys-accent);
  outline: none;
}

.ys-prev {
  left: -8px;
}

.ys-next {
  right: -8px;
}

.ys-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.ys-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ys-muted) 45%, transparent);
  cursor: pointer;
}

.ys-dot.is-active,
.ys-dot:hover {
  background: var(--ys-accent);
  transform: scale(1.2);
}

.ys-lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(1100px, calc(100vw - 32px));
  width: 100%;
}

.ys-lightbox::backdrop {
  background: rgba(22, 16, 12, 0.82);
}

.ys-lightbox-inner {
  position: relative;
  background: #140f0c;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.ys-lightbox-frame {
  aspect-ratio: 16 / 9;
}

.ys-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.92);
  color: #1a1612;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.ys-lightbox-close:hover,
.ys-lightbox-close:focus-visible {
  background: #c45c26;
  color: #fffaf3;
  outline: none;
}

@media (max-width: 960px) {
  .ys-gallery.is-grid .ys-track {
    grid-template-columns: repeat(min(2, var(--ys-columns)), minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ys-gallery {
    padding: calc(var(--ys-pad) * 0.7);
  }

  .ys-gallery.is-grid .ys-track {
    grid-template-columns: minmax(0, 1fr);
  }

  .ys-gallery.is-carousel {
    --ys-slides: 1;
  }

  .ys-nav {
    width: 36px;
    height: 36px;
    top: 32%;
  }

  .ys-prev {
    left: 4px;
  }

  .ys-next {
    right: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ys-gallery.is-carousel .ys-viewport,
  .ys-thumb img,
  .ys-play {
    scroll-behavior: auto;
    transition: none;
  }
}
