/* ==============================
   GLOBAL
============================== */
body {
  margin: 0;
  font-family: 'Concert One', cursive;
  background: #fafaf8;
  color: #1a1a1a;
}

h1, h2 {
  margin: 0;
}

.gallery-container {
  max-width: 1400px;
  margin: auto;
  padding: 120px 20px 60px;
}

/* ===== HOME BUTTON ===== */
.home-button {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

.home-button img {
  width: 100px;
  transition: transform 0.2s ease;
}

.home-button img:hover {
  transform: scale(1.15);
  content: url("images/home_button_black.gif");
}

/* ==============================
   YEAR SECTION
============================== */
.year-section {
  margin-bottom: 100px;
}

.year-title {
  font-size: 2.2rem;
  margin-bottom: 20px;
}

/* ==============================
   GRID
============================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.gallery-thumb {
  width: 100%;
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.15s;
  max-width: 400px;
  margin: auto;
}

.gallery-thumb img {
  width: 100%;
  display: block;
  border-radius: 14px;
}

.gallery-thumb:hover {
  transform: scale(1.03);
}

/* ==============================
   LIGHTBOX
============================== */

/*
   The lightbox scrolls internally if content is taller than the viewport.
   On MacBook-sized screens the side-by-side layout is preserved but the
   image is capped so it never overflows.
*/
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  /* Allow the whole lightbox to scroll if content is very tall */
  overflow-y: auto;
  padding: 60px 20px;
  box-sizing: border-box;
}

.lightbox.active {
  display: flex;
}

.lightbox-inner {
  width: 90%;
  max-width: 1100px;
  display: flex;
  gap: 40px;
  color: white;
  /* Vertically align to the top of the padded area */
  align-items: flex-start;
  /* Shrink so it never forces the flex container to scroll needlessly */
  flex-shrink: 0;
}

/* Left column: image / video */
.lightbox-media {
  flex: 1 1 0;
  min-width: 0;
}

.lightbox-media img,
.lightbox-media video {
  width: 100%;
  /* Cap height so it never exceeds the visible viewport area */
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 14px;
  display: block;
}

/* Right column: title, meta, description, button */
.lightbox-info {
  /* Fixed width so the info panel doesn't grow too wide */
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Allow the info panel itself to scroll if the screen is very short */
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.lb-title {
  font-size: 2rem;
  line-height: 1.2;
}

.lb-meta {
  font-size: 0.95rem;
  opacity: 0.8;
}

.lb-description {
  font-size: 1rem;
  line-height: 1.5;
  margin-top: 10px;
}

.speedpaint-btn {
  margin-top: 20px;
  background: #2a2280;
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: 'Concert One', cursive;
  cursor: pointer;
  transition: transform 0.15s;
  width: fit-content;
  font-size: 1rem;
}

.speedpaint-btn:hover {
  transform: scale(1.03);
}

/* CLOSE BUTTON */
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  font-size: 2rem;
  cursor: pointer;
  color: white;
  z-index: 2100;
  line-height: 1;
  user-select: none;
}

/* PREV / NEXT ARROWS */
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  cursor: pointer;
  color: white;
  user-select: none;
  z-index: 2100;
  padding: 10px;
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

/* ==============================
   MOBILE  (≤ 900 px)
============================== */
@media (max-width: 900px) {
  .gallery-container {
    padding-top: 90px;
  }

  .year-title {
    font-size: 1.8rem;
  }

  /* Stack media above info on narrow screens */
  .lightbox-inner {
    flex-direction: column;
    gap: 20px;
    width: 95%;
  }

  .lightbox-info {
    flex: none;
    max-height: none;
    overflow-y: visible;
  }

  .lightbox-media img,
  .lightbox-media video {
    max-height: 55vw;
  }

  .lightbox-nav {
    /* Move arrows closer to the image on small screens */
    font-size: 2rem;
  }

  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}