/* Oppenheimer Gallery - Premium Frontend Styles */

:root {
    --opp-accent-color: #0c1a30;
    --opp-overlay-bg: rgba(12, 26, 48, 0.7);
    --opp-transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --opp-columns: 3;
}

.opp-gallery-wrapper {
    margin: 2rem 0;
}

/* ── Masonry via CSS columns ── */
.opp-gallery-grid {
    columns: var(--opp-columns);
    column-gap: 16px;
    padding: 0;
}

/* ── Card ── */
.opp-gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.10);
    transition: var(--opp-transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.opp-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.16);
}

/* ── Titre dans la card (sous l'image) ── */
.opp-gallery-title {
    padding: 8px 14px 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-top: 2px solid #f0f0f0;
    margin: 0;
    flex-shrink: 0;
}

.opp-gallery-link {
    display: block;
    width: 100%;
}

.opp-gallery-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Images à ratio naturel — aucun rognage */
.opp-gallery-image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--opp-transition);
}

.opp-gallery-item:hover .opp-gallery-image-container img {
    transform: scale(1.04);
}

.opp-gallery-overlay {
    position: absolute;
    inset: 0;
    background: var(--opp-overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--opp-transition);
}

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

.opp-gallery-icon {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 300;
    transform: scale(0.8);
    transition: var(--opp-transition);
}

.opp-gallery-item:hover .opp-gallery-icon {
    transform: scale(1);
}

/* ── Légende dans la card (en dessous de l'image) ── */
.opp-gallery-caption {
    padding: 8px 14px 10px;
    font-size: 0.78rem;
    color: #777;
    line-height: 1.5;
    border-top: 1px solid #f0f0f0;
    margin: 0;
    font-style: italic;
    flex-shrink: 0;
}

/* ── Lightbox ── */
.opp-lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.opp-lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}

.opp-lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    animation: oppFadeIn 0.4s ease;
    display: block;
}

.opp-lightbox-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    max-width: 600px;
    min-height: 1.2em;
}

.opp-lightbox-caption {
    color: rgba(255,255,255,0.65);
    font-size: 0.82rem;
    font-style: italic;
    text-align: center;
    margin-top: 8px;
    max-width: 600px;
    line-height: 1.5;
    min-height: 1.2em;
}

@keyframes oppFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.opp-lightbox-close {
    position: fixed;
    top: 24px;
    right: 30px;
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    z-index: 100;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.opp-lightbox-close:hover {
    opacity: 1;
}

.opp-lightbox-nav span {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 26px;
    padding: 0;
    cursor: pointer;
    user-select: none;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.opp-lightbox-nav span:hover {
    background: rgba(255,255,255,0.25);
}

.opp-lightbox-prev { left: 16px; }
.opp-lightbox-next { right: 16px; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .opp-gallery-grid {
        columns: 2;
    }
}

@media (max-width: 480px) {
    .opp-gallery-grid {
        columns: 1;
    }
    .opp-lightbox-nav span {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
}
