/**
 * Boosty Galleries – Frontend Styles
 *
 * Copyright (C) 2024 BoostyApps.com. All rights reserved.
 */

/* =========================================================
   CSS Custom Properties
   ========================================================= */
:root {
  --boosty-accent:     #2563eb;
  --boosty-overlay:    rgba(0, 0, 0, 0.6);
  --boosty-gap:        15px;
  --boosty-radius:     8px;
  --boosty-transition: 0.3s ease;
  --boosty-caption-bg: rgba(0, 0, 0, 0.75);
  --boosty-caption-color: #ffffff;
}

/* =========================================================
   Gallery wrapper
   ========================================================= */
.boosty-gallery-wrapper {
  position: relative;
  width: 100%;
  margin: 0 0 24px;
}

.boosty-gallery-description {
  font-size: 15px;
  color: #4b5563;
  margin-bottom: 16px;
  line-height: 1.6;
}

/* =========================================================
   Filter Buttons
   ========================================================= */
.boosty-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  align-items: center;
}

.boosty-filter__btn {
  padding: 6px 16px;
  border: 2px solid var(--boosty-accent);
  border-radius: 30px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--boosty-transition), color var(--boosty-transition), transform 0.15s ease;
  background: transparent;
  color: var(--boosty-accent);
  line-height: 1.4;
}

.boosty-filter__btn:hover,
.boosty-filter__btn.active {
  background: var(--boosty-accent);
  color: #ffffff;
  transform: translateY(-1px);
}

.boosty-filter__btn:focus {
  outline: 2px solid var(--boosty-accent);
  outline-offset: 2px;
}

/* =========================================================
   Gallery Base
   ========================================================= */
.boosty-gallery {
  width: 100%;
}

/* =========================================================
   GRID Layout — CSS Grid
   ========================================================= */
.boosty-gallery--grid {
  display: grid;
  gap: var(--boosty-gap);
}

.boosty-gallery--grid[data-cols="1"] { grid-template-columns: 1fr; }
.boosty-gallery--grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.boosty-gallery--grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.boosty-gallery--grid[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.boosty-gallery--grid[data-cols="5"] { grid-template-columns: repeat(5, 1fr); }
.boosty-gallery--grid[data-cols="6"] { grid-template-columns: repeat(6, 1fr); }

/* =========================================================
   MASONRY Layout — CSS columns (enhanced by JS)
   ========================================================= */
.boosty-gallery--masonry {
  columns: 3;
  column-gap: var(--boosty-gap);
}

.boosty-gallery--masonry[data-cols="1"] { columns: 1; }
.boosty-gallery--masonry[data-cols="2"] { columns: 2; }
.boosty-gallery--masonry[data-cols="3"] { columns: 3; }
.boosty-gallery--masonry[data-cols="4"] { columns: 4; }
.boosty-gallery--masonry[data-cols="5"] { columns: 5; }
.boosty-gallery--masonry[data-cols="6"] { columns: 6; }

.boosty-gallery--masonry .boosty-item {
  break-inside: avoid;
  margin-bottom: var(--boosty-gap);
  display: block;
}

/* =========================================================
   JUSTIFIED Layout — widths set by JS
   ========================================================= */
.boosty-gallery--justified {
  display: flex;
  flex-wrap: wrap;
  gap: var(--boosty-gap);
}

.boosty-gallery--justified .boosty-item {
  flex-grow: 1;
  overflow: hidden;
}

.boosty-gallery--justified .boosty-item img {
  display: block;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* =========================================================
   SLIDER Layout
   ========================================================= */
.boosty-gallery--slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--boosty-radius);
}

.boosty-slider__track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.boosty-slider__slide {
  flex-shrink: 0;
  width: 100%;
  position: relative;
}

.boosty-slider__slide img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: cover;
  display: block;
}

.boosty-slider__prev,
.boosty-slider__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--boosty-transition), transform 0.15s ease;
  backdrop-filter: blur(4px);
}

.boosty-slider__prev { left: 12px; }
.boosty-slider__next { right: 12px; }

.boosty-slider__prev:hover,
.boosty-slider__next:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.08);
}

.boosty-slider__dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.boosty-slider__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background var(--boosty-transition), border-color var(--boosty-transition), transform 0.15s ease;
}

.boosty-slider__dot.active {
  background: #ffffff;
  border-color: #ffffff;
  transform: scale(1.3);
}

.boosty-slider__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 20px 20px;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
  color: #fff;
}

.boosty-slider__caption h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.boosty-slider__caption p {
  margin: 0;
  font-size: 13px;
  opacity: .85;
}

/* =========================================================
   MOSAIC Layout — CSS Grid mosaic
   ========================================================= */
.boosty-gallery--mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 180px;
  gap: var(--boosty-gap);
}

