#popup-fullscreen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#popup-fullscreen.hidden { display: none; }

.popup-inner {
    background: #fff;
    width: 90vw;
    height: 85vh;
    max-width: 1100px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
}

#popup-content-html {
    display: flex;
    width: 100%;
    height: 100%;
}

/* --- Bouton Fermer (Adaptatif) --- */
#popup-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 110;
    background: transparent;
    border: none;
    color: #000;
    text-shadow: 0 0 5px #fff, 0 0 10px #fff;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 45px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

/* --- Éléments Internes --- */
.popup-img-wrapper {
    margin: 0;
    flex-shrink: 0;
    position: relative;
}

.popup-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-credit {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 5;
    color: #ffffff;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.4); /* Fond semi-transparent pour la lisibilité */
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none; /* Pour ne pas gêner le clic/touch */
}

.popup-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-height: 0;
}

.popup-text-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    line-height: 1.4;
}

.popup-info-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 25px;
    min-height: 0;
    background: white;
}

.popup-text-scroll::-webkit-scrollbar { width: 6px; }
.popup-text-scroll::-webkit-scrollbar-thumb { background: #000; border-radius: 10px; }

.popup-container-lien, #logo-info-container {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-link {
    background: black;
    color: white;
    text-align: center;
    padding: 12px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
}

.popup-logo { display: flex; gap: 15px; }
.popup-logo img { height: 25px; }

/* --- RESPONSIVE --- */

@media (orientation: landscape) {
    #popup-content-html { flex-direction: row; }

    .popup-img-wrapper {
        width: 35%;
    }
    .popup-text {
        width: 65%;
    }
}

@media (orientation: portrait) {

    #popup-content-html { flex-direction: column; }
    .popup-img-wrapper {
        height: 45% !important;
        width: 100%;
    }
    .popup-text { height: 75%; }

    .popup-text-scroll {
        margin-bottom: 30px; /* Plus d'espace avant le lien */
    }

    .photo-credit {
        font-size: 0.65rem; /* Un peu plus petit sur mobile */
        bottom: 5px;
        left: 5px;
    }
}