.sarffy-gallery-wrapper {
  --primary-color: #2e4a3d;
  --gap: 16px;
  --radius: 8px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 20px 80px 20px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.sarffy-gallery-wrapper * {
  box-sizing: border-box;
}

.sarffy-gallery-title {
  text-align: center;
  font-size: 2.4rem;
  color: var(--primary-color);
  margin-bottom: 35px;
  font-weight: 700;
}

/* Nagyképernyős Masonry rács */
.sarffy-gallery-grid {
  column-count: 4;
  column-gap: var(--gap);
}

.sarffy-gallery-item {
  break-inside: avoid;
  margin-bottom: var(--gap);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background-color: #eae7e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sarffy-gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.sarffy-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.sarffy-gallery-item:hover img {
  transform: scale(1.025);
}

/* Reszponzív töréspontok */
@media (max-width: 1200px) {
  .sarffy-gallery-grid {
    column-count: 3;
  }
}

@media (max-width: 768px) {
  .sarffy-gallery-grid {
    column-count: 2;
  }
  .sarffy-gallery-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .sarffy-gallery-grid {
    column-count: 1;
  }
}

/* Lightbox */
.sarffy-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.sarffy-lightbox.active {
  display: flex;
}

.sarffy-lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
}

.sarffy-lightbox-close {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 36px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

/* Modal (Lightbox) háttér és konténer */
.sarffy-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  user-select: none;
}

.sarffy-modal.active {
  opacity: 1;
  visibility: visible;
}

/* Nagyított kép */
.sarffy-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sarffy-modal-img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.sarffy-modal.active .sarffy-modal-img {
  transform: scale(1);
}

/* Vezérlőgombok (Bezárás, Nyilak) */
.sarffy-modal-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  z-index: 10;
}

.sarffy-modal-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

/* Bezáró X */
.sarffy-modal-close {
  top: 20px;
  right: 25px;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
}

/* Előző / Következő léptetők */
.sarffy-modal-prev,
.sarffy-modal-next {
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  font-size: 24px;
}

.sarffy-modal-prev:hover,
.sarffy-modal-next:hover {
  transform: translateY(-50%) scale(1.08);
}

.sarffy-modal-prev {
  left: 20px;
}

.sarffy-modal-next {
  right: 20px;
}

/* Képszámláló alul */
.sarffy-modal-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  letter-spacing: 1px;
}

/* Mobil nézet */
@media (max-width: 600px) {
  .sarffy-modal-prev {
    left: 10px;
    width: 40px;
    height: 40px;
  }
  .sarffy-modal-next {
    right: 10px;
    width: 40px;
    height: 40px;
  }
  .sarffy-modal-close {
    top: 15px;
    right: 15px;
    width: 38px;
    height: 38px;
  }
}
