/* renuity-dynamic-galleries.css */

/* ------------------------------ */
/* 1. Slick Carousel Customizations */
/* ------------------------------ */

/* Hide default Slick arrow text */
.slick-carousel .slick-prev:before,
.slick-carousel .slick-next:before,
.before-after-carousel .slick-prev:before,
.before-after-carousel .slick-next:before {
    display: none;
}

.slick-carousel, .before-after-carousel {
    position: relative;
    padding-bottom: 3em;; /* Add space below the carousel for arrows */
	margin-bottom: var(--spacing-24);
}


/* Style the custom arrow buttons */
.slick-carousel .slick-prev,
.slick-carousel .slick-next, 
.before-after-carousel .slick-prev,
.before-after-carousel .slick-next {
    padding: 1.2em;
    background: var(--e-global-color-primary);
    border-radius: 6px;
    display: flex; /* Removed !important */
    align-items: center;
    justify-content: center;
    z-index: 1;
    position: absolute; /* Changed from relative to absolute */
    top: auto;
	bottom: 0;
    cursor: pointer;
    transition: background 0.3s ease;
}


/* Position arrows to the sides */
.slick-carousel .slick-prev, .before-after-carousel .slick-prev {
    left: 50%;
    transform: translate(calc(-100% - 4px), 0px); /* Shift left by 150% of arrow width and down 10px */
    /* Optional: Adjust further spacing */
}

.slick-carousel .slick-next, .before-after-carousel .slick-next {
    position: absolute;
    left: 50%; /* Start at horizontal center */
    /* Optional: Adjust further spacing */
    transform: translate(4px, 0px); /* Shift right by 50% of arrow width and down 10px */
    /* Optional: Adjust further spacing */
    margin-left: 0px;
}

