/*
 * home.css — стили главной страницы
 * Путь: /public/assets/css/pages/home.css
 *
 * Переопределяем legacy-переменные из style.css для главной страницы,
 * чтобы использовать новую дизайн-систему из tokens.css.
 */

/* ============================================================
   ТОКЕНЫ — перекрываем устаревшие значения из style.css
   ============================================================ */
body[data-page="home"] {
    --color-accent:              #1696ad;
    --color-accent-hover:        #117b8e;
    --color-accent-light:        #dff6fb;
    --color-accent-strong:       #1f6fb2;
    --color-accent-strong-hover: #175890;
    --color-emergency:           #de7b85;
    --color-emergency-hover:     #c96670;
    --color-text-primary:        #16314f;
    --color-text-body:           #45607d;
    --color-text-muted:          #667a93;
    --color-text-inverse:        #ffffff;
    --color-bg-primary:          #eef5fb;
    --color-bg-card:             #ffffff;
    --color-bg-card-soft:        rgba(255, 255, 255, 0.78);
    --color-bg-card-strong:      rgba(255, 255, 255, 0.94);
    --color-border:              rgba(22, 49, 79, 0.10);
    --shadow-card:               0 18px 50px rgba(86, 119, 154, 0.12);
    --shadow-card-lg:            0 26px 80px rgba(86, 119, 154, 0.18);
    --radius-sm:   0.75rem;
    --radius-md:   1rem;
    --radius-lg:   1.5rem;
    --radius-xl:   2rem;
    --radius-2xl:  2.5rem;
    --radius-full: 9999px;
}

/* ============================================================
   ВНЕШНИЙ ОТСТУП И СКРУГЛЁННЫЕ УГЛЫ ВСЕГО ПРИЛОЖЕНИЯ
   (body[data-page="home"] — только на главной странице)

   ВНИМАНИЕ: overflow:hidden на .headmain обрезает выпадающие
   меню навигации. Если дропдауны ломаются — переместите их
   к document.body через JS (portal/teleport паттерн) и
   добавьте им z-index > 9999.
   ============================================================ */
