/* Page-specific visitor styles moved out of Jinja template. */
.object-guide-gate {
  margin: 28px 0;
  padding: 28px;
  border: 1px solid rgba(137, 105, 72, 0.24);
  border-radius: 26px;
  background: linear-gradient(
    135deg,
    rgba(250, 247, 242, 0.94),
    rgba(239, 229, 216, 0.72)
  );
  text-align: center;
}
.object-guide-gate .access-badge {
  margin-bottom: 10px;
}
.object-guide-gate h2 {
  margin: 6px 0 10px;
}
.object-guide-gate p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.6;
}
.public-exhibit-card.is-guide-locked {
  cursor: default;
}
.public-exhibit-card.is-guide-locked:hover {
  transform: none;
}
.guide-lock-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(138, 104, 69, 0.09);
  color: #76583c;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Museum hero controls */
.museum-route-indicator {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
}
.museum-route-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(138, 104, 69, 0.1);
  color: #76583c;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.museum-hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Shared object page width (1120px). Location, attraction, and admin pages are unchanged. */
body.scanpeek-object-page .page-shell {
  width: min(1120px, calc(100% - 48px));
  max-width: none;
}
@media (max-width: 800px) {
  body.scanpeek-object-page .page-shell {
    width: min(calc(100% - 32px), 720px);
  }
}

/* Balanced introduction for all object pages. */
body.scanpeek-object-page .public-hero {
  padding-top: 42px;
  padding-bottom: 38px;
}
body.scanpeek-object-page .public-hero > h1 {
  max-width: 840px;
  margin: 14px 0 22px;
  font-size: clamp(3rem, 5vw, 4.65rem);
  line-height: 1.11;
}
body.scanpeek-object-page .public-hero > .lead {
  max-width: 760px;
  margin: 0 0 26px;
  font-size: clamp(1rem, 1.45vw, 1.16rem);
  line-height: 1.75;
}
body.scanpeek-object-page .museum-hero-actions {
  justify-content: flex-start;
}
body.scanpeek-object-page .museum-route-indicator {
  justify-content: flex-start;
}
@media (max-width: 560px) {
  body.scanpeek-object-page .public-hero {
    padding-top: 26px;
    padding-bottom: 28px;
  }
  body.scanpeek-object-page .public-hero > h1 {
    font-size: clamp(2.15rem, 9vw, 3rem);
  }
}

/* Shared object overview: right-hand content sets the desktop height.
   Photo fills exactly that height; no pixel-based height or JS measurement. */
body.scanpeek-object-page .scanpeek-object-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 30px;
  row-gap: 22px;
  align-items: start;
  margin: 30px 0 76px;
}

/* Take gallery contents out of the grid's intrinsic height calculation.
   Otherwise portrait photos can force both columns to become taller. */
body.scanpeek-object-page .scanpeek-object-overview > .public-gallery {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: relative;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
}
body.scanpeek-object-page .scanpeek-object-overview .public-gallery > .public-cover,
body.scanpeek-object-page .scanpeek-object-overview .public-gallery > .public-gallery-swipe {
  position: absolute;
  inset: 0;
  margin: 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
}
/* Fallback before the gallery JS initializes (and when JS is disabled). */
body.scanpeek-object-page .scanpeek-object-overview .public-cover .public-gallery-main,
body.scanpeek-object-page .scanpeek-object-overview .public-cover img {
  width: 100%;
  height: 100%;
  max-height: none;
}
body.scanpeek-object-page .scanpeek-object-overview .public-cover img {
  object-fit: cover;
}
/* The carousel occupies only the photo area; dots and hint sit just below it. */
body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe {
  display: block;
}
body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-track {
  height: 100%;
  min-height: 0;
  border: 2px solid #cdbca8;
  border-radius: 24px;
  box-shadow: 0 12px 35px rgba(61, 50, 39, 0.12);
}
body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-slide {
  height: 100%;
  border-radius: 24px;
}
body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-slide img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 24px;
}
body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-dots {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  margin: 0;
}
body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-hint {
  position: absolute;
  top: calc(100% + 30px);
  left: 0;
  width: 100%;
  margin: 0;
}

body.scanpeek-object-page .scanpeek-object-overview > .public-hero {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 12px 0 0;
}
body.scanpeek-object-page .scanpeek-object-overview .public-hero > h1 {
  max-width: 100%;
  font-size: clamp(2.5rem, 4vw, 3.8rem);
  line-height: 1.13;
}
body.scanpeek-object-page .scanpeek-object-overview .public-hero > .lead {
  max-width: 100%;
  font-size: 1rem;
  line-height: 1.7;
}
body.scanpeek-object-page .scanpeek-object-overview > .public-audio-card,
body.scanpeek-object-page .scanpeek-object-overview > .object-guide-gate {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  align-self: start;
  margin: 0;
}
body.scanpeek-object-page .scanpeek-object-overview > .public-audio-card {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 22px;
  padding-bottom: clamp(26px, 3vw, 42px);
  align-content: center;
}
body.scanpeek-object-page .scanpeek-object-overview .public-audio-copy h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
}

