.dialog-box {
    width: min(92vw, 62ch);
    height: fit-content;
    overflow-y: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 3.25em 1.309em 1.309em;
    border: 0;
    border-radius: 1em;
    background: #fff;
    box-sizing: border-box;
    box-shadow: 0 1.618em 5em rgba(0, 0, 0, 0.35);
    color: #2b2b2b;
    z-index: 99999;
}

.dialog-box::backdrop {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease-out;
}

.dialog-box.is-closing::backdrop {
    opacity: 0;
}

.excerpts h4 {
    font-size: 1em;
    font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
    .dialog-box::backdrop {
        transition: none;
    }
}

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

.dialog-image-trigger {
    display: inline-block !important;
    border-radius: 6px;
    cursor: pointer;
    transition: box-shadow 160ms ease, transform 160ms ease;
}

.dialog-image-trigger:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}

.dialog-image-trigger:focus-visible,
.dialog-close:focus-visible {
    outline: 3px solid rgba(0, 114, 188, 0.3);
    outline-offset: 3px;
}

.dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 1em;
    right: 1em;
    z-index: 1;
    width: 1.75em;
    height: 1.75em;
    min-height: 0;
    padding: 0;
    border-radius: 50%;
    background: #00a651;
    color: #fff;
    font-size: 1.4em;
    line-height: 1;
    transition: border-color 300ms ease, box-shadow 300ms ease, color 300ms ease, transform 300ms ease;
    border:none !important;
}

.dialog-close:hover {
    border-color: rgba(255, 255, 255, 0.95);
    color: #fff;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 1),
        inset 0 -12px 20px rgba(0, 114, 188, 0.12),
        0 12px 30px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}

.dialog-box img {
    display: block;
    width: 100%;
    height: auto;
    margin: 18px 0 0;
    border-radius: 6px;
    aspect-ratio:auto !important;
}

.dialog-box h2 {
    margin: 0 2.25em 0.618em 0;
    color: #222;
    font-size: 1.618em;
    line-height: 1.2;
}

.dialog-box p {
    margin: 0 0 1em;
    font-size: 1em;
    line-height: 1.5;
}

.dialog-box .carousel {
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

.dialog-box .carousel .scroll-x.scroll-snap {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto !important;
    overflow-y: hidden;
    scroll-snap-type: x mandatory !important;
    list-style: none;
}

.dialog-box .carousel .slide {
    display: block !important;
    float: none !important;
    width: 100%;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    scroll-snap-align: start !important;
}

.dialog-box .carousel figure {
    margin: 0;
}

.dialog-box .carousel img {
    margin-top: 0;
    aspect-ratio: auto !important;
}

.dialog-box .carousel .scroll-button {
    cursor: pointer;
}

.dialog-box .carousel figure img {
    height:auto !important;
}
