/* Убираем отступы у body и html */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Запрещаем горизонтальный скролл */
    scroll-behavior: smooth;
    scroll-padding-top: 10px; /* Убираем дополнительные отступы при скроллинге */
}


/* Фиксированный хэдер */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #3d4166;
    color: #efd832;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

/* Логотип и название */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.logo-text {
    font-family: 'PT Sans Caption', sans-serif;
    font-size: 22px;
    color: #EFD832;
}

/* Навигация */
.nav {
    display: flex;
    gap: 20px;
    padding-right: 6%;
    flex-wrap: nowrap; /* Не даём кнопкам переноситься */
    justify-content: flex-end;
    max-width: 100%;
    overflow: hidden;
}

.nav a {
    font-family: 'PT Serif Caption', serif;
    font-size: 16px;
    color: #EFD832;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 10px 15px;
    flex-shrink: 0;
}

.nav a:hover {
    text-decoration: underline;
    color: #ffffff;
}

/* Отступ для контента, чтобы не перекрывался хэдером */
body {
    padding-top: 80px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }

    /* Навигация */
    .nav {
        display: flex;
        gap: 15px;
        padding-right: 6%;
        justify-content: flex-end;
        max-width: 100%;
        overflow: hidden;
    }

    .nav a {
        position: relative;
        display: flex;
        align-items: center;
        width: 84px;
        height: 50px;
        background-color: #3d4166;
        border-radius: 10px;
        cursor: pointer;
        overflow: hidden;
        text-decoration: none;
        transition: background-color 0.3s ease-in-out;
        padding: 0;
        justify-content: center;
    }

    .nav a:hover {
        text-decoration: underline;
        color: #ffffff;
    }

    /* Текст кнопки */
.nav a span {
    font-size: 16px;
    color: white;
    white-space: nowrap;
    opacity: 1;
    margin-left: 10px;
}

    .logo-text {
        font-size: 18px;
    }
}

/* Контейнер, адаптирующийся под экран */
.container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    position: relative;
    background: #FFFFFF;
}

/* Медиа-запрос для адаптивности */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        padding: 10px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .logo-text {
        font-size: 20px;
    }
}

.hero {
    position: relative;
    width: 100vw;
    height: 875px;
    background: #000;
    display: flex;
    flex-direction: column; /* Размещаем элементы вертикально */
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    width: 100vw; /* Заполняет всю ширину окна браузера */
    height: 100%; /* Заполняет всю высоту секции */
    top: 0;
    left: 0;
    background: url(Photo.png) no-repeat center/cover;
    opacity: 0.7;
    z-index: 1;
}






.hero-title {
    font-family: 'PT Serif', serif;
    font-size: 48px;
    color: #FFFFFF;
    text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    letter-spacing: -0.02em;
    z-index: 10;
    margin-bottom: 20px; /* Добавляем отступ перед кнопкой */
}
@media (max-width: 600px){
    .hero-title {
        font-family: 'PT Serif', serif;
        font-size: 18px;
        color: #FFFFFF;
        text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
        letter-spacing: -0.02em;
        z-index: 10;
        margin-bottom: 20px; /* Добавляем отступ перед кнопкой */
    }
}

.hero-scroll-button {
    position: absolute;
    margin-top: 200px; /* Добавляет отступ от текста */
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.hero-scroll-button img {
    width: auto; /* Оригинальный размер */
    height: auto;
    max-width: 100%; /* Чтобы не превышала контейнер */
    max-height: 100%;
}

.hero-scroll-button:hover {
    opacity: 0.7;
}

.section {
    width: 100%;
    padding: 100px 0;
    text-align: center;
}

.section-title {
    font-size: 32px;
    color: #000000;
    margin-bottom: 40px;
}

.services {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 75px; /* Убираем отступ сверху */
}

.service {
    width: 300px;
    background: #3D4166;
    text-align: center;
    color: #FFFFFF;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 450px;
    overflow: hidden;
    cursor: pointer;
    transition: width 0.5s ease, height 0.5s ease, background-color 0.5s ease-in-out;
}

/* Увеличенный блок */
.service.expanded {
    width: calc(379px + 100px);
    height: 600px;
    background-color: #25283f;
}

.service img {
    width: 100%;
    height: 50%;
    object-fit: cover;
    transition: height 0.5s ease, transform 0.5s ease; /* Плавное изменение высоты и увеличение */
}

.service.expanded img {
    transform: scale(1.1); /* Увеличиваем картинку на 10% */
}

.service img {
    transition: transform 0.5s ease, height 0.5s ease;
}

.service-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 50%; /* Нижняя половина */
    padding: 20px;
}

