/* ============================================
   Стили главной страницы (макет index.png, референс Envoy Global)
   Бирюзовые секции, hero с видео, оранжевые CTA
   ============================================ */

/* Цвета секций главной */
.home-section {
    --home-section-bg: #2d5a6b;
    --home-cta-orange: #e85d04;
    --home-cta-orange-hover: #d54d02;
}

/* Hero с видео: контент внизу, белый текст, оверлей для читаемости */
.hero {
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 80px;
}

.hero .container {
    margin-top: auto;
    padding-bottom: 0;
}

.hero-content {
    margin: 0 auto;
}

/* Оверлей поверх видео для лучшей читаемости текста */
.hero-overlay {
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.65) 0%,
        rgba(0, 0, 0, 0.35) 40%,
        rgba(0, 63, 136, 0.25) 100%);
}

.hero-title,
.hero-description {
    color: var(--bg-white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-description {
    opacity: 0.95;
}

/* Общие секции на бирюзовом фоне */
.home-section {
    padding: 72px 0;
    background-color: var(--home-section-bg);
    color: var(--bg-white);
}

/* Узор из кружочков — компактный массив-«связка» между разделами (как на Envoy Global) */
.home-section--pattern-left,
.home-section--pattern-right {
    position: relative;
}

.home-section--pattern-left .container,
.home-section--pattern-right .container {
    position: relative;
    z-index: 1;
}

/* Ограниченная область: массив примерно 6×10 кружочков у нижнего края секции */
.home-section--pattern-left::before,
.home-section--pattern-right::before {
    content: '';
    position: absolute;
    bottom: 0;
    width: 240px;
    height: 400px;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.2) 1.5px,
        transparent 2px
    );
    background-size: 24px 24px;
}

.home-section--pattern-left::before {
    left: 0;
}

.home-section--pattern-right::before {
    right: 0;
    left: auto;
}

.home-section__title {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 800;
    margin-bottom: 2.5rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--bg-white);
}

/* Секция «МЫ РАБОТАЕМ С ТЕМИ, КТО» — 2 строки по 3 карточки, закругления только у угловых */
.home-audience__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .home-audience__grid {
        grid-template-columns: 1fr;
    }
}

.home-audience__card {
    background: var(--bg-white);
    border-radius: 0;
    overflow: hidden;
    color: var(--text-dark);
}

.home-audience__card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.home-audience__card-link:hover {
    opacity: 0.92;
}

/* Закругления только у угловых карточек: слева сверху, справа сверху, слева снизу, справа снизу */
.home-audience__grid .home-audience__card:nth-child(1) {
    border-top-left-radius: 12px;
}

.home-audience__grid .home-audience__card:nth-child(3) {
    border-top-right-radius: 12px;
}

.home-audience__grid .home-audience__card:nth-child(4) {
    border-bottom-left-radius: 12px;
}

.home-audience__grid .home-audience__card:nth-child(6) {
    border-bottom-right-radius: 12px;
}

@media (max-width: 768px) {
    .home-audience__grid .home-audience__card:nth-child(n) {
        border-radius: 0;
    }

    .home-audience__grid .home-audience__card:nth-child(1) {
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }

    .home-audience__grid .home-audience__card:nth-child(6) {
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
    }
}

.home-audience__card-image {
    aspect-ratio: 4/3;
    background: var(--bg-light);
    overflow: hidden;
}

