* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

h1 {
  text-align: center;
  margin: 30px 0;
  font-size: 2.2rem;
  color: #2c3e50;
  font-weight: 600;
}

/* Галерија */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 15px;
}

.gallery-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s;
}

.gallery-item img:hover {
  transform: scale(1.03);
}

.caption {
  padding: 14px 12px;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  color: #2c3e50;
  background: #fff;
  margin: 0;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Модал */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.modal-content {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border: none;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 42px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s;
}

.close:hover {
  color: #ff6b6b;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  transition: all 0.3s;
}

.nav:hover {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.left { left: 20px; }
.right { right: 20px; }

/* Responsive */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }
  .gallery-item img { height: 150px; }
  .caption { font-size: 0.9rem; padding: 10px; }
  .close { top: 15px; right: 15px; font-size: 36px; }
  .nav { font-size: 40px; padding: 15px; }
}

/* Watermark во модал */
.modal::before {
  content: "© zdravev.mk — Забрането копирање";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 2.5vw;
  color: rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 1;
  white-space: nowrap;
  font-weight: bold;
  text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}