/* Meer Gallery Widget — Styles */

*, *::before, *::after { box-sizing: border-box; }

/* ── Section ── */
.meer-gallery-section {
  width: 100%;
  padding: 60px 20px;
}

.meer-gallery-outer {
  max-width: 1400px;
  margin: 0 auto;
  overflow: hidden;
}

/* ── Track (flex row on large desktop) ── */
.meer-gallery-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: relative;
}

/* ── Items ── */
.gallery-item {
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.item-main { width: 265px; height: 455px; z-index: 5; }
.item-mid  { width: 212px; height: 368px; z-index: 4; }
.item-edge { width: 168px; height: 295px; z-index: 3; }

/* White overlay on outermost images */
.meer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

/* ── Dots (hidden on desktop) ── */
.gallery-dots {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d0d0d0;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.dot.active {
  background: #555;
  transform: scale(1.3);
}

/* ─────────────────────────────────────
   MEDIUM DESKTOP (769–1199px)
   Images fan / stack behind center
───────────────────────────────────── */
@media (max-width: 1199px) and (min-width: 769px) {

  .meer-gallery-outer { overflow: visible; }

  .meer-gallery-track {
    display: block;
    position: relative;
    height: 500px;
    width: 100%;
  }

  .gallery-item {
    position: absolute;
    left: 50%;
    top: 50%;
  }

  .gallery-item.item-main       { transform: translate(-50%, -50%); z-index: 5; }
  .gallery-item[data-index="1"] { transform: translate(calc(-50% - 195px), -50%); z-index: 4; }
  .gallery-item[data-index="3"] { transform: translate(calc(-50% + 195px), -50%); z-index: 4; }
  .gallery-item[data-index="0"] { transform: translate(calc(-50% - 355px), -50%); z-index: 3; }
  .gallery-item[data-index="4"] { transform: translate(calc(-50% + 355px), -50%); z-index: 3; }
}

@media (max-width: 1050px) and (min-width: 769px) {
  .gallery-item[data-index="1"] { transform: translate(calc(-50% - 155px), -50%); }
  .gallery-item[data-index="3"] { transform: translate(calc(-50% + 155px), -50%); }
  .gallery-item[data-index="0"] { transform: translate(calc(-50% - 280px), -50%); }
  .gallery-item[data-index="4"] { transform: translate(calc(-50% + 280px), -50%); }
}

/* ─────────────────────────────────────
   MOBILE (≤768px) — Scroll-snap slider
───────────────────────────────────── */
@media (max-width: 768px) {

  .meer-gallery-section {
    padding: 40px 0;
  }

  /* Scrollable container — hides scrollbar, enables snap */
  .meer-gallery-outer {
    overflow-x: scroll;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;           /* Firefox */
    -ms-overflow-style: none;        /* IE/Edge */
    position: relative;
    max-width: 100%;
  }

  .meer-gallery-outer::-webkit-scrollbar { display: none; }

  /* Track — horizontal flex, JS sets left/right padding to center items */
  .meer-gallery-track {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    width: max-content;
    padding: 20px 0;   /* left/right set dynamically by JS */
    transition: none;
    transform: none !important;
    will-change: auto;
  }

  /* All items: same base size, snaps to center */
  .gallery-item {
    flex-shrink: 0;
    width: 210px;
    height: 300px;
    scroll-snap-align: center;
    transform: scale(0.88);
    transition: transform 0.35s ease, height 0.35s ease, opacity 0.35s ease;
    position: relative;
    left: auto;
    top: auto;
  }

  /* Active item — bigger, full opacity */
  .gallery-item.is-active {
    transform: scale(1);
    height: 340px;
    z-index: 5;
  }

  /* Hide overlay on mobile (clean slider look) */
  .meer-overlay { display: none !important; }

  /* Show dots */
  .gallery-dots { display: flex; }
}
