
/* ============================================================
   مودال صفحه
   ============================================================ */
.modal-back {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
    display: grid; place-items: center;
    padding: 18px;
    animation: mh-fade .2s ease-out;
}
.modal-back[hidden] { display: none; }

@keyframes mh-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mh-rise {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.modal-box {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .26);
    width: 100%; max-width: 440px;
    max-height: 88vh; overflow-y: auto;
    animation: mh-rise .26s cubic-bezier(.2, .8, .3, 1);
}
.modal-close {
    /* در RTL گوشهٔ «چپ» همان بالا-راست بصری است؛ دکمه نباید
       روی عنوان بیفتد. با فاصلهٔ بیشتر و در گوشهٔ مقابل متن. */
    position: absolute; top: 10px; right: 10px; z-index: 2;
    width: 32px; height: 32px; border-radius: 50%;
    border: none; cursor: pointer;
    background: rgba(255, 255, 255, .92);
    color: var(--ink-2); font-size: 21px; line-height: 1;
    display: grid; place-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    transition: .15s;
    font-family: inherit;
}
.modal-close:hover { background: #fff; color: var(--ink); }

.modal-img { line-height: 0; background: #f1f5fd; }
.modal-img img { width: 100%; height: auto; display: block; }

.modal-content { padding: 20px 22px 22px; }
.modal-content h2 {
    /* فضای دکمهٔ بستن در گوشهٔ راست — عنوان زیر آن نرود */
    margin: 0 40px 10px 0;
    font-size: 17px; font-weight: 800; line-height: 1.7;
}
.modal-body {
    font-size: 13.5px; line-height: 2; color: var(--ink-2);
}
.modal-body p { margin: 0 0 10px; }
.modal-body p:last-child { margin-bottom: 0; }

.modal-actions {
    display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px;
}
.modal-actions .btn { width: auto; flex: 1 1 120px; margin-top: 0; padding: 12px 18px; }
.modal-actions .btn.ghost {
    background: #fff; color: var(--ink-2); border: 1.5px solid var(--line);
    box-shadow: none;
}
.modal-actions .btn.ghost:hover { border-color: var(--blue); color: var(--blue); }

@media (max-width: 760px) {
    .modal-box { max-width: 100%; max-height: 92vh; }
    .modal-content { padding: 16px 18px 18px; }
    .modal-content h2 { font-size: 15.5px; }
}
