/* ===== GALLERY ===== */
.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 4/3;
  transition: .3s cubic-bezier(.4, 0, .2, 1);
  margin-bottom: 1.5rem;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, .04);
}

.carousel-item .gallery-card {
  margin-bottom: 0;
  border: none;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: box-shadow .3s, transform .3s;
}

.carousel-item .gallery-overlay {
  opacity: .8;
  background: linear-gradient(to top, rgba(0, 0, 0, .8) 0%, rgba(0, 0, 0, .3) 50%, transparent 100%);
}

.carousel-item .gallery-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f8fafc;
  transition: .4s cubic-bezier(.4, 0, .2, 1);
}

.gallery-card:hover img {
  transform: scale(1.02);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, .05) 60%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transition: .3s;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay h5 {
  color: white;
  font-weight: 600;
  margin: 0;
  font-size: .875rem;
}

/* ===== GALLERY TOOLBAR & VIEW MODES ===== */
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.gallery-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.gallery-view-toggle .view-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: .813rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.gallery-view-toggle .view-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.gallery-view-toggle .view-btn:hover:not(.active) {
  color: #0f172a;
}

/* Grid View */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* List View */
.gallery-grid.gallery-list-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gallery-grid.gallery-list-view .gallery-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 120px;
  aspect-ratio: auto;
  margin-bottom: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.gallery-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e40af, #172554);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 2rem;
}

.gallery-grid.gallery-list-view .gallery-card img,
.gallery-grid.gallery-list-view .gallery-card .gallery-img-placeholder {
  width: 180px !important;
  height: 100% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
}

.gallery-grid.gallery-list-view .gallery-overlay {
  position: relative;
  inset: auto;
  background: transparent;
  opacity: 1;
  padding: 1rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gallery-grid.gallery-list-view .gallery-overlay h5 {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.gallery-flex {
  display: flex;
  gap: 1.5rem;
}

.gallery-flex .gallery-card {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .gallery-flex {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 1rem;
  }

  .gallery-flex .gallery-card {
    flex: 0 0 80%;
    scroll-snap-align: start;
    min-width: 240px;
  }

  .carousel-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 48px;
    background: linear-gradient(to right, transparent, rgba(250, 247, 241, .9));
    pointer-events: none;
    z-index: 1;
  }
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.gallery-view-toggle {
  display: flex;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 3px;
}

.gallery-view-toggle button {
  background: none;
  border: none;
  padding: .5rem .85rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--gray-500);
  font-size: .9rem;
  transition: all .2s;
}

.gallery-view-toggle button.active {
  background: var(--putih);
  color: var(--biru);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.gallery-grid-view .gallery-card {
  aspect-ratio: 1;
}

.gallery-card-view .gallery-card {
  aspect-ratio: auto;
  border-radius: 16px;
  overflow: hidden;
  background: var(--putih);
  border: 1px solid rgba(0, 0, 0, .04);
  text-decoration: none;
  display: flex !important;
  flex-direction: column;
}

.gallery-card-view .gallery-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #f8fafc;
}

.gallery-card-view .gallery-overlay {
  position: static;
  background: none;
  padding: 1rem 1.25rem;
}

.gallery-card-view .gallery-overlay h5 {
  color: var(--biru);
  font-size: .938rem;
}

/* Carousel */
.carousel-track {
  scroll-behavior: smooth;
}

/* Gallery hover animations */
.gallery-card {
  will-change: transform, box-shadow;
}

.gallery-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .13);
}

.gallery-card:hover img {
  transform: scale(1.06);
}

.gallery-overlay {
  transform: translateY(4px);
  transition: opacity .35s cubic-bezier(.4, 0, .2, 1), transform .35s cubic-bezier(.4, 0, .2, 1);
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Gallery view toggle button hover */
.gallery-view-toggle button {
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), background .2s, color .2s;
}

.gallery-view-toggle button:hover {
  transform: scale(1.1);
}

/* Gallery responsive */
@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 980px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-toolbar {
    gap: .5rem;
    margin-bottom: 1rem;
  }

  .galeri-filter-wrap {
    max-width: 100%;
  }

  .filter-responsive {
    max-width: 100% !important;
    width: 100% !important;
  }

  .filter-responsive-row {
    flex-direction: column;
    gap: .75rem;
  }

  .filter-responsive-row>.col-lg-4 {
    width: 100% !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
  }

  .filter-flex-wrap {
    flex-direction: column;
    align-items: stretch !important;
  }

  .filter-flex-wrap>div {
    max-width: 100% !important;
  }

  .filter-flex-wrap>.gallery-view-toggle {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .gallery-card {
    margin-bottom: .75rem;
  }

  .gallery-grid.gallery-list-view .gallery-card {
    height: auto;
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-grid.gallery-list-view .gallery-card img {
    width: 100%;
    height: 160px;
  }
}

@media (max-width: 360px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Carousel items responsive */
@media (max-width: 768px) {
  .carousel-item {
    flex: 0 0 calc(85% - 0.5rem);
    min-width: 240px;
  }
}

@media (max-width: 480px) {
  .carousel-item {
    flex: 0 0 100%;
  }
}

/* Video modal CSS moved to layout.css (global) */