/* ============================================
   ASTLR GALERIES - Frontend Styles v3
   Photos + Vidéos
   ============================================ */

/* --- Retour link --- */
.astlr-back-link {
    text-decoration: none;
    color: #666;
    font-size: 0.95em;
    transition: color 0.2s;
}
.astlr-back-link:hover {
    color: #333;
}

/* --- Category Page --- */
.astlr-category-title {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2em;
}
.astlr-category-desc {
    text-align: center;
    color: #666;
    max-width: 700px;
    margin: 0 auto 40px;
}

/* Grille des galeries */
.astlr-galeries-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 30px;
}

.astlr-galerie-card {
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}
.astlr-galerie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Mosaïque 4 images */
.astlr-mosaic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 3px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.astlr-mosaic-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.astlr-galerie-card:hover .astlr-mosaic-grid img {
    transform: scale(1.05);
}

.astlr-mosaic-single {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.astlr-mosaic-single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.astlr-galerie-card:hover .astlr-mosaic-single img,
.astlr-galerie-card:hover .astlr-mosaic-single video {
    transform: scale(1.05);
}

/* Video preview in mosaic */
.astlr-mosaic-video {
    position: relative;
}
.astlr-mosaic-video video {
    transition: transform 0.4s ease;
}
.astlr-mosaic-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.astlr-mosaic-empty {
    aspect-ratio: 4 / 3;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 0.9em;
}

.astlr-card-info {
    padding: 16px;
    text-align: center;
}
.astlr-card-info h3 {
    margin: 0 0 4px;
    font-size: 1.15em;
}
.astlr-photo-count {
    color: #888;
    font-size: 0.9em;
}

/* --- Single Gallery Page --- */
.astlr-galerie-title {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2em;
}
.astlr-galerie-desc {
    text-align: center;
    color: #666;
    max-width: 700px;
    margin: 0 auto 20px;
}
.astlr-photo-total {
    text-align: center;
    color: #999;
    margin-bottom: 30px;
}

/* Grille des photos/vidéos */
.astlr-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.astlr-photo-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 6px;
    aspect-ratio: 1;
    background: #f0f0f0;
    position: relative;
}
.astlr-photo-item img,
.astlr-photo-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.astlr-photo-item:hover img,
.astlr-photo-item:hover video {
    transform: scale(1.08);
}

/* --- Video overlay (play button) --- */
.astlr-video-item {
    position: relative;
}
.astlr-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.3s;
}
.astlr-video-item:hover .astlr-play-overlay {
    opacity: 0.8;
}

/* --- Lightbox --- */
.astlr-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
}
.astlr-lightbox.active {
    display: flex;
}

.astlr-lb-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: opacity 0.2s;
}
.astlr-lb-close:hover { opacity: 0.7; }

.astlr-lb-prev,
.astlr-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    z-index: 10;
    width: 50px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}
.astlr-lb-prev:hover,
.astlr-lb-next:hover {
    background: rgba(255, 255, 255, 0.2);
}
.astlr-lb-prev { left: 15px; }
.astlr-lb-next { right: 15px; }

.astlr-lb-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.astlr-lb-content img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}
.astlr-lb-content video {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 4px;
    background: #000;
}
#astlr-lightbox-caption {
    color: #ccc;
    margin-top: 12px;
    text-align: center;
    font-size: 0.95em;
}
#astlr-lightbox-counter {
    color: #888;
    font-size: 0.85em;
}

/* --- Empty State --- */
.astlr-empty {
    text-align: center;
    color: #999;
    padding: 60px 0;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .astlr-galeries-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .astlr-galeries-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .astlr-photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .astlr-lb-prev,
    .astlr-lb-next {
        width: 35px;
        height: 60px;
        font-size: 32px;
    }
}
