/**
 * Galerie médias PC reconditionnés — styles partagés admin + public
 */
:root {
    --pc-media-thumb-width: 160px;
    --pc-media-thumb-height: 120px;
    --pc-media-thumb-radius: 8px;
}

.pc-media-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pc-media-gallery--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--pc-media-thumb-width), 1fr));
    gap: 12px;
}

.pc-media-thumb {
    position: relative;
    width: var(--pc-media-thumb-width);
    height: var(--pc-media-thumb-height);
    overflow: hidden;
    border-radius: var(--pc-media-thumb-radius);
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    padding: 0;
    cursor: pointer;
    display: block;
    flex: 0 0 var(--pc-media-thumb-width);
}

.pc-media-thumb:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.pc-media-thumb__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.pc-media-thumb__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    pointer-events: none;
}

.pc-media-thumb--video .pc-media-thumb__overlay {
    background: rgba(0, 0, 0, 0.45);
}

.pc-media-thumb--missing {
    cursor: not-allowed;
    opacity: 0.85;
}

.pc-media-thumb--missing .pc-media-thumb__badge {
    position: absolute;
    left: 6px;
    top: 6px;
    z-index: 2;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    text-transform: uppercase;
}

.pc-media-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.85);
}

.pc-media-lightbox.is-open {
    display: flex;
}

.pc-media-lightbox__dialog {
    position: relative;
    max-width: min(96vw, 1100px);
    max-height: 92vh;
    width: 100%;
}

.pc-media-lightbox__content {
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-media-lightbox__content img,
.pc-media-lightbox__content video {
    max-width: 100%;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    background: #000;
}

.pc-media-lightbox__close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #212529;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.pc-media-lightbox__caption {
    margin-top: 12px;
    color: #f8f9fa;
    text-align: center;
    font-size: 0.95rem;
}

@media (max-width: 576px) {
    :root {
        --pc-media-thumb-width: 140px;
        --pc-media-thumb-height: 105px;
    }
}

.pc-media-thumb--card {
    width: 100%;
    height: 240px;
    flex: 1 1 auto;
    display: block;
    text-decoration: none;
    color: inherit;
}

.pc-media-thumb--card:hover {
    opacity: 0.95;
}

.pc-media-admin-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