.service-title {
    font-family: 'PT Serif', serif;
    font-size: 24px;
    color: #EFD832;
    margin-bottom: 10px;
    transition: font-size 0.5s ease;
}

.service-text {
    font-size: 16px;
    line-height: 130%;
    transition: opacity 0.5s ease;
}

.service-full-text {
    padding: 10px;
    line-height: 1.5;
    font-size: 18px;
}

.service .service-text {
    opacity: 1;
}

.service .service-full-text {
    opacity: 0;
    display: none;
}

/* Раскрытие описания */
.service.expanded .service-text {
    display: none;
}

.service.expanded .service-full-text {
    display: block;
    opacity: 1;
}

.service.collapsing .service-full-text {
    opacity: 0;
    max-height: 0;
    display: none; /* Для скрытия контента после анимации */
}

@media (max-width: 768px) {
    .services {
        flex-direction: column; /* Выстраиваем в столбик */
        align-items: center; /* Центрируем элементы */
        gap: 20px; /* Уменьшаем отступы между блоками */
        margin-top: 50px; /* Немного уменьшаем отступ сверху */
    }

    .service {
        width: 350px; /* Уменьшаем размер блока */
        height: 400px; /* Немного уменьшаем высоту */
        transition: width 0.5s ease, height 0.5s ease, background-color 0.5s ease-in-out;
    }

    /* Увеличение блока при разворачивании */
    .service.expanded {
        width: 450px; /* Увеличиваем при раскрытии */
        height: 550px; /* Делаем немного выше */
        background-color: #25283f;
    }

    /* Изображение */
    .service img {
        height: 45%; /* Немного уменьшаем */
        transition: height 0.5s ease, transform 0.5s ease;
    }

    .service.expanded img {
        transform: scale(1.05); /* Легкое увеличение */
    }

    .service-content {
        height: auto;
        padding: 15px;
    }

    .service-title {
        font-size: 20px;
    }

    .service-text {
        font-size: 14px;
    }

    .service-full-text {
        font-size: 14px;
    }
}

.projects {
    display: flex;
    justify-content: center;
    padding: 75px; /* Убираем отступы */
    margin-bottom: 0; /* Убираем отступ снизу */
    position: relative;
    flex-direction: column;
    align-items: center;
}

.section-title {
    font-size: 32px;
    color: #000000;
    margin-bottom: 40px;
}

.projects-content {
    display: flex;
    justify-content: center;
    flex-direction: column;
    position: relative;
}

.project-title {
    font-size: 32px;
    color: #000000;
    margin-top: 10px;
}

.project-container {
    display: flex;
    width: 100%;
    position: relative;
    overflow: hidden;
    height: 450px;
}

.project-item {
    display: flex;
    width: 1100px;
    transition: transform 0.5s ease;
    height: 100%;
}

.project-image,
.project-text {
    flex: 1;
    height: 100%;
}

.project-image {
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.5s ease;
}

.project-text {
    background: rgba(239, 216, 50, 0.13);
    padding: 0px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
    max-width: 100%;
    position: relative;
}

.project-title {
    font-size: 24px;
    color: #000000;
    margin-bottom: 10px;
    position: absolute;
    top: 0px;
    left: 55%;
    transform: translateX(-50%);
    width: 99%;
}

.project-description {
    font-size: 16px;
    line-height: 130%;
    color: #000000;
    margin-top: 68px;
    padding-left: 30px;
    padding-right: 30px;
    text-align: justify;
    white-space: pre-wrap;
}

/* Кнопки */
.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 10;
}

.carousel-button img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    transition: opacity 0.3s ease;
}

.carousel-button:hover img {
    opacity: 0.7;
}

/* Кнопки для проектов */
.prev-project {
    left: -70px; /* Сделано ближе к левому краю */
    position: absolute;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    filter: drop-shadow(6px 0px 2px rgba(0,0,0,0.75));
}

.next-project {
    right: -70px; /* Сделано ближе к правому краю */
    position: absolute;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    filter: drop-shadow(-6px 0px 2px rgba(0,0,0,0.75));
}

/* Кнопки для смены картинок */
.prev-image {
    left: 10px;
    transform: translateY(-50%) rotate(90deg);
    filter: drop-shadow(6px 0px 2px rgba(0,0,0,0.75));
}

.next-image {
    right: 10px;
    transform: translateY(-50%) rotate(-90deg);
    filter: drop-shadow(-6px 0px 2px rgba(0,0,0,0.75));
}

