/* Gallery-specific styles - extends main.css from jrbnz.com */

/* Filter Navigation - inside cream section */
.filter-nav {
    padding: 0 0 40px 0;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.filter-back {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: clamp(24px, 3vw, 32px);
    color: rgba(0, 58, 83, 0.35);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.filter-back:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.filter-link {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
    font-size: clamp(24px, 3vw, 32px);
}

.filter-link:hover {
    border-bottom-color: var(--accent-color);
}

.filter-link.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Hero + description panel */
.hero-panel {
    display: flex;
    flex-direction: row-reverse;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 48px;
}

.hero-panel.hidden {
    display: none;
}

.hero-panel .hero-image-wrap {
    flex: 0 0 65%;
}

.hero-panel .hero-image-wrap a {
    display: block;
    border-bottom: none;
}

.hero-panel .hero-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    cursor: pointer;
}

.hero-panel .hero-description {
    flex: 1;
    font-size: clamp(16px, 1.6vw, 20px);
    line-height: 1.7;
    color: var(--background-color);
    padding-top: 4px;
}

@media (max-width: 768px) {
    .hero-panel {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 32px;
    }

    .hero-panel .hero-image-wrap {
        flex: none;
        width: 100%;
        order: 2;
    }

    .hero-panel .hero-description {
        display: block;
        order: 1;
    }
}

/* Category overview grid (shown on /photos with no category selected) */
.category-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 48px;
}

.category-overview.hidden {
    display: none;
}

.category-card {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: inset 0 0 0 5px transparent;
    transition: box-shadow 0.2s ease;
    aspect-ratio: 3 / 2;
}

.category-card:hover {
    box-shadow: inset 0 0 0 5px var(--accent-color);
}

.category-card a {
    display: block;
    height: 100%;
    border-bottom: none;
}

.category-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.category-card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 48px 24px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(36px, 4vw, 56px);
    letter-spacing: 0.03em;
    color: #fff;
    pointer-events: none;
}

@media (max-width: 768px) {
    .category-overview {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.gallery {
    column-count: 3;
    column-gap: 20px;
    width: 100%;
}

.gallery-item {
    position: relative;
    border-radius: 4px;
    cursor: pointer;
    background-color: rgba(0, 58, 83, 0.1);
    break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
    border-bottom: none !important;
    box-shadow: inset 0 0 0 5px transparent;
    transition: box-shadow 0.2s ease;
}

.gallery-item:hover {
    box-shadow: inset 0 0 0 5px var(--accent-color);
}

.gallery-item:last-child {
    margin-bottom: 0;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item img.loaded {
    opacity: 1;
}

/* Loading & Error States */
.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: clamp(18px, 2vw, 24px);
    color: var(--background-color);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.error {
    text-align: center;
    padding: 60px 20px;
    font-size: clamp(18px, 2vw, 24px);
    color: var(--accent-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 60px;
    padding: 20px;
}

.pagination-btn {
    background-color: transparent;
    color: var(--background-color);
    border: 2px solid var(--background-color);
    padding: 12px 24px;
    font-family: 'Lora', serif;
    font-size: clamp(16px, 2vw, 20px);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--background-color);
    border-color: var(--background-color);
    color: var(--text-color);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    color: var(--background-color);
    font-size: clamp(16px, 2vw, 20px);
}

/* Lightbox Customization */
.gslide-description {
    background-color: var(--background-color);
    color: var(--text-color);
}

.glightbox-clean .gclose,
.glightbox-clean .gnext,
.glightbox-clean .gprev {
    background-color: var(--link-color);
    color: var(--background-color);
}

.glightbox-clean .gclose:hover,
.glightbox-clean .gnext:hover,
.glightbox-clean .gprev:hover {
    background-color: var(--hover-color);
}

/* Fix lightbox image sizing to prevent scrollbars */
.gcontainer {
    width: 100vw;
    height: 100vh;
}

.gslide-image img,
.gslide-media img {
    max-height: 95vh !important;
    max-width: 95vw !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

.ginner-container {
    width: auto !important;
    height: auto !important;
}

.gslide-inline,
.gslide-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .gallery {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .filter-nav {
        padding: 0 0 24px 0;
        gap: 20px;
    }

    .gallery {
        column-count: 2;
        column-gap: 16px;
    }

    .gallery-item {
        margin-bottom: 16px;
    }

    .pagination {
        flex-direction: column;
        gap: 15px;
    }

    .pagination-btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .gallery {
        column-count: 1;
    }
}
