/* ======================================
    Gallery Page Specific Styles
  ====================================== */

.site-header {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.back-button {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--light-text);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.back-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.gallery-category {
  margin-bottom: 1.5rem;
}

.category-title {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: var(--light-text);
  margin-bottom: 1rem;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.4);
  text-align: left;
  padding-left: 0.5rem;
}

.image-row {
  display: flex;
  flex-wrap: wrap; /* Allow images to wrap to the next line */
  padding: 0.5rem;
  gap: 1rem; /* Reduced gap for a tighter layout */
}

/* Custom Scrollbar */
.image-row::-webkit-scrollbar {
  height: 12px;
}
.image-row::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
}
.image-row::-webkit-scrollbar-thumb {
  background-color: var(--secondary-color);
  border-radius: 10px;
  border: 3px solid var(--card-bg-color);
}
.image-row::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-color);
}


.gallery-item {
  flex-grow: 1; /* Allow items to grow to fill space */
  height: 280px; /* Set a consistent height for all previews */
  border-radius: 10px; /* Soften the corners */
  border: 2px solid var(--border-color);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ensures the whole image is visible */
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05); /* Zoom effect on the image inside the container */
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border-color: var(--secondary-color);
}

/* ======================================
    Error/Debug Card
  ====================================== */
.error-card {
    background: rgba(255, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 0, 0, 0.4);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    text-align: left;
    color: var(--light-text);
}

.error-card h2 {
    color: #ff8a80; /* Light red for the title */
    border-bottom-color: #ff8a80;
    margin-bottom: 1rem;
}

.error-card p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.error-card code {
    background-color: rgba(0,0,0,0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
}

@media (max-width: 768px) {
  .back-button {
    position: static;
    transform: none;
    display: block;
    text-align: center;
    margin-bottom: 1rem;
  }

  .site-header {
    flex-direction: column;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Make the GLightbox image a block element for transform properties to work reliably */
.gslide-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}