/* ============================================================
   gallery.css — Styles for /gallery page
   ============================================================ */

/* ── Controls bar ───────────────────────────────────── */
.gallery-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
  .gallery-controls {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
  }
}

/* ── Type tabs ──────────────────────────────────────── */
.gallery-tabs {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.gallery-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  border: 1.5px solid #E0ACAC;
  background: transparent;
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: "DM Sans", sans-serif;
  white-space: nowrap;
}
.gallery-tab:hover {
  background: #FFF4F4;
  border-color: #B55A53;
  color: #B55A53;
}
.gallery-tab.active {
  background: #B55A53;
  border-color: #B55A53;
  color: #fff;
}

/* ── Filter dropdowns ───────────────────────────────── */
.gallery-filters {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  font-family: "DM Sans", sans-serif;
}
.filter-select {
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.6rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
  color: #374151;
  font-size: 0.875rem;
  font-family: "DM Sans", sans-serif;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.2s;
}
.filter-select:focus {
  outline: 2px solid #B55A53;
  outline-offset: 2px;
  border-color: #B55A53;
}
.filter-reset {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border-radius: 0.6rem;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  font-size: 0.875rem;
  font-family: "DM Sans", sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-reset:hover {
  border-color: #B55A53;
  color: #B55A53;
}

/* ── Responsive image grid ──────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
@media (min-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
}

/* ── Gallery card ───────────────────────────────────── */
.gallery-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: #f3f4f6;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid transparent;
}
/* Override global card hover so only gallery cards use this */
.gallery-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 28px rgba(181,90,83,0.15) !important;
  border-color: rgba(181,90,83,0.2) !important;
}

.gallery-card-img-wrap {
  position: relative;
  padding-top: 75%;   /* 4:3 ratio */
  overflow: hidden;
}
.gallery-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.45s ease;
  opacity: 0;
  background: linear-gradient(100deg, #f3f4f6 30%, #e9eaec 50%, #f3f4f6 70%);
  background-size: 200% 100%;
  animation: gallery-shimmer 1.4s ease-in-out infinite;
}
.gallery-card-img.loaded {
  opacity: 1;
  animation: none;
  background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
}
.gallery-card-img-wrap.img-error {
  background: #f3f4f6;
}
.gallery-card-img-wrap.img-error .gallery-card-img {
  opacity: 0;
  animation: none;
}
.gallery-card-img-wrap.img-error::after {
  content: "\f03e"; /* fa-image */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 1.5rem;
  color: #d1d5db;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes gallery-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.gallery-card:hover .gallery-card-img {
  transform: scale(1.06);
}

/* Event badge */
.gallery-card-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  background: rgba(181,90,83,0.88);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
  max-width: calc(100% - 1.1rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "DM Sans", sans-serif;
}

/* Video play overlay */
.gallery-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.28);
}
.gallery-card-play-btn {
  width: 3rem;
  height: 3rem;
  background: rgba(255,255,255,0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.gallery-card:hover .gallery-card-play-btn { transform: scale(1.1); }
.gallery-card-play-btn i { color: #B55A53; font-size: 1rem; margin-left: 0.15rem; }

/* Card footer */
.gallery-card-footer {
  padding: 0.6rem 0.75rem 0.7rem;
  background: #fff;
}
.gallery-card-caption {
  font-size: 0.75rem;
  color: #374151;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: "DM Sans", sans-serif;
}
.gallery-card-date {
  font-size: 0.65rem;
  color: #9ca3af;
  margin-top: 0.2rem;
  font-family: "DM Sans", sans-serif;
}

/* ── Empty state ────────────────────────────────────── */
.gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  text-align: center;
  color: #6b7280;
}

/* ── Lightbox ───────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(4px);
}
.lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: min(90vw, 1000px);
  max-height: 95vh;
  padding: 1rem;
}

/* Close */
.lb-close {
  position: absolute;
  top: 0; right: 0;
  width: 2.5rem; height: 2.5rem;
  background: rgba(255,255,255,0.12);
  border: none; border-radius: 50%;
  color: #fff; font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}
.lb-close:hover { background: rgba(181,90,83,0.7); }

/* Nav arrows */
.lb-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 2.75rem; height: 2.75rem;
  background: rgba(255,255,255,0.12);
  border: none; border-radius: 50%;
  color: #fff; font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}
.lb-nav:hover { background: rgba(255,255,255,0.22); }
.lb-prev { left: 0; }
.lb-next { right: 0; }
@media (max-width: 480px) {
  .lb-prev { left: -0.25rem; }
  .lb-next { right: -0.25rem; }
  /* larger tap targets on small screens (~44px) */
  .lb-close { width: 2.75rem; height: 2.75rem; }
  .lb-nav   { width: 3rem; height: 3rem; }
}

/* Image */
.lb-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 72vh;
  width: 100%;
}
.lb-img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  background: #1a1a1a;
}

/* Info strip */
.lb-info {
  margin-top: 0.9rem;
  text-align: center;
  color: #e5e7eb;
}
.lb-badge {
  display: inline-block;
  background: rgba(181,90,83,0.8);
  color: #fff;
  font-size: 0.7rem; font-weight: 600;
  padding: 0.18rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.03em;
  margin-bottom: 0.45rem;
  font-family: "DM Sans", sans-serif;
}
.lb-caption { font-size: 0.9rem; font-weight: 500; color: #f3f4f6; font-family: "DM Sans", sans-serif; }
.lb-date    { font-size: 0.75rem; color: #9ca3af; margin-top: 0.2rem; font-family: "DM Sans", sans-serif; }
.lb-counter { font-size: 0.72rem; color: #6b7280; margin-top: 0.35rem; font-family: "DM Sans", sans-serif; }

@keyframes lb-fade {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
.lb-img.lb-fade { animation: lb-fade 0.2s ease; }
