:root {
    --site-modal-petrol: #123844;
    --site-modal-blue: #009de0;
    --site-modal-lime: #96c11f;
    --site-modal-yellow: #ffe500;
    --site-modal-white: #fff;
    --site-modal-text: #183945;
}

.site-modal[hidden] {
    display: none;
}

.site-modal {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 3rem);
}

.site-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(7 28 36 / 72%);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

.site-modal__dialog {
    position: relative;
    width: min(100%, 63rem);
    max-height: min(80vh, 48rem);
    overflow: auto;
    color: var(--site-modal-text);
    background: var(--site-modal-white);
    border-radius: 1.25rem 0 1.25rem 0;
    box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 28%);
    outline: none;
}

.site-modal__content {
    padding: clamp(2rem, 5vw, 4.5rem);
    padding-right: clamp(3.75rem, 7vw, 6rem);
}

.site-modal__title {
    margin: 0 0 1.25rem;
    color: var(--site-modal-blue);
    font: inherit;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    font-weight: 700;
    line-height: 1.15;
}

.site-modal__text {
    font-size: clamp(1rem, 1.3vw, 1.125rem);
    line-height: 1.65;
}

.site-modal__text > :first-child { margin-top: 0; }
.site-modal__text > :last-child { margin-bottom: 0; }

.site-modal__close {
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    padding: .75rem;
    place-items: center;
    border: 0;
    color: var(--site-modal-white);
    background: var(--site-modal-lime);
    cursor: pointer;
}

.site-modal__close svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: square;
    stroke-width: 2.6;
}

.site-modal__close:hover,
.site-modal__close:focus-visible {
    color: var(--site-modal-petrol);
    background: var(--site-modal-yellow);
}

.site-modal__close:focus-visible,
.site-modal__link:focus-visible,
.site-modal-trigger:focus-visible {
    outline: .2rem solid var(--site-modal-blue);
    outline-offset: .2rem;
}

.site-modal__link,
.site-modal-trigger {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1.5rem;
    padding: .9rem 1.25rem;
    border: 0;
    border-radius: .9rem 0 .9rem 0;
    color: var(--site-modal-petrol);
    background: var(--site-modal-yellow);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.site-modal__link:hover,
.site-modal-trigger:hover {
    background: var(--site-modal-lime);
}

body.site-modal-is-open {
    overflow: hidden;
}

@media (max-width: 40rem) {
    .site-modal {
        align-items: end;
        padding: .75rem;
    }

    .site-modal__dialog {
        max-height: 88vh;
        border-radius: 1rem 0 1rem 0;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .site-modal:not([hidden]) .site-modal__backdrop {
        animation: site-modal-fade-in 180ms ease-out;
    }

    .site-modal:not([hidden]) .site-modal__dialog {
        animation: site-modal-enter 220ms ease-out;
    }
}

@keyframes site-modal-fade-in {
    from { opacity: 0; }
}

@keyframes site-modal-enter {
    from { opacity: 0; transform: translateY(1rem) scale(.985); }
}
