/* ═══════════════════════════════════════════════════════════════
   MD WELCOME POPUP  —  md-popup.css
   Save to: public/website/assets/css/md-popup.css
   Link in style.blade.php:
       <link rel="stylesheet" href="{{ asset('/') }}website/assets/css/md-popup.css">
═══════════════════════════════════════════════════════════════ */

/* ── Overlay ──────────────────────────────────────────────── */
.md-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(10, 16, 36, 0.70);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    animation: mdOverlayIn 0.3s ease 0.3s forwards;
}

.md-popup-overlay.md-popup-hiding {
    animation: mdOverlayOut 0.25s ease forwards;
}

@keyframes mdOverlayIn  { to   { opacity: 1; } }
@keyframes mdOverlayOut { from { opacity: 1; } to { opacity: 0; } }

.md-popup-overlay[hidden] { display: none !important; }

/* ── Box ──────────────────────────────────────────────────── */
.md-popup-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 420px;

    /* KEY: limits height and makes bio scrollable */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    text-align: center;
    box-shadow: 0 24px 64px rgba(10, 16, 36, 0.28), 0 0 0 1px rgba(10,16,36,0.06);
    transform: translateY(24px);
    animation: mdBoxIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

@keyframes mdBoxIn {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Gold corner accents ──────────────────────────────────── */
.md-popup-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: var(--gold, #C9A84C);
    border-style: solid;
    flex-shrink: 0;
}
.md-popup-corner.tl { top: 10px;    left: 10px;   border-width: 2px 0 0 2px; border-radius: 3px 0 0 0; }
.md-popup-corner.tr { top: 10px;    right: 10px;  border-width: 2px 2px 0 0; border-radius: 0 3px 0 0; }
.md-popup-corner.bl { bottom: 10px; left: 10px;   border-width: 0 0 2px 2px; border-radius: 0 0 0 3px; }
.md-popup-corner.br { bottom: 10px; right: 10px;  border-width: 0 2px 2px 0; border-radius: 0 0 3px 0; }

/* ── Close button ─────────────────────────────────────────── */
.md-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.12);
    background: transparent;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.18s, color 0.18s;
    z-index: 2;
}
.md-popup-close:hover { background: var(--crimson, #C0392B); color: #fff; border-color: transparent; }

/* ── Eyebrow ──────────────────────────────────────────────── */
.md-popup-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold, #C9A84C);
    margin-bottom: 16px;
    flex-shrink: 0;
}
.md-popup-eyebrow-line {
    flex: 1;
    height: 1px;
    max-width: 44px;
    background: linear-gradient(90deg, transparent, var(--gold, #C9A84C));
}
.md-popup-eyebrow-line:last-child {
    background: linear-gradient(270deg, transparent, var(--gold, #C9A84C));
}

/* ── Avatar ───────────────────────────────────────────────── */
.md-popup-avatar-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 14px;
    flex-shrink: 0;
}
.md-popup-avatar-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--gold, #C9A84C);
    opacity: 0.5;
}
.md-popup-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--navy, #1B2A4A);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 6px 20px rgba(10,16,36,0.18);
}
.md-popup-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.md-popup-avatar-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--crimson, #C0392B);
    color: #fff;
    font-family: 'Cinzel', serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 2px 6px;
    border-radius: 20px;
    border: 2px solid #fff;
}

/* ── Name & Role ──────────────────────────────────────────── */
.md-popup-name {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--navy, #1B2A4A);
    letter-spacing: 0.03em;
    line-height: 1.2;
    flex-shrink: 0;
}
.md-popup-role {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--crimson, #C0392B);
    margin-top: 4px;
    flex-shrink: 0;
}

/* ── Divider ──────────────────────────────────────────────── */
.md-popup-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0 10px;
    gap: 8px;
    color: var(--gold, #C9A84C);
    font-size: 9px;
    opacity: 0.6;
    flex-shrink: 0;
}
.md-popup-divider::before,
.md-popup-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-cream, #e8e2d4);
    max-width: 70px;
}

/* ── Bio — scrollable area ────────────────────────────────── */
.md-popup-bio {
    font-family: 'Lora', serif;
    font-size: 13px;
    font-style: italic;
    color: var(--text-muted, #6b7280);
    line-height: 1.7;
    text-align: center;
    padding: 0 4px;

    /* Scrollable when content is long */
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;

    /* Fade edges to hint scrollability */
    mask-image: linear-gradient(to bottom, transparent 0%, black 12px, black calc(100% - 12px), transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12px, black calc(100% - 12px), transparent 100%);

    scrollbar-width: thin;
    scrollbar-color: var(--border-cream, #e8e2d4) transparent;
}
.md-popup-bio::-webkit-scrollbar { width: 4px; }
.md-popup-bio::-webkit-scrollbar-track { background: transparent; }
.md-popup-bio::-webkit-scrollbar-thumb { background: var(--border-cream, #e8e2d4); border-radius: 2px; }

/* Strip extra margin from p tags inside bio */
.md-popup-bio p { margin: 0 0 8px; }
.md-popup-bio p:last-child { margin-bottom: 0; }
.md-popup-bio br { display: none; } /* hide stray <br> tags */

/* ── Actions ──────────────────────────────────────────────── */
.md-popup-actions {
    flex-shrink: 0;
    margin-top: 16px;
}

.md-popup-cta {
    display: block;
    width: 100%;
    padding: 11px 24px;
    background: var(--navy, #1B2A4A);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.md-popup-cta:hover {
    background: var(--crimson, #C0392B);
    transform: translateY(-1px);
}

.md-popup-skip {
    margin: 10px 0 0;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
}
.md-popup-skip:hover { color: var(--navy, #1B2A4A); }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .md-popup-box {
        padding: 32px 20px 22px;
        max-height: 92vh;
        border-radius: 10px;
    }
    .md-popup-avatar-wrap { width: 76px; height: 76px; }
    .md-popup-avatar { width: 76px; height: 76px; font-size: 30px; }
    .md-popup-name { font-size: 16px; }
    .md-popup-bio { font-size: 12px; }
}