#kemendagModal {
    --home-modal-image-height: 78vh;
}

@supports (height: 1dvh) {
    #kemendagModal { --home-modal-image-height: 78dvh; }
}

#kemendagModal .modal-dialog {
    width: min(var(--home-modal-image-width, 460px), calc(var(--home-modal-image-height) * var(--home-modal-image-ratio, 1)));
    max-width: min(880px, calc(100% - 32px));
    min-width: min(132px, calc(100% - 32px));
    min-height: calc(100% - 32px);
    margin: 16px auto;
}

#kemendagModal .modal-dialog-centered::before {
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
}

#kemendagModal .modal-content {
    width: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: transparent;
}

#kemendagModal .home-modal-toolbar {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
}

#kemendagModal .home-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(23 38 60 / 82%);
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

#kemendagModal .home-modal-close:hover {
    background: rgb(23 38 60 / 94%);
}

#kemendagModal .home-modal-close:active {
    background: #17263c;
}

#kemendagModal .modal-body {
    padding: 0;
    border-radius: 0;
}

#kemendagModal .carousel,
#kemendagModal .carousel-inner {
    border-radius: 0;
}

#kemendagModal .carousel-item {
    text-align: center;
}

#kemendagModal .home-modal-link {
    display: block;
    cursor: pointer;
}

#kemendagModal .home-modal-image {
    display: block;
    width: 100%;
    height: auto;
    min-height: 56px;
    max-width: 100%;
    max-height: var(--home-modal-image-height);
    margin: 0 auto;
    object-fit: contain;
}

#kemendagModal .carousel-control-prev,
#kemendagModal .carousel-control-next {
    top: 50%;
    bottom: auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #17263c;
    opacity: 1;
    transform: translateY(-50%);
    cursor: pointer;
}

#kemendagModal .carousel-control-prev { left: 12px; }
#kemendagModal .carousel-control-next { right: 12px; }

#kemendagModal .carousel-control-prev:hover,
#kemendagModal .carousel-control-next:hover {
    background: #00439c;
}

#kemendagModal .carousel-control-prev:active,
#kemendagModal .carousel-control-next:active {
    background: #001845;
}

#kemendagModal button:focus-visible,
#kemendagModal .home-modal-link:focus-visible {
    outline: 3px solid #00439c;
    outline-offset: -3px;
}

#kemendagModal .home-modal-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -3px;
    box-shadow: inset 0 0 0 6px #17263c;
}

@media (max-width: 767.98px), (hover: none) and (max-width: 991.98px) {
    #kemendagModal {
        --home-modal-image-height: 58vh;
    }

    @supports (height: 1dvh) {
        #kemendagModal { --home-modal-image-height: 58dvh; }
    }

    #kemendagModal .modal-dialog {
        max-width: min(320px, 84%);
    }
}

@media (prefers-reduced-motion: reduce) {
    #kemendagModal.fade,
    #kemendagModal .modal-dialog,
    #kemendagModal .carousel-item {
        transition: none;
    }
}
