/* ========================================
   GALLERY CONFIGURATION
======================================== */

.css-gallery {
  --thumb-items: 6;
  --gap: 8px;
  --active-color: #187100;

  --thumb-height: 75px;
  --main-radius: 10px;
  --thumb-radius: 6px;

  --arrow-width: 28px;
  --arrow-height: 45px;

  --main-arrow-width: 36px;
  --main-arrow-height: 48px;
  --main-arrow-font-size: 22px;
  --main-arrow-offset: 10px;

  position: relative;
  width: 100%;
  min-width: 0;
}

/* ========================================
   MAIN IMAGE CONTAINER
======================================== */

.css-gallery .gallery-main {
  display: grid;
  position: relative;

  width: 100%;
  height: auto;

  overflow: hidden;
  background: transparent;
  border-radius: var(--main-radius);
}

/* Main slide */

.css-gallery .gallery-main > .gallery-slide {
  grid-area: 1 / 1;

  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 0;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

/* Active slide */

.css-gallery .gallery-main > .gallery-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Main image */

.css-gallery .gallery-slide > img {
  display: block;

  width: 100%;
  height: auto;
  max-width: 100%;

  object-fit: contain;
  background: transparent;
  border-radius: var(--main-radius);
}

/* ========================================
   MAIN IMAGE PREVIOUS & NEXT ARROWS
======================================== */

.css-gallery .gallery-main-prev,
.css-gallery .gallery-main-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  display: flex;
  align-items: center;
  justify-content: center;

  height: 50px;
  width: 50px;

  margin: 0;
  padding: 0;

  background: #549c00;
  color: #fff;

  border: 2px solid #fff;
  border-radius: 50%;

  font-size: var(--main-arrow-font-size);
  font-weight: normal;
  line-height: 1;

  cursor: pointer;
  user-select: none;
  z-index: 10;

  transition: background 0.2s ease;
}

.css-gallery .gallery-main-prev {
  left: var(--main-arrow-offset);
}

.css-gallery .gallery-main-next {
  right: var(--main-arrow-offset);
}

.css-gallery .gallery-main-prev:hover,
.css-gallery .gallery-main-next:hover {
  background: #007e05;
}

/* ========================================
   THUMBNAIL CAROUSEL
======================================== */

.css-gallery .gallery-thumbnails {
  display: flex;
  position: relative;

  gap: var(--gap);
  margin-top: 10px;

  min-width: 0;
  overflow-x: auto;

  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;

  background: transparent;
}

.css-gallery .gallery-thumbnails::-webkit-scrollbar {
  display: none;
}

/* Thumbnail container */

.css-gallery .gallery-thumbnails > .gallery-thumb {
  flex: 0 0
    calc((100% - (var(--thumb-items) - 1) * var(--gap)) / var(--thumb-items));

  min-width: 0;
  box-sizing: border-box;

  margin: 0;
  padding: 0;

  border: 2px solid transparent;
  border-radius: var(--thumb-radius);

  overflow: hidden;
  background: transparent;

  cursor: pointer;
  scroll-snap-align: start;

  transition: border-color 0.2s ease;
}

/* Active thumbnail */

.css-gallery .gallery-thumb.active {
  border-color: var(--active-color);
}

/* Thumbnail hover */

.css-gallery .gallery-thumb:hover {
  outline: 1px solid #12b347;
  outline-offset: -1px;
}

/* Thumbnail image */

.css-gallery .gallery-thumbnails img {
  display: block;
  width: 100%;
  /*height: var(--thumb-height);
    object-fit: contain;*/
  background: transparent;
  border-radius: calc(var(--thumb-radius) - 2px);
  padding: 2px;
  border: 2px solid #c2c2c2;
}

/* ========================================
   THUMBNAIL PREVIOUS & NEXT ARROWS
======================================== */

@supports selector(::scroll-button(left)) {
  .css-gallery {
    anchor-scope: --gallery-thumbs;
  }

  .css-gallery .gallery-thumbnails {
    anchor-name: --gallery-thumbs;

    margin-left: calc(var(--arrow-width) + 4px);
    margin-right: calc(var(--arrow-width) + 4px);
  }

  .css-gallery .gallery-thumbnails::scroll-button(*) {
    position: absolute;
    position-anchor: --gallery-thumbs;
    align-self: anchor-center;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    margin: 0;
    padding: 0;

    background: #60be64;
    color: #fff;

    border: 2px solid #fff;
    border-radius: 6px;

    font-size: 18px;
    font-weight: normal;
    line-height: 1;

    cursor: pointer;
    z-index: 10;

    transition:
      background 0.2s ease,
      opacity 0.2s ease;
  }

  /* Previous thumbnails */

  .css-gallery .gallery-thumbnails::scroll-button(left) {
    content: "❮" / "Previous";
    right: anchor(left);
    margin-right: 4px;
  }

  /* Next thumbnails */

  .css-gallery .gallery-thumbnails::scroll-button(right) {
    content: "❯" / "Next";
    left: anchor(right);
    margin-left: 4px;
  }

  .css-gallery .gallery-thumbnails::scroll-button(*):hover {
    background: rgba(7, 114, 2, 0.9);
  }

  .css-gallery .gallery-thumbnails::scroll-button(*):disabled {
    opacity: 0.25;
    cursor: default;
  }
}

/* ========================================
   KEYBOARD FOCUS
======================================== */

.css-gallery button:focus-visible {
  outline: 2px solid var(--active-color);
  outline-offset: -2px;
}

/* ========================================
   TABLET
======================================== */

@media (max-width: 991px) {
  .css-gallery {
    --thumb-items: 8;
    --thumb-height: 65px;

    --main-arrow-width: 32px;
    --main-arrow-height: 44px;
    --main-arrow-font-size: 20px;
  }
}

/* ========================================
   MOBILE
======================================== */

@media (max-width: 767px) {
  .css-gallery {
    --thumb-items: 5;
    --gap: 5px;
    --thumb-height: 55px;

    --main-radius: 8px;
    --thumb-radius: 5px;

    --arrow-width: 22px;
    --arrow-height: 32px;

    --main-arrow-width: 28px;
    --main-arrow-height: 38px;
    --main-arrow-font-size: 16px;
    --main-arrow-offset: 6px;
  }
}

/* ========================================
   SMALL MOBILE
======================================== */

@media (max-width: 480px) {
  .css-gallery {
    --thumb-items: 4;
    --gap: 4px;
    --thumb-height: 50px;

    --main-arrow-width: 24px;
    --main-arrow-height: 34px;
    --main-arrow-font-size: 14px;
    --main-arrow-offset: 5px;
  }
}

/* ========================================
   REDUCED MOTION ACCESSIBILITY
======================================== */

@media (prefers-reduced-motion: reduce) {
  .css-gallery .gallery-thumbnails {
    scroll-behavior: auto;
  }

  .css-gallery .gallery-slide,
  .css-gallery .gallery-thumb,
  .css-gallery .gallery-main-prev,
  .css-gallery .gallery-main-next {
    transition: none;
  }
}

span.img-txt {
  position: absolute;
  bottom: 9px;
  left: 9px;
  /* width: 100%; */
  /* height: 100%; */
  background: #000000;
  color: #fff;
  padding: 6px 18px;
  /* top: 2px; */
  border-radius: 2px;
  opacity: 0.6;
}
