.lb-loader,
.lightbox {
  text-align: center;
  line-height: 0;
  position: absolute;
  margin-left: inherit;
}

body.lb-disable-scrolling {
  overflow: hidden;
}

.lightboxOverlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;
}

.lightboxOverlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--lightbox-bg);
  backdrop-filter: blur(16px);
  z-index: -1;
}

.lightbox {
  width: 100%;
  min-height: 650px;
  z-index: 10000;
  font-weight: 400;
  outline: 0;
  display: flex;
  justify-content: center;
}

/* Lightbox Image */
.lightbox .lb-image {
  display: block;
  max-width: 650px;
  max-height: 650px;
  min-width: 650px;
  min-height: 650px;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-colour);
  object-fit: contain;
  background-color: black;
}

/* Outer Container */
.lb-outerContainer {
  position: relative;
  margin: 0;
  background-color: var(--lightbox-bg);
  border-radius: var(--border-radius);
  margin-right: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.lb-outerContainer:after {
  content: "";
  display: table;
  clear: both;
}

/* Data Container */
.lb-dataContainer {
  margin: 0;
  background-color: var(--black);
  max-height: 650px;
  overflow-y: scroll;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: 4px;
  border-radius: var(--border-radius);
}

/* Loader */
.lb-loader {
  top: 43%;
  height: 25%;
  width: 100%;
}

.lb-cancel {
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  background: url(../images/lightbox/loading.gif) no-repeat;
}

/* Navigation Arrows */
.lb-nav {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 10;
}

.lb-container>.nav {
  left: 0;
}

.lb-nav a {
  outline: 0;
  background-image: url(data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==);
}

.lb-next,
.lb-prev {
  height: 100%;
  cursor: pointer;
  display: block;
}

.lb-nav a.lb-prev {
  width: 20%;
  left: 0;
  float: left;
  background: url(../images/lightbox/prev.png) left 48% no-repeat;
  opacity: 0;
  transition: opacity 0.6s;
}

.lb-nav a.lb-prev:hover {
  opacity: 1;
}

.lb-nav a.lb-next {
  width: 20%;
  right: 0;
  float: right;
  background: url(../images/lightbox/next.png) right 48% no-repeat;
  opacity: 0;
  transition: opacity 0.6s;
}

.lb-nav a.lb-next:hover {
  opacity: 1;
}

/* Data and Close Button */
.lb-dataContainer:after {
  content: "";
  display: table;
  clear: both;
}

.lb-data {
  width: 100%;
  min-width: unset;
  box-sizing: border-box;
}

.lb-data .lb-details {
  width: 100%;
  margin: 10px;
  float: left;
  text-align: left;
  line-height: 1.3em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.lb-details table {
  width: 95%;
  border-collapse: collapse;
}

.lb-details td {
  word-break: break-word;
  padding: 2px 8px;
}

.lb-data .lb-caption {
  font-weight: 500;
  line-height: 1.2em;
  padding-right: 20px;
}

.lb-data .lb-caption a {
  color: var(--sidebar-hr_solid);
}

.lb-data .lb-number {
  display: block;
  clear: left;
  padding-bottom: 0.5em;
  font-size: 12px;
  color: var(--font-colour_grey);
}

/* Lyrics overlay (.lb-lyrics / .lb-lyrics-content / .lb-lyrics-close / .lyrics-text)
 is styled in lyrics_style.css — single source for the release lightbox and
 h/lyrics-list.php. */

/* Media Query for Smaller Screens */
@media screen and (max-width: 1079px) {

  /* Pin the lightbox to the viewport. The uniform 5px padding gives the same
   margin on all four sides (top margin matches left/right). margin:0 cancels
   the inherited body margin (base rule sets margin-left:inherit), which was
   shifting everything right — double margin left, none right. position:fixed +
   !important overrides the inline top/left/size the JS writes, and overflow
   hidden + the page lock kill both axes of background scroll. */
  .lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    z-index: 10000;
    font-weight: 400;
    outline: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    padding: 5px;
    box-sizing: border-box;
  }

  /* Square image area, full inner width, keeping the rounded corners + the 5px
   gap before the info box. !important neutralises the inline pixel size the
   JS animates on. */
  .lb-outerContainer {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
    margin: 0 0 5px 0 !important;
    border-radius: var(--border-radius);
    overflow: hidden;
  }

  .lb-container {
    width: 100% !important;
    height: 100% !important;
  }

  .lightbox .lb-image {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-colour);
    object-fit: contain;
  }

  /* Info box fills the remaining height and scrolls internally — the lightbox
   itself never scrolls vertically. Keeps its rounded corners and side margins. */
  .lb-dataContainer {
    width: 100% !important;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    margin: 0 !important;
    background-color: var(--black);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-bottom: 4px;
    border-radius: var(--border-radius);
  }

  /* Navigation arrows are tappable on touch (no hover to reveal them).
   The JS still uses display:none to hide a non-applicable arrow, so this
   only reveals arrows that are actually navigable. The drawer only covers the
   bottom ~80px, so the centred arrow graphics stay above the carousel. */
  .lightbox .lb-nav a.lb-prev,
  .lightbox .lb-nav a.lb-next {
    opacity: 1 !important;
  }

  /* Drawer behaviour is tied to the WIDTH breakpoint (not @media hover:none),
   so it works on every mobile device regardless of reported hover capability.
   Default: only the 'More Images' tab peeks at the bottom of the image.
   Tapping the tab adds .lb-drawer-active, which slides the full strip up.
   !important beats the desktop :hover rules so a stray tap-hover can't open it. */
  .lb-drawer {
    transform: translateY(80px) !important;
    transition: transform 0.25s ease;
  }

  .lb-container.lb-drawer-active .lb-drawer {
    transform: translateY(0) !important;
  }
}

