.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-caption {
    color: white;
    text-align: center;
    padding: 1rem;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    margin: 0 0 2rem 0;
    padding: 1rem;
    justify-content: center;
    gap: 0.5rem;
}

.gallery-filter {
    padding: 0.5rem 1rem;
    background-color: var(--bg-light);
    border: none;
    border-radius: 4px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-filter:hover,
.gallery-filter.active {
    background-color: var(--primary-color);
    color: white;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.showcase-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1/1;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.showcase-item:hover {
    transform: translateY(-10px);
}

.showcase-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.showcase-item:hover img {
    transform: scale(1.1);
}

.showcase-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(44, 62, 80, 0.8) 0%, rgba(44, 62, 80, 0) 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.showcase-item:hover .showcase-overlay {
    opacity: 1;
}

.showcase-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    color: white;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease 0.1s;
}

.showcase-item:hover .showcase-content {
    transform: translateY(0);
    opacity: 1;
}

.showcase-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.showcase-category {
    font-size: 0.9rem;
    opacity: 0.8;
}

.img-responsive-square {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    position: relative;
    overflow: hidden;
}

.img-responsive-square img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-responsive-16-9 {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    position: relative;
    overflow: hidden;
}

.img-responsive-16-9 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lb-data .lb-caption {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

.gallery-page .gallery-filters {
    display: flex;
    flex-wrap: wrap;
    margin: 0 0 2rem 0;
    padding: 1rem;
    gap: 10px;
}
.gallery-page .filter-btn {
    padding: 8px 16px;
    background-color: var(--bg-light);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.gallery-page .filter-btn:hover {
    background-color: var(--bg-medium);
    transform: translateY(-2px);
}
.gallery-page .filter-btn.active {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.gallery-page .gallery-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    position: relative;
    min-height: 150px;
    background-color: #f0f0f0;
}
.gallery-page .gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.gallery-page .gallery-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
    opacity: 0; /* Start transparent */
    transition: opacity 0.4s ease-in, transform 0.5s ease;
}
.gallery-page .gallery-item:hover .gallery-img {
    transform: scale(1.05);
}
.gallery-page .image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 70%, rgba(0,0,0,0) 100%);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(20px);
    pointer-events: none;
    text-align: left;
}
.gallery-page .gallery-item:hover .image-overlay {
    opacity: 1;
    transform: translateY(0);
}
.gallery-page .image-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}
.gallery-page .image-category {
    font-size: 0.85rem;
    background-color: var(--accent-color);
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 5px;
}
.gallery-page .gallery-controls {
    text-align: center;
    padding: 1rem 0;
    margin-top: 1rem;
}
.gallery-page .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 10px;
    gap: 15px;
    position: relative;
}

@media (hover: none) {
    .gallery-page .image-overlay {
        opacity: 1;
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 80%, rgba(0,0,0,0) 100%);
    }
    
    .showcase-overlay {
        opacity: 0.9;
    }
    
    .showcase-content {
        transform: translateY(0);
        opacity: 1;
    }
    
    .gallery-overlay {
        opacity: 0.5;
    }
}

