/* ============================================================
   Art theme: gallery wall.
   Warm white-cube wall, gilded frames, museum wall labels.
   ============================================================ */

body.theme-art {
  --bg: #efeae1;
  --bg-soft: #f5f1e9;
  --surface: #fcfaf5;
  --border: rgba(52, 44, 34, 0.14);
  --border-strong: rgba(52, 44, 34, 0.3);
  --text: #2c2620;
  --muted: #6f6558;
  --faint: #99907f;
  --accent: #7a3030;              /* oxblood */
  --accent-soft: rgba(122, 48, 48, 0.08);
  --gilt: #a8874f;
  --nav-bg: rgba(239, 234, 225, 0.88);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "EB Garamond", Georgia, serif;

  background-image: radial-gradient(100vw 70vh at 50% -20%, rgba(255, 255, 252, 0.8), transparent 70%);
}

/* the picture rail: a moulding line under the nav */
body.theme-art::before {
  content: "";
  position: fixed;
  top: 66px; left: 0; right: 0;
  height: 5px;
  border-top: 1px solid rgba(52, 44, 34, 0.25);
  border-bottom: 1px solid rgba(52, 44, 34, 0.12);
  background: linear-gradient(rgba(255, 255, 250, 0.7), rgba(52, 44, 34, 0.05));
  z-index: 999;
  pointer-events: none;
}

body.theme-art h1 { font-weight: 500; }
body.theme-art h1 em { color: var(--accent); }
body.theme-art h2 { font-weight: 560; }
body.theme-art .nav-links a { font-family: "EB Garamond", serif; font-size: 0.92rem; text-transform: none; letter-spacing: 0.05em; }
body.theme-art .hero-sub { font-size: 1.15rem; }

/* ---------- institution rail: gilded frames ---------- */
.inst-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 26px 20px;
  margin-bottom: 54px;
}
.inst-card {
  background: none;
  border: none;
  padding: 0;
  text-align: center;
  transition: transform 0.35s var(--ease);
}
.inst-card:hover { transform: translateY(-4px); }
.inst-thumb {
  height: 108px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #ded5c4, #cfc4ae);
  /* mat + gilded frame */
  border: 6px solid #faf7f0;
  outline: 3px solid var(--gilt);
  box-shadow:
    0 0 0 4px #c3a367,
    0 10px 22px rgba(52, 44, 34, 0.22),
    inset 0 0 14px rgba(52, 44, 34, 0.18);
  transition: box-shadow 0.35s;
}
.inst-card:hover .inst-thumb,
.inst-card.active .inst-thumb {
  box-shadow:
    0 0 0 4px #c3a367,
    0 16px 30px rgba(52, 44, 34, 0.3),
    inset 0 0 14px rgba(52, 44, 34, 0.18);
}
.inst-card.active .inst-thumb { outline-color: var(--accent); box-shadow: 0 0 0 4px var(--accent), 0 16px 30px rgba(52,44,34,.3), inset 0 0 14px rgba(52,44,34,.18); }
.inst-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s;
}
.inst-thumb img.loaded { opacity: 1; }
.inst-thumb .mono {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-style: italic;
  color: #8a7c62;
}
/* the red "selected" dot, like a sold sticker */
.inst-card.active .inst-info b::after {
  content: "●";
  color: var(--accent);
  font-size: 0.6rem;
  margin-left: 7px;
  vertical-align: middle;
}
.inst-info { padding: 12px 4px 0; }
.inst-info b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}
.inst-info span {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--faint);
  letter-spacing: 0.03em;
}

/* ---------- controls ---------- */
.art-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-strong);
}
.art-controls input, .art-controls select {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 9px 16px;
  outline: none;
  transition: border-color 0.3s;
}
.art-controls input:focus, .art-controls select:focus { border-color: var(--accent); }
.art-controls input { flex: 1; min-width: 180px; }
.art-controls select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236f6558' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.art-count { font-size: 0.85rem; font-style: italic; color: var(--faint); margin-left: auto; white-space: nowrap; }

/* ---------- wall labels ---------- */
.label-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}
.wall-label {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gilt);
  padding: 22px 24px 20px;
  box-shadow: 0 8px 20px rgba(52, 44, 34, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: labelIn 0.5s var(--ease) both;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.wall-label:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(52, 44, 34, 0.14);
}
@keyframes labelIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
/* the artwork itself, hung above its label (only when an image is found) */
.wl-art { display: none; }
.wall-label.has-art { cursor: zoom-in; }
.wall-label.has-art .wl-art {
  display: block;
  margin-bottom: 16px;
  background: #e8e2d4;
  border: 5px solid #faf7f0;
  outline: 2px solid var(--gilt);
  box-shadow: 0 0 0 3px #c3a367, 0 8px 18px rgba(52, 44, 34, 0.22);
}
.wl-art img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease);
}
.wall-label.has-art:hover .wl-art img { transform: scale(1.03); }

.wl-artist {
  font-variant: small-caps;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}
.wl-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
}
.wl-genre { font-size: 0.9rem; color: var(--muted); }
.wl-meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.wl-meta .wl-place { color: var(--accent); font-style: normal; font-variant: small-caps; letter-spacing: 0.08em; }
.art-empty { padding: 60px 0; text-align: center; color: var(--faint); font-style: italic; display: none; }

/* ---------- lightbox ---------- */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(24, 20, 15, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  cursor: zoom-out;
  animation: lbIn 0.25s ease;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 100%;
}
.lightbox img {
  max-width: 90vw;
  max-height: 76vh;
  object-fit: contain;
  border: 8px solid #faf7f0;
  outline: 3px solid var(--gilt);
  box-shadow: 0 0 0 5px #c3a367, 0 30px 80px rgba(0, 0, 0, 0.6);
  background: #1c1813;
}
.lightbox figcaption {
  font-family: var(--font-body);
  color: #e7e0d2;
  text-align: center;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 640px;
}
.lightbox figcaption b { font-variant: small-caps; letter-spacing: 0.1em; }
.lightbox figcaption i { font-family: var(--font-display); font-size: 1.15rem; }
.lightbox .lb-close {
  position: absolute;
  top: 20px; right: 26px;
  background: none;
  border: none;
  color: #e7e0d2;
  font-size: 2.2rem;
  line-height: 1;
  opacity: 0.8;
}
.lightbox .lb-close:hover { opacity: 1; }
body.lb-open { overflow: hidden; }

@media (max-width: 880px) {
  .inst-rail { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 20px 14px; }
  .label-grid { grid-template-columns: 1fr; }
  .wl-art img { height: 160px; }
}
