/* Gallery container - uses gallerique-grid class */
#gallery_container {
  margin: 0;
  padding: 0;
}

#gallery_list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Bottom spacing before footer */
#gallery_list.block,
#galleryWrapper {
  margin-bottom: 3rem;
}

#module-gallerique-gallery #fancybox-title-over h4 a {
  color: #fff;
  text-decoration: underline;
}

p.label-image {
  font-weight: bold;
}

.hidden {
  display: none !important;
  visibility: hidden !important;
}
.fancybox-opened .fancybox-title.fancybox-title-inside-wrap {
  position: initial;
}

.gallerique-buttons {
  position: absolute;
  top: 10px;
  left: 50%;
  background: rgba(255, 255, 255, 0.5);
  padding: 3px 5px;
  border-radius: 4px;
  z-index: 8050;
}

.gallerique-buttons:hover {
  background: rgba(255, 255, 255, 1);
}

.gallerique-gallery {
  position: relative;
  padding: 0;
}

.gallerique-gallery img {
  width: 100%;
  display: block;
  transition: transform 0.3s ease;
}

.gallerique-gallery:hover img {
  transform: scale(1.03);
}

.gallerique-gallery-cover {
  overflow: hidden;
}

.gallerique-gallery-cover a {
  display: block;
}

.gallerique-gallery-cover a:focus {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
}

/* Gradient overlay for text contrast - accessibility improvement */
.gallerique-gallery::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.gallerique-gallery-desc {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px 12px 12px;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 0, 0, 0.5);
  font-weight: 700;
  font-size: 0.95em;
  line-height: 1.3;
  z-index: 2;
  pointer-events: none;
}

.fancybox-title-inside-wrap {
  padding-top: 0;
}

.growl_status_all {
  position: fixed;
  z-index: 9999;
  top: 5px;
  right: 10px;
}

.growl_status_gallerique {
  display: none;
  position: relative;
  margin: 5px 0;
  padding: 10px 25px 10px 20px;
  border-radius: 6px;
  color: #fff;
  background-color: rgba(67, 183, 84, 0.85);
  transition: none;
}

.growl_status_gallerique {
  background-color: rgba(226, 124, 121, 0.85);
}

.growl_status_gallerique .close_status_gallerique {
  position: absolute;
  cursor: pointer;
  right: 5px;
  top: 1px;
}

.growl_status_gallerique .close_status_gallerique:before {
  content: "\f00d";
  font-family: "FontAwesome";
  font-size: 12px;
  line-height: 12px;
}

#galleryWrapper .tag_item {
  font-size: 80%;
  padding: 2px 7px 5px;
  margin: 0 3px;
  cursor: pointer;
  border-radius: 3px;
  background-color: #f5f8f9;
}
#galleryWrapper .tag_item.active {
  background-color: #333;
  color: white;
}
#galleryWrapper .tag_item:hover {
  background-color: #666;
  color: #ccc;
}
.fancybox-wrap {
  background: white;
}
.gallerique_advanced_block {
  width: 60%;
  float: left;
}
.gallerique_advanced_block.owl-carousel {
  width: 40%;
  float: left;
}
.gallerique_advanced_block.owl-carousel .owl-nav button {
  font-size: 25px !important;
  position: absolute;
  top: 33.3%;
}
.gallerique_advanced_block.owl-carousel .owl-nav button.owl-next {
  right: 0;
}

.gallery_product_item .product_name {
  text-align: center;
  font-weight: bold;
  padding: 10px;
}
.gallery_product_item .product_description {
  padding: 10px;
}
.gallerique_advanced_block .label-image,
.gallerique_advanced_block .description,
.gallerique_advanced_block .full-description {
  padding: 10px;
}

/* ============================================
   Gallery Grid Layout - Modern Design
   ============================================ */

/* Grid Container with CSS Custom Properties */
.gallerique-grid {
  --cols-mobile: 1;
  --cols-tablet: 2;
  --cols-desktop: 3;
  --cols-large: 4;
  display: grid;
  grid-template-columns: repeat(var(--cols-mobile), 1fr);
  gap: 1rem;
}

/* Responsive breakpoints using CSS custom properties */
@media (min-width: 640px) {
  .gallerique-grid {
    grid-template-columns: repeat(var(--cols-tablet), 1fr);
  }
}

