﻿/* Replaces ModalPopupExtender styling */
dialog.ceac-modal {
    border: none;
    padding: 0;
    margin: 20px auto auto; /* replaces Y="20", centered horizontally */
    max-height: calc(100vh - 40px);
    overflow: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); /* replaces DropShadow */
    background: transparent;
}

/* Safety net: .modal-content may set display:block, which would show the closed dialog */
dialog.ceac-modal:not([open]) {
    display: none;
}

/* Fallback only (browsers without <dialog> support) */
dialog.ceac-modal.ceac-modal--fallback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
}

/* Remove page-layout margins from the inner content box */
dialog.ceac-modal > div.modal-content,
dialog.ceac-modal > div.modal-content-wide {
    margin: 0;
}

/* Replaces Y="50" on ModalPopupExtender */
dialog.ceac-modal.ceac-modal-y50 {
    margin-top: 50px;
}

/* No scrollbar, same as the old ACT popups */
dialog.ceac-modal,
dialog.ceac-modal.ceac-modal-y50 {
    overflow: visible;
    max-height: none;
}

/* Scroll only when the dialog is taller than the window (class set by ceac-modal.js) */
dialog.ceac-modal.ceac-modal--scroll {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
dialog.ceac-modal.ceac-modal-y50.ceac-modal--scroll {
    max-height: calc(100vh - 70px);
}

/* Comment boxes can grow taller but not wider than the dialog */
dialog.ceac-modal textarea {
    resize: vertical;
}

/* Replaces Y="150" */
dialog.ceac-modal.ceac-modal-y150 {
    margin-top: 150px;
}
dialog.ceac-modal.ceac-modal-y150.ceac-modal--scroll {
    max-height: calc(100vh - 170px);
}