/* ============================================
   БЛОК "КАФЕДРА В ЦИФРАХ" - СОТЫ
   Правильное соединение по граням
   ============================================ */

/* Самый тёмный — левый нижний (ИЕТН) */
.hex-1 {
    --hex-c1: #0b4f82;
    --hex-c2: #0e5f96;
    --hex-h1: #0e5f96;
    --hex-h2: #1170a8;
}

/* Диагональ 2 (ТиПХ) */
.hex-2 {
    --hex-c1: #0e5f96;
    --hex-c2: #1170a8;
    --hex-h1: #1170a8;
    --hex-h2: #1580b8;
}

/* Центр (50 магистров) */
.hex-3 {
    --hex-c1: #1170a8;
    --hex-c2: #1580b8;
    --hex-h1: #1580b8;
    --hex-h2: #1a90c8;
}

/* Диагональ 4 (168 бакалавров) */
.hex-4 {
    --hex-c1: #1580b8;
    --hex-c2: #1a90c8;
    --hex-h1: #1a90c8;
    --hex-h2: #209ed5;
}

/* Самый светлый — правый верхний (11 лаборантов) */
.hex-5 {
    --hex-c1: #1a90c8;
    --hex-c2: #209ed5;
    --hex-h1: #209ed5;
    --hex-h2: #28abe0;
}

.stats-section {
    padding: 60px 0;
    background: #ffffff;
}

.stats-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 50px;
}

/* Левая часть - текст */
.stats-content {
    flex: 1;
}

.stats-subtitle {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #003366;
    margin: 0 0 15px 0;
    font-weight: 600;
    text-align: center;
    display: none;
}
.hexagon-subtitle {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c7da0;
    margin: 0 0 25px 0;
    padding: 12px 24px;
    border: 2px solid #003366;
    border-radius: 20px;
    letter-spacing: -0.3px;
    text-align: center;
}

.stats-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #2d3748;
    margin: 0;
    padding: 50px 25px;
    background: rgba(0, 86, 179, 0.03);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(9, 127, 255, 0.26);
    backdrop-filter: blur(2px);
}
/* Правая часть - соты */
.stats-hexagon {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hexagon-wrapper {
    text-align: center;
}

.hexagon-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ряд сот */
.hexagon-row {
    display: flex;
    justify-content: center;
    gap: 4px;
}

/* Нижний ряд - правильное смещение для соединения граней */
.hexagon-row-bottom {
    margin-top: -37px;
}

/* Каждая сота */
.hexagon-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.hexagon-item:hover {
    transform: translateY(-5px);
    z-index: 10;
    position: relative;
}

/* Форма шестиугольника */
.hexagon-shape {
    width: 140px;
    height: 161px;
    background: linear-gradient(135deg, var(--hex-c1, #0056b3), var(--hex-c2, #003366));
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hexagon-item:hover .hexagon-shape {
    background: linear-gradient(135deg, var(--hex-h1, var(--hex-c2, #0056b3)), var(--hex-h2, var(--hex-c2, #0056b3)));
    box-shadow: 0 10px 25px rgba(44, 125, 160, 0.3);
}

/* Внутреннее содержимое */
.hexagon-inner {
    text-align: center;
    color: white;
    padding: 15px;
}

.hexagon-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
}

.hexagon-label {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
}
.hexagon-item {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    outline: none;
}

/* Сам tooltip */
.hexagon-item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 18px);
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 50;

    width: 330px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #ffffff;
    color: #2d3748;
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: center;
    text-transform: none;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(0, 51, 102, 0.12);

    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

/* Стрелочка */
.hexagon-item[data-tooltip]::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 51;

    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #ffffff;

    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

/* Показ tooltip при hover, focus и вручную через JS */
.hexagon-item[data-tooltip]:hover::after,
.hexagon-item[data-tooltip]:hover::before,
.hexagon-item[data-tooltip]:focus::after,
.hexagon-item[data-tooltip]:focus::before,
.hexagon-item.tooltip-open::after,
.hexagon-item.tooltip-open::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Если tooltip открыт или наведен — выше остальных */
.hexagon-item:hover,
.hexagon-item:focus,
.hexagon-item.tooltip-open {
    z-index: 20;
}

/* Подсветка при фокусе с клавиатуры */
.hexagon-item:focus-visible .hexagon-shape {
    box-shadow: 0 0 0 3px rgba(44, 125, 160, 0.35);
}

@media (max-width: 768px) {
    .hexagon-item[data-tooltip]::after {
        width: 190px;
        font-size: 0.75rem;
        padding: 10px 12px;
    }
}

/* ============================================
   АДАПТИВ
   ============================================ */

/* Планшеты */
@media (max-width: 1400px) {
    .stats-container {
        flex-direction: column;
        gap: 40px;
    }
    
    .stats-content {
        text-align: center;
        max-width: 600px;
    }
    
    .hexagon-shape {
        width: 110px;
        height: 127px;
    }
    
    .hexagon-value {
        font-size: 1.5rem;
    }
    
    .hexagon-label {
        font-size: 0.65rem;
    }
    
    .hexagon-row {
        gap: 3px;
    }
    
    .hexagon-row-bottom {
        margin-top: -30px;
        margin-left: 0px;
    }
}

/* Мобильные телефоны */
@media (max-width: 768px) {
    .hexagon-subtitle {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    .stats-section {
        padding: 40px 0;
    }
    
    .hexagon-shape {
        width: 85px;
        height: 98px;
    }
    
    .hexagon-value {
        font-size: 1.1rem;
    }
    
    .hexagon-label {
        font-size: 0.5rem;
    }
    
    .hexagon-row {
        gap: 2px;
    }
    
    .hexagon-row-bottom {
        margin-top: -22px;
        margin-left: 0px;
    }
}

/* Маленькие телефоны */
@media (max-width: 550px) {
    .stats-hexagon {
        transform: scale(0.9);
    }
}