/**
 * Purbodix 2.0 — Designer Page Gallery Styles
 */

.gallery-page {
    background-color: var(--color-surface);
    padding: var(--space-6) 0 var(--space-10) 0;
    min-height: 80vh;
}

/* ─── Gallery Header ────────────────────────────────────────────────────────── */
.gallery-header {
    text-align: center;
    margin-bottom: var(--space-6);
    position: relative;
    padding: var(--space-8) var(--space-4);
    background: linear-gradient(135deg, var(--color-brand-dark), var(--color-brand));
    border-radius: var(--radius-lg);
    color: var(--color-white);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.gallery-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.gallery-header__title {
    font-family: var(--font-headline-en);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: var(--space-2);
    letter-spacing: var(--letter-spacing-tight);
}

.gallery-header__subtitle {
    font-family: var(--font-english);
    font-size: var(--size-lead);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
    line-height: var(--line-height-body);
}

/* ─── Filters & Sorts ───────────────────────────────────────────────────────── */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    padding: 0 var(--space-2);
}

.filter-btn {
    font-family: var(--font-english);
    font-size: var(--size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-caps);
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background-color: var(--color-white);
    color: var(--color-brand-dark);
    cursor: pointer;
    transition: var(--transition-spring);
    box-shadow: var(--shadow-card);
}

.filter-btn:hover {
    background-color: var(--color-brand-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.filter-btn--active {
    background-color: var(--color-brand);
    color: var(--color-white);
    border-color: var(--color-brand);
}

.filter-btn--active:hover {
    background-color: var(--color-brand-dark);
    color: var(--color-white);
}

/* ─── Gallery Grid ──────────────────────────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.gallery-item {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-spring);
    cursor: pointer;
    position: relative;
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--color-brand-pale);
}

.gallery-item__image-container {
    position: relative;
    width: 100%;
    padding-top: 68%; /* 3:2 Aspect Ratio approximation */
    overflow: hidden;
    background-color: var(--color-brand-light);
}

.gallery-item__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.gallery-item:hover .gallery-item__image {
    transform: scale(1.08);
}

.gallery-item__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 63, 138, 0.8) 0%, rgba(15, 63, 138, 0.2) 60%, transparent 100%);
    opacity: 0;
    transition: var(--transition-default);
    display: flex;
    align-items: flex-end;
    padding: var(--space-3);
    pointer-events: none;
}

.gallery-item:hover .gallery-item__overlay {
    opacity: 1;
}

.gallery-item__zoom-icon {
    color: var(--color-white);
    font-size: var(--size-h3);
    margin: auto;
    background: rgba(30, 99, 201, 0.4);
    padding: var(--space-2);
    border-radius: var(--radius-full);
    backdrop-filter: blur(4px);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.3);
}

.gallery-item__content {
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gallery-item__badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-1);
}

.gallery-item__category {
    font-family: var(--font-english);
    font-size: var(--size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-caps);
    color: var(--color-brand);
}

.gallery-item__views {
    font-family: var(--font-english);
    font-size: var(--size-xs);
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.gallery-item__title {
    font-family: var(--font-english);
    font-size: var(--size-h4);
    font-weight: 600;
    color: var(--color-black);
    line-height: 1.4;
    margin-bottom: var(--space-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.gallery-item__excerpt {
    font-family: var(--font-english);
    font-size: var(--size-sm);
    color: var(--color-muted);
    line-height: var(--line-height-body);
    margin-bottom: var(--space-2);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4.8em;
}

.gallery-item__footer {
    margin-top: auto;
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--size-xs);
    color: var(--color-muted);
}

.gallery-item__author {
    font-weight: 600;
}

/* ─── Lightbox Modal ────────────────────────────────────────────────────────── */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
    padding: var(--space-4);
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox__wrapper {
    background-color: var(--color-white);
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    position: relative;
    box-shadow: var(--shadow-modal);
    transform: scale(0.9);
    transition: transform var(--transition-spring);
    border: 1px solid var(--color-border);
}

.lightbox.active .lightbox__wrapper {
    transform: scale(1);
}

.lightbox__close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 36px;
    height: 36px;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 10;
}

.lightbox__close:hover {
    background-color: var(--color-brand);
    transform: scale(1.1);
}

.lightbox__media {
    flex: 1.2;
    background-color: var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.lightbox__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 70vh;
}

.lightbox__details {
    flex: 0.8;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid var(--color-border);
    max-height: 90vh;
    overflow-y: auto;
    background-color: var(--color-white);
}

.lightbox__category {
    font-family: var(--font-english);
    font-size: var(--size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-caps);
    color: var(--color-brand);
    margin-bottom: var(--space-1);
}

.lightbox__title {
    font-family: var(--font-english);
    font-size: var(--size-h3);
    font-weight: 700;
    color: var(--color-black);
    line-height: var(--line-height-heading);
    margin-bottom: var(--space-2);
}

.lightbox__meta {
    font-family: var(--font-english);
    font-size: var(--size-xs);
    color: var(--color-muted);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-2);
}

.lightbox__excerpt {
    font-family: var(--font-english);
    font-size: var(--size-sm);
    color: var(--color-muted);
    line-height: var(--line-height-body);
    margin-bottom: var(--space-4);
}

.lightbox__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 var(--space-4);
    background-color: var(--color-brand);
    color: var(--color-white);
    font-weight: 600;
    font-size: var(--size-sm);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-caps);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-card);
}

.lightbox__btn:hover {
    background-color: var(--color-brand-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

/* Lightbox Navigation */
.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition-fast);
    z-index: 10;
}

.lightbox__nav:hover {
    background-color: var(--color-brand);
    transform: translateY(-50%) scale(1.1);
}

.lightbox__nav--prev {
    left: var(--space-2);
}

.lightbox__nav--next {
    right: var(--space-2);
}

/* ─── Responsive Adjustments ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .lightbox__wrapper {
        flex-direction: column;
        max-height: 95vh;
    }
    
    .lightbox__media {
        flex: none;
        height: 250px;
        min-height: auto;
    }
    
    .lightbox__img {
        max-height: 250px;
    }
    
    .lightbox__details {
        flex: none;
        border-left: none;
        border-top: 1px solid var(--color-border);
        padding: var(--space-3);
    }
    
    .lightbox__nav {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}
