body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111;
  color: #eee;
  padding: 1em;
  font-size: 16px;
  line-height: 1.6;
}
h1 {
  text-align: center;
  margin: 0 0 0.75em 0;
  font-size: 1.7rem;
}
h2.month-divider {
  margin-top: 2.5em;
  margin-bottom: 0.5em;
  text-align: center;
  color: #ccc;
  font-size: 1.2rem;
}
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.thumb {
  object-fit: contain;
  width: auto;
  height: auto;
  max-width: 320px;
  max-height: 240px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.96);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1em;
  overflow: auto; /* allow scrolling if content is too tall */
}
.lightbox.active {
  display: flex;
}
.lightbox-inner {
  max-width: 1400px;
  width: 100%;
  # max-height: 80vh;
  
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.35s ease-out;
}
.lightbox-inner img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 4px;
  background: radial-gradient(circle at center, #333 0, #000 70%);
}
.lightbox-info {
  margin-top: 1em;
  max-width: 900px;
  text-align: left;
  font-size: 0.95em;
  overflow-y: auto;
  scrollbar-width: thin;
  max-height: 20vh; /* ensures text/buttons stay visible */
}

}
.lightbox-info h3 {
  margin: 0 0 0.5em 0;
}
.lightbox-info .meta {
  margin-top: 0.5em;
  color: #bbb;
  font-size: 0.85em;
}
.btn-row {
  margin-top: 0.75em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}
.btn {
  display: inline-block;
  padding: 0.4em 0.9em;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9em;
  cursor: pointer;
  background: #0a84ff;
  color: #fff;
}
.btn-secondary {
  background: #444;
}
.btn-secondary:hover {
  background: #666;
}
.controls-container {
  margin-top: 0.75em;
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 800px;
}
.controls {
  cursor: pointer;
  user-select: none;
  font-size: 1.1em;
  color: #eee;
  padding: 0.4em 0.8em;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
}
.controls:hover {
  background: rgba(255,255,255,0.12);
}
.close-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 2.2em;
  cursor: pointer;
  color: #fff;
}
#tag-cloud {
  text-align: center;
  padding: 1.5em 1em 0.75em;
  line-height: 1.2;  /* tighten vertical spacing */
}
#tag-cloud span {
  margin: 0.1em 0.2em;
  cursor: pointer;
  display: inline-block;
  color: #6cf;
  transition: transform 0.2s ease, color 0.2s ease;
}
#tag-cloud span:hover {
  transform: scale(1.1);
  color: #fff;
}

.reset-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 1.5em;
}

.reset-container button {
  background: #6cf;
  color: #111;
  border: none;
  padding: 0.5em 1.2em;
  border-radius: 4px;
  font-size: 1.2em;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.reset-container button:hover {
  background: #006edc;
  transform: scale(1.05);
}


@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
  body {
    font-size: 17px;
  }
  .lightbox-info {
    font-size: 0.98em;
  }
}

/* === Fade-in for tag cloud and "Display all" button === */
#tag-cloud, .reset-container {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

#tag-cloud.visible, .reset-container.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Reset button centering and visibility control --- */
.reset-container {
  display: none; /* hidden by default */
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 1.5em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* When visible via JS */
.reset-container.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .lightbox {
    padding: 0.5em;
  }

  #lightbox-img {
    max-height: 60vh;
  }

  .lightbox-info {
    max-height: 35vh;
    font-size: 0.9em;
  }
}


.photo-tags a.tag-link {
  color: #0a84ff;
  text-decoration: none;
  font-weight: 500;
  margin-right: 0.2em;
  transition: color 0.2s ease, transform 0.2s ease;
}

.photo-tags a.tag-link:hover {
  color: #6cf;
  transform: scale(1.1);
}
