/* ========================================
   LM Community Updates Gallery Styles
   ======================================== */

:root {
  --lm-cug-cols: 4;
  --lm-cug-gap: 16px;
  --lm-cug-primary: #0073aa;
  --lm-cug-hover: #005a87;
}

/* ========================================
   Gallery Container
   ======================================== */
.lm-cug-gallery {
  max-width: 1400px;
  margin: 40px auto;
  padding: 0 20px;
}

/* ========================================
   Gallery Grid
   ======================================== */
.lm-cug-gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--lm-cug-cols), minmax(0, 1fr));
  gap: var(--lm-cug-gap);
  margin-bottom: 30px;
}

@media (max-width: 1200px) {
  .lm-cug-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .lm-cug-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .lm-cug-gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Card Wrapper
   ======================================== */
.lm-cug-card-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lm-cug-card-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ========================================
   Card
   ======================================== */
.lm-cug-card {
  position: relative;
  width: 100%;
  background: #f6f7f9;
  overflow: hidden;
  cursor: pointer;
}

.lm-cug-card.pinned {
  border: 2px solid #f1e0b6;
}

/* ========================================
   Media Area
   ======================================== */
.lm-cug-card-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 10;
  overflow: hidden;
  background: #f3f4f6;
}

/* ========================================
   Images and Video
   ======================================== */
.lm-cug-card__img,
.lm-cug-card__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.lm-cug-card__img {
  transition: transform 0.3s ease;
}

.lm-cug-card:hover .lm-cug-card__img {
  transform: scale(1.04);
}

/* ========================================
   Mini Carousel
   ======================================== */
.lm-cug-mini-carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

.lm-cug-mini-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.lm-cug-mini-slide {
  display: none;
  width: 100%;
  height: 100%;
}

.lm-cug-mini-slide.is-active {
  display: block;
}

.lm-cug-mini-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lm-cug-mini-nav:hover {
  background: rgba(0, 0, 0, 0.75);
}

.lm-cug-mini-nav.prev {
  left: 10px;
}

.lm-cug-mini-nav.next {
  right: 10px;
}

.lm-cug-mini-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}

.lm-cug-mini-dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 0;
}

.lm-cug-mini-dot.is-active {
  background: #fff;
}

/* ========================================
   Badges
   ======================================== */
.lm-cug-pin-badge,
.lm-cug-content-badge {
  position: absolute;
  z-index: 4;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
}

.lm-cug-pin-badge {
  top: 10px;
  left: 10px;
  background: #f1e0b6;
  color: #dd2e44;
  border: 1px solid #f1e0b6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.lm-cug-content-badge {
  top: 10px;
  right: 10px;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
}

/* ========================================
   CTA Buttons
   ======================================== */
.lm-cug-card-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
  background: #fff;
}

.lm-cug-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  height: 40px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.10);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lm-cug-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.lm-cug-card-btn:active {
  transform: translateY(0);
}

.lm-cug-card-btn-ig {
  background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  color: #fff;
}

.lm-cug-card-btn-ig:hover {
  color: #fff;
}

.lm-cug-card-btn-wa {
  background: #25d366;
  color: #fff;
}

.lm-cug-card-btn-wa:hover {
  background: #1da851;
  color: #fff;
}

.lm-cug-card-btn-details {
  background: #111827;
  color: #fff;
}

.lm-cug-card-btn-details:hover {
  background: #000;
  color: #fff;
}

/* ========================================
   Optional Caption Below Buttons
   ======================================== */
.lm-cug-card-caption {
  padding: 0 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
}

/* ========================================
   Gallery Actions
   ======================================== */
.lm-cug-gallery-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.lm-cug-loadmore {
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--lm-cug-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.lm-cug-loadmore:hover:not(:disabled) {
  background: var(--lm-cug-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.lm-cug-loadmore:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lm-cug-gallery-status {
  font-size: 14px;
  color: #666;
  text-align: center;
}

/* ========================================
   Loading + Empty States
   ======================================== */
.lm-cug-gallery-grid.loading {
  opacity: 0.6;
  pointer-events: none;
}

.lm-cug-gallery-empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 16px;
}

.lm-cug-gallery-empty::before {
  content: "🔍";
  display: block;
  font-size: 48px;
  margin-bottom: 16px;
}

/* ========================================
   Tablet
   ======================================== */
@media (min-width: 601px) and (max-width: 900px) {
  .lm-cug-card-btn {
    font-size: 13px;
    padding: 0 8px;
  }
}

/* ========================================
   Mobile
   ======================================== */
@media (max-width: 600px) {
  .lm-cug-gallery {
    padding: 0 12px;
  }

  .lm-cug-gallery-grid {
    gap: 12px;
  }

  .lm-cug-card-buttons {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .lm-cug-card-btn {
    font-size: 15px;
    min-height: 44px;
    height: 44px;
  }

  .lm-cug-pin-badge,
  .lm-cug-content-badge {
    font-size: 11px;
    padding: 5px 9px;
  }

  .lm-cug-loadmore {
    padding: 10px 24px;
    font-size: 14px;
  }

  .lm-cug-mini-nav {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
}

/* ========================================================
   Details Page Media Viewer
======================================================== */

.lm-cug-details-media {
  width: 100%;
}

.lm-cug-details-media-single,
.lm-cug-details-carousel {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f4f6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* Main media area */
.lm-cug-details-media-single,
.lm-cug-details-carousel-track {
  aspect-ratio: 9 / 10;
}

.lm-cug-details-media-single {
  height: 100%;
}

/* Carousel wrapper */
.lm-cug-details-carousel {
  position: relative;
}

/* Track keeps slides stacked in same frame */
.lm-cug-details-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Slides */
.lm-cug-details-slide {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
}

.lm-cug-details-slide.is-active {
  display: block;
}

/* Images + videos */
.lm-cug-details-image,
.lm-cug-details-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* If you prefer full video visibility instead of crop, use contain
.lm-cug-details-video {
  object-fit: contain;
}
*/

/* Navigation arrows */
.lm-cug-details-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.65);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lm-cug-details-nav:hover {
  background: rgba(17, 24, 39, 0.82);
}

.lm-cug-details-nav.prev {
  left: 12px;
}

.lm-cug-details-nav.next {
  right: 12px;
}

/* Dots */
.lm-cug-details-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.lm-cug-details-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lm-cug-details-dot.is-active {
  background: #ffffff;
  transform: scale(1.15);
}

/* Better spacing when placed inside sidebar card */
.lm-single-card .lm-cug-details-media {
  margin: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .lm-cug-details-nav {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .lm-cug-details-nav.prev {
    left: 10px;
  }

  .lm-cug-details-nav.next {
    right: 10px;
  }

  .lm-cug-details-dots {
    bottom: 10px;
  }
}
.lm-cug-details-media-single video,
.lm-cug-details-slide video,
.lm-cug-details-video {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 8px;
  background: #000;
  object-fit: contain;
}

.lm-cug-details-media-single,
.lm-cug-details-slide {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.lm-cug-details-carousel-track,
.lm-cug-details-slide,
.lm-cug-details-media-single {
  width: 100%;
}

.lm-cug-details-slide img,
.lm-cug-details-slide video,
.lm-cug-details-media-single img,
.lm-cug-details-media-single video {
  width: 100%;
  height: auto;
  display: block;
}
