:root {
    --tg-blue: #3390ec;
    --tg-bg: #f1f2f6;
    --text-main: #222222;
    --tag-bg: #e4f2fe;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--tg-bg);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    overflow-wrap: break-word;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Nav */
header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--tg-blue);
}

.btn-tg-small {
    background: var(--tg-blue);
    color: white !important;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
}

/* Grid & Case Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.case-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    /* Позволяет ссылке внутри растянуться на весь блок */
    position: relative; 
}

.case-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -10px rgba(0,0,0,0.08);
    border-color: var(--tg-blue);
}

.case-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #f3f4f6;
}

.case-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Стилизация категории (Тега) */
.tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tg-blue);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    align-self: flex-start;
    z-index: 2; /* Поверх растянутой ссылки */
}

/* Выделение заголовка */
.case-card h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-main);
}

.case-card p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
}

.case-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px dashed #e5e7eb;
}

.metrics {
    font-weight: 800;
    color: #10b981;
    font-size: 14px;
}

.btn-read {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Растягиваем область клика на всю карточку */
.btn-read::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.btn-read:hover {
    color: var(--tg-blue);
}

/* Lightbox & Zoom */
.img-zoom-container {
    position: relative;
    cursor: zoom-in;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin: 2rem 0;
}

.img-zoom-container img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.img-zoom-container:hover img {
    transform: scale(1.03);
}

@media (max-width: 640px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    .nav-links {
        gap: 15px;
    }
}

footer {
    padding: 60px 0 40px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}
