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

body {
    margin: 0;
    overflow-x: clip;
    background: var(--bg);
    color: var(--text);
    font-family: 'Manrope', sans-serif;
}

/* ===== Сторінка ===== */

.courses-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 64px) 24px 80px;
}

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

.courses-header {
    max-width: 680px;
    margin: 0 auto 56px;
    text-align: center;
}

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

.courses-header__title {
    margin: 0 0 18px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(44px, 6vw, 72px);
    font-weight: 600;
    line-height: 1.05;
}

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

.courses-header__text {
    margin: 0;
    color: #b4b9c4;
    font-size: 17px;
    line-height: 1.6;
}

.courses-empty {
    padding: 48px 24px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    color: #b4b9c4;
    text-align: center;
}

/* ===== Сітка ===== */

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

/* ===== Картка курсу ===== */

.course-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px;
    background:
            linear-gradient(160deg, rgba(165, 180, 252, 0.10) 0%, rgba(165, 180, 252, 0) 55%),
            #181b22;
    border: 1px solid rgba(165, 180, 252, 0.4);
    border-radius: 20px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.course-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 18px 48px rgba(165, 180, 252, 0.14);
}

.course-item__image {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    background:
            radial-gradient(circle at 30% 30%, rgba(165, 180, 252, 0.22), transparent 60%),
            #1d2129;
}

.course-item__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.course-item:hover .course-item__image img {
    transform: scale(1.05);
}

.course-item__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent);
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.course-item__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 14px 14px;
}

.course-item__title {
    margin: 0 0 12px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.15;
}

.course-item__title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.course-item__title a:hover {
    color: var(--accent);
}

.course-item__text {
    margin: 0 0 22px;
    color: #c7cad1;
    font-size: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}



.course-item a:focus-visible,
.courses-pagination a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 8px;
}

/* ===== Пагінація ===== */

.courses-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 48px;
    color: #9ca3af;
    font-size: 14px;
}

.courses-pagination a {
    padding: 10px 22px;
    border: 1px solid #343a47;
    border-radius: 999px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.courses-pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== Планшет ===== */

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

/* ===== Мобільний ===== */

@media (max-width: 600px) {
    .courses-page {
        padding: calc(var(--nav-height) + 40px) 16px 64px;
    }

    .courses-header {
        margin-bottom: 36px;
        text-align: left;
    }

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

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

    .course-item__title {
        font-size: 24px;
    }
}