body[data-page="home"] {
    padding: 8px;
    background:
            radial-gradient(circle at 12% 20%, rgba(168, 218, 240, 0.60), transparent 42%),
            radial-gradient(circle at 88% 75%, rgba(140, 200, 235, 0.40), transparent 42%),
            linear-gradient(145deg, #cce6f5 0%, #d6ecf8 55%, #c6e0f2 100%);
    min-height: 100vh;
    box-sizing: border-box;
}

body[data-page="home"] .headmain {
    border-radius: 1.25rem;
    overflow: hidden;
    background: var(--color-bg-primary);
    box-shadow:
            0 0 0 1px rgba(22, 49, 79, 0.06),
            0 8px 40px rgba(22, 49, 79, 0.10);
    position: relative;
}

/* Сбрасываем отступ main для главной */
body[data-page="home"] main.home-page {
    margin: 0;
    padding: 0;
    flex: 1;
    position: relative;
    overflow: hidden;

    background-image: url('/assets/images/home-top-bg.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-color: var(--color-bg-primary);
}

/* ============================================================
   СКРЫТЫЙ SVG СПРАЙТ
   ============================================================ */
.home-svg-sprite {
    display: none;
}

/* ============================================================
   БАЗОВАЯ ИКОНКА
   ============================================================ */
.home-icon {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    fill: currentColor;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.home-hero {
    position: relative;
    padding: 3.5rem 0 3.75rem;
    background: transparent;
    z-index: 1;
}

/* Мягкий оверлей поверх background.png */
.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
            radial-gradient(ellipse at 10% 60%, rgba(174, 223, 244, 0.38), transparent 55%),
            radial-gradient(ellipse at 90% 15%, rgba(152, 210, 240, 0.20), transparent 45%);
    pointer-events: none;
    z-index: 0;
}

.home-hero__content {
    position: relative;
    z-index: 1;
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 3rem 0 4rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    align-items: flex-start;
}

@media (min-width: 1024px) {
    .home-hero__content {
        flex-direction: row;
        align-items: center;
        gap: 4rem;
    }
}

/* ---- Левая колонка: текст (≈ 44% ширины) ---- */
.home-hero__copy {
    width: 100%;
}

@media (min-width: 1024px) {
    .home-hero__copy {
        flex: 0 0 43%;
        width: 43%;
    }
}

.home-hero__eyebrow {
    display: inline-block;
    margin: 0 0 0.875rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.home-hero__title {
    margin: 0 0 0.875rem;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.home-hero__title-top {
    display: block;
    font-size: clamp(2.2rem, 3.5vw, 3rem);
    color: var(--color-text-primary);
}

.home-hero__title-accent {
    display: block;
    font-size: clamp(2.2rem, 3.5vw, 3rem);
    color: var(--color-accent);
}

.home-hero__lead {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

/* ---- Кнопки (pill-форма) ---- */
.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.home-hero__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.95rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-inverse);
    text-decoration: none;
    transition:
            background-color 0.2s ease,
            box-shadow      0.2s ease,
            transform       0.15s ease;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.home-hero__button:hover {
    transform: translateY(-1px);
}

.home-hero__button--emergency {
    background-color: var(--color-emergency);
}
.home-hero__button--emergency:hover {
    background-color: var(--color-emergency-hover);
    box-shadow: 0 8px 22px rgba(222, 123, 133, 0.38);
}

.home-hero__button--primary {
    background-color: var(--color-accent-strong);
}
.home-hero__button--primary:hover {
    background-color: var(--color-accent-strong-hover);
    box-shadow: 0 8px 22px rgba(31, 111, 178, 0.32);
}

.home-hero__button .home-icon {
    width: 1.1rem;
    height: 1.1rem;
}

/* ---- Преимущества ---- */
.home-hero__features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;

    width: 100%;
    max-width: 650px;

    list-style: none;
    margin: 0;
    padding: 0;
}

.home-hero__feature {
    min-height: 56px;
    padding: 0.7rem 0.9rem 0.7rem 0.5rem;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.7rem;

    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(22, 49, 79, 0.08);
    border-radius: 0.8rem;

    box-shadow:
            0 10px 26px rgba(86, 119, 154, 0.09),
            inset 0 1px 0 rgba(255, 255, 255, 0.86);

    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);

    color: var(--color-text-body);

    transition:
            transform 0.18s ease,
            box-shadow 0.22s ease,
            border-color 0.22s ease;
}

.home-hero__feature:hover {
    transform: translateY(-2px);

    border-color: rgba(255, 255, 255, 0.9);

    box-shadow:
            0 14px 32px rgba(86, 119, 154, 0.13),
            inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.home-hero__feature .home-icon {
    width: 1.35rem;
    height: 1.35rem;

    color: var(--color-accent-strong);
    flex-shrink: 0;
}

.home-hero__feature span {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    color: rgba(69, 96, 125, 0.95);
}

@media (max-width: 1180px) {
    .home-hero__features {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .home-hero__feature {
        min-height: 54px;
    }
}

@media (max-width: 639px) {
    .home-hero__features {
        grid-template-columns: 1fr;
    }

    .home-hero__feature {
        padding: 0.75rem 0.9rem;
    }
}

/* ---- Правая колонка: медиа (занимает остаток ≈ 56%) ---- */
.home-hero__media {
    width: 100%;
    position: relative;
}

@media (min-width: 1024px) {
    .home-hero__media {
        flex: 1 1 0;
        min-width: 0;
        max-width: 640px;
    }
}

/* Рамка изображения */
.home-hero__media-frame {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    box-shadow:
            0 20px 60px rgba(22, 49, 79, 0.18),
            0 4px 12px  rgba(22, 49, 79, 0.08);
}

.home-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Бейдж расписания — поверх фото, внизу-справа */
.home-hero__badge {
    position: absolute;

    background: var(--color-bg-card-strong);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border-radius: 1.15rem;
    padding: 0.85rem 1.15rem;

    box-shadow: 0 10px 28px rgba(22, 49, 79, 0.16);

    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--color-text-body);

    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.home-hero__badge--schedule {
    bottom: 0.875rem;
    right: 0.875rem;
}

.home-hero__badge-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;

    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text-primary);

    margin-bottom: 0.2rem;
}

.home-hero__badge-title .home-icon {
    width: 1.05rem;
    height: 1.05rem;
    color: var(--color-accent);
}

/* ============================================================
   ПРОФИЛАКТИКА И БЕЗОПАСНОСТЬ
   ============================================================ */
.home-prevention {
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: 3rem 0 2rem;
    background: transparent;
}

.home-prevention__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem 0 2rem;
}

.home-prevention__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.home-prevention__eyebrow {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.35rem;
}

.home-prevention__title {
    margin: 0;
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.home-prevention__btn-all {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.375rem;
    background: var(--color-accent-strong);
    color: var(--color-text-inverse);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.home-prevention__btn-all:hover {
    background-color: var(--color-accent-strong-hover);
}

.home-prevention__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.125rem;
}

@media (min-width: 640px) {
    .home-prevention__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .home-prevention__grid { grid-template-columns: repeat(3, 1fr); }
}

.home-prevention-card {
    background: var(--color-bg-card-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 1.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.home-prevention-card:hover {
    box-shadow: var(--shadow-card-lg);
    transform: translateY(-2px);
}

.home-prevention-card__top {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.home-prevention-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    background: var(--color-accent-light);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.home-prevention-card__icon svg {
    width: 1.4rem;
    height: 1.4rem;
    color: var(--color-accent);
    stroke: var(--color-accent);
}

.home-prevention-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.home-prevention-card__tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.home-prevention-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.35;
}

.home-prevention-card__desc {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--color-text-muted);
    flex: 1;
}

.home-prevention-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    margin-top: 0.25rem;
    transition: gap 0.2s ease, color 0.2s ease;
}

.home-prevention-card__link:hover {
    gap: 0.55rem;
    color: var(--color-accent-hover);
}

.home-prevention-card__link .home-icon {
    width: 0.9rem;
    height: 0.9rem;
}

/* ============================================================
   ИНФОРМАЦИОННЫЕ КАРТОЧКИ (4 колонки)
   ============================================================ */
.home-cards {
    max-width: 1340px;
    margin: 0 auto;
    padding: 0.5rem 2rem 3rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.125rem;
}

@media (min-width: 640px) {
    .home-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .home-cards { grid-template-columns: repeat(4, 1fr); }
}

.home-info-card {
    background: var(--color-bg-card-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 1.375rem 1.375rem 1.25rem;
    position: relative;
    overflow: hidden;
}

.home-info-card__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 1.125rem;
    padding-bottom: 0.7rem;
    position: relative;
    display: inline-block;
}

.home-info-card__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 2rem;
    height: 2px;
    background-color: var(--color-accent);
    border-radius: 999px;
}

.home-info-card--slogan .home-info-card__slogan {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-primary);
    text-transform: uppercase;
    line-height: 1.7;
    margin: 0;
    letter-spacing: 0.01em;
}

