/* General Base Setup */
body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 24px;
  background-color: #fafafa;
  color: #333;
}

/* Breadcrumb Navigation */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto 20px auto;
  font-size: 21px;
  font-weight: 500;
}
.breadcrumb span {
  color: #0066cc;
  cursor: pointer;
}
.breadcrumb span:hover {
  text-decoration: underline;
}

/* Dynamic Top Section */
.top-section {
  max-width: 1200px;
  margin: 0 auto 30px auto;
  padding: 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  box-sizing: border-box;
}
.top-section h1 {
  margin-top: 0;
  margin-bottom: 8px;
}
.top-section p {
  margin: 0;
  color: #666;
}

/* Uniform Auto-Fill Grid Layout */
.grid-container {
  display: grid;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Grid Card Blocks */
.grid-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  width: 100%;
}
.image-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background-color: #eee;
}
.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.grid-card:hover .image-wrapper img {
  transform: scale(1.06);
}

/* Interactive Hover Text Swapping */
.text-wrapper {
  margin-top: 14px;
  position: relative;
  height: 24px;
  overflow: hidden;
  font-weight: 600;
}
.text-default, .text-hover {
  display: block;
  width: 100%;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.text-hover {
  position: absolute;
  top: 0;
  left: 0;
  color: #0066cc;
  opacity: 0;
  transform: translateY(100%);
}
.grid-card:hover .text-default {
  opacity: 0;
  transform: translateY(-100%);
}
.grid-card:hover .text-hover {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox Layout Overlay */
.lightbox {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}
.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* Close & Navigation UI Buttons */
.close-btn {
  position: absolute;
  top: 20px; right: 25px;
  color: #fff; font-size: 45px; font-weight: 300;
  background: none; border: none; cursor: pointer;
  z-index: 1001; line-height: 1;
}
.close-btn:hover { color: #ff3b30; }

.nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3); color: white; border: none;
  font-size: 36px; padding: 16px; cursor: pointer; user-select: none;
  transition: background-color 0.2s, color 0.2s; border-radius: 4px; z-index: 1002;
}
.nav-btn:hover { background-color: rgba(255, 255, 255, 0.8); color: black; }
.prev-btn { left: 20px; }
.next-btn { right: 20px; }

@media (max-width: 600px) {
  .nav-btn { padding: 10px; font-size: 24px; }
  .prev-btn { left: 10px; }
  .next-btn { right: 10px; }
}
