/* ================================================================
   Боковая колонка <aside> и раскладка «лента + колонка»
   Фрагменты: fragments/sidebar.html, fragments/sidebar/*.html
   Колонка видна только на широких экранах (от 1100px).
   Переменные --bg, --text, --accent, --nav-height — из nav.css.
   ================================================================ */

/* ===== Раскладка: лента слева, колонка справа ===== */

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 680px) 320px;
    justify-content: center;
    align-items: start;
    gap: 56px;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* внутри сетки ширину и выравнивание ленты задаёт сетка */
.home-layout .feed-section {
    max-width: none;
    margin: 0;
    padding: 48px 0 80px;
}

/* ===== Колонка ===== */

.home-aside {
    align-self: stretch;
    padding: 48px 0 80px;
}

/* липкая часть: едет за прокруткой под навигацией */
.home-aside__inner {
    position: sticky;
    top: calc(var(--nav-height) + 20px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== Общая карточка виджета ===== */

.aside-widget {
    --w-line: rgba(255, 255, 255, 0.08);

    position: relative;
    padding: 20px;
    border: 1px solid var(--w-line);
    border-radius: 20px;
    background:
            radial-gradient(260px 120px at 0% 0%, rgba(165, 180, 252, 0.10), transparent 70%),
            linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
    overflow: hidden;
}

/* тонкая светящаяся линия сверху — как у блока «Поделиться» и подвала */
.aside-widget::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(165, 180, 252, 0.5), transparent);
}

.aside-widget__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.aside-widget__title {
    margin: 0;
    color: var(--text);
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
}

.aside-widget__more {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.aside-widget__more:hover {
    opacity: 0.8;
}

/* ===== Виджет «Запись на консультацию» ===== */

.aside-booking {
    padding: 24px 22px 22px;
    text-align: center;
    border-color: transparent;
    /* градиентная рамка — главный виджет, выделяем сильнее */
    background:
            radial-gradient(280px 160px at 50% 0%, rgba(165, 180, 252, 0.18), transparent 70%) padding-box,
            linear-gradient(160deg, #1b1f28, #15181f) padding-box,
            linear-gradient(150deg, rgba(165, 180, 252, 0.55), rgba(255, 255, 255, 0.05) 50%, rgba(165, 180, 252, 0.25)) border-box;
    box-shadow: 0 24px 48px -30px rgba(0, 0, 0, 0.8);
}

.aside-booking::before {
    display: none;
}

.aside-booking__avatar {
    display: block;
    width: 84px;
    height: 84px;
    margin: 0 auto 16px;
    border-radius: 50%;
    object-fit: cover;
    /* кольцо со свечением вокруг фото */
    box-shadow:
            0 0 0 3px #15181f,
            0 0 0 4px rgba(165, 180, 252, 0.6),
            0 12px 28px -8px rgba(165, 180, 252, 0.45);
}

.aside-booking__title {
    margin: 0 0 8px;
    color: var(--text);
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.15;
}

.aside-booking__text {
    margin: 0 0 18px;
    color: #b4b9c4;
    font-size: 14px;
    line-height: 1.6;
}

.aside-booking__btn {
    width: 100%;
}

/* ===== Виджет «Новые выпуски» ===== */

.aside-podcasts__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 -8px;
    padding: 0;
    list-style: none;
}

.aside-podcasts__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease;
}

.aside-podcasts__item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.aside-podcasts__cover {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.aside-podcasts__cover--empty {
    background:
            radial-gradient(circle at 30% 30%, rgba(165, 180, 252, 0.35), transparent 60%),
            #1a1d24;
}

.aside-podcasts__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.aside-podcasts__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.aside-podcasts__item:hover .aside-podcasts__name {
    color: var(--accent);
}

.aside-podcasts__meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #9aa0ab;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.aside-podcasts__meta svg {
    color: var(--accent);
}

/* ===== Фокус с клавиатуры ===== */

.aside-widget__more:focus-visible,
.aside-podcasts__item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== Экраны уже 1100px: колонки нет, лента как раньше ===== */

@media (max-width: 1100px) {
    .home-layout {
        display: block;
        max-width: none;
        padding: 0;
    }

    .home-layout .feed-section {
        max-width: 680px;
        margin: 0 auto;
        padding: 48px 20px 80px;
    }

    .home-aside {
        display: none;
    }
}

/* ===== Для тех, кто отключил анимации в системе ===== */

@media (prefers-reduced-motion: reduce) {
    .aside-widget__more,
    .aside-podcasts__item,
    .aside-podcasts__name {
        transition: none;
    }
}