.home-info-card--slogan .home-info-card__slogan span {
    color: var(--color-accent);
}

.home-info-card__leaf {
    position: absolute;
    bottom: -1.75rem;
    right: -1.75rem;
    width: 7.5rem;
    height: 7.5rem;
    border-radius: 50% 0 50% 50%;
    background: var(--color-accent-light);
    opacity: 0.65;
    pointer-events: none;
    transform: rotate(-15deg);
}

/* Список ссылок */
.home-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.home-link-list__link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.84rem;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 0.15rem 0;
    transition: color 0.18s ease;
    line-height: 1.4;
}

.home-link-list__link:hover {
    color: var(--color-accent);
}

.home-link-list__link .home-icon {
    width: 1rem;
    height: 1rem;
    color: var(--color-accent);
    flex-shrink: 0;
}

.home-link-list__link--accent {
    color: var(--color-emergency) !important;
}

.home-link-list__link--accent:hover {
    color: var(--color-emergency-hover) !important;
}

.home-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-style: normal;
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 1023px) {
    .home-hero { padding: 2.25rem 0 2.75rem; }

    .home-hero__copy { width: 100%; }

    .home-hero__media {
        width: 100%;
        max-width: 540px;
        margin: 0 auto;
    }

    .home-hero__contact-card { margin-left: 0; }
}

@media (max-width: 639px) {
    /* На мобилках убираем отступ и скругление */
    body[data-page="home"] {
        padding: 0;
    }

    body[data-page="home"] .headmain {
        border-radius: 0;
        box-shadow: none;
    }

    .home-hero__actions {
        flex-direction: column;
    }

    .home-hero__button {
        justify-content: center;
        width: 100%;
    }

    .home-prevention__header {
        flex-direction: column;
        align-items: flex-start;
    }
}