/* No gallery: avoid reserving an empty left-hand column. */
body.scanpeek-object-page .scanpeek-object-overview.no-gallery {
  grid-template-columns: minmax(0, 1fr);
  max-width: 860px;
  margin-inline: auto;
}
body.scanpeek-object-page .scanpeek-object-overview.no-gallery > .public-hero {
  grid-column: 1;
  grid-row: 1;
}
body.scanpeek-object-page .scanpeek-object-overview.no-gallery > .public-audio-card,
body.scanpeek-object-page .scanpeek-object-overview.no-gallery > .object-guide-gate {
  grid-column: 1;
  grid-row: 2;
}

/* Narrow screens use a natural document flow and intrinsic image aspect ratio. */
@media (max-width: 1024px) {
  body.scanpeek-object-page .scanpeek-object-overview {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 22px;
    margin-top: 12px;
    margin-bottom: 58px;
  }
  body.scanpeek-object-page .scanpeek-object-overview > .public-hero {
    grid-column: 1;
    grid-row: 1;
    padding: 0;
  }
  body.scanpeek-object-page .scanpeek-object-overview > .public-gallery {
    grid-column: 1;
    grid-row: 2;
    height: auto;
    min-height: 0;
  }
  body.scanpeek-object-page .scanpeek-object-overview .public-gallery > .public-cover,
  body.scanpeek-object-page .scanpeek-object-overview .public-gallery > .public-gallery-swipe {
    position: static;
    height: auto;
  }
  body.scanpeek-object-page .scanpeek-object-overview .public-cover .public-gallery-main,
  body.scanpeek-object-page .scanpeek-object-overview .public-cover img,
  body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-track,
  body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-slide,
  body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-slide img {
    height: auto;
  }
  body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-slide img {
    max-height: 520px;
  }
  body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-dots,
  body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-hint {
    position: static;
    width: auto;
  }
  body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-dots {
    margin-top: 10px;
  }
  body.scanpeek-object-page .scanpeek-object-overview .public-gallery-swipe-hint {
    margin-top: 3px;
  }
  body.scanpeek-object-page .scanpeek-object-overview > .public-audio-card,
  body.scanpeek-object-page .scanpeek-object-overview > .object-guide-gate {
    grid-column: 1;
    grid-row: 3;
  }
  body.scanpeek-object-page .scanpeek-object-overview.no-gallery {
    max-width: none;
  }
  body.scanpeek-object-page .scanpeek-object-overview.no-gallery > .public-audio-card,
  body.scanpeek-object-page .scanpeek-object-overview.no-gallery > .object-guide-gate {
    grid-row: 2;
  }
}

/* Object labels share one compact row above the title. */
body.scanpeek-object-page .museum-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px 14px;
  margin-bottom: 12px;
}
body.scanpeek-object-page .museum-hero-meta .eyebrow,
body.scanpeek-object-page .museum-hero-meta .museum-route-indicator {
  margin: 0;
}
body.scanpeek-object-page .museum-hero-meta .museum-route-indicator {
  justify-content: flex-end;
  margin-left: auto;
}

/* Comfortable reading width in tablet and landscape-phone layouts. */
@media (min-width: 801px) and (max-width: 1024px) {
  body.scanpeek-object-page .page-shell {
    width: min(720px, calc(100% - 32px));
  }
}

/* Object page actions: three aligned buttons on desktop.
   Allow labels to wrap inside a button, not the entire button row. */
body.scanpeek-object-page .museum-hero-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 620px;
  align-items: stretch;
}
body.scanpeek-object-page .museum-hero-actions > .secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 10px 7px;
  box-sizing: border-box;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  font-size: 12px;
}

/* Tablet: use remaining width naturally and wrap when needed. */
@media (max-width: 1024px) {
  body.scanpeek-object-page .museum-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: none;
  }
  body.scanpeek-object-page .museum-hero-actions > .secondary-button {
    flex: 1 1 170px;
    width: auto;
  }
}

/* Phone: one full-width action per line, without tiny text. */
@media (max-width: 560px) {
  body.scanpeek-object-page .museum-hero-actions {
    flex-direction: column;
  }
  body.scanpeek-object-page .museum-hero-actions > .secondary-button {
    flex: none;
    width: 100%;
    font-size: 14px;
  }
}

/* Attraction cards are intentionally compact on wide object pages.
   An unpaired final card stays the same width and is centered. */
body.scanpeek-object-page .public-exhibit-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.scanpeek-object-page .public-exhibit-list > .public-exhibit-card {
  min-width: 0;
}

body.scanpeek-object-page .public-exhibit-list > .public-exhibit-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  width: calc((100% - 12px) / 2);
  justify-self: center;
}

/* Allow longer attraction names to wrap rather than get truncated. */
body.scanpeek-object-page .public-exhibit-content strong {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* One full-width card per row on phones and narrow tablets. */
@media (max-width: 760px) {
  body.scanpeek-object-page .public-exhibit-list {
    grid-template-columns: minmax(0, 1fr);
  }

  body.scanpeek-object-page .public-exhibit-list > .public-exhibit-card:last-child:nth-child(odd) {
    grid-column: auto;
    width: 100%;
    justify-self: stretch;
  }
}

/* Unlocked attraction cards have no decorative right arrow.
   Locked cards keep the intentional QR access marker. */
body.scanpeek-object-page .public-exhibit-card:not(.is-guide-locked) {
  grid-template-columns: 70px minmax(0, 1fr);
}

@media (max-width: 560px) {
  body.scanpeek-object-page .public-exhibit-card:not(.is-guide-locked) {
    grid-template-columns: 58px minmax(0, 1fr);
  }
}
