/* the permanent collection — gallery.css
   a hushed museum take on the glass aesthetic: deeper walls, spotlit exhibits,
   placards in small caps. builds on tokens.css / base.css / pages.css. */

/* ---------- the building ---------- */

.museum-main .museum-wing {
  /* museum walls run deeper than standard glass — the light budget goes to exhibits */
  background: rgba(9, 4, 22, 0.86);
  border-color: rgba(157, 123, 255, 0.28);
}

.museum-hero .museum-notice {
  margin: 1.1rem auto 0;
  max-width: 560px;
  padding: 0.7rem 1.1rem;
  border: 1px dashed rgba(255, 214, 107, 0.45);
  border-radius: var(--r-md);
  background: rgba(255, 214, 107, 0.06);
  color: var(--gold);
  font-size: 0.9rem;
}

.wing-lede {
  color: var(--ink-dim);
  margin: 0.55rem 0 0.2rem;
}

.wing-count {
  color: var(--ink-faint);
  font-size: 0.82rem;
  font-style: italic;
  margin: 0.2rem 0 0;
}

/* ---------- placards (small caps, as is proper) ---------- */

.placard {
  background: rgba(244, 241, 255, 0.05);
  border: 1px solid rgba(157, 123, 255, 0.24);
  border-radius: var(--r-sm);
  padding: 0.65rem 0.8rem;
  font-size: 0.8rem;
  line-height: 1.45;
}

.placard-title {
  display: block;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
  color: var(--ink);
}

.placard-medium,
.placard-date {
  display: block;
  color: var(--ink-faint);
  font-style: italic;
  font-size: 0.76rem;
  margin-top: 0.15rem;
}

.placard-note {
  color: var(--ink-dim);
  margin: 0.4rem 0 0;
}

.placard-pending {
  max-width: 520px;
  margin: 1.2rem auto 0.4rem;
  border-style: dashed;
  text-align: center;
  padding: 1.1rem 1.2rem;
}

.placard-pending .placard-title { color: var(--gold); }

/* ---------- wing i — the hall of incidents ---------- */

.exhibit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.1rem;
  margin-top: 1.2rem;
}

.frame {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.frame-art {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  border: 3px double rgba(255, 214, 107, 0.5);
  border-radius: var(--r-sm);
  /* the spotlight: warm from above, deep space below */
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 238, 200, 0.14), rgba(7, 3, 18, 0) 62%),
    linear-gradient(180deg, rgba(18, 8, 43, 0.9), rgba(7, 3, 18, 0.95));
  box-shadow: inset 0 0 30px rgba(4, 1, 12, 0.8);
  transition: transform 0.3s var(--ease-boing), box-shadow 0.3s var(--ease-smooth);
}

.frame:hover .frame-art {
  transform: translateY(-3px);
  box-shadow: inset 0 0 30px rgba(4, 1, 12, 0.8), 0 10px 26px rgba(5, 2, 20, 0.55);
}

.frame-emoji {
  font-size: 3.1rem;
  filter: drop-shadow(0 0 14px rgba(255, 238, 200, 0.35));
}

/* pieces on loan: the hook, the absence, the paperwork */

.frame-loan { opacity: 0.72; }

.frame-art-empty {
  border: 3px double rgba(157, 123, 255, 0.28);
  background:
    radial-gradient(circle at 50% 16%, rgba(157, 123, 255, 0.07), rgba(7, 3, 18, 0) 60%),
    linear-gradient(180deg, rgba(12, 6, 30, 0.9), rgba(7, 3, 18, 0.95));
}

/* the nail the piece used to hang on. the wall remembers. */
.frame-art-empty::before {
  content: '';
  position: absolute;
  top: 14%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: rgba(157, 123, 255, 0.5);
  box-shadow: 0 10px 14px rgba(4, 1, 12, 0.7);
}

.loan-tag {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  color: var(--ink-faint);
  border: 1px dashed rgba(141, 133, 184, 0.5);
  border-radius: var(--r-pill);
  padding: 0.25rem 0.8rem;
  transform: rotate(-3deg);
}

.frame-loan .placard { opacity: 0.85; }

/* ---------- wing ii — the vault annex ---------- */

.plinth-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.6rem 1.3rem;
  margin-top: 1.4rem;
  align-items: end;
}

.plinth {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.plinth-card {
  padding: 0 0.6rem;
  filter: drop-shadow(0 16px 22px rgba(4, 1, 12, 0.7));
  transition: transform 0.35s var(--ease-boing);
}

.plinth:hover .plinth-card { transform: translateY(-5px) rotate(-0.6deg); }

.plinth-card canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* the pedestal: a lit top edge, then a body that tapers into the dark */
.plinth-base {
  height: 34px;
  margin: -2px 1.1rem 0.7rem;
  border-radius: 4px 4px var(--r-sm) var(--r-sm);
  background: linear-gradient(180deg, rgba(157, 123, 255, 0.32), rgba(22, 13, 52, 0.9) 30%, rgba(7, 3, 18, 0.95));
  border-top: 1px solid rgba(244, 241, 255, 0.28);
  clip-path: polygon(0 0, 100% 0, 92% 100%, 8% 100%);
}

.plinth-empty {
  max-width: 300px;
  margin: 0 auto;
}

.plinth-empty .plinth-card { opacity: 0.85; }

/* ---------- wing iii — the observatory ---------- */

.observatory-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 1.3rem;
  align-items: flex-start;
}

