/* Semapix Gallery - Responsive CSS Grid */

.spx-galleries-grid,
.spx-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--spx-cols, 4), 1fr);
    gap: 1rem;
}

/* Galleries list cards */
.spx-gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(128, 128, 128, 0.08);
    transition: box-shadow 0.2s ease;
}

.spx-gallery-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.spx-gallery-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.spx-gallery-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.spx-gallery-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, 0.15);
    color: inherit;
    opacity: 0.4;
    font-size: 2rem;
}

.spx-gallery-info {
    padding: 0.75rem 1rem;
}

.spx-gallery-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.spx-gallery-count {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Gallery detail items */
.spx-gallery-item {
    display: block;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
}

.spx-gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.2s ease;
}

.spx-gallery-item:hover img {
    transform: scale(1.05);
}

.spx-gallery-description {
    margin-bottom: 1.5rem;
}

/* Hidden items (pagination) */
.spx-gallery-item.spx-hidden {
    display: none;
}

/* Pagination controls */
.spx-gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.spx-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border: 1px solid rgba(128, 128, 128, 0.3);
    border-radius: 4px;
    background: none;
    color: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.spx-page-btn:hover:not(:disabled):not(.active) {
    background: rgba(128, 128, 128, 0.1);
    border-color: rgba(128, 128, 128, 0.5);
}

.spx-page-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
    font-weight: 600;
}

.spx-page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.spx-page-prev,
.spx-page-next {
    font-size: 1.25rem;
    line-height: 1;
}

.spx-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    color: inherit;
    opacity: 0.5;
    font-size: 0.9rem;
}

/* Responsive breakpoints */
@media (max-width: 992px) {
    .spx-galleries-grid,
    .spx-gallery-grid {
        grid-template-columns: repeat(min(var(--spx-cols, 4), 3), 1fr);
    }
}

@media (max-width: 768px) {
    .spx-galleries-grid,
    .spx-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .spx-galleries-grid,
    .spx-gallery-grid {
        grid-template-columns: 1fr;
    }
}
