/* 일반 모달 전용 규격. 1.5초 결과 알림에는 storyro-modal을 붙이지 않는다. */
.storyro-modal {
    --storyro-modal-space: 1.5rem;
    --bs-modal-bg: var(--bs-body-bg);
    --bs-modal-border-width: 0;
    --bs-modal-border-radius: 1rem;
    --bs-modal-header-border-width: 0;
    --bs-modal-footer-border-width: 0;
}

.storyro-modal .modal-content {
    box-shadow: var(--bs-box-shadow);
    overflow: hidden;
}

.storyro-modal .modal-sm {
    --bs-modal-width: 26rem;
}

/* form이 content 바로 아래에 있어도 본문만 스크롤되게 한다. */
.storyro-modal .modal-content > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.storyro-modal .modal-header {
    position: relative;
    justify-content: flex-start;
    flex-shrink: 0;
    padding: var(--storyro-modal-space) var(--storyro-modal-space) 0.75rem;
    border: 0;
    background: transparent;
    color: var(--bs-body-color);
}

.storyro-modal .modal-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding-inline-end: 2.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: start;
    overflow-wrap: anywhere;
}

.storyro-modal .modal-header > .btn-close {
    position: absolute;
    inset-inline-end: var(--storyro-modal-space);
    margin: 0;
}

.storyro-modal .modal-body {
    min-height: 0;
    padding: 0.75rem var(--storyro-modal-space);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.storyro-modal .form-label {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.storyro-modal :is(.form-control, .form-select):not(textarea) {
    min-height: 2.5rem;
    font-size: 1rem;
}

.storyro-modal .form-control[readonly] {
    background-color: var(--bs-tertiary-bg);
}

.storyro-modal .modal-footer {
    flex-shrink: 0;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem var(--storyro-modal-space) var(--storyro-modal-space);
    border: 0;
}

.storyro-modal .modal-footer > * {
    margin: 0;
}

.storyro-modal .storyro-modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 100%;
    margin-inline-start: auto;
}

.storyro-modal .storyro-modal-action {
    display: flex;
}

@media (max-width: 575.98px) {
    .storyro-modal {
        --storyro-modal-space: 1rem;
        margin: 0;
    }

    .storyro-modal .modal-dialog {
        margin: 0.5rem;
        height: calc(100% - 1rem);
        height: calc(100dvh - 1rem);
        min-height: 0;
    }
}
