/* AchieveAI — Related Articles / Guides (compact sticky sidebar) */

.related-articles {
    width: 100%;
}

.related-articles__card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background:
        radial-gradient(circle at 12% 0%, rgba(77, 124, 254, 0.14), transparent 42%),
        rgba(8, 13, 21, 0.92);
    border: 1px solid rgba(77, 124, 254, 0.18);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.related-articles__topbar {
    height: 2px;
    background: linear-gradient(90deg, #4D7CFE, #00ffa2);
    opacity: 0.95;
}

.related-articles__header {
    padding: 0.7rem 0.8rem 0.45rem;
}

.related-articles__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    padding: 0.18rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(0, 255, 162, 0.2);
    background: rgba(0, 255, 162, 0.08);
    color: #00ffa2;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.related-articles__badge-dot {
    width: 0.32rem;
    height: 0.32rem;
    border-radius: 9999px;
    background: #00ffa2;
    box-shadow: 0 0 8px rgba(0, 255, 162, 0.65);
}

.related-articles__title {
    margin: 0;
    color: #f8fbff;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.related-articles__subtitle {
    display: none;
}

.related-articles__list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0.15rem 0.55rem 0.35rem !important;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.related-articles__list > li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.related-articles__list > li::before {
    display: none !important;
    content: none !important;
}

.related-articles__item {
    display: grid !important;
    grid-template-columns: 2.15rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.5rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(77, 124, 254, 0.1);
    background: rgba(5, 8, 13, 0.4);
    color: inherit;
    text-decoration: none !important;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.related-articles__item:hover {
    border-color: rgba(77, 124, 254, 0.28);
    background: rgba(77, 124, 254, 0.08);
    text-decoration: none !important;
}

.related-articles__thumb {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 0.55rem;
    overflow: hidden;
    border: 1px solid rgba(77, 124, 254, 0.16);
    background: rgba(77, 124, 254, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.related-articles__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.related-articles__thumb-fallback {
    color: #9fb8ff;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.related-articles__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.related-articles__meta {
    display: block;
    color: #00ffa2;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.1;
}

.related-articles__item-title {
    display: -webkit-box;
    color: #f1f5ff;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-articles__excerpt {
    display: none;
}

.related-articles__arrow {
    color: #7fa2ff;
    font-size: 0.8rem;
    opacity: 0.65;
    transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.related-articles__item:hover .related-articles__arrow {
    opacity: 1;
    color: #00ffa2;
    transform: translateX(2px);
}

.related-articles__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin: 0.1rem 0.55rem 0.55rem;
    padding: 0.48rem 0.65rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(77, 124, 254, 0.14);
    background: linear-gradient(135deg, rgba(77, 124, 254, 0.1), rgba(0, 255, 162, 0.06));
    color: #e7ecff;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.related-articles__footer:hover {
    border-color: rgba(0, 255, 162, 0.28);
    color: #00ffa2;
    text-decoration: none !important;
}

/* Sticky sidebar: keep the whole card in view */
.dark-theme-sidebar .related-articles,
.sidebar-container .related-articles {
    max-height: calc(100vh - 7.5rem);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(77, 124, 254, 0.35) transparent;
}

.dark-theme-sidebar .related-articles::-webkit-scrollbar,
.sidebar-container .related-articles::-webkit-scrollbar {
    width: 4px;
}

.dark-theme-sidebar .related-articles::-webkit-scrollbar-thumb,
.sidebar-container .related-articles::-webkit-scrollbar-thumb {
    background: rgba(77, 124, 254, 0.35);
    border-radius: 9999px;
}

@media (max-width: 1023px) {
    .related-articles {
        margin: 1rem 0;
        max-height: none;
        overflow: visible;
    }

    .related-articles__subtitle {
        display: block;
        margin: 0.25rem 0 0;
        color: #94a3b8;
        font-size: 0.78rem;
        line-height: 1.4;
    }
}
