#news-popup-content-text {
    color: #2D2D2D;
    margin: 0;
    font-family: 'GaretWebBook';
    font-size: 16px;
    line-height: 125%;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

#news-popup-content-text h2 {
    color: rgb(45, 45, 45);
    font-family: GaretWebBook;
    margin: 22px 0;
    font-size: 24px;
}

#news-popup-content-text h3 {
    color: rgb(45, 45, 45);
    font-family: GaretWebBook;
    margin: 22px 0;
    font-size: 20px;
}

.news-section .news-grid {
    width: 100%;
}

.news-section .news-grid-row {
    display: flex;
    width: 100%;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    cursor: pointer;
    height: 120px;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

.news-section .news-grid-row:hover {
    background-color: #30473C !important;
    color: #fff;
}

.news-section .news-grid-row:hover .news-grid-date, .news-section .news-grid-row:hover .news-grid-action {
    color: #fff;
}

.news-section .news-grid-row:hover .news-grid-link {
    color: #fff;
}

.news-section .news-grid-col {
    padding: 0 15px;
    box-sizing: border-box;
}

.news-section .news-grid-date {
    width: 25%;
    text-align: left;
    font-family: 'GaretWebBook';
    font-size: 24px;
    line-height: 125%;
    color: #796A5F;
    padding-left: 75px;
}

.news-section .news-grid-title {
    font-size: 24px;
    line-height: 100%;
    color: #2D2D2D;
    display: flex;
    align-items: center;
    font-family: 'GaretWebBook';
    margin: 0;
    width: 50%;
}

.news-section .news-grid-title .ellipse {
    width: 16px;
    height: 16px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
}

.news-section .news-grid-action {
    width: 25%;
    text-align: right;
    font-family: 'GaretWebBook';
    font-size: 20px;
    line-height: 100%;
    text-decoration: none;
    color: #796A5F;
    padding-right: 75px;
}

.news-section span.news-grid-event {
    position: relative;
    border-bottom: none;
}

.news-section span.news-grid-event::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #796A5F;
}

.news-section .news-grid-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
    font-family: "Comfortaa";
    font-size: 40px;
    line-height: 100%;
}

.news-section .news-grid-header {
    margin-bottom: 30px;
    display: flex;
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.news-section .news-grid-title-head {
    font-size: 24px;
    line-height: 100%;
    color: #2D2D2D;
    display: flex;
    align-items: center;
    font-family: 'GaretWebBook';
    margin: 0;
    padding-right: 75px;
}

.news-section .news-grid-title-head .allnews {
    text-align: right;
    font-family: 'GaretWebBook';
    font-size: 20px;
    line-height: 100%;
    text-decoration: none;
    color: #796A5F;
    border-bottom: 1px solid #796A5F;
}
    
.news-section .allnews.mobile {
    display: none;
}

.news-section .news-grid-title-head .allnews:hover {
    color: #BA5A42;
    border-bottom: 1px solid #BA5A42;
}

.news-section .news-grid-title h2 {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.news-section .ellipse {
    width: 16px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 6px;
}

.news-section .news-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.news-section .news-popup.active {
    opacity: 1;
    visibility: visible;
}

.news-section .news-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    touch-action: none; /* Разрешаем обработку touch-событий */
}

.news-section .news-popup-content {
    position: relative;
    background: white;
    width: 80%;
    max-width: 900px;
    max-height: 85vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.news-section .news-popup.active .news-popup-content {
    transform: scale(1);
}

.news-section .news-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: #30473C;
    color: white;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.news-section .news-popup-close:hover {
    background: #BA5A42;
}

.news-section .news-popup-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-bottom: 2px solid #30473C;
}

.news-section .news-popup-title {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: #30473C;
    line-height: 1.3;
}

.news-section .news-popup-image-container {
    display: none;
    padding: 0 30px;
    margin: 0 0 20px 0;
}

.news-section .news-popup-preview-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.news-section .news-popup-body {
    padding: 30px 30px;
    overflow-y: auto;
    flex: 1;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    overscroll-behavior: contain; /* Предотвращает скролл body при достижении границ */
}

.news-section .video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 50%;
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
}

.news-section .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Стили для скроллбара в попапе */
.news-section .news-popup-body::-webkit-scrollbar {
    width: 4px;
}

