/* ===== Список тестов /tests ===== */

:root {
    --bg: #0f1115;
    --surface: #181b22;
    --surface-sunken: #12141a;
    --border: #2f3542;
    --text: #f3f4f6;
    --text-soft: #d1d5db;
    --muted: #9ca3af;
    --accent: #a5b4fc;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: clip;
    background:
            radial-gradient(900px 500px at 85% -10%, rgba(165, 180, 252, 0.12), transparent 65%),
            radial-gradient(700px 400px at -10% 100%, rgba(165, 180, 252, 0.06), transparent 65%),
            var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Manrope', sans-serif;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ===== Страница ===== */

.tests-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 120px 24px 80px; /* сверху — место под прозрачный nav */
}

/* ===== Шапка ===== */

.tests-header {
    max-width: 720px;
    margin-bottom: 48px;
}

.tests-header__label {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tests-header__title {
    margin: 0 0 16px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(42px, 6vw, 68px);
    font-weight: 600;
    line-height: 1.02;
}

.tests-header__title em {
    color: var(--accent);
    font-style: italic;
    font-weight: 500;
}

.tests-header__text {
    margin: 0;
    color: var(--text-soft);
    font-size: 17px;
    line-height: 1.65;
}

.tests-empty {
    padding: 48px 24px;
    border: 1px dashed var(--border);
    border-radius: 20px;
    color: var(--muted);
    text-align: center;
}

/* ===== Сетка ===== */

.tests-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* ===== Карточка ===== */

.test-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.test-card:hover {
    transform: translateY(-4px);
    border-color: rgba(165, 180, 252, 0.45);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.test-card__image {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-sunken);
}

.test-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.test-card:hover .test-card__image img {
    transform: scale(1.04);
}

.test-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background:
            radial-gradient(circle at 30% 30%, rgba(165, 180, 252, 0.25), transparent 60%),
            linear-gradient(135deg, #1c2030, #12141a);
}

.test-card__placeholder svg {
    width: 56px;
    height: 56px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.7;
}



.test-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px 24px 24px;
}

.test-card__title {
    margin: 0 0 10px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.15;
}

.test-card__title a {
    color: var(--text);
    text-decoration: none;
}

.test-card__title a:hover {
    color: var(--accent);
}

.test-card__text {
    flex: 1;
    margin: 0 0 20px;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.test-card__link {
    align-self: flex-start;
    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.test-card__link span {
    display: inline-block;
    transition: transform 0.2s ease;
}

.test-card__link:hover span {
    transform: translateX(4px);
}

/* ===== Подгрузка ===== */

.tests-next {
    display: block;
    width: fit-content;
    margin: 48px auto 0;
    padding: 14px 32px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.tests-next:hover {
    background: var(--accent);
    color: #111827;
}

.tests-note {
    max-width: 640px;
    margin: 56px auto 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

/* ===== Планшет и мобильный ===== */

@media (max-width: 960px) {
    .tests-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }
}

@media (max-width: 600px) {
    .tests-page {
        padding: 96px 16px 56px;
    }

    .tests-header {
        margin-bottom: 32px;
    }

    .tests-header__text {
        font-size: 16px;
    }

    .tests-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .test-card__body {
        padding: 18px 18px 20px;
    }

    .test-card__title {
        font-size: 24px;
    }
}