/* Hide the mobile bottom nav while the lightbox is open so the info box can use
 the full screen height. lb-disable-scrolling is added to <body> on open. */
body.lb-disable-scrolling #mobile-nav-wrapper {
  display: none !important;
}

/* Gallery Drawer overlay container */
.lb-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 30;
  transform: translateY(110px);
  transition: transform 0.3s ease;
}

/* When hovering container but NOT active: peek tab */
.lb-container:hover .lb-drawer {
  transform: translateY(80px);
}

/* Reveal drawer when enabled AND container is hovered */
.lb-container.lb-drawer-active .lb-drawer,
.lb-container.lb-drawer-active:hover .lb-drawer {
  transform: translateY(0);
}

/* On touch devices there is no hover, so the tab peeks at the bottom of the image
 by default, and the .lb-drawer-active class (toggled by tapping the tab) slides
 the full thumbnail strip up. */
@media (hover: none) {
  .lb-drawer {
    transform: translateY(80px);
    transition: transform 0.3s ease;
  }

  .lb-container.lb-drawer-active .lb-drawer {
    transform: translateY(0);
  }
}

/* Drawer Toggle Tab styling */
.lb-drawer-tab {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  height: 30px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--font-colour_offwhite);
  padding: 0 16px;
  line-height: 30px;
  font-size: 11px;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
  user-select: none;
}

.lb-drawer-tab:hover {
  background: var(--main-colour);
}

/* Thumbnails list — no scrollbar, horizontal scroll only */
.lb-drawer-thumbnails {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 16px;
  max-width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lb-drawer-thumbnails::-webkit-scrollbar {
  display: none;
}

/* Custom thumbnail images */
.lb-thumbnail {
  height: 55px;
  flex-shrink: 0;
  border-radius: 0;
  border: 2px solid transparent;
  cursor: pointer;
  object-fit: cover;
  transition: filter 0.15s ease, border-color 0.15s ease;
}

.lb-thumbnail:hover {
  filter: brightness(60%);
}

.lb-thumbnail.lb-active-thumbnail {
  border-color: var(--main-colour, #a00);
  filter: none;
}