/* ============================================================
   OLYMPIA — PREMIUM GALLERY UPGRADE
   Replaces the uniform 3-col grid with a mixed-size
   mosaic layout on desktop. Responsive down to mobile.
   ============================================================ */

/* ── SECTION ─────────────────────────────────────────────── */
.gallery-page {
  padding: 60px 0 80px !important;
  background: #090909 !important;
}

/* ── FILTER BAR ──────────────────────────────────────────── */
.gallery-filters {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  justify-content: center !important;
  margin-bottom: 48px !important;
}

.filter-btn {
  padding: 9px 20px !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase !important;
  background: transparent !important;
  border: 1px solid rgba(201,168,76,0.18) !important;
  border-radius: 3px !important;
  color: #888 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  position: relative !important;
}

.filter-btn:hover {
  border-color: rgba(201,168,76,0.45) !important;
  color: #f0c45a !important;
  background: rgba(201,168,76,0.05) !important;
}

.filter-btn.active {
  background: linear-gradient(135deg, rgba(201,168,76,0.18), rgba(201,168,76,0.08)) !important;
  border-color: rgba(201,168,76,0.55) !important;
  color: #f0c45a !important;
  box-shadow: 0 0 12px rgba(201,168,76,0.12) !important;
}

/* ── MOSAIC GRID ─────────────────────────────────────────── */
/*
  Desktop: 4-column CSS Grid with named rows.
  Every 7 items = one mosaic "row" pattern:
    [1] tall    [2] normal [3] normal
    [1]         [4] wide   [5] normal
    [6] normal  [4]        [5]
  Items get special sizes via nth-child pattern.
  On tablet: 3-col uniform. On mobile: 2-col uniform.
*/

.gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  grid-auto-rows: 220px !important;
  gap: 6px !important;
  width: 100% !important;
}

/* Default item — 1×1 */
.gallery-item {
  position: relative !important;
  overflow: hidden !important;
  border-radius: 6px !important;
  background: #0d0d0d !important;
  cursor: pointer !important;
  grid-column: span 1 !important;
  grid-row: span 1 !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5) !important;
  transition: box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.22,1,0.36,1) !important;
}

/* Mosaic pattern: every 7th+1 item = tall (spans 2 rows) */
.gallery-item:nth-child(7n+1) {
  grid-column: span 2 !important;
  grid-row: span 2 !important;
}

/* Every 7th+4 item = wide (spans 2 columns) */
.gallery-item:nth-child(7n+4) {
  grid-column: span 2 !important;
  grid-row: span 1 !important;
}

/* Every 7th+6 item = medium tall */
.gallery-item:nth-child(7n+6) {
  grid-column: span 1 !important;
  grid-row: span 2 !important;
}

/* ── IMAGE ───────────────────────────────────────────────── */
.gallery-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  filter: brightness(0.82) saturate(0.9) !important;
  transition:
    transform 0.65s cubic-bezier(0.22,1,0.36,1),
    filter 0.45s ease !important;
}

.gallery-item:hover img {
  transform: scale(1.07) !important;
  filter: brightness(0.95) saturate(1.08) !important;
}

/* ── HOVER OVERLAY ───────────────────────────────────────── */
.gallery-hover {
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.15) 40%,
    transparent 65%
  ) !important;
  opacity: 0 !important;
  transition: opacity 0.4s ease !important;
  display: flex !important;
  align-items: flex-end !important;
  padding: 16px !important;
}

.gallery-item:hover .gallery-hover {
  opacity: 1 !important;
}

/* Gold bottom line that slides in on hover */
.gallery-hover::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 0 !important;
  height: 2px !important;
  background: linear-gradient(90deg, #c9a84c, #f0c45a, #c9a84c) !important;
  transition: width 0.5s cubic-bezier(0.22,1,0.36,1) !important;
}

.gallery-item:hover .gallery-hover::after {
  width: 100% !important;
}

/* ── LABEL ───────────────────────────────────────────────── */
.gallery-item-label {
  font-size: 0.64rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
  color: rgba(255,255,255,0.92) !important;
  background: rgba(0,0,0,0.55) !important;
  border: 1px solid rgba(201,168,76,0.35) !important;
  padding: 5px 11px !important;
  border-radius: 2px !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

/* ── ZOOM ICON ───────────────────────────────────────────── */
.gallery-zoom {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  width: 32px !important;
  height: 32px !important;
  background: rgba(0,0,0,0.65) !important;
  backdrop-filter: blur(6px) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  border-radius: 50% !important;
  font-size: 0.72rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  transform: scale(0.65) !important;
  transition: opacity 0.3s ease, transform 0.3s ease !important;
}

.gallery-item:hover .gallery-zoom {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* ── ITEM HOVER LIFT ─────────────────────────────────────── */
.gallery-item:hover {
  box-shadow:
    0 16px 48px rgba(0,0,0,0.7),
    0 0 0 1px rgba(201,168,76,0.22) !important;
  z-index: 2 !important;
  transform: translateY(-2px) !important;
}

/* ── FILTER ANIMATION ────────────────────────────────────── */
.gallery-item.hiding {
  opacity: 0 !important;
  transform: scale(0.92) !important;
  transition: opacity 0.25s ease, transform 0.25s ease !important;
  pointer-events: none !important;
}

.gallery-item.showing {
  animation: galleryReveal 0.45s cubic-bezier(0.22,1,0.36,1) both !important;
}

@keyframes galleryReveal {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── TABLET: 3-col uniform ───────────────────────────────── */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    grid-auto-rows: 200px !important;
    gap: 5px !important;
  }
  /* Reduce mosaic effect on tablet */
  .gallery-item:nth-child(7n+1) {
    grid-column: span 1 !important;
    grid-row: span 2 !important;
  }
  .gallery-item:nth-child(7n+4) {
    grid-column: span 2 !important;
    grid-row: span 1 !important;
  }
  .gallery-item:nth-child(7n+6) {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }
}

/* ── MOBILE: 2-col uniform ───────────────────────────────── */
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-rows: 150px !important;
    gap: 4px !important;
  }
  /* All same size on mobile */
  .gallery-item:nth-child(7n+1),
  .gallery-item:nth-child(7n+4),
  .gallery-item:nth-child(7n+6) {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }
  .gallery-item:hover {
    transform: none !important;
  }
}

/* ── COUNT BADGE ─────────────────────────────────────────── */
.gallery-count-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 2px;
}

.gallery-count-text {
  font-size: 0.75rem;
  color: #666;
  letter-spacing: 0.1em;
}

.gallery-count-text span {
  color: rgba(201,168,76,0.7);
  font-weight: 700;
}