@media (min-width: 1280px) {
  .gallerique-grid {
    grid-template-columns: repeat(var(--cols-desktop), 1fr);
  }
}

@media (min-width: 1536px) {
  .gallerique-grid {
    grid-template-columns: repeat(var(--cols-large), 1fr);
  }
}

/* Gallery Item Card */
.gallerique-grid-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 0.5rem;
  background-color: transparent;
}

/* Highlight shadow effect (inner glow) */
.gallerique-grid-item::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: 0.5rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

/* Link wrapper */
.gallerique-grid-item > a {
  display: block;
  position: relative;
}
.gallerique-grid-item img {
  width: 100%;
}
/* ============================================
   Blur-Up Progressive Image Loading
   ============================================ */

/* Image wrapper for blur-up effect */
.gallerique-img-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1/1;
  background: #f0f0f0;
  border-radius: 0.5rem;
}

/* Thumbnail - blurred placeholder (loads immediately) */
.gallerique-img-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px);
  transform: scale(1.1); /* Hide blur edges */
  transition: opacity 0.5s ease-out;
  border-radius: 0.5rem;
}

/* Full image - fades in over thumbnail */
.gallerique-img-full {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease-out, filter 0.3s ease;
  filter: brightness(0.9);
  border-radius: 0.5rem;
}

/* When full image loaded */
.gallerique-img-full.loaded {
  opacity: 1;
}

/* Hide thumbnail after full loads (saves memory) */
.gallerique-img-wrapper.complete .gallerique-img-thumb {
  opacity: 0;
}

/* Hover effects on wrapper */
.gallerique-grid-item:hover .gallerique-img-wrapper {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

.gallerique-grid-item:hover .gallerique-img-full.loaded {
  filter: brightness(1.1);
}

/* ============================================
   Single Image Blur-In Effect (Gallery List)
   ============================================ */

/* Wrapper for single image with skeleton - reserves space */
.gallerique-img-wrapper--single {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1/1;
  border-radius: 0.5rem;
  background: #e8e8e8;
}

/* Skeleton shimmer animation */
.gallerique-img-wrapper--single::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: gallerique-skeleton 1.5s ease-in-out infinite;
  z-index: 1;
}

@keyframes gallerique-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Hide skeleton when loaded */
.gallerique-img-wrapper--single.complete::before {
  display: none;
}

/* Cover image - starts blurred, fades in sharp */
.gallerique-img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: blur(20px);
  transform: scale(1.1);
  transition: opacity 0.5s ease-out, filter 0.5s ease-out, transform 0.5s ease-out;
}

/* When cover image loaded */
.gallerique-img-cover.loaded {
  opacity: 1;
  filter: blur(0) brightness(0.9);
  transform: scale(1);
}

/* Stop skeleton animation when loaded */
.gallerique-img-wrapper--single.complete {
  animation: none;
  background: transparent;
}

/* Hover effect for cover images */
.gallerique-grid-item:hover .gallerique-img-cover.loaded {
  filter: blur(0) brightness(1.1);
}

/* Gallery name overlay */
.gallerique-grid-item .gallerique-grid-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1rem 1rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  border-radius: 0 0 0.5rem 0.5rem;
  pointer-events: none;
  z-index: 2;
}

/* Featured/Hero Card (first item spans multiple cells) */
.gallerique-grid-item--featured {
  grid-column: span 1;
  grid-row: span 1;
}

@media (min-width: 640px) {
  .gallerique-grid-item--featured {
    grid-column: span 2;
    grid-row: span 2;
  }
}

@media (min-width: 1280px) {
  .gallerique-grid-item--featured {
    grid-column: span 1;
    grid-row: span 2;
  }
}

.gallerique-grid-item--featured img {
  aspect-ratio: auto;
  height: 100%;
  min-height: 300px;
}

@media (min-width: 640px) {
  .gallerique-grid-item--featured img {
    min-height: 400px;
  }
}

/* Hero card with content (optional) */
.gallerique-grid-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  overflow: hidden;
  border-radius: 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 4rem 1.5rem 4rem;
  text-align: center;
  color: #fff;
  grid-column: span 1;
  grid-row: span 1;
}

@media (min-width: 640px) {
  .gallerique-grid-hero {
    grid-column: span 2;
    grid-row: span 2;
    padding: 6rem 1.5rem 4rem;
  }
}

