/* ==========================================================
   TDV Core Modal v1.0
========================================================== */

:root {
    --tdv-core-purple: #613194;
    --tdv-core-purple-dark: #4D267D;

    --tdv-core-text: #1A1A1A;
    --tdv-core-text-secondary: #757575;

    --tdv-core-border: #E5E5E5;
    --tdv-core-white: #FFFFFF;

    --tdv-core-overlay: rgba(0, 0, 0, 0.60);
    --tdv-core-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
    --tdv-core-transition: 0.18s ease;
}


/* Overlay */

#tdv-core-modal-overlay.tdv-core-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 30px;
    background: var(--tdv-core-overlay);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9999999;
    box-sizing: border-box;
}

#tdv-core-modal-overlay.tdv-core-modal-overlay.active {
    display: flex;
}


/* Container */

#tdv-core-modal.tdv-core-modal {
    width: 100%;
    max-width: 960px;
    max-height: calc(100vh - 120px);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    background: var(--tdv-core-white);
    border: 1px solid var(--tdv-core-border);
    border-radius: 0;
    box-shadow: var(--tdv-core-shadow);

    color: var(--tdv-core-text);
    font-family: "Montserrat", sans-serif;

    opacity: 0;
    transform: translateY(20px) scale(0.98);

    transition:
        opacity var(--tdv-core-transition),
        transform var(--tdv-core-transition);

    box-sizing: border-box;
}

#tdv-core-modal-overlay.active #tdv-core-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}


/* Header */

#tdv-core-modal .tdv-core-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;

    padding: 28px 32px;
    margin: 0;

    background: var(--tdv-core-white);
    border-bottom: 1px solid var(--tdv-core-border);

    box-sizing: border-box;
}

#tdv-core-modal .tdv-core-modal-header-left {
    flex: 1;
    min-width: 0;
}


/* Category / Kicker */

#tdv-core-modal .tdv-core-modal-category {
    margin: 0 0 6px;
    padding: 0;

    color: var(--tdv-core-purple);

    font-size: 12px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}


/* Main title */

#tdv-core-modal .tdv-core-modal-title {
    margin: 0;
    padding: 0;

    color: var(--tdv-core-purple);

    font-size: 20px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: 0;
}


/* Body */

#tdv-core-modal .tdv-core-modal-body {
    flex: 1;
    min-height: 0;

    padding: 32px;
    margin: 0;

    background: var(--tdv-core-white);
    color: var(--tdv-core-text);

    font-size: 13px;
    line-height: 1.55;
    font-weight: 400;

    overflow-y: auto;
    overflow-x: hidden;

    box-sizing: border-box;
}


/* Body typography */

#tdv-core-modal .tdv-core-modal-body h2 {
    margin: 0 0 16px;

    color: var(--tdv-core-text);

    font-size: 20px;
    line-height: 1.35;
    font-weight: 500;
}

#tdv-core-modal .tdv-core-modal-body h3,
#tdv-core-modal .tdv-core-modal-body h4 {
    margin: 0 0 12px;

    color: var(--tdv-core-text);

    font-size: 16px;
    line-height: 1.4;
    font-weight: 500;
}

#tdv-core-modal .tdv-core-modal-body p {
    margin: 0 0 16px;

    color: var(--tdv-core-text);

    font-size: 13px;
    line-height: 1.55;
    font-weight: 400;
}

#tdv-core-modal .tdv-core-modal-body p:last-child {
    margin-bottom: 0;
}

#tdv-core-modal .tdv-core-modal-body small,
#tdv-core-modal .tdv-core-modal-secondary {
    color: var(--tdv-core-text-secondary);

    font-size: 12px;
    line-height: 1.45;
    font-weight: 400;
}

#tdv-core-modal .tdv-core-modal-meta {
    color: var(--tdv-core-text-secondary);

    font-size: 10px;
    line-height: 1.4;
    font-weight: 400;
}


/* Footer */

#tdv-core-modal .tdv-core-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;

    padding: 20px 32px;
    margin: 0;

    background: var(--tdv-core-white);
    border-top: 1px solid var(--tdv-core-border);

    box-sizing: border-box;
}

#tdv-core-modal .tdv-core-modal-footer:empty {
    display: none;
}


/* Close button */

#tdv-core-modal button.tdv-core-modal-close {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;

    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;

    margin: 0 0 0 24px;
    padding: 0;

    border: 1px solid var(--tdv-core-border);
    border-radius: 50%;

    background: var(--tdv-core-white);
    color: var(--tdv-core-text);

    box-shadow: none;

    font-family: Arial, sans-serif;
    font-size: 24px;
    line-height: 1;
    font-weight: 400;

    text-indent: 0;
    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        background var(--tdv-core-transition),
        border-color var(--tdv-core-transition),
        color var(--tdv-core-transition);
}

#tdv-core-modal button.tdv-core-modal-close:hover {
    background: var(--tdv-core-purple);
    border-color: var(--tdv-core-purple);
    color: var(--tdv-core-white);
}

#tdv-core-modal button.tdv-core-modal-close:active {
    background: var(--tdv-core-purple-dark);
    border-color: var(--tdv-core-purple-dark);
    color: var(--tdv-core-white);
}

#tdv-core-modal button.tdv-core-modal-close:focus-visible {
    outline: 2px solid var(--tdv-core-purple);
    outline-offset: 3px;
}


/* Scrollbar */

#tdv-core-modal .tdv-core-modal-body::-webkit-scrollbar {
    width: 10px;
}

#tdv-core-modal .tdv-core-modal-body::-webkit-scrollbar-track {
    background: #F5F5F5;
}

#tdv-core-modal .tdv-core-modal-body::-webkit-scrollbar-thumb {
    background: #CCCCCC;
}

#tdv-core-modal .tdv-core-modal-body::-webkit-scrollbar-thumb:hover {
    background: #AAAAAA;
}


/* Tablet */

@media (max-width: 1024px) {

    #tdv-core-modal.tdv-core-modal {
        max-width: 90%;
    }

}


/* Mobile */

@media (max-width: 768px) {

    #tdv-core-modal-overlay.tdv-core-modal-overlay {
        padding: 20px;
    }

    #tdv-core-modal.tdv-core-modal {
        max-width: 100%;
        max-height: calc(100vh - 40px);
    }

    #tdv-core-modal .tdv-core-modal-header {
        padding: 24px;
    }

    #tdv-core-modal .tdv-core-modal-body {
        padding: 24px;
    }

    #tdv-core-modal .tdv-core-modal-footer {
        padding: 18px 24px;
    }

    #tdv-core-modal .tdv-core-modal-title {
        font-size: 20px;
    }

    #tdv-core-modal button.tdv-core-modal-close {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;

        font-size: 22px;
    }

}


/* Small mobile */

@media (max-width: 480px) {

    #tdv-core-modal-overlay.tdv-core-modal-overlay {
        padding: 12px;
    }

    #tdv-core-modal.tdv-core-modal {
        max-height: calc(100vh - 24px);
    }

    #tdv-core-modal .tdv-core-modal-header,
    #tdv-core-modal .tdv-core-modal-body {
        padding: 20px;
    }

    #tdv-core-modal .tdv-core-modal-footer {
        padding: 16px 20px;
    }

    #tdv-core-modal .tdv-core-modal-title {
        font-size: 22px;
    }

    #tdv-core-modal .tdv-core-modal-category {
        font-size: 11px;
        letter-spacing: 0.9px;
    }

}