.boosty-gallery--mosaic .boosty-item:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

.boosty-gallery--mosaic .boosty-item:nth-child(5),
.boosty-gallery--mosaic .boosty-item:nth-child(9),
.boosty-gallery--mosaic .boosty-item:nth-child(13) {
  grid-column: span 2;
  grid-row: span 2;
}

.boosty-gallery--mosaic .boosty-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================================
   ALBUM Layout
   ========================================================= */
.boosty-gallery--album {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--boosty-gap);
}

.boosty-album-item {
  position: relative;
  border-radius: var(--boosty-radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: box-shadow var(--boosty-transition), transform var(--boosty-transition);
}

.boosty-album-item:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  transform: translateY(-3px);
}

.boosty-album-item__cover {
  aspect-ratio: 4/3;
  overflow: hidden;
}

.boosty-album-item__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--boosty-transition);
}

.boosty-album-item:hover .boosty-album-item__cover img {
  transform: scale(1.06);
}

.boosty-album-item__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 30px;
  backdrop-filter: blur(4px);
}

.boosty-album-item__info {
  padding: 10px 12px;
  background: var(--boosty-caption-bg);
}

.boosty-album-item__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--boosty-caption-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   Gallery Item (shared)
   ========================================================= */
.boosty-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--boosty-radius);
  background: #f3f4f6;
}

.boosty-item__link {
  display: block;
  position: relative;
  overflow: hidden;
}

.boosty-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--boosty-transition), filter var(--boosty-transition), opacity var(--boosty-transition);
}

/* =========================================================
   Hover Effects
   ========================================================= */

/* Zoom */
.boosty-item--hover-zoom .boosty-item__link:hover img {
  transform: scale(1.08);
}

/* Fade */
.boosty-item--hover-fade .boosty-item__link:hover img {
  opacity: 0.65;
}

/* Blur */
.boosty-item--hover-blur .boosty-item__link:hover img {
  filter: blur(4px);
}

/* Grayscale */
.boosty-item--hover-grayscale img {
  filter: grayscale(0%);
  transition: filter var(--boosty-transition);
}
.boosty-item--hover-grayscale .boosty-item__link:hover img {
  filter: grayscale(100%);
}

/* Colorize — image starts grayscale, reveals colour on hover */
.boosty-item--hover-colorize img {
  filter: grayscale(80%);
  transition: filter var(--boosty-transition);
}
.boosty-item--hover-colorize .boosty-item__link:hover img {
  filter: grayscale(0%);
}

/* Overlay — generic overlay effect */
.boosty-item--hover-overlay .boosty-item__overlay {
  opacity: 0;
}
.boosty-item--hover-overlay .boosty-item__link:hover .boosty-item__overlay {
  opacity: 1;
}

/* Slide caption */
.boosty-item--hover-slide-caption .boosty-item__caption--overlay {
  transform: translateY(100%);
  opacity: 1;
  transition: transform var(--boosty-transition);
}
.boosty-item--hover-slide-caption .boosty-item__link:hover .boosty-item__caption--overlay {
  transform: translateY(0);
}

/* =========================================================
   Overlay Icon
   ========================================================= */
.boosty-item__overlay {
  position: absolute;
  inset: 0;
  background: var(--boosty-overlay);
  opacity: 0;
  transition: opacity var(--boosty-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 2;
}

.boosty-item__link:hover .boosty-item__overlay {
  opacity: 1;
}

.boosty-item__overlay svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
  transition: transform 0.2s ease;
}

.boosty-item__link:hover .boosty-item__overlay svg {
  transform: scale(1.1);
}

/* =========================================================
   Captions
   ========================================================= */
.boosty-item__caption {
  padding: 10px 12px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.boosty-item__caption--overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 14px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.8) 0%, transparent 100%);
  color: #fff;
  z-index: 3;
  border-top: none;
}

.boosty-item__caption--below {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.boosty-item__title {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
}

.boosty-item__desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  opacity: .85;
  color: inherit;
}

