/* ══════════════════════════════════════════════════════════════════
   hero-tooltip.css — тултип с историческим текстом на hero-SVG
   ══════════════════════════════════════════════════════════════════ */

/* ── Обёртка визуализатора: нужен position для connector SVG ── */
.hero-viz-wrapper {
    position: relative;
    cursor: crosshair;
}

/* ── SVG-слой пунктирной линии-выноски ── */
.hero-connector-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    opacity: 0;
    transition: opacity 150ms ease;
    z-index: 2;
}

.hero-connector-svg.is-visible {
    opacity: 1;
}

/* Анимация «живой» пунктирной линии */
@keyframes dash-march {
    to { stroke-dashoffset: -18; }
}

.hero-connector-line {
    animation: dash-march 0.9s linear infinite;
}

/* ── Тултип ── */
.hero-tooltip {
    /* Позиционирование — JS управляет через transform: translate3d */
    position: fixed;
    top: 0;
    left: 0;
    z-index: 420;

    width: max-content;
    max-width: 340px;
    padding: 14px 18px;

    background: var(--brand-primary);           /* #006C76 */
    color: #ffffff;
    border-radius: 4px;
    border: 1px solid rgba(53, 196, 181, 0.35); /* brand-teal tint */
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(53, 196, 181, 0.15);

    /* Начальное состояние — скрыт */
    opacity: 0;
    transform: translate3d(-9999px, -9999px, 0);
    transition:
        opacity 150ms ease,
        box-shadow 150ms ease;

    pointer-events: none;
    will-change: transform, opacity;
}

/* Маленький треугольник-хвостик (опциональный, без JS-зависимости) */
.hero-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 14px;
    width: 8px;
    height: 8px;
    background: var(--brand-primary);
    border-top: 1px solid rgba(53, 196, 181, 0.35);
    border-left: 1px solid rgba(53, 196, 181, 0.35);
    transform: rotate(45deg);
    pointer-events: none;
}

.hero-tooltip.is-visible {
    opacity: 1;
}

/* Текст внутри тултипа */
.hero-tooltip__text {
    margin: 0;
    font-family: var(--font-body, sans-serif);
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.01em;
}

/* Год — акцент */
.hero-tooltip__text strong {
    color: var(--brand-teal, #35C4B5);
    font-weight: 600;
}

/* ── Visually-hidden (для скринридеров) ── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ══════════════════════════════════════════════════════════════════
   Адаптив: touch-устройства — без тултипа и линии
   ══════════════════════════════════════════════════════════════════ */
@media not all and (hover: hover) and (pointer: fine) {
    .hero-tooltip,
    .hero-connector-svg {
        display: none !important;
    }

    .hero-viz-wrapper {
        cursor: default;
    }
}

/* ══════════════════════════════════════════════════════════════════
   prefers-reduced-motion: статичный показ, без анимаций
   ══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .hero-tooltip {
        transition: opacity 0ms;
    }

    .hero-connector-svg {
        transition: opacity 0ms;
    }

    .hero-connector-line {
        animation: none;
    }
}
