.art-viewer-is-open,
.art-viewer-is-open body {
  overflow: hidden;
}

.art-viewer-trigger,
.project-card__art.art-viewer-trigger,
.commission-row__art.art-viewer-trigger {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.project-card__caption {
  pointer-events: none;
}

.project-card__caption a {
  pointer-events: auto;
}

.project-card__link {
  color: var(--apricot-ink);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-card__link:hover,
.project-card__link:focus-visible {
  color: var(--text);
}

.art-viewer-trigger:focus-visible {
  z-index: 6;
  outline-offset: -7px;
}

.art-viewer-trigger__hint {
  position: absolute;
  right: 22px;
  top: 22px;
  z-index: 4;
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid rgba(255, 253, 248, 0.36);
  border-radius: 999px;
  background: rgba(11, 16, 13, 0.58);
  color: #fffdf8;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.commission-row__art .art-viewer-trigger__hint {
  left: 24px;
  right: auto;
  top: auto;
  bottom: 20px;
}

.art-viewer-open {
  appearance: none;
  -webkit-appearance: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 253, 248, 0.4);
  border-radius: 999px;
  background: rgba(11, 16, 13, 0.5);
  color: #fffdf8;
  cursor: zoom-in;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.art-viewer-open:hover,
.art-viewer-open:focus-visible {
  background: rgba(229, 152, 98, 0.88);
  color: var(--accent-ink);
}

.art-viewer {
  width: min(1120px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 32px));
  height: min(820px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.7);
  color: var(--text);
}

.art-viewer:not([open]) {
  display: none;
}

.art-viewer::backdrop {
  background: rgba(5, 8, 6, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: art-viewer-backdrop-in 180ms ease both;
}

.art-viewer[open] {
  animation: art-viewer-in 240ms var(--ease-smooth) both;
}

.art-viewer--fallback {
  position: fixed;
  inset: 16px;
  z-index: 1000;
  box-shadow: 0 0 0 100vmax rgba(5, 8, 6, 0.9), 0 34px 100px rgba(0, 0, 0, 0.7);
}

.art-viewer__surface {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.art-viewer__header,
.art-viewer__footer {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  background: rgba(24, 32, 27, 0.96);
}

.art-viewer__header {
  border-bottom: 1px solid var(--line);
}

.art-viewer__footer {
  align-items: end;
  border-top: 1px solid var(--line);
}

.art-viewer__status,
.art-viewer__instructions {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.art-viewer__title {
  margin-top: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 3vw, 2.15rem);
  font-weight: 500;
  line-height: 1;
}

.art-viewer__description {
  max-width: 66ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.art-viewer__close,
.art-viewer__navigation {
  appearance: none;
  -webkit-appearance: none;
  min-width: 48px;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.art-viewer__close {
  padding: 0 17px;
}

.art-viewer__close:hover,
.art-viewer__navigation:hover,
.art-viewer__close:focus-visible,
.art-viewer__navigation:focus-visible {
  border-color: var(--apricot-strong);
  background: var(--apricot-strong);
  color: var(--accent-ink);
}

.art-viewer__navigation:disabled {
  cursor: default;
  opacity: 0.38;
}

.art-viewer__stage {
  display: grid;
  min-height: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  overflow: hidden;
  background: var(--bg-deep);
}

.art-viewer__navigation {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
}

.art-viewer__navigation-text {
  display: none;
}

.art-viewer__media {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 18px;
  touch-action: pan-y pinch-zoom;
}

.art-viewer__media--image::before,
.art-viewer__media--image::after {
  display: none;
}

.art-viewer__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.art-viewer__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes art-viewer-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
}

@keyframes art-viewer-backdrop-in {
  from { opacity: 0; }
}

@media (max-width: 720px) {
  .art-viewer {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .art-viewer--fallback {
    inset: 0;
  }

  .art-viewer__header {
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  }

  .art-viewer__footer {
    display: block;
    padding: 13px 16px calc(14px + env(safe-area-inset-bottom));
  }

  .art-viewer__instructions {
    margin-top: 7px;
  }

  .art-viewer__stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
  }

  .art-viewer__media {
    grid-column: 1 / -1;
    grid-row: 1;
    border-radius: 14px;
  }

  .art-viewer__navigation {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
  }

  .art-viewer__navigation--previous { grid-column: 1; grid-row: 2; }
  .art-viewer__navigation--next { grid-column: 2; grid-row: 2; }
  .art-viewer__navigation-text { display: inline; }

  .art-viewer-trigger__hint {
    min-height: 32px;
    padding: 0 10px;
  }
}

@media (max-width: 460px) {
  .editorial-hero__caption {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-right: 92px;
  }

  .art-viewer-open {
    min-height: 32px;
  }

  .project-card__caption {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .project-card__link {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .art-viewer[open],
  .art-viewer::backdrop {
    animation: none;
  }
}