@media (min-width: 1280px) {
  .gallerique-grid-hero {
    grid-column: span 1;
    grid-row: span 2;
  }
}

.gallerique-grid-hero::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: 0.5rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.gallerique-grid-hero__title {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.gallerique-grid-hero__desc {
  max-width: 32ch;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.gallerique-grid-hero__btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #fff;
  border-radius: 0.5rem;
  background-color: #fff;
  color: #000;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  z-index: 10;
}

.gallerique-grid-hero__btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ============================================
   Custom Gallery Lightbox Overlay
   ============================================ */

.gallerique-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallerique-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Blurred background image */
.gallerique-overlay-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.3);
  transform: scale(1.1);
  z-index: 0;
}

/* Close button - top left */
.gallerique-overlay-close {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  background: rgba(30, 30, 30, 0.8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10002;
  transition: background 0.2s ease, transform 0.2s ease;
}

.gallerique-overlay-close:hover {
  background: rgba(60, 60, 60, 0.9);
  transform: scale(1.05);
}

.gallerique-overlay-close::before,
.gallerique-overlay-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

.gallerique-overlay-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.gallerique-overlay-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Main image container */
.gallerique-overlay-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 100px 20px;
  position: relative;
  min-height: 0;
  z-index: 1;
}

/* Image wrapper with dark background */
.gallerique-overlay-img-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  background: rgba(20, 20, 20, 0.9);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

.gallerique-overlay-main img {
  display: block;
  max-width: 90vw;
  max-height: calc(100vh - 200px);
  object-fit: contain;
}

/* Navigation arrows */
.gallerique-overlay-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(30, 30, 30, 0.8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10001;
  transition: background 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallerique-overlay-nav:hover {
  background: rgba(60, 60, 60, 0.9);
  transform: translateY(-50%) scale(1.05);
}

.gallerique-overlay-nav--prev {
  left: 20px;
}

.gallerique-overlay-nav--next {
  right: 20px;
}

.gallerique-overlay-nav::after {
  content: "";
  width: 10px;
  height: 10px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
}

.gallerique-overlay-nav--prev::after {
  transform: rotate(-135deg);
  margin-left: 3px;
}

.gallerique-overlay-nav--next::after {
  transform: rotate(45deg);
  margin-right: 3px;
}

/* Image caption/label - hidden by default, shows on hover */
.gallerique-overlay-caption {
  display: none;
}

/* Thumbnail slider container */
.gallerique-overlay-thumbs {
  flex-shrink: 0;
  background: transparent;
  padding: 12px 0 20px;
  position: relative;
  z-index: 1;
}

.gallerique-overlay-thumbs-wrapper {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.gallerique-overlay-thumbs-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 0;
  justify-content: center;
}

.gallerique-overlay-thumbs-track::-webkit-scrollbar {
  display: none;
}

/* Thumbnail scroll buttons - hidden, rely on drag/scroll */
.gallerique-overlay-thumbs-nav {
  display: none;
}

/* Individual thumbnail */
.gallerique-overlay-thumb {
  flex-shrink: 0;
  width: 70px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  border: 2px solid transparent;
}

.gallerique-overlay-thumb:hover {
  opacity: 0.7;
}

.gallerique-overlay-thumb.active {
  opacity: 1;
  border-color: #fff;
}

.gallerique-overlay-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .gallerique-overlay-main {
    padding: 60px 10px 10px;
  }

  .gallerique-overlay-main img {
    max-width: 100vw;
    max-height: calc(100vh - 160px);
  }

  .gallerique-overlay-nav {
    width: 40px;
    height: 40px;
  }

  .gallerique-overlay-nav--prev {
    left: 10px;
  }

  .gallerique-overlay-nav--next {
    right: 10px;
  }

  .gallerique-overlay-close {
    top: 10px;
    left: 10px;
    width: 38px;
    height: 38px;
  }

  .gallerique-overlay-thumb {
    width: 55px;
    height: 40px;
  }

  .gallerique-overlay-thumbs-wrapper {
    padding: 0 40px;
  }

  .gallerique-overlay-close {
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
  }
}

/* Prevent body scroll when overlay is open */
body.gallerique-overlay-open {
  overflow: hidden;
}