/* Убираем обводки кнопок */
.carousel-button:focus {
    outline: none;
}

/* Убираем скрытие проекта по умолчанию */
.project-item:not(:first-child) {
    display: none;
}

/* Затемненный фон */
.modal {
    display: none; /* По умолчанию скрыто */
    position: fixed;
    z-index: 9999; /* Поверх всего */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8); /* Затемненный фон */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Увеличенное изображение */
.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

/* Кнопка закрытия */
.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #ccc;
}


@media (max-width: 600px) {
    /* Общие стили для контейнера проектов */
    .projects {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 0px; /* Уменьшаем отступы */
        margin-bottom: 0;
        width: 100%; /* Расширяем до всей ширины экрана */
    }

    .project-title {
        font-size: 20px;
        color: #000;
        margin-bottom: 10px;
    }

    .projects-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    /* Контейнер для проекта */
    .project-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 450px; /* Фиксированная ширина */
        height: 801px; /* Фиксированная высота */
        position: relative;
        margin-bottom: 20px;
    }

    /* Элемент проекта */
    .project-item {
        display: flex;
        flex-direction: column;
        width: 75%;
        height: 100%; /* Элемент проекта занимает всю высоту контейнера */
        position: relative;
    }

    /* Стиль для изображения проекта */
    .project-image {
        width: 100%; /* Занимает всю ширину контейнера */
        height: 50%; /* Фиксированная высота для изображения (половина контейнера) */
        overflow: hidden;
        position: relative;
    }

    .project-img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Изображение не растягивается, а заполняет контейнер */
        display: block;
    }

    /* Блок с текстом проекта */
    .project-text {
        background: rgba(239, 216, 50, 0.13);
        padding: 20px; /* Отступы */
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        text-align: left;
        width: 88%; /* Одинаковая ширина с изображением */
        height: 50%; /* Фиксированная высота для текстового блока (половина контейнера) */
    }

    .project-title {
        font-size: 18px;
        color: #000;
        margin-bottom: 10px;
    }

    .project-description {
        font-size: 13px;
        line-height: 1.4;
        color: #000;
        margin-top: 35px;
        padding-left: 0px;
        padding-right: 0px;
        text-align: justify;
        white-space: pre-wrap;
        overflow-y: auto;

        mask-image: linear-gradient(to bottom, rgba(255, 255, 255, 1) 85%, rgba(255, 255, 255, 0) 98%);
        }
    
    .project-description {
        mask-image: linear-gradient(to top, rgba(255, 255, 255, 1) 91%, rgba(255, 255, 255, 0) 98%);
    }

    /* Кнопки переключения проектов */
    .prev-project,
    .next-project {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        opacity: 0.5; /* Сделаем кнопки изначально прозрачными */
        transition: opacity 0.3s ease;
    }

    .prev-project {
        left: 10px; /* Расположены рядом с изображением */
    }

    .next-project {
        right: 10px; /* Расположены рядом с изображением */
        transform: translateY(-50%) rotate(-180deg);
    }

    .prev-project img,
    .next-project img {
        width: 18px;
        height: 18px;
        transform: rotate(90deg); /* Стрелки для переключения */
    }

    /* Кнопки переключения изображений */
    .carousel-button {
        width: 42px;
        position: absolute;
        top: 50%;
        cursor: pointer;
        z-index: 5;
    }

    .carousel-button img {
        width: 100px; /* Увеличиваем кнопки */
        height: 30px;
        opacity: 0.5; /* Сделаем кнопки прозрачными */
        transition: opacity 0.3s ease;
    }

    .carousel-button:hover img,
    .prev-project:hover,
    .next-project:hover {
        opacity: 1; /* При наведении становятся видимыми */
    }

    .prev-image {
        left: 10px;
        transform: translateY(-50%) rotate(90deg); /* Поворот стрелки */
    }

    .next-image {
        right: 10px;
        transform: translateY(-50%) rotate(-90deg); /* Поворот стрелки */
    }

    /* Убираем фокус с кнопок */
    .carousel-button:focus {
        outline: none;
    }

    .modal {
        width: 100%; /* Модальное окно на весь экран */
        max-height: 100vh; /* Высота на весь экран */
        top: 0;
        left: 0;
        transform: translate(0, 0); /* Убираем смещение для идеального центрирования */
    }

    .modal-content {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 90vw;
        max-height: 90vh;
        object-fit: contain;
    }
}



/* О нас */
.about {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 5%;
}

