.sergo-modal-content {
    position: relative;
    margin: 40px auto; /* отступ сверху и снизу */
    top: 50%;
    transform: translateY(-50%);
    max-width: 900px;
    width: 90%; /* адаптивная ширина на мобильных */
    padding: 20px 25px; /* внутренние отступы */
    max-height: 65vh;
    overflow-y: auto;
    animation: slideUp 0.4s forwards;
    box-sizing: border-box;
}

.sergo-modal-content h2.modal-title {
    margin: 0 0 15px 0;
    line-height: 1.3; /* расстояние между строк заголовка */
    word-break: break-word; /* перенос длинных слов */
}

.sergo-modal-content .modal-body {
    line-height: 1.5;
}

/* На очень маленьких экранах */
@media screen and (max-width: 480px) {
    .sergo-modal-content {
        padding: 15px 15px;
        width: 95%;
        margin: 20px auto;
    }
}

.sergo-modal-content::-webkit-scrollbar {
    width: 25px; /* ширина полосы */
}


.sergo-posts-list a {
    text-decoration: none;
    color: inherit;
}

.sergo-modal .modal-body img {
    max-width: 100%;
    height: auto;
}

.sergo-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0,0,0,0.6);
    animation: fadeIn 0.4s;
}

.sergo-modal-content {
    position: relative;
    margin: auto;
    top: 50%;
    transform: translateY(-50%);
    max-width: 800px;
    padding: 20px;
    max-height: 75vh;
    overflow-y: auto;
    animation: slideUp 0.4s forwards;
}

.sergo-close {
    position: sticky;
    top: 0;
    right: 0;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    display: inline-block;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    padding: 2px 8px;
    z-index: 9999999;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(-50%); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-50%); opacity: 1; }
    to   { transform: translateY(100%); opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
