:root {
  --vm-pink: #d356b4;
  --vm-gold: #d4af7a;
  --vm-berry: #6b1f4b;
  --vm-ink: #2e0f1a;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body.vm-gallery-page {
  min-width: 0;
  overflow-x: clip;
  background-color: #fff8f2;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 238px, rgba(212, 175, 122, 0.11) 238px 239px),
    linear-gradient(90deg, rgba(211, 86, 180, 0.045) 0 18%, transparent 18% 82%, rgba(211, 86, 180, 0.045) 82%),
    radial-gradient(ellipse 58rem 28rem at 50% 12%, rgba(212, 175, 122, 0.22), transparent 72%),
    linear-gradient(180deg, #fffdf9 0%, #fff6f7 50%, #fff9f0 100%);
  color: var(--vm-ink);
  font-family: Inter, system-ui, sans-serif;
}

body.vm-gallery-page:has(.vm-gallery-viewer[open]) {
  overflow: hidden;
}

.vm-skip-link {
  position: fixed;
  z-index: 100000;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  border: 2px solid var(--vm-gold);
  border-radius: 8px;
  background: #fff;
  color: var(--vm-berry);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-160%);
}

.vm-skip-link:focus {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.vm-gallery-header {
  width: min(calc(100% - 32px), 1180px);
  margin: 18px auto 0;
  padding: 18px 22px;
  border: 1px solid rgba(212, 175, 122, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(107, 31, 75, 0.08);
}

.vm-gallery-nav,
.vm-gallery-footer nav,
.vm-gallery-external {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 20px;
}

.vm-gallery-nav a {
  padding: 10px 8px;
  border-radius: 10px;
  color: var(--vm-berry);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.vm-gallery-nav .vm-gallery-brand {
  color: var(--vm-pink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 19px;
}

.vm-gallery-nav [aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--vm-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.vm-gallery-main {
  width: min(calc(100% - 32px), 1180px);
  margin: 0 auto;
  padding: 64px 0 76px;
}

.vm-gallery-intro {
  max-width: 650px;
  margin: 0 auto 42px;
  text-align: center;
}

.vm-gallery-ornament {
  margin: 0 0 6px;
  color: var(--vm-pink);
  font-size: 48px;
  line-height: 1;
}

.vm-gallery-intro h1 {
  margin: 0;
  color: var(--vm-berry);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(48px, 9vw, 88px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

.vm-gallery-description {
  margin: 18px 0 0;
  color: #5b3349;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
}

.vm-gallery-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.vm-gallery-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid var(--vm-gold);
  border-radius: 999px;
  background: #fff;
  color: var(--vm-berry);
  font-weight: 700;
  text-decoration: none;
}

.vm-gallery-actions a:last-child {
  border-color: var(--vm-berry);
  background: var(--vm-berry);
  color: #fff;
}

.vm-gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vm-gallery-grid li,
.vm-gallery-trigger {
  min-width: 0;
}

.vm-gallery-trigger {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--vm-gold);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(107, 31, 75, 0.13);
  cursor: zoom-in;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.vm-gallery-trigger:hover {
  box-shadow: 0 18px 40px rgba(107, 31, 75, 0.2);
  transform: translateY(-3px);
}

.vm-gallery-trigger img {
  display: block;
  width: 100%;
  height: auto;
}

.vm-gallery-trigger:focus-visible,
.vm-gallery-viewer button:focus-visible,
.vm-gallery-nav a:focus-visible,
.vm-gallery-actions a:focus-visible,
.vm-gallery-footer a:focus-visible,
.vm-skip-link:focus-visible {
  outline: 3px solid var(--vm-gold);
  outline-offset: 4px;
}

.vm-gallery-viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(29, 8, 20, 0.97);
  color: #fff;
}

.vm-gallery-viewer::backdrop {
  background: rgba(29, 8, 20, 0.94);
}

.vm-gallery-viewer-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(48px, 8vw) minmax(0, 1fr) minmax(48px, 8vw);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 58px 8px 18px;
}

.vm-gallery-viewer figure {
  display: grid;
  grid-column: 2;
  place-items: center;
  min-width: 0;
  height: 100%;
  margin: 0;
}

.vm-gallery-viewer figure img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 104px);
  border: 1px solid var(--vm-gold);
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.vm-gallery-viewer button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(212, 175, 122, 0.86);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.vm-gallery-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
}

.vm-gallery-previous {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
}

.vm-gallery-next {
  grid-column: 3;
  grid-row: 1;
  justify-self: center;
}

.vm-gallery-position {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 10px 0 0;
  text-align: center;
}

.vm-gallery-footer {
  padding: 42px 22px 28px;
  border-top: 1px solid rgba(212, 175, 122, 0.8);
  background: rgba(255, 255, 255, 0.72);
  color: #5b3349;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}

.vm-gallery-footer nav,
.vm-gallery-external {
  margin-bottom: 18px;
}

.vm-gallery-footer a {
  color: var(--vm-berry);
  text-decoration: underline;
  text-decoration-color: rgba(212, 175, 122, 0.85);
  text-underline-offset: 4px;
}

.vm-gallery-footer p {
  margin: 0;
}

.vm-gallery-footer p span {
  display: block;
}

.vm-gallery-unavailable {
  padding: 28px;
  border: 1px solid var(--vm-gold);
  border-radius: 18px;
  background: #fff;
  text-align: center;
}

.vm-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

@media (min-width: 480px) {
  .vm-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .vm-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
}

@media (min-width: 1280px) {
  .vm-gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .vm-gallery-header {
    padding: 14px 12px;
    border-radius: 18px;
  }

  .vm-gallery-nav {
    gap: 4px 8px;
  }

  .vm-gallery-nav a {
    padding: 8px 6px;
    font-size: 13px;
  }

  .vm-gallery-nav .vm-gallery-brand {
    flex-basis: 100%;
    font-size: 19px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .vm-gallery-trigger {
    transition: none;
  }
}