.about-text {
    max-width: 900px; /* Сделал шире */
    font-size: 18px;
    line-height: 1.6;
    color: #000000;
}

/* Контакты */
.contacts {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 5%;
    background-color: #f8f8f8;
    max-width: 1080px;
    margin: 0 auto;
}

/* Заголовок контактов (отдельно от блока с содержимым) */
.contacts-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

/* Контент контактов (контакты + карта) */
.contacts-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Блок с контактной информацией */
.contact-info {
    font-size: 18px;
    line-height: 1.5;
    max-width: 50%;
    text-align: left;
}

/* Карта справа */
.map {
    flex: 1;
    display: flex;
    justify-content: flex;
    padding-left: 20px;
}

.map img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    width: 400px;
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 1024px) {
    .contacts-content {
        flex-direction: column;
        text-align: center;
    }

    .contact-info {
        max-width: 100%;
        text-align: center;
    }

    .map {
        justify-content: center;
        margin-top: 20px;
    }

    .map img {
        width: 100%;
        max-width: 500px;
    }
}


/* Стили для футера */
footer {
    background-color: #3d4166;
    color: #efd832;
    padding: 20px;
    margin-top: 15px;
}

/* Контейнер для текста и кнопок */
.footer-content {
    display: flex;
    justify-content: space-between; /* Разместить текст слева, кнопки справа */
    max-width: 2000px;
    margin: 0 auto;
}

/* Текст в футере */
.footer-text {
    font-size: 18px;
    font-weight: bold;
    text-align: left;
}

/* Контейнер для кнопок */
.footer-buttons {
    display: flex;
    gap: 15px;
}

/* Кнопки */
.footer-button {
    position: relative;
    display: flex;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: #3d4166;
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: width 0.5s ease, background-color 0.5s ease-in-out;
    text-decoration: none;
}

/* Анимация при наведении */
.footer-button:hover {
    width: 300px;
    background-color: #25283f;
}

/* Логотип */
.footer-button img {
    width: 30px;
    height: 30px;
    transition: transform 0.4s ease, left 0.4s ease;
    flex-shrink: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Текст кнопки */
.footer-button span {
    opacity: 0;
    font-size: 26px;
    color: white;
    white-space: nowrap;
    margin-top: 75%;
    margin-left: 50px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Анимация при наведении */
.footer-button:hover img {
    transform: translateX(0);
    left: 15px;
}

.footer-button:hover span {
    opacity: 1;
    transform: translateX(0);
}

/* Анимация при уходе курсора */
.footer-button:not(:hover) img {
    left: 50%;
    transform: translateX(-50%);
    transition: left 0.4s ease, transform 0.4s ease;
}

@media (max-width: 600px) {
    /* Стили для футера */
    footer {
        background-color: #3d4166;
        color: #efd832;
        padding: 20px;
        margin-top: 15px;
    }

    /* Контейнер для текста и кнопок */
    .footer-content {
        display: flex;
        justify-content: space-between; /* Разместить текст слева, кнопки справа */
        max-width: 2000px;
        margin: 0 auto;
    }

    /* Текст в футере */
    .footer-text {
        font-size: 18px;
        font-weight: bold;
        text-align: left;
    }

    /* Контейнер для кнопок */
    .footer-buttons {
        display: flex;
        gap: 15px;
    }

    /* Кнопки */
    .footer-button {
        position: relative;
        display: flex;
        align-items: center;
        width: 50px;
        height: 50px;
        background-color: #3d4166;
        border-radius: 10px;
        cursor: pointer;
        overflow: hidden;
        transition: width 0.5s ease, background-color 0.5s ease-in-out;
        text-decoration: none;
    }

    /* Анимация при наведении */
    .footer-button:hover {
        width: 50px;
        background-color: #25283f;
    }

    /* Логотип */
    .footer-button img {
        width: 30px;
        height: 30px;
        transition: transform 0.4s ease, left 0.4s ease;
        flex-shrink: 0;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Текст кнопки */
    .footer-button span {
        opacity: 0;
        font-size: 26px;
        color: white;
        white-space: nowrap;
        margin-top: 75%;
        margin-left: 50px;
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

    /* Анимация при наведении */
    .footer-button:hover img {
        transform: translateX(0);
        left: 10px;
    }

    .footer-button:hover span {
        opacity: 1;
        transform: translateX(0);
    }

    /* Анимация при уходе курсора */
    .footer-button:not(:hover) img {
        left: 50%;
        transform: translateX(-50%);
        transition: left 0.4s ease, transform 0.4s ease;
    }
}
