.modal {
    margin: auto;
    background-color: var(--background-color);
    overflow: hidden;
    border: none;
    outline: none;
}

.modal::backdrop {
    background-color: rgb(0, 0, 0, .75);
}

.modal > .controls {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 5rem;
}

.modal > .controls,
.modal .close {
    position: fixed;
}

.modal > .controls span,
.modal .close {
    width: 3rem;
    height: 3rem;
    padding: .3rem;
    color: white;
    cursor: pointer;
}

.modal > .controls {
    bottom: 50%;
    inset-inline: 1rem;
}

.modal .close {
    top: 1rem;
    right: 1rem;
}

.modal .prev:hover,
.modal .next:hover,
.modal .close:hover {
    background-color: var(--logo-blue-color);
}

.modal img {
    padding: .5rem;
    padding-bottom: 1.5rem;
    filter: drop-shadow(0 .5em 1em rgb(0, 0, 0, .3));
}

.modal article {
    min-height: 5rem;
    max-height: 5rem;
    padding: .5rem 1rem;
    position: absolute;
    inset-block: auto 0;
    inset-inline: 2rem;
    overflow: hidden;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    transition: max-height .5s;
}

.modal article:hover {
    max-height: 100vh; /* value must be bigger than what needed */
}

.modal[light] article {
    color: var(--text-color);
}

.modal[dark] article {
    color: var(--background-color);
}

.modal article .title h2 {
    margin-bottom: 0;
}
.modal article .title h3 {
    margin-top: 0;
    font-weight: normal;
}

body:has(dialog[open]) {
    overflow: hidden;
}
