/* === GALERIE PASTORALE === */

/* Section galerie */
.pastoral-gallery-section {
    padding: 60px 0 100px;
    min-height: 60vh;
}

/* État vide */
.empty-gallery {
    text-align: center;
    padding: 80px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.empty-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
}

.empty-info {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    text-align: left;
}

.empty-info p {
    margin: 10px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.empty-info code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--accent-primary);
}

/* Introduction */
.gallery-intro {
    text-align: center;
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Grille des galeries */
.pastoral-galleries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

@media (max-width: 768px) {
    .pastoral-galleries-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Carte galerie */
.gallery-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
}

.gallery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.gallery-card:hover::before {
    opacity: 0.05;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px var(--shadow-color);
    border-color: var(--accent-primary);
}

/* Image de la carte */
.gallery-card-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-card:hover .gallery-card-image img {
    transform: scale(1.1);
}

/* Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
}

.gallery-icon {
    font-size: 1.5rem;
}

.gallery-count {
    font-size: 1rem;
}

/* Contenu de la carte */
.gallery-card-content {
    padding: 25px;
    position: relative;
    z-index: 1;
}

.gallery-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

/* Bouton voir */
.gallery-view-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.gallery-view-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.4s ease;
}

.gallery-view-btn:hover::before {
    left: 100%;
}

.gallery-view-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.gallery-view-btn .arrow {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.gallery-view-btn:hover .arrow {
    transform: translateX(5px);
}

/* === MODAL GALERIE MODERNE === */

/* Overlay du modal avec backdrop */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 99999999 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-modal.active {
    display: flex;
    opacity: 1;
}

/* Contenu principal du modal */
.gallery-modal-content {
    position: relative;
    width: 95%;
    max-width: 1300px;
    max-height: 92vh;
    background: var(--card-bg);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    padding: 35px;
    box-sizing: border-box;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.6),
        0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gallery-modal.active .gallery-modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Bouton fermer moderne */
.gallery-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.gallery-modal-close:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: rotate(90deg);
}

/* Titre du modal élégant */
.gallery-modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin: 0 0 30px 0;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.15);
    letter-spacing: -0.5px;
}

/* Container du slider */
.gallery-slider {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 25px;
    min-height: 550px;
    max-height: 700px;
}

/* Zone d'affichage de l'image */
.gallery-slider-container {
    flex: 1;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.02), rgba(139, 92, 246, 0.02));
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(139, 92, 246, 0.08);
}

.gallery-slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
    height: 100%;
}

.gallery-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 25px;
}

.gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.25),
        0 5px 15px rgba(139, 92, 246, 0.1);
    transition: transform 0.3s ease;
}

.gallery-slide img:hover {
    transform: scale(1.02);
}

/* Boutons de navigation modernes */
.gallery-slider-btn,
.gallery-slider-prev,
.gallery-slider-next {
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-slider-btn svg,
.gallery-slider-prev svg,
.gallery-slider-next svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.5;
}

.gallery-slider-btn:hover,
.gallery-slider-prev:hover,
.gallery-slider-next:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: scale(1.08);
    box-shadow:
        0 6px 20px rgba(139, 92, 246, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

.gallery-slider-btn:disabled,
.gallery-slider-prev:disabled,
.gallery-slider-next:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

/* Compteur élégant */
.gallery-counter {
    text-align: center;
    padding: 18px 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Container des thumbnails */
.gallery-thumbnails-container {
    margin-top: 25px;
    padding: 22px 0 0 0;
    border-top: 1px solid rgba(139, 92, 246, 0.12);
}

.gallery-thumbnails {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) rgba(139, 92, 246, 0.08);
    justify-content: center;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 7px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.05);
    border-radius: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Thumbnails modernes */
.gallery-thumbnail {
    width: 85px;
    height: 85px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(139, 92, 246, 0.15);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    opacity: 0.6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    position: relative;
}

.gallery-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-thumbnail:hover::after {
    opacity: 1;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-thumbnail:hover {
    border-color: var(--accent-primary);
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.25);
}

.gallery-thumbnail:hover img {
    transform: scale(1.12);
}

.gallery-thumbnail.active {
    border-color: var(--accent-primary);
    border-width: 3px;
    opacity: 1;
    box-shadow:
        0 8px 20px rgba(139, 92, 246, 0.3),
        0 0 0 1px rgba(139, 92, 246, 0.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-modal-content {
        width: 92%;
        padding: 30px;
    }

    .gallery-slider {
        min-height: 480px;
        max-height: 580px;
    }
}

@media (max-width: 768px) {
    .gallery-modal {
        padding: 1.5rem;
    }

    .gallery-modal-content {
        width: 96%;
        padding: 25px;
        border-radius: 16px;
    }

    .gallery-modal-close {
        width: 40px;
        height: 40px;
        top: 1rem;
        right: 1rem;
        font-size: 1.3rem;
    }

    .gallery-modal-title {
        font-size: 1.6rem;
        margin-bottom: 25px;
        padding-bottom: 16px;
    }

    /* Layout mobile : image en haut, boutons en dessous */
    .gallery-slider {
        flex-direction: column;
        gap: 20px;
        min-height: auto;
        max-height: none;
    }

    .gallery-slider-container {
        width: 100%;
        min-height: 400px;
        max-height: 500px;
        order: 1;
    }

    .gallery-slider-prev {
        order: 2;
        width: 50px;
        height: 50px;
    }

    .gallery-slider-next {
        order: 3;
        width: 50px;
        height: 50px;
    }

    /* Créer un layout pour les boutons côte à côte */
    .gallery-slider {
        display: grid;
        grid-template-columns: 1fr auto auto 1fr;
        grid-template-rows: auto auto;
        gap: 15px;
        align-items: center;
    }

    .gallery-slider-container {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .gallery-slider-prev {
        grid-column: 2;
        grid-row: 2;
        margin-right: 10px;
    }

    .gallery-slider-next {
        grid-column: 3;
        grid-row: 2;
        margin-left: 10px;
    }

    .gallery-slider-prev svg,
    .gallery-slider-next svg {
        width: 22px;
        height: 22px;
    }

    .gallery-slide {
        padding: 15px;
    }

    .gallery-counter {
        padding: 12px 0;
        font-size: 0.95rem;
    }

    .gallery-thumbnails-container {
        margin-top: 20px;
        padding-top: 18px;
    }

    .gallery-thumbnails {
        gap: 12px;
        padding: 10px 0;
    }

    .gallery-thumbnail {
        width: 70px;
        height: 70px;
        border-radius: 8px;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-description {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-modal {
        padding: 1rem;
    }

    .gallery-modal-content {
        padding: 20px;
    }

    .gallery-modal-close {
        width: 36px;
        height: 36px;
    }

    .gallery-modal-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    .gallery-slider {
        gap: 12px;
    }

    .gallery-slider-container {
        min-height: 350px;
        max-height: 450px;
    }

    .gallery-slider-prev,
    .gallery-slider-next {
        width: 48px;
        height: 48px;
    }

    .gallery-slider-prev svg,
    .gallery-slider-next svg {
        width: 20px;
        height: 20px;
    }

    .gallery-slide {
        padding: 10px;
    }

    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }
}
