/* events — exhibitions list + per-item image sliders */

.exhibitions-wrap {
  max-width: 720px;
  margin: 0 auto;
}

.exhibition-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.exhibition-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule-light);
}

.exhibition-item:first-child {
  padding-top: 0;
}

.exhibition-item:last-child {
  border-bottom: none;
}

/* Slider above poster + details */
.exhibition-item--has-slider .exhibition-item-slider {
  margin-bottom: 0;
}

.exhibition-item--has-slider .exhibition-item-lower {
  margin-top: 16px;
}

/* Fixed-width poster column (matches .book-row image column) + fluid details */
.exhibition-item-lower--with-poster {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}

.exhibition-item-lower--with-poster .exhibition-item-body {
  min-width: 0;
}

.exhibition-item-poster {
  margin: 0;
  width: 200px;
  box-sizing: border-box;
  border: 1px solid var(--rule-light);
  background: color-mix(in srgb, var(--rule-light) 22%, var(--bg));
  padding: 8px;
}

.exhibition-item-poster-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  max-height: 280px;
  text-decoration: none;
  color: inherit;
  cursor: zoom-in;
  outline-offset: 2px;
}

.exhibition-item-poster-link:focus-visible {
  outline: 2px solid var(--link);
}

.exhibition-item-poster img {
  display: block;
  width: 100%;
  max-height: 264px;
  height: auto;
  object-fit: contain;
}

.exhibition-item-slider {
  position: relative;
  width: 100%;
  border: 1px solid var(--rule-light);
  background: color-mix(in srgb, var(--rule-light) 22%, var(--bg));
  overflow: hidden;
}

.exhibition-item-slides {
  position: relative;
  width: 100%;
  min-height: min(36vh, 340px);
}

.exhibition-item-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.45s ease;
  padding: 10px;
  box-sizing: border-box;
  pointer-events: none;
}

.exhibition-item-slide.is-active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

.exhibition-item-slide-link {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  text-decoration: none;
  color: inherit;
  cursor: zoom-in;
  outline-offset: 2px;
}

.exhibition-item-slide-link:focus-visible {
  outline: 2px solid var(--link);
}

.exhibition-item-slide img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(36vh, 340px);
  object-fit: contain;
  pointer-events: none;
}

.exhibition-pdf-loading,
.exhibition-pdf-error {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.exhibition-pdf-error {
  color: var(--cite-color);
}

.exhibition-pdf-page-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.exhibition-pdf-canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(36vh, 340px);
  pointer-events: none;
}

.exhibition-pdf-page-hit {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  border-radius: 0;
}

.exhibition-pdf-page-hit:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.exhibition-item-pdf-slide {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

.exhibition-item-pdf-frame {
  width: 100%;
  min-height: 280px;
  height: min(42vh, 380px);
  border: 1px solid var(--rule-light);
  background: color-mix(in srgb, var(--text) 6%, var(--bg));
}

.exhibition-item-pdf-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  font-family: var(--font-body);
  font-size: var(--fs-small);
}

.exhibition-item-slide-link--pdf {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--link);
}

.exhibition-item-slide-link--pdf:hover {
  color: var(--link-hover);
}

.exhibition-item-pdf-newtab {
  color: var(--text-muted);
  text-decoration: none;
}

.exhibition-item-pdf-newtab:hover {
  color: var(--link);
  text-decoration: underline;
}

.exhibition-item-prev,
.exhibition-item-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, var(--text));
  border: 1px solid var(--rule-light);
  color: var(--text);
  width: 36px;
  height: 56px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.exhibition-item-prev:hover,
.exhibition-item-next:hover {
  background: color-mix(in srgb, var(--bg) 70%, var(--text));
}

.exhibition-item-prev {
  left: 6px;
}

.exhibition-item-next {
  right: 6px;
}

.exhibition-item-body {
  min-width: 0;
}

.exhibition-item time {
  display: block;
  font-size: var(--fs-small);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cite-color);
  margin-bottom: 8px;
}

.exhibition-item h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--heading);
  margin: 0 0 8px;
}

.exhibition-meta {
  margin: 0 0 8px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
}

.exhibition-note {
  margin: 0;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .exhibition-item-slides {
    min-height: min(30vh, 260px);
  }

  .exhibition-item-slide img {
    max-height: min(30vh, 260px);
  }

  .exhibition-item-pdf-frame {
    min-height: 220px;
    height: min(38vh, 300px);
  }
}

@media (max-width: 760px) {
  .exhibitions-wrap {
    padding: 0 4px;
  }

  .exhibition-item-lower--with-poster {
    grid-template-columns: 1fr;
  }

  .exhibition-item-poster {
    width: 200px;
    margin-inline: auto;
  }
}