.gallery-page .gallery-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}
.gallery-page .gallery-loading.hidden {
    opacity: 0;
    pointer-events: none;
}
.gallery-page .loader {
    border: 5px solid var(--light-gray);
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: gallery-spin 1s linear infinite;
}
@keyframes gallery-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@media (max-width: 992px) {
    .gallery-page .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-page .gallery-cell {
        width: 33.333%;
    }
    
    .gallery-page .gallery-table {
        border-spacing: 10px;
    }
    
    .gallery-page .gallery-item {
        height: 180px;
    }
}
@media (max-width: 768px) {
    .gallery-page .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    .gallery-page .gallery-filters {
        padding: 0.5rem;
        gap: 5px;
    }
    .gallery-page .filter-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .showcase-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-filters {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-left: 0;
        padding-right: 0;
    }
    
    .gallery-filter {
        padding: 0.35rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .gallery-page .gallery-table {
        border-spacing: 8px;
        margin: 0 -8px;
    }
    
    .gallery-page .gallery-cell {
        width: 50%;
    }
    
    .gallery-page .gallery-item {
        height: 150px;
    }
}
@media (max-width: 576px) {
    .gallery-page .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .gallery-page .image-title {
        font-size: 0.9rem;
    }
    .gallery-page .image-overlay {
        padding: 10px;
    }
    
    .gallery-caption {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .showcase-title {
        font-size: 1rem;
    }
    
    .showcase-category {
        font-size: 0.8rem;
    }
    
    .gallery-filter {
        padding: 0.4rem 0.8rem;
        margin: 0.2rem;
    }
}

@media (max-width: 375px) {
    .gallery-page .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-filters {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 15px;
        margin-bottom: 1rem;
        justify-content: flex-start;
    }
    
    .gallery-filter {
        flex: 0 0 auto;
    }
}

.gallery-page .page-header {
    padding-top: 120px;
}

.gallery-page .gallery-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 15px;
    margin: 0 auto;
    text-align: center;
}

.gallery-page .gallery-row {
    display: table-row;
}

.gallery-page .gallery-cell {
    display: table-cell;
    width: 25%;
    padding-bottom: 15px;
    vertical-align: top;
    text-align: center;
}

.gallery-page .gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: 200px;
    margin: 0 auto;
    max-width: 300px;
}

.gallery-page .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.gallery-page .image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
}

.gallery-page .image-category {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 12px;
}

.gallery-page .image-title {
    margin: 5px 0 0;
    font-size: 16px;
    font-weight: 600;
}

.gallery-page .container {
    text-align: center;
    padding: 0 15px;
}

.gallery-page .more-images-container {
    display: none;
    text-align: center;
}

.gallery-page .gallery-cell-template {
    display: inline-block;
    width: 25%;
    padding: 15px;
    vertical-align: top;
    text-align: center;
}

.gallery-page .gallery-cell-template .gallery-item {
    height: 200px;
    margin: 0 auto;
    max-width: 300px;
}

.gallery-page .gallery-filters {
    text-align: center;
    margin-bottom: 30px;
}

.gallery-page .filter-btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 5px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 30px;
    color: #333;
    cursor: pointer;
}

.gallery-page .filter-btn.active {
    background-color: var(--accent-color);
    color: white;
}

.gallery-page .loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.gallery-page .gallery-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.gallery-page .gallery-controls {
    text-align: center;
    margin: 30px 0;
    clear: both;
    display: block;
}

.gallery-page .gallery-btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 0 5px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

@media (max-width: 992px) {
    .gallery-page .gallery-cell {
        width: 33.333%;
    }
    
    .gallery-page .gallery-table {
        border-spacing: 10px;
    }
    
    .gallery-page .gallery-item {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .gallery-page .gallery-table {
        border-spacing: 8px;
        margin: 0 -8px;
    }
    
    .gallery-page .gallery-cell {
        width: 50%;
    }
    
    .gallery-page .gallery-item {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .gallery-page .gallery-table {
        display: block;
        border-spacing: 0;
        width: 100%;
        margin: 0 auto;
    }
    
    .gallery-page .gallery-row {
        display: block;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .gallery-page .gallery-cell {
        display: block;
        width: 100%;
        padding: 0;
        text-align: center;
    }
    
    .gallery-page .gallery-item {
        height: 220px;
        margin: 0 auto !important;
        max-width: 90%;
        width: 280px;
        display: inline-block;
        margin-bottom: 15px !important;
    }
    
    .gallery-page .gallery-item img,
    .gallery-page .gallery-cell-template img {
        object-fit: contain !important;
        object-position: center center;
        width: 100%;
        height: 100%;
    }
    
    .gallery-page .image-overlay {
        padding: 10px;
    }
}
