/* The gallery. Pictures made for the passage, framed like plates in a book.
   Warm paper in the rail, a dark room in the lightbox, both themes handled. */

.art-strip {
  margin: 0 auto 2.4rem;
  max-width: min(60rem, 92vw);
}

.art-strip-label {
  margin: 0 0 .55rem;
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--ink-3);
  text-transform: lowercase;
}

.art-all {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--gold);
  border-bottom: 1px solid var(--gold-soft);
  cursor: pointer;
}

.art-all:hover { color: var(--ink); }

.art-rail {
  display: flex;
  gap: .7rem;
  margin: 0;
  padding: 0 0 .5rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.art-rail > li {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.art-plate {
  display: block;
  width: 11.5rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}

.art-frame {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 3px;
  background: var(--paper-3) center / cover no-repeat;
  box-shadow: var(--shadow-1);
  outline: 1px solid var(--rule);
  outline-offset: -1px;
}

.art-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s var(--ease), transform .6s var(--ease);
}

.art-frame.loaded img { opacity: 1; }

.art-plate:hover .art-frame img,
.art-plate:focus-visible .art-frame img { transform: scale(1.04); }

.art-plate:focus-visible .art-frame {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.art-plate-name {
  display: block;
  margin-top: .4rem;
  font-size: .78rem;
  line-height: 1.35;
  color: var(--ink-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ------------------------------------------------------------- lightbox */

body.art-open { overflow: hidden; }

.art-box {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 0;
  padding: clamp(.8rem, 3vw, 2.2rem);
  background: rgba(20, 16, 11, .93);
  backdrop-filter: blur(6px);
  color: #f2e9d9;
}

.art-stage {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: center / cover no-repeat;
  display: grid;
  place-items: center;
  min-height: 0;
}

.art-full {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  transform-origin: 52% 48%;
}

/* A slow drift across the plate. Twenty six seconds is under the threshold
   where the eye reads it as motion, which is the point. */
.art-full.burns { animation: art-burns 26s var(--ease) infinite alternate; }

@keyframes art-burns {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.07) translate3d(-1.4%, -1%, 0); }
}

.art-caption {
  max-width: 44rem;
  margin: 1rem auto 0;
  text-align: center;
}

.art-title {
  margin: 0 0 .3rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: #fbf4e6;
}

.art-line {
  margin: 0 0 .5rem;
  font-size: .92rem;
  line-height: 1.5;
  color: #ddd0b8;
}

.art-meta,
.art-rights,
.art-hedge {
  margin: .25rem 0 0;
  font-size: .78rem;
  color: #b3a58c;
}

.art-hedge { font-style: italic; }

.art-rights a {
  color: var(--gold-soft);
  text-underline-offset: 3px;
}

.art-verses {
  margin: .7rem 0 0;
  font-size: .78rem;
  color: #b3a58c;
}

.art-verses-label { letter-spacing: .04em; }

.art-ref {
  border: 1px solid rgba(201, 165, 106, .45);
  background: rgba(255, 255, 255, .04);
  color: #eadfc9;
  border-radius: 999px;
  padding: .12rem .55rem;
  margin: .12rem 0;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}

.art-ref:hover,
.art-ref:focus-visible {
  background: rgba(201, 165, 106, .22);
  color: #fff;
}

.art-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin-top: .9rem;
}

.art-step,
.art-close {
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: #f2e9d9;
  border-radius: 999px;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.art-step:hover,
.art-close:hover { background: rgba(255, 255, 255, .16); }

.art-step:focus-visible,
.art-close:focus-visible,
.art-all:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
}

.art-close {
  position: absolute;
  top: clamp(.8rem, 3vw, 2.2rem);
  right: clamp(.8rem, 3vw, 2.2rem);
  z-index: 1;
}

.art-count {
  font-size: .78rem;
  letter-spacing: .06em;
  color: #b3a58c;
  min-width: 5rem;
  text-align: center;
}

/* ------------------------------------------------------------- explorer */

.art-gallery-line {
  margin: 0 0 1.2rem;
  font-size: .85rem;
  color: var(--ink-2);
}

.art-chapter { margin-bottom: 1.6rem; }

.art-chapter h3 {
  margin: 0 0 .45rem;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.art-chapter h3 a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.art-chapter h3 a:hover { color: var(--gold); }

.art-chapter.here h3 { color: var(--gold); }

.art-here {
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--ink-3);
}

.art-chapter .art-plate { width: 8.5rem; }

@media (max-width: 640px) {
  .art-plate { width: 9rem; }
  .art-caption { max-width: none; }
  .art-title { font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  .art-full.burns { animation: none; }
  .art-frame img { transition: opacity .01s; }
  .art-plate:hover .art-frame img { transform: none; }
}
