/* Modal de détail d'une réalisation (annuaire public) */

.realisation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    overflow-y: auto;
}

.realisation-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.realisation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10001;
}

.realisation-modal-container {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10002;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: realisationSlideUp 0.3s ease;
}

@keyframes realisationSlideUp {
    from { opacity: 0; transform: translateY(50px); }
    to   { opacity: 1; transform: translateY(0); }
}

.realisation-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background-color 0.2s ease;
}

.realisation-modal-close:hover {
    background: rgba(0, 0, 0, 0.75);
}

.realisation-modal-loading {
    padding: 4rem 2rem;
    text-align: center;
}

.realisation-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--cenc-orange);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: realisationSpin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes realisationSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.realisation-modal-error {
    padding: 3rem 2rem;
    text-align: center;
    color: #721c24;
}

/* Avantage adhérent : contenu réservé (remplace le detail pour un visiteur non adhérent) */
.realisation-modal-gate {
    padding: 3rem 2rem;
    text-align: center;
}

.realisation-modal-gate-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.realisation-modal-gate-title {
    margin: 0 0 1rem 0;
    color: var(--cenc-brown-dark);
    font-size: 1.4rem;
}

.realisation-modal-gate-text {
    max-width: 480px;
    margin: 0 auto 1rem;
    color: #555;
    line-height: 1.6;
}

.realisation-modal-gate-cta {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: var(--cenc-orange);
    color: white;
    border-radius: 24px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.realisation-modal-gate-cta:hover {
    background: var(--cenc-brown-dark);
    transform: translateY(-1px);
}

.realisation-modal-gate-note {
    max-width: 480px;
    margin: 1.75rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    color: #888;
    font-size: 0.85rem;
    line-height: 1.5;
}

.realisation-modal-gate-note a {
    color: var(--cenc-orange);
}

/* Photo principale + vignettes */
.realisation-modal-photo {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.realisation-modal-photo img {
    display: block;
    width: 100%;
    max-height: 55vh;
    object-fit: contain;
    background: #1a1a1a;
}

.realisation-modal-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    font-size: 3rem;
    background: var(--cenc-hemp);
}

.realisation-modal-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.6rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
    color: white;
    font-size: 0.85rem;
}

.realisation-modal-thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    background: #f8f9fa;
}

.realisation-modal-thumbs img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.2s ease, outline 0.2s ease;
    flex: 0 0 auto;
}

.realisation-modal-thumbs img:hover {
    opacity: 0.9;
}

.realisation-modal-thumbs img.active {
    opacity: 1;
    outline: 2px solid var(--cenc-orange);
    outline-offset: -2px;
}

/* Corps : titre, badges, description */
.realisation-modal-body {
    padding: 1.5rem 2rem 2rem;
}

.realisation-modal-title {
    margin: 0 0 0.75rem 0;
    color: var(--cenc-brown-dark);
    font-size: 1.5rem;
}

.realisation-modal-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.realisation-modal-fact {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    color: #444;
}

.realisation-modal-description {
    line-height: 1.7;
    color: #444;
    white-space: pre-line;
}

/* Responsive */
@media (max-width: 768px) {
    .realisation-modal-container {
        width: 96%;
        max-height: 95vh;
    }

    .realisation-modal-body {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .realisation-modal-photo img {
        max-height: 40vh;
    }
}
