﻿#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 2em;
}

.gallery-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 10px;
  text-align: center;
  transition: transform 0.2s;
}

.gallery-item:hover {
  transform: scale(1.03);
}

.thumb {
  max-width: 100%;
  max-height: 120px;
  cursor: pointer;
  border-radius: 4px;
}

.fallback-thumb {
  font-size: 40px;
  padding: 30px;
  background: #eee;
  border-radius: 4px;
  cursor: default;
}

.caption {
  margin-top: 8px;
  font-size: 0.9em;
  color: #333;
  word-break: break-word;
}

#overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.overlay-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  text-align: center;
}

#overlayImg {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
}

#overlayCaption {
  color: white;
  margin-top: 10px;
  font-size: 1em;
}

#downloadBtn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background: white;
  color: black;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
}

.close {
  position: absolute;
  top: 10px; right: 20px;
  font-size: 30px;
  color: white;
  cursor: pointer;
}

.download-all {
  margin-top: 20px;
  padding: 10px 20px;
  background: #0078d4;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
}

.download-all:hover {
  background: #005fa3;
}

.action-bar {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.action-button {
  padding: 10px 20px;
  background: #0078d4;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.2s;
}

.action-button:hover {
  background: #005fa3;
}

.action-button:active {
  transform: scale(0.98);
}
