/* Volume detail page styles */
.volume-detail {
  width: min(var(--container-w), 90vw);
  margin: calc(var(--nav-h) + clamp(1rem, 3vw, 2rem)) auto clamp(3rem, 6vw, 5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.volume-detail__text {
  max-width: min(70vw, 820px);
  margin: 0 auto;
}

.volume-detail__text > *:first-child {
  margin-top: 0;
}

.volume-detail__text > *:last-child {
  margin-bottom: 0;
}

.volume-detail__meta {
  margin: 0 auto clamp(0.75rem, 2vw, 1.5rem);
  text-align: center;
  font-size: .95rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(30, 64, 175, 0.7);
}

.volume-detail__gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.5rem, 1vw, 1.2rem);
  width: 100%;
  justify-items: center;
  align-items: start;
  overflow: visible;
}

.volume-detail__figure {
  margin: 0 auto;
  max-width: min(70vw, 820px);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: stretch;
  position: relative;
  transition: z-index 0s ease;
}

.volume-detail__gallery .volume-detail__figure {
  margin: 0;
  max-width: 100%;
}

.volume-detail__figure:focus-within,
.volume-detail__figure:hover {
  z-index: 3;
}

.volume-detail__image {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 18px;
  overflow: hidden;
  background: #f8fafc;
  transition: transform 480ms cubic-bezier(.2,.8,.2,1), box-shadow 480ms cubic-bezier(.2,.8,.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center;
  will-change: transform, box-shadow;
}

.volume-detail__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
  transition: transform 480ms cubic-bezier(.2,.8,.2,1);
  display: block;
  will-change: transform;
}

.volume-detail__figure:hover .volume-detail__image,
.volume-detail__figure:focus-within .volume-detail__image {
  transform: scale(1.9);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.volume-detail__figure:hover .volume-detail__image img,
.volume-detail__figure:focus-within .volume-detail__image img {
  transform: scale(1);
}

.volume-detail__figure figcaption {
  text-align: center;
  font-size: .95rem;
  color: rgba(15, 23, 42, 0.72);
  max-width: 60ch;
}

.volume-detail__links ul {
  list-style: none;
  padding: 0;
  margin: clamp(.75rem, 2vw, 1.2rem) 0 0;
  display: grid;
  gap: .65rem;
}

.volume-detail__links a {
  color: rgba(37, 99, 235, 0.88);
  text-decoration: none;
  font-weight: 500;
  transition: color 200ms ease;
}

.volume-detail__links a:hover,
.volume-detail__links a:focus-visible {
  color: rgba(30, 64, 175, 1);
  text-decoration: underline;
}

@media (max-width: 960px) {
  .volume-detail__gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

@media (max-width: 640px) {
  .volume-detail__figure {
    max-width: 100%;
  }

  .volume-detail__gallery {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .volume-detail__text {
    max-width: 100%;
  }
}
