/* public/css/gallery.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    line-height: 1.6;
}

.banner-image {
    width: 100%;
    max-width: 1200px;
    height: auto;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
}

.intro-text {
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

footer {
    background-color: #333;
    padding: 1rem 0;
    text-align: center;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .banner-image {
        max-height: 300px;
    }
}

/* Galerie */
.gallery-container {
    padding: 20px;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Espacement entre les images */
    margin-top: 20px;
}

/* Carte individuelle */
.gallery-item {
    background-color: #333; /* Fond sombre pour les cartes */
    border-radius: 10px;
    overflow: hidden;
    width: calc(33.333% - 20px); /* 3 images par ligne */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    background-color: #3a3a3a; /* Légère variation de couleur au survol */
}

/* Conteneur de l'image */
.image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px; /* Espacement intérieur */
    background-color: #444; /* Fond sombre pour le conteneur */
    border-radius: 10px 10px 0 0; /* Bordures arrondies en haut */
    overflow: hidden; /* Cache les débordements */
}

/* Image dans la carte */
.gallery-item img {
    max-width: 100%; /* Largeur maximale */
    height: auto; /* Hauteur ajustée automatiquement */
    border-radius: 5px; /* Bordures arrondies */
    object-fit: cover; /* Pour éviter les déformations */
    display: block; /* Assure que l'image est un bloc */
    margin: 0 auto; /* Centre l'image horizontalement */
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05); /* Effet de zoom au survol */
}

/* Message "Aucune image trouvée" */
.no-images {
    text-align: center;
    color: #cccccc;
    font-size: 16px;
    margin-top: 20px;
}

/* Détails de l'image */
.gallery-item .image-details {
    padding: 12px 14px 16px;
    text-align: center;
    background-color: #3a3a3a;
    border-radius: 0 0 10px 10px;
    color: #fff;
}

.gallery-item .image-details h3 {
    font-size: 16px;
    margin: 0 0 10px;
    color: #fff;
    font-weight: 600;
}

.gallery-description {
    text-align: center;
    font-size: 0.92rem;
    color: #fff;
    line-height: 1.55;
}

.gallery-description-excerpt,
.gallery-description-excerpt p {
    margin: 0;
    color: #fff;
    text-align: left;
}

.gallery-read-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 0.9rem;
}

.gallery-read-more,
.gallery-read-more-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 9.5rem;
    padding: 0.55rem 1.35rem;
    border: 1px solid rgba(255, 140, 125, 0.55);
    border-radius: 999px;
    background: linear-gradient(135deg, #ff6f61 0%, #e65a50 100%);
    color: #fff;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(255, 111, 97, 0.28);
    transition: transform 0.25s ease, box-shadow 0.3s ease, background 0.25s ease, border-color 0.25s ease;
}

.gallery-read-more:hover,
.gallery-read-more-inline:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 180, 170, 0.85);
    background: linear-gradient(135deg, #ff8a7f 0%, #ff6f61 100%);
    color: #fff;
    box-shadow:
        0 0 18px rgba(255, 111, 97, 0.65),
        0 0 36px rgba(255, 111, 97, 0.28),
        0 10px 24px rgba(255, 111, 97, 0.35);
}

.gallery-read-more:focus-visible,
.gallery-read-more-inline:focus-visible {
    outline: 2px solid #ff8a7f;
    outline-offset: 3px;
}

.gallery-description--inline .gallery-description-full {
    margin-top: 0.75rem;
    text-align: left;
}

.gallery-item .rich-text-content,
.gallery-item .rich-text-content p,
.gallery-item .rich-text-content li,
.gallery-item .rich-text-content strong,
.gallery-item .rich-text-content b {
    color: #fff;
}

.gallery-item .rich-text-content p {
    margin-bottom: 0.5rem;
}

.gallery-item .rich-text-content p:last-child {
    margin-bottom: 0;
}

.gallery-item .rich-text-content ul,
.gallery-item .rich-text-content ol {
    margin: 0.35rem 0 0.65rem 1.1rem;
}

.gallery-item:hover .image-details {
    background-color: #444;
}

