/* =========================================
   ИЗОЛИРОВАННЫЕ СТИЛИ СТРАНИЦ КЕЙСОВ (CASES.CSS)
   ========================================= */

/* --- Глобальный масштаб и ширина --- */
#t2s-case-page-wrapper {
    background-color: #ffffff;
    font-size: 1.1rem; /* Увеличенный шрифт под инженерный стиль */
    line-height: 1.5;
}

/* Принудительно пробиваем UIkit для сетки 1600px */
html body #t2s-case-page-wrapper .uk-container {
    max-width: 1600px !important;
    width: 100% !important;
}

#t2s-case-page-wrapper p, 
#t2s-case-page-wrapper li {
    font-size: 1.05rem;
    line-height: 1.55;
}

/* --- Блок-паспорт (Hero) --- */
.t2s-case-passport {
    border: 1px solid #111111;
    padding: 60px;
    background: #ffffff;
    position: relative;
    box-shadow: 12px 12px 0px rgba(17, 17, 17, 0.03);
}

.t2s-case-passport__badge {
    position: absolute;
    top: -14px;
    left: 40px;
    background: #111111;
    color: #ffffff;
    font-family: monospace;
    font-size: 0.8rem;
    padding: 4px 12px;
    letter-spacing: 0.08em;
}

.t2s-case-passport__title {
    font-size: clamp(2rem, 3.8vw, 3.2rem);
    line-height: 1.15;
    margin: 0;
}

.t2s-case-specs__item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed rgba(17, 17, 17, 0.15);
}

.t2s-case-specs__item:last-child {
    border-bottom: none;
}

.t2s-case-label {
    display: block;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: #FF5C00;
    margin-bottom: 6px;
}

/* --- Дашборд результатов --- */
.t2s-case-result-box {
    background: #fcfcfc;
    border: 1px solid #111111;
    padding: 25px;
    height: 100%;
    box-sizing: border-box;
}

.t2s-case-result-val {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 10px;
    color: #111111;
    letter-spacing: -0.03em;
}

.t2s-case-result-desc {
    font-size: 0.9rem;
    line-height: 1.35;
    color: #444444;
    font-weight: 500;
}

/* --- Окантовка картинки с крестиками --- */
.t2s-case-image-frame {
    position: relative;
    border: 1px solid #111111;
    padding: 12px;
    background: #ffffff;
}

.t2s-case-image-frame img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(15%) contrast(1.05);
}

.t2s-case-image-frame__corner {
    position: absolute;
    width: 10px;
    height: 10px;
    font-family: monospace;
    font-size: 14px;
    color: #FF5C00;
    line-height: 1;
}

.t2s-case-image-frame__corner--tl { top: -6px; left: -6px; }
.t2s-case-image-frame__corner--tl::before { content: '+'; }

.t2s-case-image-frame__corner--br { bottom: -6px; right: -6px; }
.t2s-case-image-frame__corner--br::before { content: '+'; }

/* --- Диагностическая панель "ДО" --- */
.t2s-case-diag-panel {
    background-color: #111111;
    color: #ffffff;
    padding: 60px;
    position: relative;
    border-left: 6px solid #FF5C00;
}

.t2s-case-diag-panel__header {
    font-family: monospace;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.t2s-text-muted-light {
    color: #cccccc !important;
    line-height: 1.6;
}

.t2s-case-tech-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.t2s-case-tech-list li {
    font-size: 1rem;
    color: #eeeeee;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    padding-left: 24px;
}

.t2s-case-tech-list li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #FF5C00;
    font-family: monospace;
    font-weight: bold;
}

/* --- Пульсирующая точка --- */
.t2s-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #FF5C00;
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 0 0 rgba(255, 92, 0, 0.7);
    animation: t2s-pulse-orange 2s infinite;
}

@keyframes t2s-pulse-orange {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 92, 0, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 92, 0, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 92, 0, 0); }
}

/* --- Блок заявления / Резюме --- */
.t2s-statement-box {
    background: #ffffff;
    border: 1px solid #111111;
    border-left: 6px solid #FF5C00;
    padding: 60px;
    position: relative;
}

.t2s-statement-marker {
    position: absolute;
    top: 0;
    right: 20px;
    background: #111111;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 12px;
    text-transform: uppercase;
    font-family: monospace;
}

.t2s-statement-note {
    border-left: 1px solid #ddd;
    padding-left: 25px;
}

/* --- ОБНОВЛЕННЫЙ CTA-БЛОК (Убираем слипание с футером) --- */
.t2s-case-cta-section {
    background-color: #ffffff; /* Белая подложка под секцией */
    padding-bottom: 80px;
}

.t2s-case-cta-card {
    background-color: #f5f5f7;
    border: 1px solid #111111;
    padding: 60px;
    position: relative;
    box-shadow: 10px 10px 0px rgba(17, 17, 17, 0.04);
}

