/*-- -------------------------- -->
<---          Gallery           -->
<--- -------------------------- -*/

/* Mobile - 360px */
@media only screen and (min-width: 0rem) {
    #gallery {
        padding: var(--sectionPadding);
    }
    #gallery .cs-container {
        width: 100%;
        max-width: 80rem;
        margin: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        /* 48px - 64px */
        gap: clamp(2rem, 4vw, 2.5rem);
        position: relative;
    }
    #gallery .cs-content {
        text-align: left;
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
        gap: 1.5rem;
    }
    #gallery .cs-title {
        margin: 0;
    }
    #gallery .cs-gallery {
        width: 100%;
        padding: 0;
        margin: 0;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(19.0625rem, 1fr));
        /* 16px - 20px */
        gap: clamp(1rem, 1.5vw, 1.25rem);
        position: relative;
    }
    #gallery .cs-image {
        /* 260px - 360px */
        min-height: clamp(16.25rem, 60vw, 20rem);
        border-radius: 1rem;
        /* clips the image corners */
        overflow: hidden;
        display: block;
        position: relative;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    #gallery .cs-image:hover {
        transform: scale(1.02);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
    #gallery .cs-image img {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 100%;
        /* makes it act like a background image */
        object-fit: cover;
        object-position: top;
        transition: transform 0.4s ease;
    }
    #gallery .cs-image:hover img {
        transform: scale(1.05);
    }
    
    /* Exception: pic01 - stretch to fill entire box */
    #gallery #pic01 img {
        object-fit: fill;
    }
    
    /* Hidden images */
    #gallery .cs-image.cs-hidden {
        display: none;
        opacity: 0;
        transform: translateY(1rem);
    }
    
    /* Revealed images get animation */
    #gallery .cs-image.cs-revealed {
        display: block;
        opacity: 0;
        transform: translateY(1.5rem) scale(0.98);
        animation: fadeInUp 0.6s ease-out forwards;
    }
    
    @keyframes fadeInUp {
        0% {
            opacity: 0;
            transform: translateY(1.5rem) scale(0.98);
        }
        60% {
            opacity: 0.8;
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    /* Toggle button styling */
    #gallery .cs-gallery-toggle {
        font-size: 1rem;
        line-height: 3rem;
        text-decoration: none;
        font-weight: 700;
        text-align: center;
        color: #fff;
        min-width: 10rem;
        padding: 0 1.5rem;
        background-color: var(--primary);
        border: none;
        border-radius: 0.25rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        cursor: pointer;
        position: relative;
        z-index: 1;
        box-sizing: border-box;
        transition: background-color 0.3s ease;
    }
    #gallery .cs-gallery-toggle:before {
        content: "";
        position: absolute;
        height: 100%;
        width: 0%;
        background: #000;
        opacity: 1;
        top: 0;
        left: 0;
        z-index: -1;
        border-radius: 0.25rem;
        transition: width 0.3s;
    }
    #gallery .cs-gallery-toggle:hover:before {
        width: 100%;
    }
    #gallery .cs-toggle-icon {
        transition: transform 0.3s ease;
    }
    
    /* Rotate arrow when fully expanded */
    #gallery.cs-fully-expanded .cs-gallery-toggle .cs-toggle-icon {
        transform: rotate(180deg);
    }
}

/* Dark Mode */
@media only screen and (min-width: 0rem) {
    body.dark-mode #gallery .cs-title {
        color: var(--bodyTextColorWhite);
    }
    body.dark-mode #gallery .cs-topper {
        color: var(--primaryLight);
    }
    body.dark-mode #gallery .cs-gallery-toggle {
        color: #000;
        background-color: var(--primaryLight);
    }
    body.dark-mode #gallery .cs-gallery-toggle:before {
        background: var(--bodyTextColorWhite);
    }
    body.dark-mode #gallery .cs-image:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
}
                                