/* Styles pour la liste des dossiers */
.folder-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 5px;
    margin-bottom: 20px;
	font-size: 13px;
}

.folder-link {
    display: inline-block;
    padding: 5px 10px;
    background-color: #444;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #555;
}

.folder-link:hover {
    background-color: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.folder-link.active {
    background-color: #ff6f61;
    color: #fff;
    border: 2px solid #ff6f61;
    box-shadow: 0 4px 8px rgba(255, 111, 97, 0.3);
}

.folder-link.active:hover {
    background-color: #e65a50;
    border-color: #e65a50;
}

.folder-cover {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

.folder-link span {
    padding: 10px;
    font-size: 16px;
    font-weight: bold;
}

.folder-link i {
    font-size: 48px;
    margin: 20px 0;
    color: #ff6f61;
}

@media (max-width: 768px) {
    .folder-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .folder-cover {
        height: 100px;
    }

    .folder-link span {
        font-size: 14px;
    }
}

/* Message "Aucun dossier sélectionné" */
.no-folder-selected {
    text-align: center;
    color: #ccc;
    font-size: 16px;
    margin-top: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
}

.pagination a {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s ease;
}

.pagination a.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination a:hover {
    background-color: #f1f1f1;
}

/* Lightbox */
body.lightbox-open {
    overflow: hidden;
    touch-action: none;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background-color: #000;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.25s ease;
    touch-action: none;
    flex-direction: column;
}

.lightbox-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    height: 100%;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    touch-action: none;
}

.lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100dvh;
}

.lightbox-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    max-height: 55%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2.5rem 1.25rem 1.1rem;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease;
    pointer-events: none;
    -webkit-overflow-scrolling: touch;
}

.lightbox-stage.has-caption-content.is-caption-visible .lightbox-caption {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lightbox-caption,
.lightbox-caption p,
.lightbox-caption li {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.lightbox-caption p {
    margin-bottom: 0.55rem;
}

.lightbox-caption p:last-child {
    margin-bottom: 0;
}

.lightbox-caption ul,
.lightbox-caption ol {
    margin: 0.35rem 0 0.65rem 1.15rem;
}

.lightbox-caption strong,
.lightbox-caption b {
    color: #fff;
}

.lightbox-caption a {
    color: #ff6f61;
}

.lightbox-content {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100dvh;
    object-fit: contain;
    transform-origin: center center;
    opacity: 0;
    transition: opacity 0.25s ease;
    cursor: zoom-in;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}

.lightbox.active .lightbox-content {
    opacity: 1;
}

.lightbox-content:active {
    cursor: grabbing;
}

.lightbox-content.is-zoomed {
    cursor: grab;
}

.lightbox-content.is-zoomed:active {
    cursor: grabbing;
}

.close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10002;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 8px 12px;
}

.close:hover {
    color: #bbb;
}

/* Flèches de navigation — masquées (swipe / scroll) */
.lightbox-nav {
    display: none !important;
}

@media (max-width: 768px) {
    .lightbox-stage {
        max-width: 100vw;
        max-height: 100dvh;
    }

    .lightbox-content {
        max-width: 100vw;
        max-height: 100dvh;
    }

    .lightbox-caption {
        padding: 2rem 1rem 0.95rem;
        font-size: 0.9rem;
    }

    .close {
        top: max(8px, env(safe-area-inset-top));
        right: max(8px, env(safe-area-inset-right));
        font-size: 34px;
    }
}
.gallery-item .twentytwenty-container {
    width: 100%;
    min-height: 280px;
}

.gallery-item .twentytwenty-container img {
    max-width: 100%;
    display: block;
}

@media (max-width: 768px) {
    main,
    .gallery-container {
        max-width: 100%;
        padding: 15px;
    }

    .gallery {
        gap: 15px;
    }

    .gallery-item {
        width: calc(50% - 10px);
    }

    .folder-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .gallery-item {
        width: 100%;
    }

    .folder-list {
        grid-template-columns: 1fr;
    }

    .folder-link {
        text-align: center;
    }
}