.t2s-case-cta-card__badge {
    position: absolute;
    top: -12px;
    left: 30px;
    background-color: #FF5C00;
    color: #ffffff;
    font-family: monospace;
    font-size: 0.75rem;
    padding: 3px 10px;
    font-weight: bold;
    letter-spacing: 0.05em;
}

/* Мобильная адаптивность */
@media (max-width: 959px) {
    .t2s-case-passport,
    .t2s-case-diag-panel,
    .t2s-statement-box,
    .t2s-case-cta-card {
        padding: 30px 20px;
    }
    
    .t2s-statement-note {
        border-left: none;
        padding-left: 0;
        margin-top: 25px;
        border-top: 1px solid #eee;
        padding-top: 20px;
    }
}

/* =========================================
   ИНЖЕНЕРНАЯ СЕТКА КЕЙСОВ (ФИКС GRID-АЛГОРИТМА)
   ========================================= */
.engineering-cases-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    /* Фиксируем высоту каждой строки, чтобы картинки не прыгали */
    grid-auto-rows: 320px !important; 
    gap: 15px !important;
    /* Включаем dense-упаковку: CSS Grid сам заполнит пустые дыры подходящими карточками */
    grid-auto-flow: dense !important; 
}

/* Модификаторы размеров ячеек */
.case-item-wide { 
    grid-column: span 2 !important; 
}

.case-item-tall { 
    grid-row: span 2 !important; 
}

/* Контейнер карточки */
.case-item {
    position: relative;
    overflow: hidden;
    background-color: #111111;
    border: 1px solid #111111;
    display: block;
    width: 100%;
    height: 100%; /* Карточка строго заполняет выделенный Grid-слот */
}

/* Фикс для изображений внутри сетки */
.case-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Обрезает картинки строго по сетке, без искажений */
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-item:hover img { 
    transform: scale(1.04); 
}

/* Мобильная адаптация под UIkit-стандарт */
@media (max-width: 959px) {
    .engineering-cases-grid {
        grid-template-columns: 1fr !important;
        grid-auto-rows: 280px !important;
        gap: 15px !important;
    }
    .case-item-wide, 
    .case-item-tall {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }
}

/* =========================================
   РЕЕСТР КЕЙСОВ: СВЕРХЛЕГКИЙ DATA STRIP LAYOUT
   ========================================= */

.t2s-cases-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Отдельная полоса кейса */
.t2s-case-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #111111;
    /* Нативный SVG-шум без растровых внешних картинок */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.07'/%3E%3C/svg%3E");
    border: 1px solid #111111;
    padding: 24px 30px;
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
    color: #ffffff !important;
    transition: border-color 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.3s ease;
    box-sizing: border-box;
}

.t2s-case-strip:hover {
    border-color: #FF5C00;
    transform: translateX(4px);
}

/* Левая содержательная часть */
.t2s-case-strip__body {
    flex: 1 1 auto;
    padding-right: 40px;
}

.t2s-case-strip__meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.t2s-case-strip__code {
    font-family: monospace;
    font-size: 0.75rem;
    color: #FF5C00;
    letter-spacing: 0.1em;
}

.t2s-case-strip__tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 2px 8px;
}

.t2s-case-strip__title {
    color: #ffffff !important;
    margin: 0 0 8px 0 !important;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.t2s-case-strip__desc {
    color: #aaaaaa;
    font-size: 0.95rem;
    margin: 0;
    max-width: 900px;
    line-height: 1.4;
}

/* Правая часть: Кадр-ярлык и кнопка перехода */
.t2s-case-strip__action {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.t2s-case-strip__thumb {
    width: 240px;
    height: 120px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    position: relative;
    background: #000;
}

.t2s-case-strip__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%) contrast(1.1);
    transition: transform 0.5s ease, filter 0.5s ease;
}

.t2s-case-strip:hover .t2s-case-strip__thumb img {
    transform: scale(1.06);
    filter: grayscale(0%) contrast(1.05);
}

.t2s-case-strip__arrow {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.3s ease;
}

.t2s-case-strip:hover .t2s-case-strip__arrow {
    background: #FF5C00;
    border-color: #FF5C00;
    color: #ffffff;
}

.t2s-case-strip__arrow svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    transition: transform 0.3s ease;
}

.t2s-case-strip:hover .t2s-case-strip__arrow svg {
    transform: translate(2px, -2px);
}

/* Мобильная адаптация под UIkit */
@media (max-width: 959px) {
    .t2s-case-strip {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .t2s-case-strip__body {
        padding-right: 0;
        margin-bottom: 16px;
    }

    .t2s-case-strip__action {
        width: 100%;
        justify-content: space-between;
    }

    .t2s-case-strip__thumb {
        width: 100%;
        height: 160px;
    }
}