.slick-carousel .slick-slide img {
  aspect-ratio: 1/1;
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.service-repeater .repeater-item .slick-carousel .slick-slide img {
	aspect-ratio: 3/2!important;
	margin-bottom: 0px!important;
}

@media(max-width:480px){
	.service-repeater .repeater-item .slick-carousel .slick-slide img {
		aspect-ratio: 1!important;
	}
}

.service-repeater .slick-carousel::before,
.service-repeater .slick-carousel::after {
  content: "";
  position: absolute;
  top: 0;
  width: 120px; /* wider solid coverage */
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.service-repeater .slick-carousel::before {
  left: 0;
  background: linear-gradient(to right, white 10%, rgba(255,255,255,0) 100%);
}

.service-repeater .slick-carousel::after {
  right: 0;
  background: linear-gradient(to left, white 10%, rgba(255,255,255,0) 100%);
}

.slick-carousel .slick-next, .before-after-carousel .slick-next {
    right: 10px;
}

/* Hover effect for arrows */
.slick-carousel .slick-prev:hover,
.slick-carousel .slick-next:hover,
.before-after-carousel .slick-prev:hover,
.before-after-carousel .slick-next:hover {
    background: var(--e-global-color-secondary);
}

/* Style the Font Awesome icons within the arrows */
.slick-carousel .slick-prev i,
.slick-carousel .slick-next i,
.before-after-carousel .slick-prev i,
.before-after-carousel .slick-next i {
    font-size: 1em;
    color: white;
}

/* Ensure Dots are Visible */
.slick-carousel .slick-dots, .before-after-carousel .slick-dots {
    bottom: 0;
    position: relative;
    order: -1;
}

.slick-carousel .slick-dots li button:before,
.before-after-carousel .slick-dots li button:before {
    color: var(--e-global-color-primary);
    opacity: 0.5;
    font-size: 12px;
}

.slick-carousel .slick-dots li.slick-active button:before,
.before-after-carousel .slick-dots li.slick-active button:before {
    color: var(--e-global-color-primary) !important;
    opacity: 1;
}

/* Styles for Image Labels in Carousel */
.slick-carousel .gallery-item .image-label {
    margin-top: 8px;
    text-align: center;
    font-size: 16px;
    color: var(--e-global-color-text);
    font-family: inherit, sans-serif;
    font-weight: 600;
}

/* ------------------------------ */
/* 2. Grid Layout Customizations */
/* ------------------------------ */

/* Base Grid Styles */
.product-type-gallery-grid {
    display: grid;
    /* Default values */
    grid-template-columns: repeat(3, 1fr); /* Default desktop columns */
    gap: 10px; /* Default grid gap */
}

/* Gallery Item Styles */
.product-type-gallery-grid .gallery-item {
    position: relative;
    overflow: hidden;
}

.product-type-gallery-grid .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

.product-type-gallery-grid .gallery-item .image-label {
    margin-top: 8px;
    text-align: center;
    font-size: 16px;
    color: #333;
    font-family: inherit;
    font-weight: 600;
}

/* Responsive Grid Columns */

/* Desktop Columns */
.product-type-gallery-grid.columns-desktop-1 {
    grid-template-columns: repeat(1, 1fr);
}

.product-type-gallery-grid.columns-desktop-2 {
    grid-template-columns: repeat(2, 1fr);
}

.product-type-gallery-grid.columns-desktop-3 {
    grid-template-columns: repeat(3, 1fr);
}

.product-type-gallery-grid.columns-desktop-4 {
    grid-template-columns: repeat(4, 1fr);
}

.product-type-gallery-grid.columns-desktop-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Tablet Columns */
@media (max-width: 1024px) {
    .product-type-gallery-grid.columns-tablet-1 {
        grid-template-columns: repeat(1, 1fr);
    }
    .product-type-gallery-grid.columns-tablet-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-type-gallery-grid.columns-tablet-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    .product-type-gallery-grid.columns-tablet-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    .product-type-gallery-grid.columns-tablet-5 {
        grid-template-columns: repeat(5, 1fr);
    }

    /* Adjust Slick Slider gap for tablet */
    .slick-slider {
        gap: 16px;
    }
}

/* Mobile Columns */
@media (max-width: 767px) {
    .product-type-gallery-grid.columns-mobile-1 {
        grid-template-columns: repeat(1, 1fr);
    }
    .product-type-gallery-grid.columns-mobile-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-type-gallery-grid.columns-mobile-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    .product-type-gallery-grid.columns-mobile-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Adjust Slick Slider gap for mobile */
    .slick-slider {
        gap: 12px;
    }
}

/* Grid Gap Customizations */
.product-type-gallery-grid.grid-gap-0 {
    gap: 0px;
}

.product-type-gallery-grid.grid-gap-5 {
    gap: 5px;
}

.product-type-gallery-grid.grid-gap-10 {
    gap: 10px;
}

.product-type-gallery-grid.grid-gap-15 {
    gap: 15px;
}

.product-type-gallery-grid.grid-gap-20 {
    gap: 20px;
}

/* ------------------------------ */
/* 3. Add Spacing Between Slick Slides */
/* ------------------------------ */

/* Add spacing between slides */
.slick-carousel .slick-slide, .before-after-container .slick-slide {
    padding: 0 var(--spacing-8); /* Adjust the padding as needed */
    box-sizing: border-box;
}

/* Optional: Remove extra padding on the first and last slides */
.slick-carousel .slick-slide:first-child, .before-after-container .slick-slide:first-child {
    padding-left: 0;
}

.slick-carousel .slick-slide:last-child, before-after-container .slick-slide:last-child {
    padding-right: 0;
}



/* Aspect Ratio Container */
.ba-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;  
}

.ba-carousel .slick-list,
.ba-carousel .slick-track {
  height: 100%;
}


/* Before Slick initializes, show only the first slide */
.ba-carousel:not(.slick-initialized) .carousel-slide {
  display: none;             /* hide all */
}
.ba-carousel:not(.slick-initialized) .carousel-slide:first-child {
  display: block;            /* show only the first */
}

/* Hide arrows until Slick is ready */
.ba-carousel:not(.slick-initialized) .slick-arrow {
  display: none !important;
}


.ba-container {
  position: relative;
  aspect-ratio: 3/2;
  background-size: cover;
  background-position: center;
  width: 100%;
  overflow: hidden;
}

/* After Image Overlay */
.after-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  clip-path: inset(0 50% 0 0);
  transition: clip-path 0.1s linear;
}

