/**
 * Styles pour les popups du widget Animals Archive
 */

/* Styles pour les éléments déclencheurs de popup */
[data-role="openpopup"] {
    cursor: pointer;
}

/* Style de base pour la popup */
.popup {
    position: fixed;
    bottom: 0;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    /* Aligne à droite */
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.3s ease;
}

/* Popup active */
.popup.shown {
    opacity: 1;
    pointer-events: auto;
}

/* Wrapper de la popup */
.popup-wrapper {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 40dvw;
    height: 100svh;
    margin: 0;
    margin-left: auto;
    /* Positionne à droite */
    z-index: 100;
}

/* Overlay de la popup */
.popup-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    cursor: default;
    z-index: 100;
}

/* Contenu de la popup */
.animal-popup {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: 100%;
    overflow-y: auto;
    border-radius: 0px 0px 0px 100px;
}

/* Bouton de fermeture */
.popup-close {
    position: absolute;
    top: 17px;
    right: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

/* Styles pour le contenu de la popup */
.popup-thumbnail {
    grid-row: 1;
    overflow: hidden;
    border-radius: 0px;
    height: 50dvh;
}

.popup-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0px !important;
}

.popup-infos {
    grid-row: 2;
    overflow-y: auto;
    padding: 100px;
    background-color: #FAF5ED;
    background-image: url('../animals-archive/bg-popup.svg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    text-align: left;
}

.popup-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1C4F5A;
}

.popup-description {
    margin-bottom: 25px;
    line-height: 1.6;
    color: #333;
}

.popup-btn-info {
    margin: 25px 0;
}

.animal-btn-info {
    display: inline-block;
    padding: 12px 25px;
    background-color: #1C4F5A;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.animal-btn-info:hover {
    background-color: #143942;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.popup-category {
    display: inline-block;
    padding: 5px 10px;
    background-color: rgba(147, 168, 35, 0.1);
    color: #93A823;
    font-size: 14px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.popup-tag {
    display: inline-block;
    padding: 4px 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
}

.popup-desc {
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Style pour bloquer le scroll du body quand la popup est ouverte */
html.popup-opened {
    overflow: hidden;
}

@media  (max-width: 1650px) {
    .popup-wrapper{
        width: 70dvw;
    }
    .popup-infos{
        padding: 50px;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    

    .animal-popup {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        overflow-y: auto;
    }

    .popup-thumbnail {
        grid-row: 1;
        max-height: 50dvh;
        overflow: hidden;
    }

    .popup-thumbnail img {
        object-position: center top;
    }

    .popup-infos {
        grid-row: 2;
        padding: 40px !important;
        max-height: none;
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    .popup-wrapper {
        width: calc(100vw - 60px);
        max-height: 100dvh;
    }


    .popup-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 22px;
    }

    .popup-title {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .popup-thumbnail {
        max-height: 50dvh;
    }
}

@media (max-width: 1500px) {
    .popup-infos{
        padding: 70px 130px 70px 70px;
    }
}