/* Секция ленты */
.feed-section {
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 20px 96px;
}

#feed {
    display: flex;
    flex-direction: column;
    gap: 28px;
    scroll-margin-top: calc(var(--nav-height) + 16px);
}

.feed-title {
    margin: 0 0 40px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(36px, 5vw, 52px);
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    color: var(--text);
}

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

.feed-empty {
    margin: 0;
    padding: 48px 24px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    color: #9ca3af;
    text-align: center;
}

/* Общие стили карточек */
.post-card,
.course-card {
    position: relative;
    overflow: hidden;
    padding: 12px;
    background: #181b22;
    border: 1px solid var(--border);
    border-radius: 18px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover,
.course-card:hover {
    transform: translateY(-3px);
    border-color: #3a4050;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.post-card img,
.course-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    transition: opacity 0.25s ease;
}

.post-card > a:first-child:hover img,
.course-card > a:first-child:hover img {
    opacity: 0.9;
}

.card-body {
    padding: 20px 14px 14px;
}

.card-body h2 {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

.card-body h2 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-body h2 a:hover {
    color: var(--accent);
}

.card-body p {
    margin: 0 0 20px;
    color: #9ca3af;
    font-size: 16px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-date {
    margin-bottom: 10px !important;
    color: #8b909a !important;
    font-size: 14px !important;
    letter-spacing: 0.02em;
}

/* Ссылка «Читати далі» / «Детальніше про курс» */
.card-body > a:last-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: gap 0.2s ease;
}

.card-body > a:last-child:hover {
    gap: 10px;
}

.post-card a:focus-visible,
.course-card a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Карточка курса */
.course-card {
    background:
            linear-gradient(160deg, rgba(165, 180, 252, 0.10) 0%, rgba(165, 180, 252, 0) 55%),
            #181b22;
    border-color: rgba(165, 180, 252, 0.45);
}

.course-card:hover {
    border-color: var(--accent);
    box-shadow: 0 16px 44px rgba(165, 180, 252, 0.12);
}

/* Метка «Курс» поверх фото */
.course-card .card-label {
    position: absolute;
    top: 26px;
    left: 26px;
    z-index: 1;
    margin: 0;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent);
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: inline-block;
    -webkit-line-clamp: unset;
}

/* Кнопка у курса */
.course-card .card-body > a:last-child {
    padding: 12px 24px;
    border-radius: 999px;
    background: var(--accent);
    color: #111827;
}

.course-card .card-body > a:last-child:hover {
    gap: 6px;
    box-shadow: 0 8px 24px rgba(165, 180, 252, 0.3);
}

/* Запасная ссылка «Далі» и маркер автозагрузки */
#next-link {
    display: block;
    width: fit-content;
    margin: 40px auto 0;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

#sentinel {
    height: 1px;
}

/* Мобильный */
@media (max-width: 600px) {
    .feed-section {
        padding: 40px 14px 72px;
    }

    #feed {
        gap: 20px;
    }

    .post-card,
    .course-card {
        padding: 8px;
        border-radius: 16px;
    }

    .card-body {
        padding: 16px 10px 10px;
    }

    .card-body h2 {
        font-size: 20px;
    }

    .course-card .card-label {
        top: 18px;
        left: 18px;
    }

    .course-card .card-body > a:last-child {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
}