/* --- ОБЩИЕ СТИЛИ СБРОСА --- */
body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f4f4;
}

/* --- СТИЛИ ДЛЯ DESKTOP ВЕРСИИ (шире 820px) --- */
.hero-section {
    display: flex;
    width: 100%;
    min-height: 450px;
    background-color: #CBC3E3;
    overflow: hidden;
}

.hero-text-content {
    flex: 0 0 45%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-sizing: border-box;
    /* Устанавливаем z-index для будущего наложения на мобильной версии */
    position: relative; 
    z-index: 3;
}

.hero-text-content h1 {
    color: #f4f4f4;
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 1.5px;
    margin: 0;
    text-transform: uppercase;
}

.hero-image-container {
    flex: 1;
    position: relative; /* Для позиционирования img внутри */
}

/* Стили для самого изображения */
.hero-image-container img {
    width: 100%;
    height: 100%;
    /* Это свойство заставляет <img> вести себя как background-size: cover */
    object-fit: cover; 
    display: block; /* Убирает возможный нижний отступ у картинки */
}


/* --- АДАПТИВНАЯ ВЕРСИЯ ДЛЯ МОБИЛЬНЫХ ЭКРАНОВ (820px и меньше) --- */
@media (max-width: 820px) {

    .hero-section {
        position: relative; /* Родительский элемент для абсолютного позиционирования */
        min-height: 50vh;
        
        /* Центрируем текстовый блок */
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    /* Контейнер с картинкой растягиваем на весь родительский блок */
    .hero-image-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1; /* Картинка будет на самом нижнем слое */
    }

    /* Создаем затемняющий слой поверх изображения */
    .hero-image-container::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5); /* Черный с 50% прозрачностью */
        z-index: 2; /* Затемняющий слой будет над картинкой, но под текстом */
    }

    .hero-text-content {
        background-color: transparent; /* Убираем серый фон */
        width: 90%;
    }

    .hero-text-content h1 {
        font-size: 2rem;
    }
}


/* Стили для контента ниже, чтобы было видно, что блок занимает всю ширину */
.content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.about-master-section {
    background-color: #e0ddd9; /* Цвет фона как в макете */
    padding: 80px 20px; /* Вертикальные и горизонтальные отступы */
    text-align: center; /* Центрируем заголовок и кнопку */
}

.container {
    max-width: 1260px; /* Ограничиваем ширину контента на больших экранах */
    margin: 0 auto; /* Центрируем контейнер */
}

.section-title {
    font-size: 2.5rem; /* Размер заголовка */
    color: #333333;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 40px;
}

/* --- КОНТЕНТ В ДВЕ КОЛОНКИ (ДЛЯ ДЕСКТОПА) --- */
.content-wrapper {
    display: flex; /* Включаем Flexbox для создания колонок */
    align-items: center; /* Выравниваем элементы по центру по вертикали */
    gap: 40px; /* Расстояние между текстом и картинкой */
    text-align: left; /* Возвращаем выравнивание текста по левому краю */
    margin-bottom: 50px;
}

.text-content {
    flex: 2; /* Текстовый блок занимает в 2 раза больше места, чем картинка */
}

.text-content p {
    font-weight:600;
    font-size: 1.2rem;
    line-height: 1.5; /* Межстрочный интервал для читаемости */
    color: #333333;
    margin: 0;
}

.image-content {
    flex: 1; /* Блок с картинкой */
    text-align: center; /* Центрируем картинку внутри своего блока */
}

.image-content img {
    max-width: 300px; /* Ограничиваем максимальный размер иконки */
    height: auto;
}

/* --- СТИЛИ КНОПКИ --- */
.cta-button {
    display: inline-block;
    text-decoration: none;
    color: #333333;
    background: linear-gradient(180deg, #CBC3E3, #a896df);
    
    /* --- ИЗМЕНЕНИЕ ЗДЕСЬ --- */
    /* Было: padding: 18px 60px; */
    padding: 18px 100px; /* <-- ГОРИЗОНТАЛЬНЫЙ ОТСТУП УВЕЛИЧЕН */
    
    border-radius: 50px;
    font-weight:700;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.25);
    background: linear-gradient(180deg, #69c3bd, #CBC3E3);
}


/* --- АДАПТИВНАЯ ВЕРСИЯ (МОЙ ВКУС) --- */
@media (max-width: 820px) {
    .section-title {
        font-size: 2rem; /* Уменьшаем заголовок */
    }

    .content-wrapper {
        flex-direction: column; /* Ставим элементы друг под друга */
        text-align: center; /* Центрируем текст на мобильных */
    }

    /* Меняем порядок элементов: сначала картинка, потом текст */
    .image-content {
        order: 1; /* Картинка будет первой */
    }

    .text-content {
        order: 2; /* Текст будет вторым */
    }
}


.reasons-section {
    background-color: #e0ddd9;
    padding-top: 80px; /* Убираем нижний отступ, так как он будет у последнего элемента списка */
    padding-bottom: 80px;
}

/* Контейнер остается тем же */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.reasons-main-title {

    text-align: center;
    font-size: 2.5rem;
    color: #333333;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 50px;
}

.reasons-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reason-item {
    background-color:#CBC3E3;
    /* Устанавливаем только вертикальные отступы. Горизонтальные не нужны, так как блок и так во всю ширину */
    padding: 40px 0; 
}

/* Создаем разделительную полосу между элементами */
.reason-item:not(:last-child) {
    margin-bottom: 10px;
}

.reason-item h3 {
    /* --- ШРИФТ УВЕЛИЧЕН --- */
    font-size: 1.6rem; 
    color: #333333;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
}

.reason-item p {
    /* --- ШРИФТ УВЕЛИЧЕН --- */
    font-size: 1.2rem; 
    color: #333333;
    line-height: 1.7; /* Увеличим межстрочный интервал для больших шрифтов */
    margin: 0;
       font-weight: 600;
}


/* --- АДАПТИВНАЯ ВЕРСИЯ --- */
@media (max-width: 768px) {
    .reasons-section {
        padding-top: 50px;
        padding-bottom: 50px;
    }

    .reasons-main-title {
        font-size: 2rem;
    }

    .reason-item {
        padding: 30px 0; /* Уменьшаем внутренние отступы карточек на мобильных */
    }

    .reason-item h3 {
        font-size: 1.3rem; /* Чуть уменьшаем для мобильных */
    }

    .reason-item p {
        font-size: 1rem;
    }
}
/* --- СТИЛИ ДЛЯ БЛОКА "НЕКОТОРЫЕ РАБОТЫ" --- */

/* --- СТИЛИ ДЛЯ БЛОКА "НЕКОТОРЫЕ РАБОТЫ" --- */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- СТИЛИ БЛОКА ПОРТФОЛИО --- */
.portfolio-section {
    background-color: #e0ddd9;
    padding: 80px 0;
}
.portfolio-main-title {
    text-align: center;
    font-size: 2.5rem;
    color: #333;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 50px;
}
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px;
}

