h1, h2 {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: stretch; /* Растягиваем блоки на всю высоту */
    max-width: 80%; /* Увеличиваем ширину контейнера до 80% */
    margin: 40px auto;
    padding: 0;
    gap: 0; /* Убираем пробел между блоками на десктопе */
    max-height: 600px;
}

.video-block {
    flex: 3; /* Большая часть блока выделена под видео */
    background: #001648; /* Цвет фона, как в вашем примере */
    padding: 20px;
    border-radius: 0 15px 15px 0; /* Скругляем только правые углы */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-content: center; /* Центрируем содержимое по вертикали */
}

.video-block video {
    width: 90%; /* Увеличиваем ширину видео */
    height: auto; /* Автоматическая высота для сохранения пропорций */
}

.news-wrapper {
    flex: 1; /* Новостной блок занимает меньше места */
    background: #fff;
    padding: 20px;
    border-radius: 15px 0 0 15px; /* Скругляем только левые углы */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Выравниваем новости по верхнему краю */
    overflow-y: auto; /* Включаем вертикальную прокрутку */
}

.news-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    user-select: none;
}

.news-date {
    color: #c8c8c8;
    margin-bottom: 10px;
}

.news-popup {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    user-select: none;
    justify-content: center;
    align-items: center;
}

.news-popup-content {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 10px;
    min-height: 50%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
    text-align: left;
    display: grid;
    gap: 10px;
}

.news-popup-date {
    text-align: left;
    color: #c8c8c8;
}

.news-popup-text {
    flex: 1;
    max-width: 50%;
    padding-right: 20px;
}

.news-popup-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.news-popup-close:hover,
.news-popup-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.news-popup-image img {
    max-width: 100%;
    height: auto;
}

.news-popup-slider {
    position: relative;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-popup-slider-container {
    display: flex;
    transition: transform 0.3s ease-in-out;
    width: 100%;
}

.news-popup-image-slider {
    flex: 1;
    /* max-width: 50%; */
    display: flex;
    justify-content: center;
}

.news-popup-slider-container img {
    width: 100%;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    max-height: 400px;
}


/* Кнопки переключения */
.news-popup-slider button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
}

.title-site {
    display: grid;
    justify-items: center;
    gap: 50px;
    margin: 50px 50px 30px;
}

.title-site h1 {
    color: white;
    font-size: 48px;
}

.title-site a {
  padding: 20px;
  color: white;
  text-decoration: none;
  background: #ff7e0a;
  font-size: 28px;
  border-radius: 5px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.advantages, .contest-system {
    display: grid;
    gap: 50px;
}

.advantages h2 {
    justify-self: center;
    color: white;
    font-size: 34px;
}

.advantages-wrapper {
  display: grid;
  grid-auto-flow: column;
  justify-content: space-evenly;
}

.advantage {
  display: grid;
  background: white;
  max-width: 300px;
  justify-items: center;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 30px;
  border-radius: 15px;
}

.advantage-photo img {
    width: 300px;
}

.advantage-text {
    width: 220px;
}

.page-wrapper {
    display: grid;
    gap: 30px;
}

.contest-system {
    background: white;
    border-radius: 15px;
    width: fit-content;
    padding: 40px;
    justify-self: center;
    gap: 20px;
    margin-top: 40px;
}

.contest-system-title {
    justify-self: center;
    color: black;
    font-size: 32px;
}

.contest-system ul {
    justify-self: start;
    padding-left: 20px;
    color: black;
    font-size: 24px;
}

.prev { left: 10px; }
.next { right: 10px; }

/* Расположение элементов на десктопе */
@media (min-width: 601px) {
    .news-popup-content {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto 1fr;
        grid-template-areas:
    "header header" 
    "text image";
      }

    .news-header {
        grid-area: header;
        display: grid;
        grid-auto-flow: column;
        grid-template-areas:
      "date close";
    }
    
    .news-popup-date {
        grid-area: date;
        text-align: left;
        color: #c8c8c8;
    }

    .news-popup-close {
        grid-area: close;
        text-align: right;
        font-size: 28px;
        font-weight: bold;
        cursor: pointer;
    }

    .news-popup-text {
        grid-area: text;
        max-width: 100%;
        padding-right: 20px;
    }

    .news-popup-image-slider {
        grid-area: image;
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 1080px) {
    .advantages-wrapper {
        display: grid;
        grid-auto-flow: row;
        justify-content: space-evenly;
    }
}

/* Расположение элементов на мобильных устройствах */
@media (max-width: 600px) {
    .news-popup-content {
        grid-template-columns: 1fr;
        grid-template-areas:
    "header header" 
    "image image" 
    "text  text ";
    }

    .news-popup-description {
        text-align: center;
    }

    .news-header {
        grid-area: header;
        display: grid;
        grid-auto-flow: column;
        grid-template-areas:
      "date close";
    }
    
    .news-popup-date {
        grid-area: date;
        text-align: left;
        align-content: center;
    }

    .news-popup-close {
        grid-area: close;
        text-align: right;
    }

    .news-popup-image-slider {
        grid-area: image;
    }

    .news-popup-text {
        grid-area: text;
        max-width: 100%;
    }

    .advantages-wrapper {
        grid-auto-flow: row;
        gap: 30px;
    }

    .title-site {
        margin: 25px;
    }
    
    .contest-system {
        margin: 25px 25px 0;
    }
}


.hidden {
    display: none;
}

.video-block:has(iframe) {
    display: block;
}

.video-block:has(video) {
    display: flex;
}

.video-block iframe {
    width: 100%; /* Видео занимает всю ширину блока */
    height: 100%;
}


@media (max-width: 900px) {
    .title-site h1 {
        font-size: 32px;
    }

    .title-site a {
        font-size: 28px;
    }

    .advantages h2 {
        font-size: 24px;
    }

    .contest-system-title {
        font-size: 24px;
    }

    .contest-system ul {
        font-size: 16px;
    }

    .content-wrapper {
        flex-direction: column-reverse; /* Новостной блок снизу, видео сверху */
        gap: 20px; /* Добавляем пробел между блоками на мобильных устройствах */
    }

    .video-block, .news-wrapper {
        flex: 1 1 100%; /* Блоки занимают всю ширину */
        border-radius: 15px; /* Скругляем углы для мобильных устройств */
    }

    .video-block {
        background: none; /* Убираем синий фон на мобильных устройствах */
        padding: 0; /* Убираем отступы, чтобы видео занимало весь блок */
    }

    .video-block video, .video-block iframe {
        width: 100%; /* Видео занимает всю ширину блока */
        border-radius: 15px; /* Скругляем углы видео */
    }

    .news-wrapper {
        max-height: 300px; /* Уменьшаем высоту новостного блока на мобильных устройствах */
    }
}

@media (max-width: 768px) {
    .news-popup-content {
        width: 90%; /* Увеличим ширину на маленьких экранах */
        padding: 15px; /* Уменьшим внутренние отступы */
        min-height: auto; /* Убираем минимальную высоту */
    }
    
    .news-popup-close {
        font-size: 24px; /* Уменьшаем размер крестика */
    }
}