/* Divider Handle */
.divider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background-color: var(--e-global-color-accent);
  cursor: ew-resize;
  transform: translateX(-50%);
  z-index: 2;
  transition: left 0.1s linear;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.divider-handle::after {
    content: '\e0a4';
    position: absolute;
    font-family: 'Font Awesome 6 Pro';
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    aspect-ratio: 1;
    display: flex;
    background: var(--e-global-color-accent);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    justify-content: center;
    align-items: center;
    color: white;
}

/* Slick Slide Aspect Ratio */
.slick-slide > div {
  height: 100%;
}

.slick-list {
  overflow: hidden;
  width: 100%;
}

.slick-track {
  display: flex;
  align-items: center;
}

/* Ensure active slide visibility */
.before-after-carousel .slick-slide {
  opacity: 0;
  transition: opacity 0.3s;
}

.before-after-carousel .slick-slide.slick-active {
  opacity: 1;
}

/* Handle z-index */
.before-after-carousel .ba-container {
  position: relative;
  z-index: 1;
}

.slick-active .ba-container {
  z-index: 2;
}

/* Divider Performance Fix */
.divider-handle {
  will-change: left;
}

/* Active Slide Styling */
.slick-slide.slick-active .ba-container {
  z-index: 1;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
}

.ba-container .image-label {
    position: absolute;
    bottom: 1em;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    z-index: 4;
    pointer-events: none;
    display: flex;
    width: 100%;
    justify-content: space-around;
}

.ba-container .image-label .before-label, .ba-container .image-label .after-label {
    padding: 8px 14px;
	border-radius: 6px;
	background-color: var(--e-global-color-accent);
}

/* ===== Locked Mosaic (12 cols × 6 rows, exactly 9 images) ===== */
.product-type-gallery-mosaic.is-locked {
  /* Desktop defaults */
  --cols: 12;
  --rows: 6;
  --row: 160px;  /* desktop row height */
  --gap: 16px;


  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), var(--row));
  gap: var(--gap);
}

/* Shared item styles */
.product-type-gallery-mosaic.is-locked .gallery-item {
  position: relative;
  overflow: hidden;
}

.product-type-gallery-mosaic.is-locked .gallery-item a,
.product-type-gallery-mosaic.is-locked .gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
}
.product-type-gallery-mosaic.is-locked .gallery-item img { object-fit: cover; }