/* Caption styles */
.boosty-caption-style--card .boosty-item__caption {
  background: #fff;
  border-radius: 0 0 var(--boosty-radius) var(--boosty-radius);
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

.boosty-caption-style--full .boosty-item__caption {
  padding: 14px 16px;
  background: #1f2937;
  color: #f9fafb;
  border-radius: 0 0 var(--boosty-radius) var(--boosty-radius);
}

/* =========================================================
   Aspect Ratio Wrappers
   ========================================================= */
.boosty-item[data-ratio="1:1"]  .boosty-item__link { aspect-ratio: 1 / 1; }
.boosty-item[data-ratio="4:3"]  .boosty-item__link { aspect-ratio: 4 / 3; }
.boosty-item[data-ratio="16:9"] .boosty-item__link { aspect-ratio: 16 / 9; }
.boosty-item[data-ratio="3:2"]  .boosty-item__link { aspect-ratio: 3 / 2; }

/* =========================================================
   Watermark
   ========================================================= */
.boosty-watermark {
  position: absolute;
  bottom: 8px;
  right: 10px;
  z-index: 4;
  pointer-events: none;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  font-weight: 600;
  white-space: nowrap;
}

/* =========================================================
   Lazy Loading
   ========================================================= */
.boosty-item img[data-src],
.boosty-item img.boosty-lazy {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.boosty-item img.loaded,
.boosty-item img.boosty-loaded {
  opacity: 1;
}

/* =========================================================
   Entrance Animations
   ========================================================= */
.boosty-item.boosty-animate {
  opacity: 0;
}

.boosty-item.boosty-animate--fade {
  animation: boostyFadeIn 0.55s ease forwards;
}

.boosty-item.boosty-animate--slide-up {
  animation: boostySlideUp 0.5s ease forwards;
}

.boosty-item.boosty-animate--zoom {
  animation: boostyZoomIn 0.5s ease forwards;
}

@keyframes boostyFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes boostySlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes boostyZoomIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* =========================================================
   Pagination
   ========================================================= */
.boosty-pagination {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.boosty-pagination--numbered .boosty-pagination__btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 2px solid #e5e7eb;
  border-radius: var(--boosty-radius);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  transition: all var(--boosty-transition);
}

.boosty-pagination--numbered .boosty-pagination__btn:hover {
  border-color: var(--boosty-accent);
  color: var(--boosty-accent);
}

.boosty-pagination--numbered .boosty-pagination__btn.active {
  background: var(--boosty-accent);
  border-color: var(--boosty-accent);
  color: #fff;
}

/* Load More */
.boosty-load-more__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--boosty-accent);
  color: #fff;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--boosty-transition), transform 0.15s ease, box-shadow var(--boosty-transition);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.boosty-load-more__btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.boosty-load-more__btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.boosty-load-more__btn .boosty-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: boostySpin 0.7s linear infinite;
  display: none;
}

.boosty-load-more__btn.loading .boosty-spinner { display: block; }

@keyframes boostySpin {
  to { transform: rotate(360deg); }
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
.boosty-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overscroll-behavior: contain;
}

.boosty-lightbox.open {
  opacity: 1;
  pointer-events: all;
}

/* Close button */
.boosty-lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 10;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--boosty-transition), transform 0.15s ease;
  backdrop-filter: blur(4px);
}

.boosty-lightbox__close:hover {
  background: rgba(255,255,255,.2);
  transform: scale(1.1) rotate(90deg);
}

/* Navigation arrows */
.boosty-lightbox__prev,
.boosty-lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--boosty-transition), transform 0.15s ease;
  backdrop-filter: blur(4px);
}

.boosty-lightbox__prev { left: 20px; }
.boosty-lightbox__next { right: 20px; }

.boosty-lightbox__prev:hover { background: rgba(255,255,255,.2); transform: translateY(-50%) translateX(-2px); }
.boosty-lightbox__next:hover { background: rgba(255,255,255,.2); transform: translateY(-50%) translateX(2px); }

/* Image container */
.boosty-lightbox__stage {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
}

.boosty-lightbox__stage.grabbing { cursor: grabbing; }

.boosty-lightbox__image {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  user-select: none;
  transform-origin: center center;
  transition: transform 0.2s ease;
}

.boosty-lightbox__image.zoomed {
  transition: none;
}

/* Toolbar (top) */
.boosty-lightbox__toolbar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.boosty-lightbox__counter {
  color: rgba(255,255,255,.8);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  background: rgba(0,0,0,.4);
  border-radius: 20px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.boosty-lightbox__btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--boosty-transition);
  backdrop-filter: blur(4px);
}

.boosty-lightbox__btn:hover { background: rgba(255,255,255,.2); }

/* Caption */
.boosty-lightbox__caption {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #ffffff;
  z-index: 10;
  max-width: 80vw;
  pointer-events: none;
}

.boosty-lightbox__caption-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}

.boosty-lightbox__caption-desc {
  font-size: 13px;
  opacity: .8;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  line-height: 1.4;
}

/* Thumbnail strip */
.boosty-lightbox__thumbs {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.3) transparent;
  z-index: 10;
}

.boosty-lightbox__thumbs::-webkit-scrollbar { height: 4px; }
.boosty-lightbox__thumbs::-webkit-scrollbar-track { background: transparent; }
.boosty-lightbox__thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 2px; }

.boosty-lightbox__thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity var(--boosty-transition), outline var(--boosty-transition), transform 0.15s ease;
  border-radius: 3px;
  flex-shrink: 0;
}

.boosty-lightbox__thumb:hover { opacity: 0.75; }
.boosty-lightbox__thumb.active {
  opacity: 1;
  outline: 2px solid #ffffff;
  transform: scale(1.05);
}