.portrait-frame {
  flex: 1 1 340px;
  min-width: 260px;
  padding: 10px;
  border: 4px double rgba(255, 214, 107, 0.55);
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(18, 8, 43, 0.85), rgba(7, 3, 18, 0.95));
  box-shadow: var(--shadow-pop);
}

#observatory-canvas {
  display: block;
  width: 100%;
  border-radius: 4px;
}

.observatory-placard {
  flex: 1 1 220px;
  max-width: 340px;
  align-self: center;
}

/* ---------- wing iv — the archive ---------- */

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.archive-item {
  border: 1px solid rgba(157, 123, 255, 0.24);
  border-left: 3px solid rgba(255, 214, 107, 0.55);
  border-radius: var(--r-sm);
  background: rgba(244, 241, 255, 0.04);
  padding: 0.75rem 0.95rem;
  transition: border-color 0.25s, background 0.25s;
}

.archive-item:hover {
  border-color: rgba(157, 123, 255, 0.5);
  background: rgba(244, 241, 255, 0.06);
}

.archive-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.archive-icon { font-size: 1.05rem; }

.archive-kind {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  color: var(--gold);
}

.archive-date {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 0.74rem;
  font-style: italic;
}

.archive-text {
  color: var(--ink-dim);
  font-size: 0.92rem;
  margin: 0.35rem 0 0;
}

/* ---------- the gift shop ---------- */

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.gift-item {
  display: block;
  text-decoration: none;
  border: 1px solid rgba(157, 123, 255, 0.3);
  border-radius: var(--r-md);
  background: rgba(22, 13, 52, 0.6);
  padding: 1rem 1.05rem 1.05rem;
  transition: transform 0.3s var(--ease-boing), border-color 0.25s, box-shadow 0.3s;
}

.gift-item:hover,
.gift-item:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(125, 249, 224, 0.55);
  box-shadow: var(--glow-seafoam);
  outline: none;
}

.gift-item:focus-visible { border-color: var(--seafoam); }

.gift-emoji { font-size: 1.7rem; display: block; }

.gift-name {
  display: block;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-top: 0.35rem;
}

.gift-price {
  display: block;
  color: var(--gold);
  font-size: 0.78rem;
  font-style: italic;
  margin-top: 0.1rem;
}

.gift-blurb {
  color: var(--ink-dim);
  font-size: 0.84rem;
  margin: 0.45rem 0 0;
}

/* ---------- the guestbook ---------- */

.guestbook {
  margin-top: 1.6rem;
  border-top: 1px dashed rgba(157, 123, 255, 0.3);
  padding-top: 1.2rem;
}

.guestbook-label {
  display: block;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 0.55rem;
}

.guestbook-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

#guestbook-input {
  flex: 1 1 240px;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
  background: rgba(7, 3, 18, 0.6);
  border: 1px solid rgba(157, 123, 255, 0.35);
  border-radius: var(--r-pill);
  padding: 0.55rem 1rem;
}

#guestbook-input::placeholder { color: var(--ink-faint); }

#guestbook-input:focus-visible {
  outline: none;
  border-color: var(--seafoam);
  box-shadow: 0 0 0 3px rgba(125, 249, 224, 0.2);
}

.guestbook-btn {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bg-deep);
  background: var(--seafoam);
  border: none;
  border-radius: var(--r-pill);
  padding: 0.55rem 1.4rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease-boing), box-shadow 0.25s;
}

.guestbook-btn:hover,
.guestbook-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--glow-seafoam);
  outline: none;
}

.guestbook-btn:active { transform: translateY(0) scale(0.97); }

.guestbook-confirm {
  min-height: 1.2em;
  color: var(--seafoam);
  font-size: 0.84rem;
  font-style: italic;
  margin: 0.6rem 0 0;
}

/* ---------- narrow rooms ---------- */

@media (max-width: 480px) {
  .exhibit-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.8rem; }
  .frame-emoji { font-size: 2.4rem; }
  .plinth-row { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .archive-date { margin-left: 0; flex-basis: 100%; }
}

/* ---------- reduced motion: exhibits hold still ---------- */

@media (prefers-reduced-motion: reduce) {
  .frame:hover .frame-art,
  .plinth:hover .plinth-card,
  .gift-item:hover,
  .gift-item:focus-visible,
  .guestbook-btn:hover,
  .guestbook-btn:focus-visible {
    transform: none;
    transition: none;
  }
}

/* ---------- the catalog (museums print catalogs) ---------- */

@media print {
  #bg-canvas,
  #site-nav,
  .guestbook,
  .noscript-banner,
  .museum-notice { display: none !important; }

  body { background: #fff !important; color: #111 !important; }

  .museum-main .museum-wing,
  .gift-item,
  .archive-item,
  .placard {
    background: #fff !important;
    border-color: #999 !important;
    box-shadow: none !important;
    color: #111 !important;
  }

  .page-hero h1,
  .placard-title,
  .gift-name,
  .section-title,
  .archive-text,
  .placard-note,
  .gift-blurb,
  .wing-lede { color: #111 !important; text-shadow: none !important; }

  .placard-medium,
  .placard-date,
  .archive-date,
  .wing-count,
  .hero-sub,
  .hero-kicker,
  .gift-price,
  .archive-kind { color: #555 !important; }

  .frame-art,
  .frame-art-empty { background: #f4f2fa !important; border-color: #999 !important; box-shadow: none !important; }

  .loan-tag { color: #555 !important; border-color: #aaa !important; }

  .reveal { opacity: 1 !important; transform: none !important; }

  .museum-wing { break-inside: avoid; page-break-inside: avoid; }
}
