/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Base styles */
body {
  font-family: 'Iosevka', monospace;
  background-color: #cccccc;
  color: #444;
  line-height: 1.6;
  padding: 2rem;
  transition: background-color 0.3s, color 0.3s;
}

/* Dark mode */
body.dark-mode {
  background-color: #222222;
  color: #ccc;
}

/* Header */
.site-header { text-align: center; padding: 2rem 1rem; }
.site-title {
  font-family: 'Liu Jian Mao Cao', cursive; /* fall back to generic cursive */
  font-size: 3rem;           /* adjust for your design */
  line-height: 1;            /* keep it tight vertically */
  letter-spacing: -0.02em;   /* crush letters slightly together */
  transform: skewX(-4deg);   /* exaggerate the right-leaning slant */
  white-space: nowrap;       /* prevent awkward line-breaks */
  margin-bottom: 2.5rem;
}

/* Button row */
.button-row { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.icon-btn { background: none; border: none; padding: 0; margin: 0; cursor: pointer; }
.icon-btn img { width: 32px; height: 32px; display: block; filter: grayscale(100%) opacity(85%); transition: transform 0.2s ease, opacity 0.2s ease; }
.icon-btn img:hover { transform: scale(1.1); opacity: 0.95; }

/* Default popup/modal */
.popup-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
}
.popup-modal.show { opacity: 1; visibility: visible; }
.popup-content {
  background: #cfcfcf;
  color: #333;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  max-width: 90%;
  text-align: center;
  position: relative;
}
body.dark-mode .popup-content {
  background: #353535;
  color: #ccc;
}
#popup-close { position: absolute; top: 0.5rem; right: 0.75rem; background: none; border: none; font-size: 1.25rem; cursor: pointer; color: inherit; }

/* Footer */
.site-footer { text-align: center; padding: 2rem 0; font-family: 'Iosevka', monospace; font-size: 0.8rem; color: #666; }
.site-footer a { color: inherit; text-decoration: none; transition: opacity 0.2s ease; }
.site-footer a:hover { opacity: 0.7; }

/* Gallery: stacked layout */
.cascading-gallery { display: flex; flex-direction: column; align-items: center; padding: 1rem 0; }
.gallery-item-group {
  display: grid;
  grid-template-columns: clamp(100px, 15vw, 200px) 1fr;
  align-items: start;
  column-gap: 2rem;
  margin-bottom: 3rem;
}
.gallery-caption { grid-column: 1; align-self: start; text-align: left; margin: 0; font-size: clamp(1rem, 2vw, 1.5rem); color: #444; }
.gallery-caption .gallery-location { font-size: clamp(0.9rem, 1.5vw, 1.3rem); color: #555; margin: 0.25rem 0; }
.gallery-caption time { display: block; font-size: clamp(0.9rem, 1.5vw, 1.3rem); color: #666; margin-top: 0.25rem; }
body.dark-mode .gallery-caption { color: #ccc; }
body.dark-mode .gallery-caption .gallery-location { color: #ddd; }
body.dark-mode .gallery-caption time { color: #eee; }

.gallery-images { display: flex; flex-direction: column; }
.gallery-images .gallery-item { margin: 0 0 1rem; width: 100%; max-width: 800px; }
.gallery-images .gallery-item img {
  display: block;
  width: 95%;
  margin: 0 auto;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
  max-height: calc(100vh - 200px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-images .gallery-item img:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 24px rgba(0,0,0,0.4);
  z-index: 10;
}

/* Mobile fallback */
@media (max-width: 600px) {
  .gallery-item-group { display: block; }
  .gallery-caption { text-align: center; margin-bottom: 1rem; }
  .gallery-images .gallery-item { max-width: 90vw; }
  .gallery-images .gallery-item img { width: 100%; max-height: none; }
}

/* Lightbox styles */
.lightbox-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center; z-index: 2000; }
.lightbox-modal.show { display: flex; }
.lightbox-content { position: relative; max-width: 90vw; max-height: 90vh; }
.lightbox-controls { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 1rem; }
.lightbox-btn { background: none; border: none; color: #fff; font-family: inherit; font-size: 1rem; text-transform: lowercase; cursor: pointer; }
.lightbox-btn:hover { text-decoration: underline; }
.lightbox-content img { display: block; max-width: 100%; max-height: 100%; border-radius: 6px; }
body.dark-mode .lightbox-btn { color: #eee; }