/* Social Share bar */
.boosty-lightbox__share {
  position: absolute;
  top: 16px;
  left: 20px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.boosty-lightbox__share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
  text-decoration: none;
  transition: transform 0.15s ease, filter var(--boosty-transition);
}

.boosty-lightbox__share-btn:hover { transform: scale(1.12); filter: brightness(1.15); }

.boosty-share--facebook  { background: #1877f2; }
.boosty-share--twitter   { background: #1da1f2; }
.boosty-share--pinterest { background: #e60023; }
.boosty-share--download  { background: rgba(255,255,255,.15); backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.25); }

/* Loading spinner inside lightbox */
.boosty-lightbox__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.boosty-lightbox__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: boostySpin 0.8s linear infinite;
}

/* =========================================================
   Error / Empty states
   ========================================================= */
.boosty-error,
.boosty-empty {
  padding: 16px 20px;
  border-radius: var(--boosty-radius);
  font-size: 14px;
}

.boosty-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.boosty-empty {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* =========================================================
   Responsive — Tablet (≤ 960px)
   ========================================================= */
@media (max-width: 960px) {
  .boosty-gallery--grid[data-cols="5"] { grid-template-columns: repeat(3, 1fr); }
  .boosty-gallery--grid[data-cols="6"] { grid-template-columns: repeat(3, 1fr); }

  .boosty-gallery--masonry[data-cols="5"],
  .boosty-gallery--masonry[data-cols="6"] { columns: 3; }

  .boosty-gallery--mosaic { grid-template-columns: repeat(3, 1fr); }

  .boosty-lightbox__thumb { width: 46px; height: 36px; }
}

/* =========================================================
   Responsive — Mobile (≤ 600px)
   ========================================================= */
@media (max-width: 600px) {
  .boosty-gallery--grid[data-cols="3"],
  .boosty-gallery--grid[data-cols="4"],
  .boosty-gallery--grid[data-cols="5"],
  .boosty-gallery--grid[data-cols="6"] { grid-template-columns: repeat(2, 1fr); }

  .boosty-gallery--masonry { columns: 2; }

  .boosty-gallery--mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 130px;
  }

  .boosty-gallery--mosaic .boosty-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .boosty-lightbox__prev { left: 8px; width: 40px; height: 40px; }
  .boosty-lightbox__next { right: 8px; width: 40px; height: 40px; }

  .boosty-lightbox__caption { bottom: 70px; }

  .boosty-lightbox__share { top: 8px; left: 8px; }

  .boosty-lightbox__toolbar {
    top: 8px;
    gap: 4px;
  }
}

/* =========================================================
   Bootstrap 5 compatibility — prevent Bootstrap from
   overriding our gallery styles inside .container
   ========================================================= */
.boosty-gallery-wrapper img,
.boosty-gallery img {
  max-width: none; /* override BS img-fluid */
}

.boosty-gallery-wrapper .boosty-item img {
  max-width: 100%;
  height: auto;
}

.boosty-gallery--grid .boosty-item,
.boosty-gallery--masonry .boosty-item,
.boosty-gallery--mosaic .boosty-item {
  box-sizing: border-box;
}

/* =========================================================
   Dark mode
   ========================================================= */
@media (prefers-color-scheme: dark) {
  .boosty-item__caption--below,
  .boosty-item__caption {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
  }

  .boosty-filter__btn {
    color: #93c5fd;
    border-color: #3b82f6;
  }

  .boosty-filter__btn:hover,
  .boosty-filter__btn.active {
    background: #2563eb;
    color: #fff;
  }

  .boosty-item { background: #111827; }

  .boosty-pagination--numbered .boosty-pagination__btn {
    background: #1f2937;
    border-color: #374151;
    color: #d1d5db;
  }
}

/* =========================================================
   RTL Support
   ========================================================= */
[dir="rtl"] .boosty-gallery {
  direction: rtl;
}

[dir="rtl"] .boosty-lightbox__prev { left: auto; right: 20px; }
[dir="rtl"] .boosty-lightbox__next { right: auto; left: 20px; }

[dir="rtl"] .boosty-lightbox__close { right: auto; left: 20px; }

[dir="rtl"] .boosty-slider__prev { left: auto; right: 12px; }
[dir="rtl"] .boosty-slider__next { right: auto; left: 12px; }

[dir="rtl"] .boosty-watermark { right: auto; left: 10px; }

/* =========================================================
   Print
   ========================================================= */
@media print {
  .boosty-lightbox,
  .boosty-filter,
  .boosty-pagination { display: none !important; }

  .boosty-item__overlay { display: none; }

  .boosty-gallery--slider .boosty-slider__track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  .boosty-slider__slide { width: auto; }
}
