/* CTS Gallery – Frontend */
.cts-gallery-wrap {
    width: 100%;
    font-family: 'Montserrat', sans-serif;
}

/* Filter buttons */
.cts-gallery-filters {
    margin-bottom: 20px;
    text-align: center;
}

.cts-gallery-filters-top {
    margin-bottom: 8px;
}

.cts-gallery-filters-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* View All on its own row */
.cts-filter-btn[data-filter="all"] {
    flex-basis: 100%;
    max-width: 160px;
}

.cts-filter-btn {
    background: #0b4b91;
    color: #ffffff;
    border: 2px solid #0b4b91;
    border-radius: 4px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.cts-filter-btn:hover,
.cts-filter-btn.active {
    background: #ffffff;
    color: #0b4b91;
}

/* Grid */
.cts-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .cts-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .cts-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

/* Gallery items */
.cts-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    aspect-ratio: 4 / 3;
    background: #ebebeb;
    transition: opacity 0.3s;
}

.cts-gallery-item.cts-hidden {
    display: none;
}

.cts-gallery-item {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cts-gallery-item.cts-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.cts-gallery-item:nth-child(2)  { transition-delay: 0.04s; }
.cts-gallery-item:nth-child(3)  { transition-delay: 0.08s; }
.cts-gallery-item:nth-child(4)  { transition-delay: 0.12s; }
.cts-gallery-item:nth-child(5)  { transition-delay: 0.16s; }
.cts-gallery-item:nth-child(6)  { transition-delay: 0.20s; }
.cts-gallery-item:nth-child(7)  { transition-delay: 0.24s; }
.cts-gallery-item:nth-child(8)  { transition-delay: 0.28s; }

.cts-gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.cts-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.cts-gallery-item:hover img {
    transform: scale(1.04);
}

.cts-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 75, 145, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
}

.cts-gallery-item:hover .cts-gallery-overlay {
    opacity: 1;
}

.cts-gallery-icon {
    display: none;
}

.cts-gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    padding: 40px 0;
}

/* Lightbox */
.cts-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.cts-lightbox.cts-lb-open {
    display: flex;
}

.cts-lb-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.cts-lb-inner img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

.cts-lb-title {
    color: #fff;
    margin: 12px 0 0;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
}

.cts-lb-close,
.cts-lb-prev,
.cts-lb-next {
    position: fixed;
    background: rgba(11, 75, 145, 0.8);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s;
    padding: 0;
}

.cts-lb-close:hover,
.cts-lb-prev:hover,
.cts-lb-next:hover {
    background: #0b4b91;
}

.cts-lb-close {
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 32px;
}

.cts-lb-prev,
.cts-lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 60px;
    font-size: 36px;
}

.cts-lb-prev { left: 16px; }
.cts-lb-next { right: 16px; }
