/* Masonry Grid Layout */
.evvo-gallery-container {
  margin: 40px 0;
}

.evvo-gallery-container h3 {
  margin-bottom: 30px;
  font-size: 1.8rem;
  color: #333;
  text-align: center;
}

.evvo-masonry-grid {
  column-count: 4;
  column-gap: 15px;
  margin: 0 auto;
}

.evvo-masonry-item {
  break-inside: avoid;
  margin-bottom: 15px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.evvo-masonry-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.evvo-gallery-link {
  display: block;
  position: relative;
  cursor: zoom-in;
}

.evvo-gallery-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
  max-width: 350px; /* Zajistit max velikost náhledu */
}

.evvo-masonry-item:hover .evvo-gallery-image {
  transform: scale(1.05);
}

/* Picture element */
.evvo-gallery-link picture {
  display: block;
  width: 100%;
}

/* Overlay with zoom icon */
.evvo-gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.evvo-masonry-item:hover .evvo-gallery-overlay {
  opacity: 1;
}

.zoom-icon {
  color: white;
  width: 40px;
  height: 40px;
}

/* Lightbox */
.evvo-lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.95);
  animation: fadeIn 0.3s;
}

.evvo-lightbox.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.evvo-lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  animation: zoomIn 0.3s;
}

@keyframes zoomIn {
  from { transform: scale(0.8); }
  to { transform: scale(1); }
}

/* Loading spinner */
.evvo-lightbox-loader {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.evvo-lightbox.loading .evvo-lightbox-loader {
  display: block;
}

.evvo-lightbox.loading .evvo-lightbox-content {
  display: none;
}

.spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 3px solid white;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.evvo-lightbox-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: auto;
}

.evvo-lightbox-close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 10000;
}

.evvo-lightbox-close:hover,
.evvo-lightbox-close:focus {
  color: #bbb;
  text-decoration: none;
}

/* Navigation arrows */
.evvo-lightbox-prev,
.evvo-lightbox-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 30px;
  transition: 0.3s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  background-color: rgba(0, 0, 0, 0.3);
}

.evvo-lightbox-next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.evvo-lightbox-prev {
  left: 0;
}

.evvo-lightbox-prev:hover,
.evvo-lightbox-next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
  .evvo-masonry-grid {
    column-count: 3;
  }
}

@media screen and (max-width: 768px) {
  .evvo-masonry-grid {
    column-count: 2;
    column-gap: 10px;
  }
  
  .evvo-masonry-item {
    margin-bottom: 10px;
  }
  
  .evvo-lightbox-content {
    max-width: 95%;
    max-height: 70vh;
  }
}

@media screen and (max-width: 480px) {
  .evvo-masonry-grid {
    column-count: 1;
  }
  
  .evvo-lightbox-prev,
  .evvo-lightbox-next {
    font-size: 20px;
    padding: 10px;
  }
  
  .evvo-lightbox-close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }
}

/* Empty state */
.evvo-gallery-empty {
  text-align: center;
  padding: 40px;
  color: #999;
  font-style: italic;
}

/* Accessibility */
.evvo-gallery-link:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.evvo-lightbox-close:focus,
.evvo-lightbox-prev:focus,
.evvo-lightbox-next:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}