/* Gallery member-facing styles (Phase 2). Minimal — full visual polish
   lands in Phase 7. Loaded per-page via {% block extra_css %}. */

.gallery-submit { max-width: 680px; }

.gs-image-preview img {
  max-height: 320px;
  width: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
}

.gs-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.gs-pick {
  padding: 2px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.gs-pick img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.gs-pick.is-selected { border-color: var(--bs-primary, #6c5ce7); }

.gs-count { font-variant-numeric: tabular-nums; }

/* Manage the landing carousel (curator) */
.cm-carousel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 8px;
}
.cm-slot { width: 120px; }
.cm-slot img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;          /* match the landing carousel's letterbox... */
  background: #c2d4a6;          /* ...on the site green, so this previews it */
  border-radius: 8px;
  display: block;
}
.cm-slot__ctrls {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}
.cm-slot__ctrls button {
  border: 1px solid #ef589c;
  background: #fff;
  color: #ef589c;
  border-radius: 6px;
  min-width: 30px;
  min-height: 30px;
  line-height: 1;
  cursor: pointer;
}
.cm-slot__ctrls button:disabled { opacity: 0.35; cursor: default; }

/* My Gallery Pieces */
.gp-list { display: grid; gap: 16px; max-width: 820px; }
.gp-card {
  display: flex;
  gap: 16px;
  border: 1px solid #e9e4da;
  border-radius: 10px;
  padding: 12px;
}
.gp-card > img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
}
.gp-status { text-transform: capitalize; }
.gp-reactions { display: flex; gap: 14px; }

/* "Request a correction" disclosure on My Gallery Pieces. The summary is
   styled as a soft pill (.th-nav-btn-soft), so suppress the native marker
   and let it size to its content. */
.gp-correction > summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
}
.gp-correction > summary::-webkit-details-marker { display: none; }
.gp-correction > form { max-width: 460px; }

/* In-app notification banner (minimal — full surface in Phase 5) */
.gallery-banner { border-radius: 0; margin-bottom: 0; }


/* ==========================================================================
   Phase 3 — public Gallery (entrance / room / zoom).
   Placeholder-quality visuals; full polish + real assets land in Phase 7.
   The picture frame is drawn in CSS for now (.gw-frame); it swaps to an
   image overlay in Phase 7 with no markup change.
   ========================================================================== */

/* Shared portrait column: full width on a portrait phone; a centred portrait
   column with the site green showing in the side margins on landscape/tablet.
   The simple CSS equivalent of the album's bespoke JS book-fit — same intent
   (portrait, centred, green margins), no spread / rotate machinery. The 120px
   is an approximate header allowance; the proportion is easy to tune. */
.gallery-entrance,
.gallery-room,
.gallery-zoom {
  --gallery-col-w: min(100%, calc((100dvh - 120px) * 0.62), 560px);
}

/* ---- Entrance ----------------------------------------------------------- */

.gallery-entrance {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100dvh - 120px);
}

/* The box is sized to the painting's exact 2:3 ratio, so there's no internal
   letterbox — the box *is* the painting, and the floor-plan card pins to the
   painting itself rather than drifting into a green strip. Width is the
   smaller of the container width and the width that fits the viewport height,
   so the whole scene always shows (never cropped); the site green fills the
   side (and any top/bottom) margins. `cover` == `contain` here since the box
   matches the image ratio. */
.gallery-entrance__bg {
  position: relative;
  width: min(100%, calc((100dvh - 120px) * 2 / 3));
  aspect-ratio: 2 / 3;
  background: url("../images/entrance/entrance.0e747144407e.jpg") center / cover no-repeat;
}