.news-section .news-popup-body::-webkit-scrollbar-thumb {
    background: #30473C;
    border-radius: 2px;
}

.news-section .news-popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.news-section .news-popup-body iframe {
    width: 100%;
    height: auto;
    min-height: 400px;
    border: none;
    border-radius: 8px;
    margin: 0;
}

.news-section .news-popup-body img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 6px;
}

.news-section .news-popup-body p {
    margin-bottom: 16px;
}

.news-section .news-popup-body h1,
.news-section .news-popup-body h2,
.news-section .news-popup-body h3,
.news-section .news-popup-body h4,
.news-section .news-popup-body h5,
.news-section .news-popup-body h6 {
    color: #30473C;
    margin: 24px 0 16px 0;
}

.news-section .news-popup-body ul,
.news-section .news-popup-body ol {
    margin: 16px 0;
    padding-left: 24px;
}

.news-section .news-popup-body li {
    margin-bottom: 8px;
}

.news-section .news-popup-body blockquote {
    border-left: 4px solid #BA5A42;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #666;
}

@media (max-width: 1024px) {
    .news-section .news-grid-date {
        width: 30%;
    }
    
    .news-section .news-grid-title {
        width: 40%;
    }
    
    .news-section .news-grid-action {
        width: 30%;
    }
    
    .news-section .news-grid-col {
        padding: 0 10px;
    }
    
    .news-section .news-popup-content {
        width: 85%;
        max-height: 80vh;
    }
    
    .news-section .news-popup-body iframe {
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .news-section .news-grid-title-head {
        font-size: 16px;
        line-height: 125%;
        height: 17px;
        font-family: 'GaretWebBook';
    }
    
    .news-section .news-grid-title-head .allnews {
        display: none;
    }
    
    .news-section .allnews.mobile {
        display: block;
        color: #796A5F;
        font-size: 14px;
        line-height: 100%;
        text-align: center;
        width: 100%;
        margin-top: 20px;
        text-decoration: underline;
    }
    
    .news-section .video-container {
        margin: 0;
    }
    
    .news-section .news-grid-link {
        font-size: 16px;
        line-height: 125%;
    }
    
    .news-section .news-grid-row {
        flex-direction: column;
        padding: 20px 0;
        border-bottom: 2px solid #D8C6B2;
    }
    
    .news-section .news-grid-col {
        width: 100% !important;
        padding: 8px 0;
        display: flex;
        align-items: center;
    }
    
    .news-section .news-grid-date,
    .news-section .news-grid-action {
        text-align: left;
    }
    
    .news-section .news-grid-mobile-label {
        display: inline-block;
        min-width: 80px;
    }
    
    .news-section .news-grid-header {
        margin-bottom: 20px;
    }
    
    .news-section .news-grid-title h2 {
        font-size: 20px;
    }
    
    /* Ключевые исправления для мобильного попапа */
    .news-section .news-popup-content {
        width: 95% !important;
        max-height: 90vh !important;
        margin: 20px auto !important;
        height: auto;
    }
    
    .news-section .news-popup-header {
        padding: 20px 20px 15px !important;
    }
    
    .news-section .news-popup-title {
        font-size: 20px !important;
    }
    
    .news-section .news-popup-image-container {
        padding: 0 20px;
        margin: 0 0 15px 0;
    }
    
    .news-section .news-popup-preview-image {
        max-height: 300px;
    }
    
    .news-section .news-popup-body {
        padding: 20px !important;
        font-size: 14px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important; /* Плавный скролл на iOS */
        max-height: calc(90vh - 150px) !important;
    }
    
    .news-section .news-popup-close {
        width: 35px;
        height: 35px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }
    
    .news-section .news-popup-body iframe {
        min-height: 300px;
    }
    
    .news-section .video-container {
        padding-bottom: 56.25% !important;
    }
}

@media (max-width: 480px) {
    .news-section .news-grid-container {
        padding: 0;
    }
    
    .news-section .news-grid-col {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .news-section .news-grid-mobile-label {
        min-width: 60px;
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .news-section .news-grid-row {
        font-size: 14px;
        height: 121px;
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        position: relative;
        line-height: 125%;
        border-bottom: 2px solid #D8C6B2;
    }
    
    .news-section .news-grid-row:first-child {
        border-top: 2px solid #D8C6B2;
    }
    
    .news-section .news-grid-title h2 {
        font-size: 18px;
    }
    
    .news-section .news-popup-content {
        width: 95% !important;
        max-height: 85vh !important;
        margin: 10px auto !important;
        border-radius: 8px;
    }
    
    .news-section .news-popup-header {
        padding: 15px 15px 10px !important;
    }
    
    .news-section .news-popup-title {
        font-size: 18px !important;
    }
    
    .news-section .news-popup-image-container {
        padding: 0 15px;
        margin: 0 0 10px 0;
    }
    
    .news-section .news-popup-preview-image {
        max-height: 200px;
    }
    
    .news-section .news-popup-body {
        padding: 15px 15px !important;
        font-size: 14px !important;
        max-height: calc(85vh - 120px) !important;
    }
    
    .news-section .news-popup-body iframe {
        min-height: 250px;
    }
}

/* Ховер эффекты для тач-устройств */
@media (hover: none) {
    .news-section .news-grid-row:hover {
        background-color: transparent !important;
        color: #2D2D2D;
    }
    
    .news-section .news-grid-row:hover .news-grid-link {
        color: #2D2D2D;
    }
    
    .news-section .news-grid-row:active {
        background-color: #D8C6B2 !important;
        color: #2D2D2D;
    }
    
    .news-section .news-grid-row:active .news-grid-link {
        color: #2D2D2D;
    }
}

.news-section .news-empty {
    text-align: center;
    padding: 40px 20px;
    color: #2D2D2D;
}

.news-section .news-empty p {
    margin: 10px 0;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .news-section .news-grid-row {
        height: 105px !important;
        padding: 15px 0px !important;
        position: relative;
        border-bottom: 2px solid #D8C6B2 !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
    }
    
    /* Скрываем десктопные элементы */
    .news-section .news-grid-col {
        display: none !important;
    }
    
    /* Показываем мобильные элементы */
    .news-section .news-grid-mobile {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        height: 100%;
        position: relative;
    }
    
    .news-section .news-grid-mobile-title {
        font-family: GaretWebBook;
        font-size: 16px;
        line-height: 125%;
        color: #2D2D2D;
        margin-bottom: 8px;
        font-weight: 600;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 40px;
    }
    
    .news-section .news-grid-mobile-date {
        font-family: 'GaretWebBook';
        font-size: 14px;
        color: #796A5F;
        margin-bottom: 8px;
        line-height: 125%;
        position: absolute;
        bottom: -5px;
        left: 0;
    }
    
    .news-section .news-grid-mobile-action {
        position: absolute;
        bottom: -5px;
        right: 0;
        font-family: 'GaretWebBook';
        font-size: 14px;
        color: #796A5F;
        text-decoration: none;
        margin-bottom: 11px;
    }
    
    .news-section .news-grid-mobile-action::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 100%;
        height: 1px;
        background-color: #796A5F;
    }
    
    /* Ховер эффект для мобильных устройств */
    .news-section .news-grid-row:active {
        background-color: #D8C6B2 !important;
    }
    
    .news-section .news-grid-row:active .news-grid-mobile-title,
    .news-section .news-grid-row:active .news-grid-mobile-date,
    .news-section .news-grid-row:active .news-grid-mobile-action {
        color: #2D2D2D !important;
    }
    
    .news-section .news-grid-row:active .news-grid-mobile-action::after {
        background-color: #2D2D2D !important;
    }
}

/* Скрываем мобильные элементы на десктопе */
@media (min-width: 769px) {
    .news-section .news-grid-mobile {
        display: none !important;
    }
}

/* Улучшенные стили для тач-устройств */
@media (hover: none) and (pointer: coarse) {
    .news-section .news-grid-row {
        -webkit-tap-highlight-color: transparent;
        transition: background-color 0.2s ease;
    }
     
    .news-section .news-grid-row:active {
        background-color: #D8C6B2 !important;
        transition: background-color 0.1s ease;
    }
}

/* Стили для изображений в контенте попапа */
.news-section .news-content-image {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 6px;
    margin: 15px 0 !important;
    display: block;
}

/* Скрываем подписи к изображениям */
.news-section #news-popup-content-text figcaption {
    display: none !important;
}

/* Дополнительные стили для мобильной версии попапа */
@media (max-width: 768px) {
    .news-section #news-popup-content-text img {
        max-width: 100% !important;
        height: auto !important;
        margin: 10px 0 !important;
    }
}