/* ================================
   galeri.css — Galeri Sayfası Stilleri
   (Hero: assets/css/styles.css — .site-page-hero)
================================ */

/* Filter Bar */
.gal-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 22px 0 6px;
}
.gal-filter-btn {
  background: none;
  border: 1px solid rgba(27, 48, 34, 0.2);
  color: rgba(27, 48, 34, 0.6);
  font-family: var(--font-mono-family);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.gal-filter-btn:hover,
.gal-filter-btn.active {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}

/* Masonry / Grid */
.gal-grid {
  column-count: 1; /* Updated to column-count for true masonry */
  column-gap: 16px;
  margin-top: 32px;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  direction: ltr; /* Keeps RTL languages from breaking masonry */
}
@media (min-width: 640px)  { .gal-grid { column-count: 2; } }
@media (min-width: 1024px) { .gal-grid { column-count: 3; } }
@media (min-width: 1280px) { .gal-grid { column-count: 4; } }

.gal-item {
  display: block; /* Changed from inline-block to block */
  width: 100%;
  max-width: 100%;
  margin-bottom: 16px; /* Ensures even vertical spacing */
  position: relative;
  overflow: hidden;
  cursor: pointer;
  
  /* Critical for masonry: prevents breaking items across columns */
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  break-inside: avoid;
  
  line-height: 0; /* Removes phantom spacing below images */
  border: 1px solid rgba(27,48,34,0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.gal-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  z-index: 2;
}
.gal-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover; /* Forces image to fit container properly */
  filter: grayscale(20%);
  transition: filter 0.4s ease, transform 0.5s ease;
}
.gal-item:hover img {
  filter: grayscale(0%);
  transform: scale(1.04);
}

/* Overlay on hover */
.gal-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(27,48,34,0.85) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  line-height: 1.5; /* Restores line-height for the text */
}
.gal-item:hover .gal-item-overlay { opacity: 1; }
.gal-item-tag {
  font-family: var(--font-mono-family);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--brand-accent);
  text-transform: uppercase;
  border: 1px solid rgba(196, 155, 85, 0.4);
  padding: 4px 10px;
}
.gal-item-zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gal-item:hover .gal-item-zoom { opacity: 1; }
.gal-item-zoom .material-symbols-outlined { font-size: 18px; color: white; }

/* Hidden items (filtered out) - Critical fix for masonry filters */
.gal-item.hidden {
  display: none !important;
}

/* ===== Lightbox ===== */
.gal-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.gal-lightbox.open {
  opacity: 1;
  pointer-events: all;
}
.gal-lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gal-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,0.1);
  transition: opacity 0.3s ease;
}
.gal-lb-close,
.gal-lb-prev,
.gal-lb-next {
  position: fixed;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
  
  /* Circular buttons */
  border-radius: 50% !important;
  width: 50px !important;
  height: 50px !important;
}
.gal-lb-close:hover,
.gal-lb-prev:hover,
.gal-lb-next:hover { 
  background: var(--brand-accent); 
  border-color: var(--brand-accent); 
  transform: scale(1.1); 
}
.gal-lb-prev:hover, .gal-lb-next:hover {
  transform: translateY(-50%) scale(1.1) !important;
}

.gal-lb-close {
  top: 24px;
  right: 24px;
}
.gal-lb-close .material-symbols-outlined { font-size: 22px; }
.gal-lb-prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}
.gal-lb-next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}
.gal-lb-prev .material-symbols-outlined,
.gal-lb-next .material-symbols-outlined { font-size: 26px; }

.gal-lb-caption {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono-family);
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: normal;
  max-width: 90vw;
  text-align: center;
}

[dir="rtl"] .gal-lb-close { right: auto; left: 24px; }
[dir="rtl"] .gal-lb-prev { left: auto; right: 24px; }
[dir="rtl"] .gal-lb-next { right: auto; left: 24px; }

@media (max-width: 480px) {
  .gal-lb-prev,
  .gal-lb-next {
    width: 40px !important;
    height: 40px !important;
  }
  .gal-lb-prev { left: 10px; }
  .gal-lb-next { right: 10px; }
  [dir="rtl"] .gal-lb-prev { right: 10px; left: auto; }
  [dir="rtl"] .gal-lb-next { left: 10px; right: auto; }
}