/* ==========================================================
   GALLERY / LIGHTSLIDER / SIMPLELIGHTBOX – BEST PRACTICE CSS
   Goals:
   - Thumbnails: uniform tile size, clean crop, no red background
   - Carousel tile background: WHITE (best practice)
   - Popup: NO distortion (viewport-constrained, preserves aspect ratio)
   - WAF/ModSecurity friendly (no min(), no calc(), no inset shorthand)
   ========================================================== */


/* ===========================
   Core / Utility
=========================== */

* { box-sizing: border-box; }

.hidden { display: none; }

.clear { clear: both; }

.list-unstyled {
  padding-left: 0;
  list-style: none;
}

a {
  color: #009688;
  text-decoration: none;
}

a:hover {
  color: #01695f;
  text-decoration: none;
}


/* ===========================
   LightSlider – Base
=========================== */

.cS-hidden {
  height: 1px;
  opacity: 0;
  filter: alpha(opacity=0);
  overflow: hidden;
}

/* Remove the old red background entirely */
.content-lightSlider li {
  background-color: #ffffff;  /* best practice: white tile background */
  text-align: center;
  color: #000;
}

.content-lightSlider h3 {
  margin: 0;
  padding: 70px 0;
}


/* ==========================================================
   LightSlider – Uniform Thumbnails (Best Practice)
   - Constant tile height (uniform)
   - Image fills tile with safe crop
   - White background prevents ugly gaps / loading flashes
   ========================================================== */

/* IMPORTANT:
   Do not float slider items; LightSlider controls layout.
   Floats can cause odd spacing/glitches in some builds.
*/
.gallery-lightSlider li {
  float: none;
  margin-right: 0;

  height: 220px;              /* adjust as needed */
  overflow: hidden;

  background-color: #ffffff;  /* ensure no red/colored bleed-through */

  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightSlider li img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;          /* clean, uniform crop */
}

/* Responsive thumbnail height (still uniform—just smaller tiles) */
@media (max-width: 1200px) { .gallery-lightSlider li { height: 200px; } }
@media (max-width: 992px)  { .gallery-lightSlider li { height: 180px; } }
@media (max-width: 768px)  { .gallery-lightSlider li { height: 160px; } }
@media (max-width: 480px)  { .gallery-lightSlider li { height: 140px; } }

/* Optional: subtle hover polish */
.gallery-lightSlider li img {
  transition: transform 0.15s ease;
}

.gallery-lightSlider li:hover img {
  transform: scale(1.02);
}


/* ==========================================================
   Legacy Grid Rule – Scoped (kept, but not allowed to fight slider)
   If you use .gallery as a non-slider grid elsewhere, this applies.
   ========================================================== */

.container .gallery:not(.gallery-lightSlider) a img {
  float: left;
  width: 25%;
  height: auto;
  border: 2px solid #fff;
  transition: transform 0.15s ease;
  position: relative;
}


/* ==========================================================
   SimpleLightbox – Base Styles (preserved + safe)
   ========================================================== */

body.hidden-scroll {
  overflow: hidden;
}

.sl-overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: #fff;
  display: none;
  z-index: 1035;
}

.sl-wrapper {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1040;
}

.sl-wrapper * {
  box-sizing: border-box;
}

.sl-wrapper button {
  border: 0 none;
  background: transparent;
  font-size: 28px;
  padding: 0;
  cursor: pointer;
}

.sl-wrapper button:hover {
  opacity: 0.7;
}

.sl-wrapper .sl-close {
  display: none;
  position: fixed;
  right: 30px;
  top: 30px;
  z-index: 10060;
  height: 44px;
  width: 44px;
  line-height: 44px;
  font-family: Arial, Baskerville, monospace;
  color: #000;
  font-size: 3rem;
}

.sl-wrapper .sl-counter {
  display: none;
  position: fixed;
  top: 30px;
  left: 30px;
  z-index: 1060;
  color: #000;
  font-size: 1rem;
}

.sl-wrapper .sl-navigation {
  width: 100%;
  display: none;
}

.sl-wrapper .sl-navigation button {
  position: fixed;
  top: 50%;
  margin-top: -22px;
  height: 44px;
  width: 22px;
  line-height: 44px;
  text-align: center;
  display: block;
  z-index: 10060;
  font-family: Arial, Baskerville, monospace;
  color: #000;
}

.sl-wrapper .sl-navigation button.sl-next {
  right: 5px;
  font-size: 2rem;
}

.sl-wrapper .sl-navigation button.sl-prev {
  left: 5px;
  font-size: 2rem;
}

@media (min-width: 568px) {
  .sl-wrapper .sl-navigation button {
    width: 44px;
  }
  .sl-wrapper .sl-navigation button.sl-next {
    right: 10px;
    font-size: 3rem;
  }
  .sl-wrapper .sl-navigation button.sl-prev {
    left: 10px;
    font-size: 3rem;
  }
}

@media (min-width: 800px) {
  .sl-wrapper .sl-navigation button.sl-next { right: 20px; }
  .sl-wrapper .sl-navigation button.sl-prev { left: 20px; }
}


/* ==========================================================
   SimpleLightbox – Popup (Best Practice: NO distortion)
   - No forced width/height
   - Fits within viewport
   - Preserves aspect ratio
   ========================================================== */

.sl-wrapper .sl-image {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: center;

  -ms-touch-action: none;
  touch-action: none;
}

.sl-wrapper .sl-image img {
  margin: 0;
  padding: 0;
  border: 0 none;
  display: block;

  width: auto;
  height: auto;

  max-width: 90vw;
  max-height: 90vh;

  object-fit: contain;
}


/* ===========================
   Captions / Spinner (kept)
=========================== */

.sl-wrapper .sl-image .sl-caption {
  display: none;
  padding: 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  font-size: 1.25rem;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.sl-spinner {
  display: none;
  border: 5px solid #333;
  border-radius: 40px;
  height: 40px;
  width: 40px;
  left: 50%;
  margin: -20px 0 0 -20px;
  opacity: 0;
  position: fixed;
  top: 50%;
  z-index: 1007;
}
