/* STH Gallery Frontend Styles */
:root {
    --sth-yellow: #FBBE01;
    --sth-dark-blue: #093C73;
    --sth-dark-red: #9C1E1E;
    --sth-grid-columns: 3;
}

/* Filters */
.sth-gallery-filters {
    margin-bottom: 25px;
    text-align: center;
}

.sth-filter-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 20px;
    margin: 5px;
    cursor: pointer;
    font-size: 1em;
    color: var(--sth-dark-blue);
    transition: all 0.3s ease;
}

.sth-filter-btn:hover {
    background-color: #e0e0e0;
}

.sth-filter-btn.active {
    background-color: var(--sth-dark-blue);
    color: #fff;
    border-color: var(--sth-dark-blue);
}

/* Gallery Grid */
.sth-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--sth-grid-columns), 1fr);
    gap: 15px;
}

.sth-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    display: block;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sth-gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.sth-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.sth-gallery-item:hover img {
    transform: scale(1.1);
}

.sth-gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(9, 60, 115, 0.8) 0%, rgba(9, 60, 115, 0) 60%);
    display: flex;
    align-items: flex-end;
    padding: 15px;
    transition: background 0.3s ease;
}

.sth-gallery-item-title {
    color: #fff;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sth-gallery-item:hover .sth-gallery-item-title {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive Grid */
@media (max-width: 992px) {
    .sth-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .sth-gallery-grid { grid-template-columns: 1fr; }
}

/* Lightbox */
.sth-lightbox {
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.sth-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
}

.sth-lightbox-image {
    max-width: 100%;
    max-height: 80vh; /* Control max height */
    object-fit: contain;
    border-radius: 4px;
}

.sth-lightbox-details {
    color: #fff;
    padding: 15px;
    background: rgba(0,0,0,0.5);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}
.sth-lightbox-title {
    margin: 0 0 10px 0;
    color: var(--sth-yellow);
}
.sth-lightbox-description {
    margin: 0 0 10px 0;
    font-size: 0.9em;
}
.sth-lightbox-date {
    font-size: 0.8em;
    opacity: 0.7;
}

.sth-lightbox-close,
.sth-lightbox-prev,
.sth-lightbox-next {
    cursor: pointer;
    position: absolute;
    color: white;
    font-size: 35px;
    font-weight: bold;
    transition: 0.3s;
    user-select: none;
}
.sth-lightbox-close { top: 15px; right: 35px; }
.sth-lightbox-prev, .sth-lightbox-next { top: 50%; transform: translateY(-50%); }
.sth-lightbox-prev { left: 15px; }
.sth-lightbox-next { right: 15px; }

.sth-lightbox-close:hover,
.sth-lightbox-prev:hover,
.sth-lightbox-next:hover {
    color: #bbb;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
.sth-lightbox.fade-out {
    animation: fadeOut 0.3s;
}


/* Load More & Pagination */
.sth-load-more-container, .sth-gallery-pagination {
    text-align: center;
    margin-top: 30px;
}

.sth-btn {
    background-color: var(--sth-dark-blue);
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.sth-btn:hover {
    background-color: #072f5a;
}

.sth-gallery-loader {
    text-align: center;
    padding: 20px;
}
.sth-gallery-loader .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-left-color: var(--sth-dark-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.sth-gallery-pagination .page-numbers {
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid #ccc;
    text-decoration: none;
    color: var(--sth-dark-blue);
    border-radius: 4px;
}
.sth-gallery-pagination .page-numbers.current,
.sth-gallery-pagination .page-numbers:hover {
    background-color: var(--sth-dark-blue);
    color: #fff;
    border-color: var(--sth-dark-blue);
}
