/**
 * Global Member Directory — Modal styles.
 *
 * Loaded on relation pages and pages with relation/modal shortcodes.
 *
 * @package GlobalMemberDirectory
 */


/* =========================================================================
 * 1. OVERLAY
 * ====================================================================== */

.gmd-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
    animation: gmd-modal-fade-in .2s ease-out;
}

.gmd-modal-overlay[aria-hidden="false"],
.gmd-modal-overlay.is-open {
    display: flex;
}

@keyframes gmd-modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* =========================================================================
 * 2. DIALOG
 * ====================================================================== */

.gmd-modal {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    animation: gmd-modal-slide-in .22s ease-out;
}

@keyframes gmd-modal-slide-in {
    from {
        transform: translateY(-12px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.gmd-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, .05);
    border: 0;
    border-radius: 50%;
    color: #1d2327;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background .12s ease;
}

.gmd-modal-close:hover,
.gmd-modal-close:focus {
    background: rgba(0, 0, 0, .12);
    outline: none;
}

.gmd-modal-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}


/* =========================================================================
 * 3. BODY
 * ====================================================================== */

.gmd-modal-body {
    padding: 32px 28px 28px;
}

.gmd-modal-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.gmd-modal-loading .gmd-spinner {
    width: 20px;
    height: 20px;
    border-width: 3px;
    color: #1e3a8a;
}


/* =========================================================================
 * 4. CONTENT
 * ====================================================================== */

.gmd-modal__header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.gmd-modal__flags {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.gmd-modal__flags img {
    height: 32px;
    width: auto;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.gmd-modal__flags-arrow {
    color: #6b7280;
    font-size: 1.25rem;
}

.gmd-modal__title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1d2327;
    line-height: 1.25;
}

.gmd-modal__summary {
    font-size: 13.5px;
    color: #6b7280;
    margin: 0;
    line-height: 1.55;
}

.gmd-modal__section {
    margin-top: 20px;
}

.gmd-modal__section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: #1d2327;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.gmd-modal__choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 560px) {
    .gmd-modal__choices {
        grid-template-columns: 1fr;
    }
    .gmd-modal {
        max-height: 95vh;
    }
    .gmd-modal-body {
        padding: 24px 20px 20px;
    }
}

.gmd-modal__choice {
    display: block;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all .12s ease;
    background: #fff;
}

.gmd-modal__choice:hover,
.gmd-modal__choice:focus {
    border-color: #1e3a8a;
    box-shadow: 0 4px 12px rgba(30, 58, 138, .12);
    transform: translateY(-2px);
    outline: none;
}

.gmd-modal__choice-thumb {
    width: 100%;
    height: 100px;
    border-radius: 6px;
    background: #f6f7f7;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.gmd-modal__choice-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gmd-modal__choice-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(30, 58, 138, .1);
    color: #1e3a8a;
    margin-bottom: 8px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.gmd-modal__choice-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px;
    color: #1d2327;
    line-height: 1.3;
}

.gmd-modal__choice-excerpt {
    font-size: 12.5px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gmd-modal__empty {
    text-align: center;
    padding: 30px 20px;
    color: #6b7280;
    font-size: 14px;
}