/* ==========================================================================
   Exhibit Viewer — Structural Styles
   Location: /wp-content/themes/bb-theme-child/css/exhibit-viewer.css
   ========================================================================== */

/* ── Two-column layout ── */
.exhibit-viewer {
  display: flex;
  align-items: flex-start;
  margin-top: 24px;
}

/* ── Desktop title — shown on desktop ── */
.exhibit-title-desktop {
  display: block;
  margin-bottom: 16px;
}

/* ── Desktop back button — shown on desktop ── */
.exhibit-back-desktop {
  display: block;
  margin-bottom: 16px;
  margin-top: 0;
  padding-top: 0;
}

/* ── Hide mobile-only elements on desktop ── */
@media (min-width: 769px) {
  .exhibit-title {
    display: none;
  }

  .exhibit-back-mobile {
    display: none;
  }
}

/* ── Sidebar ── */
.exhibit-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 100px; /* adjust to match your header height */
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background-color: #e7e5d7;
  padding: 10px;
  /* Firefox scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #924444 transparent;
}

/* Chrome, Edge, Safari scrollbar */
.exhibit-sidebar::-webkit-scrollbar {
  width: 4px;
}

.exhibit-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.exhibit-sidebar::-webkit-scrollbar-thumb {
  background-color: #924444;
  border-radius: 4px;
}

/* ── Back button padding fix ── */
.exhibit-sidebar .fl-button,
.exhibit-back-desktop .fl-button,
.exhibit-back-mobile .fl-button {
  padding: 5px 0 !important;
}

/* ── Nav list ── */
.exhibit-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Active state for sidebar nav items ── */
.exhibit-nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.exhibit-nav-list a.is-active {
  border-left: 3px solid #924444;
  font-weight: 700;
  opacity: 1;
}

.exhibit-nav-list a:not(.is-active) {
  opacity: 0.6;
}

/* ── Sidebar thumbnail sizing ── */
.exhibit-nav-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

/* ── Main content area ── */
.exhibit-main {
  flex: 1;
  min-width: 0; /* prevents flex overflow on long content */
  padding: 0 40px 0 32px;
}

/* ── Photo panels — hidden by default, JS adds .is-visible ── */
.exhibit-panel {
  display: none !important;
}

.exhibit-panel.is-visible {
  display: block !important;
}

/* Clear float after each panel */
.exhibit-panel::after {
  content: '';
  display: table;
  clear: both;
}

/* ── Photo sizing and float ── */
.exhibit-photo-wrap {
  float: left;
  margin: 0 24px 16px 0;
}

.exhibit-photo-wrap img {
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  display: block;
}

.exhibit-photo-wrap p {
  margin: 6px 0 0;
  font-size: 0.875rem;
}

/* ==========================================================================
   Mobile — sidebar becomes a horizontal scrolling strip
   ========================================================================== */
@media (max-width: 768px) {

  .exhibit-viewer {
    flex-direction: column;
    margin-top: 0;
  }

  /* Stack order: title → back button → strip → content */
  .exhibit-title {
    order: 1;
    padding: 16px 20px 4px;
  }

  .exhibit-back-mobile {
    order: 2;
    padding: 0 20px 12px;
  }

  .exhibit-sidebar {
    order: 3;
    width: 100%;
    position: sticky;
    top: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 10;
  }

  .exhibit-main {
    order: 4;
    padding: 24px 20px;
  }

  /* Hide desktop-only elements on mobile */
  .exhibit-title-desktop {
    display: none;
  }

  .exhibit-back-desktop {
    display: none;
  }

  .exhibit-sidebar::before {
    display: none;
  }

  .exhibit-nav-list {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 8px;
    white-space: nowrap;
  }

  .exhibit-nav-list li {
    flex-shrink: 0;
  }

  .exhibit-nav-list a {
    flex-direction: column;
    align-items: center;
    max-width: 80px;
    white-space: normal;
    text-align: center;
    font-size: 0.75rem;
    border-left: none !important; /* override desktop active state */
  }

  .exhibit-nav-list a.is-active {
    border-left: none !important;
    border-bottom: 3px solid #924444;
  }

  .exhibit-nav-thumb {
    width: 40px;
    height: 40px;
  }

  /* Photo full width on mobile */
  .exhibit-photo-wrap {
    float: none;
    margin: 0 0 16px 0;
  }

  .exhibit-photo-wrap img {
    max-height: none;
    width: 100%;
  }

}