/* ==========================================================================
   AHSOKA KNOP 
   ========================================================================== */
#ahsokacookie {
    width: 10rem;
    height: 20rem;
    display: flex;

    position: fixed;
    bottom: 2rem;
    right: 1rem;
    z-index: 50;

    /*butoon styling*/
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;

    &:hover,
    &:focus-visible {
        transform: scale(1.05);
    }

    @media(max-width:1000px) {
        width: 15rem;
        height: 15rem;
        right: .25rem;
        bottom: 2rem;
    }

    @media (max-width:500px) {
        width: 10rem;
        height: 10rem;
        right: -1rem;
        bottom: 7rem;
    }

    @media(prefers-reduced-motion: reduce) {
        animation: none;
    }

}

button#ahsokacookie:hover img,
button#ahsokacookie:focus-visible img {
    content: url(../images/ahsokacookie2.svg);

}

button#ahsokacookie:focus-visible {
    outline: 3px solid var(--starwars-yellow);
}

/* ==========================================================================
   COOKIE POPUP (DIALOG) 
   ========================================================================== */
dialog#cookiepopup[open] {
    display: flex;
    align-items: flex-start;
    justify-content: space-evenly;
    flex-direction: column;

    position: fixed;
    top: 15%;
    left: 35%;
    bottom: auto;

    width: min(90vw, 55rem);
    height: auto;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.2rem;
    border: none;
    border-radius: 2rem;
    background-color: var(--bg-color);
    color: var(--black-color);
    z-index: 40;

    /* Typografie binnen dialog */
    h2 {
        font-family: 'Deathstar';
        font-size: var(--h2);
        letter-spacing: .5rem;
    }

    p {
        font-family: 'Montserrat';
        font-size: var(--p);
    }

    @media(max-width:1000px) {
        top: 5%;
        left: 5%;
        bottom: 5%;
        max-height: 50vh;
        max-width: 90vw;
        width: 60rem;
        height: 70rem;
    }

    @media (max-width: 500px) {
        
        top: 3vh;
        left: 5vw;
        width: 90vw;
        
      
        max-height: 90vh;
        max-height: 90dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1.5rem 1.2rem;
        gap: 1rem;
        border-radius: 1.5rem;
        &::after {
            display: none;
        }
       
        h2 {
            font-size: 1.5rem;
            letter-spacing: 0.12rem;
            line-height: 1.2;
        }
        p {
            font-size: 0.95rem;
            line-height: 1.45;
        }
    }
}

dialog#cookiepopup[open]::after {
    content: '';
    position: absolute;
    bottom: -2.5rem;
    right: 4rem;

    border-width: 4rem 0rem 0rem 4rem;
    border-style: solid;
    border-color: var(--bg-color) transparent transparent transparent;
}

dialog#cookiepopup::backdrop {
    background-color: var(--gradient-black-overlay-bg);
}

dialog h2 {
    font-family: 'Deathstar';
    letter-spacing: .5rem;
}

dialog p {
    font-family: 'Montserrat';
}

dialog#cookiepopup details {
    width: 100%;
    margin: .4rem 0;
    font-family: 'Montserrat';

    summary {
        cursor: pointer;
        font-weight: 600;
        font-size: var(--p);
        color: var(--black-color);
        padding: .5rem 0;
        list-style: none;

        &::before {
            content: '▶';
            display: inline-block;
            margin-right: .5rem;
            transition: transform 0.2s ease;
            color: var(--black-color);
        }

        &:hover,
        &:focus-visible {
            text-decoration: underline;
            outline: none;
        }
    }

    &[open] summary::before {
        transform: rotate(90deg);
    }

    ul {
        background: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
        width: 100% !important;
        height: auto !important;
        border: none !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        margin: 0.5rem 0 0 0;
        padding: 0 0 0 1.2rem;
        list-style: disc;
        text-align: left;
    }

    li {
        grid-column: auto !important;
        grid-row: auto !important;
        font-family: 'Montserrat';
        font-size: 0.85rem;
        line-height: 1.5;
        color: var(--black-color);
        margin: 0;

        &::before {
            content: '—';
            position: absolute;
            left: 0;
            top: 0;
            color: var(--starwars-yellow);
            font-weight: bold;
        }
    }

    li a {
        font-size: 0.85rem !important;
        font-family: 'Montserrat';
        color: var(--black-color);
        text-decoration: underline;
        font-weight: 600;
        display: inline;

        &:hover,
        &:focus-visible {
            color: #ffffff;
            text-shadow: 0 0 5px var(--starwars-yellow);
        }
    }

    li a:last-of-type {
        display: block;
        margin-top: 0.2rem;
        font-size: 0.8rem !important;
        font-weight: 400;
        opacity: 0.85;
    }
}

dialog#cookiepopup>section {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em;

    @media(max-width:500px) {
        place-content: center;
        grid-template-columns: 1fr;
    }
}

dialog#cookiepopup>button,
#acceptbtn,
#declinebtn {
    background-color: var(--black-color);
    color: var(--starwars-yellow);
    width: 15rem;
    height: 3.5rem;

    position: relative;

    display: grid;
    place-items: center;
    border-radius: 2.5rem;

    font-family: 'Montserrat';
    font-weight: 600;
    font-size: var(--p);
    text-align: center;

    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    border: 2px solid transparent;

    @media(max-width:500px) {
        width: 100%;
        height: 3.5rem;
        display: grid;
        place-items: center;
        border-radius: 2.5rem;
        text-align: center;
    }

    @media (max-width:1000px) {
        width: 12.5rem;
        height: 4rem;
        display: grid;
        place-items: center;
        border-radius: 2.5rem;
        text-align: center;
    }

}

#acceptbtn:hover,
#declinebtn:hover {
    background-color: var(--starwars-yellow);
    color: var(--black-color);
    border: 2px solid var(--black-color);
}

#acceptbtn:focus-visible,
#declinebtn:focus-visible {
    outline: 3px solid var(--starwars-yellow);
    outline-offset: 3px;
}