﻿/* СЕТКА: широкая основная + одна боковая */
.case-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) 320px;
    gap: 24px;
    margin-top: 8px;
}

.case-main {
    min-width: 0;
}
/* чтобы контент не выпихивал колонку */
.case-side {
    position: sticky;
    top: 84px; /* подгоняй под высоту хедера сайта */
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Оглавление в сайдбаре */
.case-toc {
    border: 1px solid #1f2738;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .case-toc .toc-title {
        color: #9aa4b2;
        font-size: .85rem;
        padding: 2px 4px 6px 4px;
    }

    .case-toc a {
        padding: 6px 10px;
        border: 1px solid #1f2738;
        border-radius: 10px;
        text-decoration: none;
        color: #dfe7f6;
    }

        .case-toc a:hover {
            background: #141a28
        }

/* Ковер и мета в сайдбаре */
.cover {
    margin: 0;
    border: 1px solid #202a3d;
    border-radius: 12px;
    overflow: hidden
}

    .cover img {
        display: block;
        width: 100%;
        height: auto
    }

.meta {
    border: 1px solid #202a3d;
    border-radius: 14px;
    padding: 14px;
}

    .meta dl {
        margin: 0;
        display: grid;
        gap: 8px
    }

    .meta dt {
        color: #9aa4b2;
        font-size: .85rem
    }

    .meta dd {
        margin: 0
    }

/* Заголовочная часть в main */
.case-header .badge {
    color: #9aa4b2;
    border: 1px solid #1f2738;
    border-radius: 999px;
    padding: 4px 12px;
    display: inline-block
}

.case-header .title {
    margin: .2rem 0 0;
    font-weight: 800;
    font-size: clamp(28px,4.5vw,40px);
    background: linear-gradient(90deg,#67e8f9,#a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.case-header .subtitle {
    color: #c4ccda;
    margin: .25rem 0 .25rem
}

.case-header .lead {
    color: #aeb8c7
}

/* Контент */
.metrics {
    display: flex;
    gap: 18px;
    margin: 14px 0 8px
}

.metric .num {
    display: block;
    font-weight: 800
}

.metric .lbl {
    display: block;
    color: #9aa4b2
}

.content section {
    margin-bottom: 28px
}

.check {
    list-style: none;
    padding-left: 0
}

    .check li {
        margin: .25rem 0
    }

    .check i {
        color: #67e8f9;
        margin-right: .5rem
    }

.bullets {
    padding-left: 1.2rem
}

.steps {
    padding-left: 1.2rem
}

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

    .stack span {
        border: 1px solid #1f2738;
        border-radius: 999px;
        padding: 4px 10px
    }

.gallery {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 12px
}

    .gallery figure {
        margin: 0;
        border: 1px solid #202a3d;
        border-radius: 12px;
        overflow: hidden
    }

/* Анимация появления (если используешь data-reveal) */
[data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: all .6s cubic-bezier(.2,.6,.2,1)
}

    [data-reveal].show {
        opacity: 1;
        transform: none
    }

/* Адаптив */
@media (max-width: 1200px) {
    .case-grid {
        grid-template-columns: minmax(0,1fr) 280px;
    }
}

@media (max-width: 992px) {
    .case-grid {
        grid-template-columns: 1fr;
    }

    .case-side {
        position: relative;
        top: auto;
    }

    .gallery {
        grid-template-columns: 1fr;
    }
}

.cta {
    padding: 30px 0px;
}

/* === GALLERY THUMBS ===================================================== */
/* Глобально можно поменять отношение сторон эскизов: 16/9, 4/3, 1/1 */
:root {
    --case-thumb-ratio: 16/9;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 12px;
}

@media (max-width: 992px) {
    .gallery {
        grid-template-columns: 1fr;
    }
}

.gallery .frame {
    position: relative;
    aspect-ratio: var(--case-thumb-ratio);
    border: 1px solid #202a3d;
    border-radius: 12px;
    overflow: hidden;
    background: #0f141f;
}

.gallery .thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* ВПИСЫВАНИЕ ЦЕЛИКОМ */
    background: radial-gradient(100% 100% at 30% 20%, #1a2030, #0e1420);
}

/* === LIGHTBOX =========================================================== */
.lightbox[hidden] {
    display: none !important;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(5,8,13,.86);
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    justify-items: center;
    padding: 24px;
}

.lb-stage {
    position: relative;
    width: min(96vw, 1400px);
    height: min(90vh, 900px);
    display: grid;
    place-items: center;
}

#lbImg {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
    object-fit: contain; /* без обрезки */
    box-shadow: 0 18px 60px rgba(0,0,0,.45);
    border-radius: 12px;
    background: #0f141f;
}

.lb-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -40px;
    text-align: center;
    color: #c7d2e3;
    font-size: .95rem;
}

