/* GALERII SEKTSIOON - Frontend */
.lhk-gallery-section {
  padding: 4rem 0;
  background: #f8fafc;
}

.lhk-gallery-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.lhk-gallery-section .section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

.lhk-gallery-section .section-subtitle {
  text-align: center;
  font-size: 1.125rem;
  color: #64748b;
  margin: 0 0 3rem 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Galerii grid - tunnuspiltide grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Galerii tunnuspilt - UUENDATUD STRUKTUUR */
.gallery-preview {
  position: relative;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  /* MITTE RUUDUKUJULINE - et caption mahuks */
}

.gallery-preview:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.gallery-preview-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1; /* Ainult pilt on ruudukujuline */
  overflow: hidden;
}

.gallery-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-preview:hover img {
  transform: scale(1.1);
}

/* GALERII CAPTION - pildi all (ILMA PILTIDE ARVUTA) */
.gallery-caption {
  padding: 1rem;
  background: #fff;
  text-align: center;
  border-top: 1px solid #e5e7eb;
}

.gallery-name {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
  line-height: 1.3;
}

/* Eemaldame gallery-meta (piltide arv) */
.gallery-meta {
  display: none;
}

/* Hover efekt caption-ile */
.gallery-preview:hover .gallery-name {
  color: #2563eb;
}

/* Overlay (hover) - VALGE TEKST */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
  text-align: center;
}

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

.gallery-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: white !important; /* VALGE TEKST */
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Eemaldame gallery-count overlay-st */
.gallery-count {
  display: none;
}

.gallery-view-btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  color: white !important; /* VALGE TEKST */
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.gallery-preview:hover .gallery-view-btn {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
  color: white !important; /* VALGE TEKST */
}

/* Zoom ikoon */
.gallery-zoom-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  color: #374151;
  font-size: 18px;
}

.gallery-preview:hover .gallery-zoom-icon {
  opacity: 1;
  transform: scale(1.1);
}

/* Galerii jalus */
.gallery-footer {
  text-align: center;
  margin-top: 3rem;
}

.gallery-view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: #3b82f6;
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.gallery-view-all:hover {
  background: #2563eb;
  text-decoration: none;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.gallery-view-all::after {
  content: '→';
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
  font-size: 1.2em;
}

.gallery-view-all:hover::after {
  transform: translateX(4px);
}

/* Responsive - Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .lhk-gallery-section .container {
    padding: 0 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .lhk-gallery-section .section-title {
    font-size: 2.25rem;
  }
}

/* Responsive - Mobile (max 768px) */
@media (max-width: 768px) {
  .lhk-gallery-section {
    padding: 3rem 0;
  }

  .lhk-gallery-section .container {
    padding: 0 1rem;
  }

  .lhk-gallery-section .section-title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .lhk-gallery-section .section-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .gallery-caption {
    padding: 0.75rem;
  }

  .gallery-name {
    font-size: 0.9rem;
  }

  .gallery-info h3 {
    font-size: 1.2rem;
  }

  .gallery-view-btn {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
  }

  .gallery-zoom-icon {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

/* Responsive - Very small screens (max 480px) */
@media (max-width: 480px) {
  .lhk-gallery-section .container {
    padding: 0 0.75rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(1, 1fr);
    gap: 0.75rem;
  }

  .lhk-gallery-section .section-title {
    font-size: 1.75rem;
  }

  .gallery-caption {
    padding: 0.5rem;
  }

  .gallery-name {
    font-size: 0.85rem;
  }

  .gallery-info h3 {
    font-size: 1.1rem;
  }

  .gallery-view-btn {
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
  }

  .gallery-zoom-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
    top: 10px;
    right: 10px;
  }
}

/* Loading states */
.gallery-preview.loading {
  background: #f1f5f9;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Focus visible support */
.gallery-preview:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .gallery-preview {
    border: 2px solid;
  }

  .gallery-overlay {
    background: rgba(0, 0, 0, 0.9);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .gallery-preview,
  .gallery-preview img,
  .gallery-overlay,
  .gallery-zoom-icon,
  .gallery-view-btn {
    transition: none;
  }

  .gallery-preview:hover {
    transform: none;
  }

  .gallery-preview:hover img {
    transform: none;
  }
}

/* Print styles */
@media print {
  .lhk-gallery-section {
    break-inside: avoid;
    background: white !important;
    padding: 2rem 0;
  }

  .gallery-preview {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }

  .gallery-overlay {
    display: none;
  }

  .gallery-zoom-icon {
    display: none;
  }

  .gallery-caption {
    background: white !important;
    border-top: 1px solid #e5e7eb;
  }
}
