/* ============================================================================
   The virtual museum: the collection hangs on a lit plaster wall, each object
   with its label under it; the exhibits "in the window" and the photos of an
   exhibit stand in a dark showcase lit from above, on a brass edge; the
   catalogue record reads like the printed card of a museum register.
   Loaded by museum.php, exhibit.php and admin/museum.php.
   ========================================================================== */
:root {
  --mv-wall: #e4dfd4; --mv-wall-light: #f2eee6;
  --mv-case: #221f1a; --mv-lamp: rgba(255, 234, 186, .2);
  --mv-brass: #7d6115;            /* the inventory numbers: dark enough to read on the labels */
  --mv-internal: #fbf6e4; --mv-internal-line: #d8c48a;
}
.mv-page { margin-bottom: 48px; }

/* ---- the head of the museum --------------------------------------------- */
.mv-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 28px 0 6px; padding-bottom: 18px; border-bottom: 3px double var(--line-2); }
.mv-head h1 { font-size: clamp(2.1rem, 4.2vw, 3.05rem); margin: 0 0 10px; }
.mv-head .lead { font-size: 1.12rem; line-height: 1.55; color: var(--ink-2); max-width: 68ch; margin: 0; }
.mv-manage { margin: 0; flex: 0 0 auto; }
.mv-section-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 1.7rem; margin: 34px 0 14px; }
.mv-count { font-family: var(--font-body); font-size: .92rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }

/* ---- the inventory number and the visibility of an exhibit ---------------- */
.mv-inv { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .8rem; font-weight: 700; color: var(--mv-brass); letter-spacing: .03em; font-variant-numeric: tabular-nums lining-nums; }
.mv-vis { display: inline-flex; align-items: center; gap: 3px; padding: 0 7px 0 5px; border-radius: 999px; border: 1px solid; font-size: .72rem; font-weight: 600; letter-spacing: 0; line-height: 1.6; }
.mv-vis .ico { width: .95em; height: .95em; vertical-align: 0; }
.mv-vis.members { background: var(--green-soft); border-color: #b8dcb4; color: var(--green-dark); }
.mv-vis.admin { background: var(--gold-soft); border-color: #e2cf8f; color: #6b5210; }

/* ---- in the window: the showcase lit from above -------------------------- */
.mv-feat-grid { display: grid; gap: 16px; }
.mv-feat-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mv-feat-grid.n3 { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.mv-feat-grid.n3 .mv-feat:first-child { grid-row: span 2; }
.mv-feat { display: flex; flex-direction: column; min-width: 0; color: inherit; background: var(--card); border: 1px solid var(--mv-case); border-radius: 3px; overflow: hidden; }
.mv-feat:hover { text-decoration: none; }
.mv-feat:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.mv-feat .mv-wall { position: relative; display: block; flex: 1 1 auto; min-height: 170px; overflow: hidden;
  background: radial-gradient(70% 60% at 50% -8%, var(--mv-lamp), rgba(255, 234, 186, 0) 72%), var(--mv-case); box-shadow: inset 0 0 60px rgba(0, 0, 0, .5); }
.mv-feat-grid.n1 .mv-wall, .mv-feat-grid.n2 .mv-wall { aspect-ratio: 16 / 10; }
.mv-feat-grid.n3 .mv-feat:first-child .mv-wall { aspect-ratio: 4 / 3; }
.mv-feat .mv-wall img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6% 8%; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .55)); }
.mv-feat .mv-noimg { position: absolute; left: 50%; top: 50%; width: 28%; height: auto; max-height: 60%; transform: translate(-50%, -50%); color: #6d6456; }
.mv-feat-label { display: flex; flex-direction: column; gap: 3px; padding: 12px 16px 14px; border-top: 3px solid var(--gold); }
.mv-feat .mv-title { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; line-height: 1.2; color: var(--ink); }
.mv-feat-grid.n3 .mv-feat:first-child .mv-title, .mv-feat-grid.n1 .mv-title { font-size: 1.6rem; }
.mv-feat:hover .mv-title { color: var(--green-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.mv-excerpt { margin-top: 4px; font-size: .95rem; line-height: 1.45; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mv-feat-grid.n3 .mv-feat:not(:first-child) .mv-excerpt { display: none; }
/* one exhibit in the window: the showcase beside its label */
.mv-feat-grid.n1 .mv-feat { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.mv-feat-grid.n1 .mv-feat-label { border-top: 0; border-left: 3px solid var(--gold); justify-content: center; padding: 22px 26px; }

/* ---- the search and the filters of the collection ------------------------- */
.mv-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; padding: 14px 16px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); }
.mv-search { flex: 1 1 100%; display: flex; gap: 8px; }
.mv-search input { flex: 1 1 auto; min-width: 0; }
.mv-purpose { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.mv-purpose a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-weight: 600; font-size: .92rem; color: var(--ink-2); }
.mv-purpose a + a { border-left: 1px solid var(--line-2); }
.mv-purpose a:hover { background: var(--gold-soft); text-decoration: none; }
.mv-purpose a.on { background: var(--mv-case); color: #f1e7c9; }
.mv-purpose a .ico { color: var(--gold); }
.mv-purpose a.on .ico { color: var(--gold-2); }
/* the lists stand in the same row as the purpose; the order, which only sorts, keeps to the right */
.mv-selects { display: contents; }
.mv-selects label:last-of-type { margin-left: auto; }
.mv-selects label { display: flex; flex-direction: column; gap: 3px; margin: 0; font-size: .8rem; color: var(--muted); }
.mv-selects select { width: auto; min-width: 140px; max-width: 210px; padding: 6px 9px; font-size: .92rem; }
.mv-found { margin: 10px 0 0; color: var(--muted); }

/* ---- the collection: objects on the wall, the label under each ----------- */
.mv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 20px 18px; margin-top: 18px; }
.mv-grid.small { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 16px; margin-top: 0; }
.mv-card { display: flex; flex-direction: column; min-width: 0; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.mv-card:hover { text-decoration: none; border-color: var(--line-2); }
.mv-card:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.mv-card .mv-wall { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: radial-gradient(85% 65% at 50% 0%, var(--mv-wall-light), var(--mv-wall) 75%); }
.mv-card .mv-wall img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 11%; filter: drop-shadow(0 6px 8px rgba(28, 26, 22, .28)); }
.mv-card .mv-noimg { position: absolute; left: 50%; top: 50%; width: 34%; height: auto; transform: translate(-50%, -50%); color: #b5aa92; }
.mv-label { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.mv-card .mv-title { font-family: var(--font-display); font-weight: 600; font-size: 1.16rem; line-height: 1.2; color: var(--ink); margin: 1px 0 3px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mv-card:hover .mv-title { color: var(--green-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.mv-meta { display: flex; align-items: flex-start; gap: 6px; font-size: .84rem; line-height: 1.35; color: var(--muted); }
.mv-meta .ico { color: var(--gold); margin-top: 1px; }
.mv-grid.small .mv-title { font-size: 1.05rem; }
.mv-empty { text-align: center; padding: 42px 20px; margin-top: 18px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); }
.mv-empty > .ico { width: 52px; height: 52px; color: var(--line-2); }
.mv-empty p { margin: 10px 0 14px; font-size: 1.05rem; }

/* ---- the page of an exhibit ------------------------------------------------ */
.mv-exhibit { margin-top: 4px; }
.mv-ex-head { margin: 6px 0 18px; }
.mv-ex-inv { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 4px; font-size: .92rem; color: var(--muted); }
.mv-ex-inv b { font-size: 1.02rem; color: var(--mv-brass); letter-spacing: .03em; font-variant-numeric: tabular-nums lining-nums; }
.mv-ex-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); max-width: 34ch; margin: 0 0 12px; }
.mv-icons li { font-size: .88rem; }
/* the showcase of the photos: lit from above, on a brass edge, the photos bigger than elsewhere */
.mv-photos { margin: 0; }
.mv-photos .photo-strip.vitrine { padding: 26px 22px 22px; border: 0; border-bottom: 3px solid var(--gold); border-radius: 3px;
  background: radial-gradient(60% 85% at 50% -12%, var(--mv-lamp), rgba(255, 234, 186, 0) 70%), var(--mv-case); box-shadow: inset 0 0 70px rgba(0, 0, 0, .5); }
.mv-photos .photo-strip.vitrine .ps-row { gap: 22px; }
/* a photo with a transparent background (a PNG of a dark badge) stands on a light mount, as on a museum board; an ordinary photo covers it */
.mv-photos .photo-strip.vitrine .ps-item > a { background: #ebe6db; border-radius: 2px; }
.mv-photos .photo-strip.vitrine .ps-item img { height: 340px; max-width: min(84vw, 560px); filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .55)); }
.mv-photos .photo-strip.vitrine .ps-add label { height: 340px; }
.mv-photos .ps-help { margin-top: 8px; }

.mv-ex-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 36px; margin-top: 28px; align-items: start; }
.mv-ex-text > section + section { margin-top: 28px; }
.mv-ex-text h2 { font-size: 1.6rem; margin: 0 0 10px; }
.mv-inscr { max-width: 74ch; margin: 0; padding: 12px 18px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 0 3px 3px 0;
  font-family: var(--font-display); font-style: normal; font-size: 1.22rem; line-height: 1.45; letter-spacing: .02em; color: var(--ink); }
.mv-ex-side { display: grid; gap: 16px; min-width: 0; }
/* the catalogue record: the printed card of the register */
.mv-record { background: var(--card); border: 1px solid var(--line-2); border-radius: 3px; padding: 16px 18px 6px; }
.mv-record h2 { font-size: 1.4rem; margin: 0; padding-bottom: 8px; border-bottom: 3px double var(--line-2); }
.mv-ex-side dl { margin: 0; }
.mv-rec-row { padding: 8px 0 9px; border-top: 1px solid var(--line); }
.mv-rec-row:first-child { border-top: 0; }
.mv-rec-row dt { display: flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.mv-rec-row dd { margin: 2px 0 0; font-size: .97rem; line-height: 1.45; overflow-wrap: anywhere; }
.mv-cite, .mv-internal { border-radius: 3px; padding: 12px 16px 14px; }
.mv-cite { background: var(--paper-2); border: 1px solid var(--line); }
.mv-cite h2, .mv-internal h2 { display: flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: .98rem; font-weight: 700; letter-spacing: 0; margin: 0 0 6px; color: var(--ink); }
.mv-cite h2 .ico, .mv-internal h2 .ico { color: var(--gold); }
.mv-cite p { margin: 0 0 8px; color: var(--ink-2); overflow-wrap: anywhere; }
.mv-internal { background: var(--mv-internal); border: 1px dashed var(--mv-internal-line); }
.mv-internal > p { margin: 0 0 4px; }
.mv-internal .mv-rec-row { padding: 6px 0 7px; border-top-color: #eadcae; }
.mv-related { margin-top: 12px; }
.mv-exhibit .pager { margin-top: 34px; }

/* ---- Admin → Virtual museum ------------------------------------------------ */
.mv-form fieldset { background: var(--card); }
.mv-form legend .ico { color: var(--gold); }
.mv-form fieldset.mv-internal-fs { background: var(--mv-internal); border: 1px dashed var(--mv-internal-line); }
.mv-form select[multiple] { min-height: 128px; }

/* ---- narrow screens -------------------------------------------------------- */
@media (max-width: 900px) {
  .mv-ex-body { grid-template-columns: 1fr; gap: 26px; }
  .mv-ex-side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: start; }
  .mv-feat-grid.n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mv-feat-grid.n3 .mv-feat:first-child { grid-row: auto; grid-column: 1 / -1; }
  .mv-feat-grid.n3 .mv-feat:first-child .mv-wall { aspect-ratio: 16 / 10; }
}
@media (max-width: 680px) {
  .mv-head { flex-direction: column; align-items: stretch; gap: 14px; margin-top: 18px; }
  .mv-filters { display: grid; grid-template-columns: 1fr; padding: 12px; }
  .mv-purpose { justify-self: start; max-width: 100%; }
  .mv-purpose a { padding: 7px 11px; }
  .mv-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .mv-selects label:last-of-type { margin-left: 0; }
  .mv-selects select { width: 100%; min-width: 0; max-width: none; }
  .mv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mv-grid.small { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mv-label { padding: 8px 10px 10px; }
  .mv-card .mv-title { font-size: 1.05rem; }
  .mv-feat-grid.n2, .mv-feat-grid.n3 { grid-template-columns: 1fr; }
  .mv-feat-grid.n3 .mv-feat:not(:first-child) .mv-wall { aspect-ratio: 16 / 10; flex: 0 0 auto; }
  .mv-feat-grid.n1 .mv-feat { display: flex; }
  .mv-feat-grid.n1 .mv-feat-label { border-left: 0; border-top: 3px solid var(--gold); padding: 12px 16px 14px; }
  .mv-photos .photo-strip.vitrine { padding: 16px 12px 14px; }
  .mv-photos .photo-strip.vitrine .ps-item img { height: 240px; }
  .mv-photos .photo-strip.vitrine .ps-add label { height: 240px; }
}
@media (max-width: 380px) {
  .mv-selects { grid-template-columns: 1fr; }
}