.home-audience__card-image img,
.home-audience__card-image picture,
.home-audience__card-image picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Плейсхолдер, если изображение не добавлено (файлы в assets/images/home/) */
.home-audience__card-image--placeholder {
    background: linear-gradient(135deg, var(--bg-light) 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-audience__card-image--placeholder::after {
    content: '';
    width: 48px;
    height: 48px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%239ca3af' viewBox='0 0 24 24'%3E%3Cpath d='M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3E%3C/svg%3E") no-repeat center;
    opacity: 0.6;
}

.home-audience__card-text {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
    text-align: center;
}

.home-audience__footer {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.7;
    letter-spacing: 0.01em;
    opacity: 0.98;
    font-weight: 500;
}

/* Секция «НАШИ УСЛУГИ» — рамка на контейнере, отступ от краёв через padding (фон остаётся бирюзовым) */
.home-section.home-services {
    background-color: var(--home-section-bg);
    margin-bottom: 0;
    padding: 4rem 1rem;
}

@media (min-width: 768px) {
    .home-section.home-services {
        padding: 3.5rem 2rem;
    }
}

/* Рамка с закруглёнными углами на внутреннем контейнере — без белых полос по бокам */
.home-section.home-services .container {
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 24px;
    padding: 3.5rem 1.5rem;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset,
                0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .home-section.home-services .container {
        border-radius: 28px;
        padding: 4rem 2rem;
    }
}

/* Три колонки одинаковой ширины: текст | центр (2 карточки) | право (2 карточки со смещением вниз) */
.home-services__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 900px) {
    .home-services__layout {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 2rem 1.5rem;
        align-items: start;
    }
}

.home-services__col {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Карточки в колонках — одинаковой высоты внутри колонки */
.home-services__col--center .home-services__category,
.home-services__col--right .home-services__category {
    flex: 1;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.home-services__col--center .home-services__category ul,
.home-services__col--right .home-services__category ul {
    flex: 1;
}

/* Правая колонка — смещение вниз относительно центральной */
.home-services__col--right {
    margin-top: 5rem;
}

@media (min-width: 900px) {
    .home-services__col--right {
        margin-top: 4rem;
    }
}

/* Основной текст: отступ первой строки, крупнее, стильнее */
.home-services__intro-text {
    margin-bottom: 1.75rem;
}

.home-services__intro-text p {
    text-indent: 1.75em;
    margin: 0 0 1rem;
    font-size: 1.25rem;
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--bg-white);
    opacity: 0.98;
}

.home-services__intro-text p:first-child {
    margin-top: 0;
}

.home-services__intro-text p:last-child {
    margin-bottom: 0;
}

/* Оранжевая кнопка */
.btn--orange {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    background: var(--home-cta-orange);
    color: var(--bg-white);
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    transition: background 0.2s;
}

.btn--orange:hover {
    background: var(--home-cta-orange-hover);
}

.home-services__category {
    background: var(--bg-white);
    color: var(--text-dark);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    min-height: 300px;
}

/* Заголовки карточек — крупнее и выразительнее */
.home-services__category-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--secondary-color);
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.home-services__category ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-services__category li {
    padding: 0.45rem 0;
    font-size: 1.05rem;
    line-height: 1.5;
    letter-spacing: 0.01em;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.home-services__category li:last-child {
    border-bottom: none;
}

.home-services__category a {
    color: var(--text-dark);
    text-decoration: none;
    display: inline-block;
    padding: 0.15em 0.35em;
    margin: -0.15em -0.35em;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.home-services__category a:hover {
    color: var(--secondary-color);
    background: rgba(0, 63, 136, 0.08);
}

/* Секция «КАК МЫ РАБОТАЕМ» — пологая лестница: flex + смещение вниз, красные стрелки между шагами */
.home-how__diagram {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.5rem 2rem;
    margin-bottom: 2.5rem;
    max-width: 100%;
    width: min(100%, 1100px);
    margin-left: auto;
    margin-right: auto;
}

.home-how__diagram .home-how__step {
    flex: 1 1 0;
    min-width: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    color: var(--bg-white);
}

/* Пологая лестница: каждый следующий шаг чуть ниже; стрелки на уровне .home-how__step-box */
.home-how__diagram .home-how__step:nth-child(1) { margin-top: 0; }
.home-how__diagram .home-how__connector:nth-of-type(1) { margin-top: 0.5rem; align-self: flex-start; }
.home-how__diagram .home-how__step:nth-child(3) { margin-top: 3rem; }
.home-how__diagram .home-how__connector:nth-of-type(2) { margin-top: 3.5rem; align-self: flex-start; }
.home-how__diagram .home-how__step:nth-child(5) { margin-top: 6rem; }
.home-how__diagram .home-how__connector:nth-of-type(3) { margin-top: 6.5rem; align-self: flex-start; }
.home-how__diagram .home-how__step:nth-child(7) { margin-top: 9rem; }

/* Оранжевый блок-заголовок с чёрной обводкой */
.home-how__step-box {
    display: block;
    background: #e8a54b;
    color: var(--text-dark);
    font-weight: 700;
    min-width: 250px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--text-dark);
    border-radius: 4px;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.home-how__step-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    opacity: 0.98;
    max-width: 100%;
}

/* Красная соединительная стрелка вправо-вниз (от .home-how__step-box к следующему) */
.home-how__connector {
    flex: 0 0 auto;
    display: block;
    width: 36px;
    height: 36px;
    margin-left: 3.5rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c53030' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M17 7h-6M17 7v6'/%3E%3C/svg%3E") no-repeat center;
    background-size: 28px 28px;
    transform: rotate(90deg);
    opacity: 0.95;
}

@media (max-width: 700px) {
    .home-how__diagram {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .home-how__diagram .home-how__step {
        margin-top: 0 !important;
        max-width: none;
    }

    .home-how__diagram .home-how__connector {
        margin-top: 0 !important;
        align-self: center;
        transform: rotate(90deg);
    }

    .home-how__step-desc {
        max-width: none;
    }
}

.home-how__footer {
    text-align: left;
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.98;
    margin: 0;
    max-width: 720px;
}

@media (min-width: 701px) {
    .home-how__footer {
        margin-left: 0;
    }
}

/* Секция «ЧТО ВАЖНО ЗНАТЬ СЕГОДНЯ И СЕЙЧАС» — рамка как у «НАШИ УСЛУГИ» */
.home-section.home-know {
    background-color: var(--home-section-bg);
    margin-bottom: 0;
    padding: 4rem 1rem;
}

@media (min-width: 768px) {
    .home-section.home-know {
        padding: 3.5rem 2rem;
    }
}

.home-section.home-know .container {
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 24px;
    padding: 3.5rem 1.5rem;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset,
                0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .home-section.home-know .container {
        border-radius: 28px;
        padding: 4rem 2rem;
    }
}

/* Секции списков: ЧТО ВАЖНО ЗНАТЬ, С КАКИМИ ВОПРОСАМИ */
.home-know__list,
.home-faq__list {
    max-width: 640px;
    margin: 0 auto 1.5rem;
    padding-left: 1.5rem;
    line-height: 1.65;
}

.home-know__list li,
.home-faq__list li {
    margin-bottom: 0.5rem;
}

.home-know__footer {
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.95;
    margin: 0;
}

/* Секция «НОВОСТИ» — три карточки */
.home-news__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.home-news__card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.home-news__card-image {
    aspect-ratio: 16/10;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.home-news__card-image img,
.home-news__card-image picture,
.home-news__card-image picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-news__card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.home-news__date {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.home-news__card-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.home-news__card-title a {
    color: var(--bg-white);
    text-decoration: none;
}

.home-news__card-title a:hover {
    text-decoration: underline;
}

.home-news__card-summary {
    font-size: 0.9rem;
    opacity: 0.9;
    flex: 1;
    margin-bottom: 0.75rem;
}

.home-news__link {
    color: var(--bg-white);
    font-size: 0.9rem;
    font-weight: 600;
}

.home-news__link:hover {
    text-decoration: underline;
}

/* Секция «КОНТАКТЫ» — оранжевый фон */
.home-contact {
    background: var(--home-cta-orange);
}

.home-contact__content {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

.home-contact__content p {
    margin-bottom: 0.5rem;
}

.home-contact__content a {
    color: var(--bg-white);
    text-decoration: underline;
}

.home-contact__content a:hover {
    opacity: 0.9;
}

.btn--white-outline {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--bg-white);
    background: transparent;
    color: var(--bg-white);
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.btn--white-outline:hover {
    background: var(--bg-white);
    color: var(--home-cta-orange);
}