.lb-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(24,31,49,.7);
    color: #e8ecf1;
    font-size: 28px;
    line-height: 44px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.lb-prev {
    left: 14px;
}

.lb-next {
    right: 14px;
}

.lb-close {
    top: 14px;
    right: 14px;
    transform: none;
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-size: 24px;
}

.lb-btn:hover {
    background: rgba(36,46,74,.9);
}

.case-favicon {
    width: 100px;
    height: 100px;
    margin-right: 20px;
}

/* === CASES LIST ========================================================== */
.cases-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid #1f2738;
    border-radius: 12px;
    background: linear-gradient(180deg,#121827,#101522);
}

    .cases-filters .label {
        color: #9aa4b2;
        font-size: .9rem;
        margin-right: 4px;
    }

    .cases-filters .select {
        background: #0e1420;
        color: #e8ecf1;
        border: 1px solid #22304a;
        border-radius: 10px;
        padding: 6px 10px;
    }

.cases-grid {
    display: grid;
    /* grid-template-columns: repeat(2,1fr);  --- 2 COLUMNS*/ 
    gap: 14px;
}

@media (max-width: 992px) {
    .cases-grid {
        grid-template-columns: 1fr;
    }
}

.case-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 14px;
    border: 1px solid #1a2130;
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease;
}

    .case-card:hover {
        transform: translateY(-2px);
        border-color: #28324a;
    }

    .case-card .ico {
        flex: 0 0 auto;
        width: 56px;
        height: 56px;
        border-radius: 12px;
        overflow: hidden;
        display: grid;
        place-items: center;
        background: #0f141f;
        border: 1px solid #202a3d;
    }

        .case-card .ico img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

    .case-card .meta {
        min-width: 0;
    }

    .case-card .title {
        margin: 0 0 3px;
        font-size: 1.05rem;
        font-weight: 700;
    }

    .case-card .sub {
        color: #9aa4b2;
        font-size: .9rem;
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .case-card .sum {
        margin: .4rem 0 0;
        color: #cbd6ea;
        opacity: .95;
    }

    .case-card .tags {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        padding-left: 0;
        margin: .5rem 0 0;
    }

        .case-card .tags li {
            list-style: none;
            font-size: .8rem;
            color: #aeb8c9;
            border: 1px solid #1f2738;
            border-radius: 999px;
            padding: 2px 8px;
        }

/* Pager */
.pager {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    margin-top: 16px;
}

    .pager a {
        min-width: 36px;
        text-align: center;
        padding: 6px 10px;
        border: 1px solid #1f2738;
        border-radius: 10px;
        color: #e8ecf1;
    }

        .pager a.active {
            background: #1a2236;
            border-color: #2a3550;
        }

        .pager a.disabled {
            opacity: .5;
            pointer-events: none;
        }

    .pager .dots {
        padding: 0 6px;
        color: #9aa4b2;
    }

/* === CASES FILTERS: левая/правая зоны =================================== */
.cases-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid #1f2738;
    border-radius: 12px;
    background: linear-gradient(180deg,#121827,#101522);
}

    .cases-filters .label {
        color: #9aa4b2;
        font-size: .9rem;
        margin-right: 4px;
    }

    .cases-filters .select {
        background: #0e1420;
        color: #e8ecf1;
        border: 1px solid #22304a;
        border-radius: 10px;
        padding: 6px 10px;
    }

    .cases-filters .search {
        min-width: 260px;
    }

    .cases-filters .filters-left {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 12px;
        align-items: center;
    }

    .cases-filters .filters-right {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 12px;
        align-items: center;
        margin-left: auto;
    }

/* Cards (добавки) */
.case-card .row-top {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.case-card .date {
    color: #9aa4b2;
    font-size: .9rem;
}

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .75rem;
    border: 1px solid #1f2738;
    color: #cbd6ea;
    background: rgba(255,255,255,.04);
    margin-bottom: 10px;
}

.pill-project {
    color: #ffdba1;
    background: rgba(255,219,161,.08);
    border-color: #3b2f1a;
}

.pill-case {
    color: #a7c7ff;
    background: rgba(167,199,255,.08);
    border-color: #2a3350;
}

.case-card .subt {
    margin: .25rem 0 0;
    color: #cbd6ea;
    opacity: .95;
}