.product-type-gallery-mosaic.is-locked .image-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 8px 10px;
  font-size: 14px;
  color: #fff;
  line-height: 1.3;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
  pointer-events: none;
}
@media(min-width: 1025px){
/* ---------- DESKTOP (≥1026px): 12 columns ---------- */
.product-type-gallery-mosaic.is-locked .gallery-item:nth-child(1)  { grid-column: 1 / span 4;  grid-row: 1 / span 4; }
.product-type-gallery-mosaic.is-locked .gallery-item:nth-child(2)  { grid-column: 5 / span 3;  grid-row: 1 / span 2; }
.product-type-gallery-mosaic.is-locked .gallery-item:nth-child(3)  { grid-column: 8 / span 5;  grid-row: 1 / span 1; }
.product-type-gallery-mosaic.is-locked .gallery-item:nth-child(4)  { grid-column: 1 / span 3;  grid-row: 5 / span 2; }
.product-type-gallery-mosaic.is-locked .gallery-item:nth-child(5)  { grid-column: 5 / span 3;  grid-row: 3 / span 2; }
.product-type-gallery-mosaic.is-locked .gallery-item:nth-child(6)  { grid-column: 8 / span 3;  grid-row: 2 / span 2; }
.product-type-gallery-mosaic.is-locked .gallery-item:nth-child(7)  { grid-column: 11 / span 2; grid-row: 2 / span 2; }
.product-type-gallery-mosaic.is-locked .gallery-item:nth-child(8)  { grid-column: 4 / span 4;  grid-row: 5 / span 2; }
.product-type-gallery-mosaic.is-locked .gallery-item:nth-child(9)  { grid-column: 8 / span 5;  grid-row: 4 / span 3; }
}
/* ---------- Laptop (≤1376px): 8 columns ---------- */
@media (max-width: 1375px) {
  .product-type-gallery-mosaic.is-locked {
    --cols: 8;
    --row: 120px;
    --gap: 16px;
   
  }

/* ---------- TABLET (≤1025px): 8 columns ---------- */
@media (max-width: 1024px) and (min-width: 768px) {
  .product-type-gallery-mosaic.is-locked {
    --cols: 8;
    --row: 96px;
    --gap: 16px;
    grid-template-columns: repeat(var(--cols), 1fr);
    grid-template-rows: repeat(var(--rows), var(--row));
  }

  /* Remapped positions for 8-col canvas */
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(1) { grid-column: 1 / span 3; grid-row: 1 / span 4; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(2) { grid-column: 4 / span 2; grid-row: 1 / span 2; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(3) { grid-column: 6 / span 3; grid-row: 1 / span 1; }

  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(4) { grid-column: 1 / span 2; grid-row: 5 / span 2; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(5) { grid-column: 4 / span 2; grid-row: 3 / span 2; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(6) { grid-column: 6 / span 2; grid-row: 2 / span 2; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(7) { grid-column: 8 / span 1; grid-row: 2 / span 2; }

  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(8) { grid-column: 3 / span 3; grid-row: 5 / span 2; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(9) { grid-column: 6 / span 3; grid-row: 4 / span 3; }
}

/* ---------- MOBILE (≤767px): 4 columns ---------- */
@media (max-width: 767px) {
  .product-type-gallery-mosaic.is-locked {
    --cols: 4;
    --row: 80px;  /* go 92px if you want tighter */
    --gap: 12px;
    grid-template-columns: repeat(var(--cols), 1fr);
    grid-template-rows: repeat(var(--rows), var(--row));
  }
	}
@media (max-width: 767px) and (min-width: 397px) {
  /* Remapped positions for 4-col canvas */
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(1) { grid-column: 1 / span 2; grid-row: 1 / span 3; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(2) { grid-column: 3 / span 1; grid-row: 1 / span 2; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(3) { grid-column: 4 / span 1; grid-row: 1 / span 1; }

  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(4) { grid-column: 1 / span 2; grid-row: 4 / span 2; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(5) { grid-column: 3 / span 1; grid-row: 3 / span 2; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(6) { grid-column: 4 / span 1; grid-row: 2 / span 2; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(7) { grid-column: 4 / span 1; grid-row: 4 / span 1; }

  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(8) { grid-column: 1 / span 2; grid-row: 6 / span 1; }
  .product-type-gallery-mosaic.is-locked .gallery-item:nth-child(9) { grid-column: 3 / span 2; grid-row: 5 / span 2; }
}

/* Small phones tuning */
@media (max-width: 576px) {
  .product-type-gallery-mosaic.is-locked { --row: 72px; --gap: 8px; }
}
@media (max-width: 480px) {
  .product-type-gallery-mosaic.is-locked { --row: 60px; --gap: 8px; }
}
	
@media (max-width: 396px) {
  .product-type-gallery-mosaic.is-locked {
    /* 3 columns, no fixed row tracks */
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: none;   /* disable the 6 locked rows */
    grid-auto-rows: auto;
    --gap: 8px;
  }

  .product-type-gallery-mosaic.is-locked .gallery-item {
    aspect-ratio: 1 / 1; !important       
    grid-column: auto / span 1 !important; 
    position: relative; 
  }

  .product-type-gallery-mosaic.is-locked .gallery-item a,
  .product-type-gallery-mosaic.is-locked .gallery-item img {
    width: 100%; height: 100%;
    display: block;
    object-fit: cover;
  }
}