/* --- ГЛАВНОЕ ИСПРАВЛЕНИЕ ЗДЕСЬ --- */

.portfolio-item {
    position: relative; /* Родительский контейнер для позиционирования */
    overflow: hidden; /* ОБЯЗАТЕЛЬНО. Обрезает все, что выходит за рамки */

    aspect-ratio: 1 / 1;
    cursor: pointer;
}

/* 1. Стили для обертки изображения */
.portfolio-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 2. Стили для самого изображения внутри обертки */
.portfolio-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Анимация применяется теперь только к картинке */
    transition: transform 0.4s ease-out, filter 0.4s ease-out;
}

/* 3. Оверлей с текстом */
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    
    /* Центрирование текста с помощью Flexbox */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    
    /* Анимация появления */
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

.portfolio-overlay h3 {
    font-weight: 500;
    margin: 0;
    font-size: 1.5rem;
    /* Исправление качества рендеринга шрифта */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 4. Эффекты при наведении на родительский .portfolio-item */
.portfolio-item:hover .portfolio-image-wrapper img {
    transform: scale(1.1);
    filter: blur(4px);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

/* --- АДАПТИВНОСТЬ СЕТКИ --- */
@media (max-width: 992px) { .portfolio-grid { grid-template-columns: repeat(1, 1fr); } }
@media (max-width: 576px) { .portfolio-grid { grid-template-columns: 1fr; } }


/* --- СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА (без изменений) --- */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.8); justify-content: center; align-items: center; }
.modal.active { display: flex; }
.modal-content { background-color: #fefefe; padding: 30px; border-radius: 10px; width: 90%; max-width: 1100px; position: relative; max-height: 90vh; display: flex; flex-direction: column; }
.modal-close { color: #aaa; position: absolute; top: 10px; right: 25px; font-size: 35px; font-weight: bold; cursor: pointer; z-index: 10; }
.modal-close:hover { color: #000; }
.modal-body { display: flex; gap: 30px; overflow: hidden; }
.modal-slider { flex: 3; min-width: 0; }
.modal-description { flex: 2; overflow-y: auto; }
.modal-title { margin-top: 0; font-size: 2rem; }
.modal .swiper-slide img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.modal .swiper { width: 100%; height: 100%; min-height: 400px; }
.modal .swiper-button-next, .modal .swiper-button-prev { color: #ffffff; --swiper-navigation-size: 30px; }
.modal .swiper-pagination-bullet-active { background: #ffffff; }
@media (max-width: 820px) { .modal-body { flex-direction: column; } .modal-content { padding: 20px; } .modal-title { font-size: 1.5rem; } }

/* --- СТИЛИ ДЛЯ БЛОКА "ОТЗЫВЫ" (ОБНОВЛЕННАЯ ВЕРСИЯ) --- */

.reviews-section {
    background-color: #e0ddd9;
    padding: 80px 0;
}

.reviews-main-title {
    text-align: center;
    font-size: 2.5rem;
    color: #333333;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 50px;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px;
}

.review-card {
    background-color: #aa96e7;
    padding: 30px;
    border-radius: 8px;
    color: #ffffff;
    
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    /* --- ДОБАВЬТЕ ЭТУ СТРОКУ --- */
    height: 100%;
}

.review-text {
    /* --- ИЗМЕНЕНИЯ ЗДЕСЬ --- */
    font-size: 1.2rem; /* Увеличили размер шрифта */
    font-weight: 500; /* Сделали шрифт жирнее (500 - это semi-bold) */
    line-height: 1.7;
    margin: 0;
}

.review-author {
    font-weight: 700;
    font-size: 1.1rem;
    font-style: italic;
    color: #181818;
    margin-top: 30px; /* Увеличили отступ от текста отзыва */
    
    /* --- ИЗМЕНЕНИЯ ЗДЕСЬ --- */
    text-align: center; /* Убедимся, что выравнивание по центру */
}


/* --- АДАПТИВНОСТЬ БЛОКА ОТЗЫВОВ --- */
@media (max-width: 820px) {
    .reviews-grid {
        grid-template-columns: 1fr;
    }
    
    .review-card {
        /* На мобильных убираем соотношение сторон, чтобы текст не сжимался */
        aspect-ratio: auto;
    }

    .reviews-section {
        padding: 50px 0;
    }

    .reviews-main-title {
        font-size: 2rem;
    }
}