/* ========================= Gallery ========================= */
.gallery {
    column-count: 3;
    column-gap: 16px;
    padding: 10px;
}
  
.gallery img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 16px;
    display: block;
    box-shadow:
      0 0 12px rgba(var(--primary-accent-color-rgb), 0.3),
      0 0 24px rgba(var(--primary-accent-color-rgb), 0.2);
    transition: box-shadow 0.3s ease;
  
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUpImage 0.6s ease forwards;
}
  
/* Medium screens: 2 columns */
@media only screen and (max-width: 1024px) {
    .gallery {
      column-count: 2;
    }
}
  
/* Small screens: 1 column */
@media only screen and (max-width: 769px) {
    .gallery {
      column-count: 1;
    }
}

/* ========================= Gallery Selector ========================= */
.gallery-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns by default */
    gap: 20px;
    padding: 20px;
    transition: grid-template-columns 0.3s ease; /* Smooth transition */
}

@media (max-width: 1024px) {
    .gallery-selector {
        grid-template-columns: repeat(2, 1fr); /* 2 columns when the screen width is <= 1024px */
    }
}

@media (max-width: 768px) {
    .gallery-selector {
        grid-template-columns: 1fr; /* 1 column when the screen width is <= 768px */
    }
}


/* ========================= Gallery Card ========================= */
.gallery-card {
    position: relative;
    height: 500px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    opacity: 0; /* Start fully transparent */
    animation: fadeInFromLeft 0.5s ease-out forwards;
}

.gallery-card:hover {
    transform: translateY(-10px) scale(1.05); /* Ensure translateX(0) is kept on hover */
    box-shadow: 0 6px 24px rgba(var(--white-color-rgb), 0.5);
}
  
.gallery-card:hover::after {
    top: 25%;
    opacity: 1;
    transform: scale(1.0) translateY(-10px) translateX(0)
}
  
.gallery-card .overlay {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 16px;
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    border-radius: 0 0 12px 12px;
}

/* ========================= Gallery Info ========================= */
.gallery-info {
    width: 100%;
    padding-bottom: 5px;
    text-align: center;
}
  
.gallery-info h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--white-color);
}
  
.gallery-info hr {
    width: 90%;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--primary-accent-color) 5%, var(--primary-accent-color) 95%, transparent);
    border: none;
    border-radius: 2px;
    margin: 10px 5%;
}
  
.gallery-info p {
    font-size: 1.1rem;
    color: var(--white-color);
}

.gallery-meta-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    padding: 0 15px;
    margin-top: 1rem;
}

.meta-item {
    background: rgba(var(--light-gray-color-rgb), 0.25);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 1rem;
    color: var(--shaded-white-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.meta-item:hover {
    transform: translateY(-4px);
}

.meta-item strong {
    display: block;
    font-weight: 600;
    color: var(--secondary-accent-color);
}

#active-gallery-container {
    position: relative;
    z-index: 1;
}

/* ========================= Back Button ========================= */
.back-button {
    position: fixed !important;
    top: calc(var(--header-height) * 1.5);
    left: 20px;
    padding: 0 16px;
    height: 40px;
    min-width: 60px;
    border: none;
    border-radius: 20px;
    background-color: rgba(51, 51, 51, 0.6); /* semi-transparent */
    color: var(--white-color);
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px); /* smooths over background */
    transition: background-color 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.8);
    opacity: 0.9;
    text-decoration: none;
}

.back-button:hover {
    background-color: rgba(51, 51, 51, 0.8);
    opacity: 1;
}

/* ========================= Keyframes ========================= */
@keyframes fadeUpImage {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
}

@keyframes fadeInFromLeft {
    0% {
      --entry-transform: translateX(-50px) scale(0.8);
      opacity: 0;
    }
    100% {
      --entry-transform: translateX(0) scale(1);
      opacity: 1;
    }
}