.gallery-floorplan {
  position: absolute;
  left: 50%;
  bottom: 0;             /* flush with the painting's bottom edge */
  transform: translateX(-50%);
  width: min(86%, 360px);
  padding: 14px 20px 16px;
  background: #f6efe2;
  border: 1px solid #d8cbb2;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  font-family: "Cormorant", Georgia, serif;
}
.gallery-floorplan__title {
  margin: 0;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 600;
  color: #4a3f2f;
}
.gallery-floorplan__sub {
  margin: 0 0 8px;
  text-align: center;
  font-size: 0.95rem;
  font-style: italic;
  color: #8a7a5f;
}
.gallery-floorplan__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.gallery-floorplan__room {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-top: 1px solid #e4dac4;
  color: #3f3527;
  text-decoration: none;
  font-size: 1.1rem;
}
.gallery-floorplan__room:hover { color: #00537d; background: rgba(0, 0, 0, 0.03); }
.gallery-floorplan__num {
  flex: 0 0 auto;
  width: 1.6em;
  height: 1.6em;
  display: grid;
  place-items: center;
  border: 1px solid #b9a988;
  border-radius: 50%;
  font-size: 0.85rem;
}
.gallery-floorplan__lock { margin-left: 4px; font-size: 0.8em; color: #9b8c70; }

/* One open room: "Now showing" + name + a single Enter button. The button
   stays in the card's parchment idiom (not the site pink pill) so the
   floor-plan card keeps reading as an in-world artefact. */
.gallery-floorplan__solo-name {
  margin: 0;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  color: #3f3527;
}
.gallery-floorplan__enter {
  display: block;
  width: fit-content;
  margin: 12px auto 2px;
  padding: 6px 34px;
  border: 1px solid #b9a988;
  border-radius: 4px;
  background: #fbf7ec;
  color: #3f3527;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.gallery-floorplan__enter:hover { color: #00537d; background: rgba(0, 0, 0, 0.03); }

/* No open rooms: a calm between-exhibitions note replaces the list. */
.gallery-floorplan__closed {
  margin: 6px 0 2px;
  text-align: center;
  font-style: italic;
  font-size: 1.05rem;
  color: #8a7a5f;
}

/* Graphical floor plan (Phase 2, 2-6 open rooms): a hand-drawn plan image
   between the sub-line and the list (which doubles as the legend). Each
   room gets an invisible %-positioned hotspot link with a numbered badge
   at its centre; the coordinates live in FLOORPLAN_HOTSPOTS
   (gallery/views.py), hand-tuned per image. */
.gallery-floorplan--map { width: min(92%, 430px); }
.gallery-floorplan__map {
  position: relative;
  margin: 2px 0 8px;
}
.gallery-floorplan__map img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #d8cbb2;
  border-radius: 3px;
}
.gallery-floorplan__hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 4px;
  text-decoration: none;
}
.gallery-floorplan__hotspot:hover { background: rgba(0, 83, 125, 0.06); }
.gallery-floorplan__badge {
  width: 1.7em;
  height: 1.7em;
  display: grid;
  place-items: center;
  border: 1px solid #b9a988;
  border-radius: 50%;
  background: #f6efe2;
  color: #3f3527;
  font-size: 0.95rem;
}

/* ---- Room (fixed "stage-set" scene) ------------------------------------- */
/* The room is ONE viewport-tall frame that never scrolls vertically: a slim
   bar, the art hung on the wall (a salon double-row that pans HORIZONTALLY),
   and the seated figure as foreground furniture, always in view. The seated
   viewer is big (close to you); the art is smaller (across the room) — the
   piece count drives how far you pan, not how small the art gets.
   gallery_room.js measures the available height into --scene-h and flags the
   strip when it overflows. The two knobs on .gallery-scene are first-pass and
   tuned on-device. */

.gallery-room { --wall-colour: #efe9e0; }

/* The room presentation sits in the portrait column; the site green shows
   outside it. */
.gallery-room__col {
  width: var(--gallery-col-w);
  margin-inline: auto;
}

.gallery-scene {
  /* ---- TUNABLE KNOBS ---- */
  --piece-size: min(calc(var(--scene-h, 78vh) * 0.21), 230px);   /* salon frame size */
  --figure-h: 0.55;                                              /* seated-figure height, fraction of the scene */

  height: var(--scene-h, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--wall-colour, #efe9e0);
  overflow: hidden;
}

/* Slim one-line bar (replaces three fat pills that wrapped on phones). */
.gallery-room__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  background: color-mix(in srgb, var(--wall-colour, #efe9e0) 90%, #000);
}
.gallery-room__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  text-align: center;
  font-family: "Cormorant", Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-room__ctrl {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #ef589c;
  background: #ef589c;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.gallery-room__ctrl:hover,
.gallery-room__ctrl:focus { background: #fff; color: #ef589c; }
.gallery-room__ctrl .bi { font-size: 1.05rem; }
/* On the narrowest phones the back arrow stands alone (label hidden) to keep
   the bar on one line. */
@media (max-width: 360px) {
  .gallery-room__ctrl-label { display: none; }
}

/* The wall = the art band; fills the space above the foreground figure. */
.gallery-wall {
  position: relative;
  flex: 0 0 auto;            /* size to the art (2 salon rows); the figure takes the rest */
  min-height: 30%;           /* a bare wall still has presence in an empty / 'being hung' room */
  background: var(--wall-colour, #efe9e0);
  overflow: hidden;
}
.gallery-wall__rail {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8px;
  /* Picture rail "in the wall colour" (§2.2): a slightly darker shade. */
  background: color-mix(in srgb, var(--wall-colour, #efe9e0) 82%, #000);
  z-index: 2;
}

/* Salon double-row, packed into columns, panned horizontally. */
.gallery-wall__strip {
  display: grid;
  grid-template-rows: repeat(2, var(--piece-size));
  grid-auto-flow: column;
  grid-auto-columns: var(--piece-size);
  gap: clamp(10px, 3vmin, 22px);
  justify-content: start;
  padding: clamp(14px, 3vmin, 26px) 16px clamp(10px, 3vmin, 22px);   /* top clears the rail */
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  /* Soft fade at the right edge hints there's more wall to pan to. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent);
}
/* When the whole hang fits, centre it and drop the fade. */
.gallery-wall__strip:not(.is-overflowing) {
  justify-content: center;
  -webkit-mask-image: none;
          mask-image: none;
}

/* Foreground: the seated figure as close-up furniture, always visible. */
.gallery-foreground {
  position: relative;
  flex: 1 1 auto;            /* the empty wall below the art; the figure overlays + spills up over it */
  min-height: 0;
  overflow: visible;         /* let the taller figure spill upward over the wall */
  background: var(--wall-colour, #efe9e0);
}
.gallery-wall__baseboard {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: color-mix(in srgb, var(--wall-colour, #efe9e0) 78%, #000);
  opacity: 0.5;
}
.gallery-room__figure {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  /* Explicit height (definite — no flex-% guesswork). Deliberately taller than
     the wall space below the art so she spills UP over it; her transparent top
     passes harmlessly over the lowest row of art. Dial via --figure-h. */
  height: calc(var(--scene-h, 80vh) * var(--figure-h, 0.55));
  width: auto;
  max-width: 100%;
  pointer-events: none;
  z-index: 4;   /* sit IN FRONT of the art she overlaps (frames carry z-index 1–2) */
}

.gallery-room__note {
  max-width: 420px;
  text-align: center;
  color: #6b6256;
}
.gallery-room__note--float {
  position: absolute;
  left: 16px; right: 16px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 auto;
  z-index: 1;
}

/* ---- Framed piece (shared by wall + zoom) ------------------------------- */

.gw-piece {
  width: 100%;             /* fills its salon grid cell (--piece-size square) */
  height: 100%;
  margin: 0;
  scroll-snap-align: start;
  z-index: 1;
  transition: transform 0.12s ease;
}
.gw-piece:hover { z-index: 2; transform: scale(1.04); }

.gw-frame {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 7%;                       /* the mat */
  background: #fdfcf9;               /* mat colour */
  border: 6px solid #b08d57;         /* placeholder gold frame */
  border-radius: 2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 0 0 2px #8a6d3b;
}
.gw-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Transparent-background pieces show white here; pieces saved with their
     own background colour cover it (T7). Phase 7 sizes the frame to the
     artwork to remove the contain letterbox. */
  background: #fff;
}

/* ---- Zoom --------------------------------------------------------------- */

/* The zoom sits the framed piece on the room's wall colour (the portrait
   column), with the site green outside — so it still feels like standing in
   the room (T8). */
.gallery-zoom { --wall-colour: #efe9e0; }
.gallery-zoom__col {
  width: var(--gallery-col-w);
  margin-inline: auto;
  background: var(--wall-colour);
  min-height: calc(100dvh - 120px);
  padding: 22px 16px 32px;
  text-align: center;
}
.gallery-zoom__image {
  display: flex;
  justify-content: center;
}
.gw-frame--zoom {
  width: min(88%, 460px);
  height: auto;
  aspect-ratio: 1 / 1;
  padding: 4%;
}
.gallery-zoom__plaque {
  max-width: 92%;
  margin: 20px auto 0;
}
.gallery-plaque__title {
  margin: 0 0 2px;
  font-family: "Cormorant", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
}
.gallery-plaque__artist {
  margin: 0 0 10px;
  font-style: italic;
  color: #5a5145;
}
.gallery-plaque__blurb { margin: 0 0 10px; line-height: 1.5; }
.gallery-plaque__meta { margin: 0; font-size: 0.85rem; color: #8a8174; }

.gallery-zoom__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 22px;
}
.gallery-reactions { display: flex; gap: 10px; }
.gw-react {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid #d9d2c6;
  border-radius: 999px;
  background: #fff;
  color: #6b6256;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.gw-react:hover { border-color: #b9a988; }
.gw-react.is-active {            /* the visitor's own reaction — site accent */
  color: #ef589c;
  border-color: #ef589c;
  background: #fff4fa;
}
.gw-react__count { font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* On the visitor's own piece the buttons are read-only. */
.gallery-reactions[data-react-mode="own"] .gw-react { cursor: default; }
.gallery-reactions[data-react-mode="own"] .gw-react:hover { border-color: #d9d2c6; }

.gw-react-msg { margin-top: 12px; font-size: 0.9rem; color: #6b6256; }
