body {
    font-family: 'Times New Roman', serif;
    background-color: #8b8b8b;
    color: #333333;
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 20px;
}

header {
    background-image: url('header-background.jpg');
    background-size: 100% 100%;
    background-position: center;
    padding: 100px 20px;
    color: white;
}

header h1 {
    color: #333333;
    font-size: 50px;
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    display: inline;
    margin: 0 15px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    color: #333333;
}

nav ul li a.active {
    text-decoration: underline;
    color: black;
}

section {
    padding: 50px 20px;
    margin-right: 150px;
    margin-left: 150px;
}

.container .img-part {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    justify-content: center;
    justify-items: center;
    align-items: center;
    flex-wrap: wrap;
}

.container .img-part .img {
    width: 250px;
    height: 200px;
    border: 5px solid rgb(85, 85, 85);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container .img-part .img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.container .img-part .img:hover img {
    transform: scale(1.1);
}

.img-item p {
    margin-top: 10px;
    font-size: 25px;
    color: black;
}

.img-item a {
    text-decoration: none;
    color: inherit;
}

.container h2 {
    font-size: 30px;
}

footer {
    background-color: #8b8b8b;
    text-align: center;
    padding: 10px 0;
    font-size: 20px;
    color: #333;
    font-weight: normal;
}

.container .pop-up {
    position: fixed;
    top: 0px;
    left: 0;
    height: 100%;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
}

.container .pop-up img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 5px solid white;
    border-radius: 8px;
    width: auto;
    max-height: 500px;
}

.container .pop-up span {
    position: fixed;
    top: 10px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: white;
    font-size: 50px;
    font-weight: 900;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

.img-item {
    padding: 10px 0px;
}

.pop-up .nav {
    position: absolute;
    top: 50%;
    font-size: 80px;
    color: white;
    cursor: pointer;
    user-select: none;
    transform: translateY(-50%);
}

.pop-up .nav.left {
    left: 100px;
}

.pop-up .nav.right {
    right: 100px;
}

.language-switch {
    position: absolute;
    top: 25px;
    right: 25px;
    padding: 5px 10px;
    border-radius: 5px;
}

.language-switch a {
    color: black;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    display: inline-block;
    transition: transform 0.3s ease, color 0.3s ease;
}

.language-switch a:hover {
    transform: scale(1.4) translateY(-6px);
    color: red;
}

/* Медиазапросы для адаптации под устройства с маленькими экранами */

/* Для планшетов и маленьких экранов */
@media (max-width: 768px) {
    header h1 {
        font-size: 36px; /* Уменьшаем размер шрифта для заголовка */
    }

    nav ul li a {
        font-size: 18px; /* Уменьшаем размер шрифта для ссылок */
    }

    .img-item p {
        font-size: 18px; /* Уменьшаем размер текста для подписей */
    }

    .container h2 {
        font-size: 28px; /* Уменьшаем размер заголовков внутри контейнера */
    }

    .container .img-part {
        grid-template-columns: repeat(2, 1fr); /* Уменьшаем количество колонок до 2 на экранах меньшего размера */
    }

    /* Отключаем увеличение изображений на мобильных устройствах */
    .container .img-part .img:hover img {
        transform: scale(1); /* Отключаем эффект увеличения при наведении */
    }

    /* Адаптация изображений */
    .container .img-part .img img {
        object-fit: contain; /* Сохраняем пропорции изображений, чтобы они не обрезались */
    }
}

/* Для мобильных устройств */
@media (max-width: 480px) {
    header {
        padding: 60px 10px; /* Уменьшаем отступы для мобильных устройств */
    }

    .container .img-part {
        grid-template-columns: 1fr; /* Все изображения в один столбец */
    }

    .container .img-part .img {
        height: auto;
        width: 90%; /* Уменьшаем ширину изображений на мобильных устройствах */
        text-align: center;
    }

    .language-switch {
        font-size: 16px; /* Уменьшаем размер шрифта для переключателя языка */
        top: 15px;
        right: 15px;
    }

    .container .pop-up img {
        max-width: 100%; /* Изображения в попапе будут адаптироваться под экран */
        max-height: 80vh; /* Ограничиваем высоту изображения в попапе */
    }
}
