/* =====================================================
   guide.css — trang Hướng dẫn sử dụng (danh sách video)
   Dữ liệu video: site_config.guide_video_links → YouTube oEmbed.
   Bố cục: header + lưới card video + sidebar (tổng quan, video mới).
   Tìm kiếm + phân trang client-side.
   ===================================================== */

.guide {
    padding: var(--stc-space-16, 64px) 0 var(--stc-space-20, 80px);
    min-height: 60vh;
    background:
        radial-gradient(900px 380px at 12% -8%, var(--stc-primary-a08, rgba(39, 164, 242, .08)), transparent 62%),
        var(--stc-page, #f5fafd);
}

.guide__inner {
    width: 100%;
    max-width: var(--stc-container, 1200px);
    margin-inline: auto;
    padding-inline: 20px;
    box-sizing: border-box;
}

/* ---------- Header ---------- */
.guide__head {
    text-align: center;
    margin-bottom: var(--stc-space-10, 40px);
}

.guide__eyebrow {
    font-size: var(--stc-text-xs, 11px);
    font-weight: var(--stc-weight-semibold, 600);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--stc-primary, #27a4f2);
    margin-bottom: var(--stc-space-2, 8px);
}

.guide__title {
    font-size: var(--stc-text-4xl, 36px);
    font-weight: var(--stc-weight-extrabold, 800);
    color: var(--stc-text-strong, #16324a);
    line-height: var(--stc-leading-tight, 1.25);
    margin: 0 0 var(--stc-space-3, 12px);
}

.guide__title span,
.guide__title em {
    color: var(--stc-primary, #27a4f2);
    font-style: normal;
}

.guide__subtitle {
    font-size: var(--stc-text-lg, 16px);
    color: var(--stc-text-muted, #6b93b1);
    max-width: 640px;
    margin-inline: auto;
    line-height: var(--stc-leading-normal, 1.55);
}

/* ---------- Layout 2 cột ---------- */
.guide__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--stc-space-8, 32px);
    align-items: start;
}

/* ---------- Toolbar + filter ---------- */
.guide__toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--stc-space-4, 16px);
    margin-bottom: var(--stc-space-5, 20px);
}

.guide__toolbar h2 {
    font-size: var(--stc-text-2xl, 22px);
    font-weight: var(--stc-weight-bold, 700);
    color: var(--stc-text-strong, #16324a);
    margin: 0 0 4px;
}

.guide__toolbar p {
    font-size: var(--stc-text-base, 14px);
    color: var(--stc-text-muted, #6b93b1);
    margin: 0;
}

.guide__toolbar a {
    font-size: var(--stc-text-sm, 12px);
    font-weight: var(--stc-weight-semibold, 600);
    color: var(--stc-primary, #27a4f2);
    text-decoration: none;
}

.guide__toolbar a:hover { text-decoration: underline; }

.guide__filter {
    display: flex;
    gap: var(--stc-space-3, 12px);
    align-items: flex-end;
    background: var(--stc-surface, #ffffff);
    border: 1px solid var(--stc-border, #d9e8f3);
    border-radius: var(--stc-radius-md, 14px);
    padding: var(--stc-space-4, 16px);
    margin-bottom: var(--stc-space-6, 24px);
    box-shadow: var(--stc-shadow-xs);
}

.guide__filter label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.guide__filter label span {
    font-size: var(--stc-text-sm, 12px);
    font-weight: var(--stc-weight-semibold, 600);
    color: var(--stc-text, #24425c);
}

.guide__filter input[type="search"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--stc-border, #d9e8f3);
    border-radius: var(--stc-radius-xs, 8px);
    font: inherit;
    font-size: var(--stc-text-base, 14px);
    color: var(--stc-text-strong, #16324a);
    background: var(--stc-surface-subtle, #fafcff);
    box-sizing: border-box;
}

.guide__filter input[type="search"]:focus {
    outline: 2px solid var(--stc-focus, rgba(39, 164, 242, .3));
    outline-offset: 1px;
    border-color: var(--stc-primary, #27a4f2);
}

/* ---------- Grid video ---------- */
.guide__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--stc-space-5, 20px);
}

.guide-card {
    background: var(--stc-surface, #ffffff);
    border: 1px solid var(--stc-border, #d9e8f3);
    border-radius: var(--stc-radius-md, 14px);
    overflow: hidden;
    box-shadow: var(--stc-shadow-xs);
    display: flex;
    flex-direction: column;
    transition: transform var(--stc-duration-normal, 220ms) var(--stc-ease),
                box-shadow var(--stc-duration-normal, 220ms) var(--stc-ease);
}

.guide-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--stc-shadow-md);
}

.guide-card__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--stc-neutral-100, #ebf4fa);
    overflow: hidden;
}

.guide-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s var(--stc-ease, ease);
}

.guide-card:hover .guide-card__thumb img {
    transform: scale(1.05);
}

.guide-card__thumb--empty::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--stc-primary-soft, #e8f5fe), var(--stc-neutral-100, #ebf4fa));
}

.guide-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-card__play svg {
    width: 46px;
    height: 46px;
    padding: 11px;
    box-sizing: content-box;
    border-radius: 50%;
    background: var(--stc-primary, #27a4f2);
    color: var(--stc-white, #ffffff);
    box-shadow: var(--stc-shadow-primary);
    transition: transform var(--stc-duration-normal, 220ms) var(--stc-ease);
}

.guide-card:hover .guide-card__play svg {
    transform: scale(1.12);
}

.guide-card__body {
    padding: var(--stc-space-4, 16px);
    display: flex;
    flex-direction: column;
    gap: var(--stc-space-2, 8px);
    flex: 1;
}

.guide-card__meta {
    display: flex;
    align-items: center;
    gap: var(--stc-space-2, 8px);
    font-size: var(--stc-text-sm, 12px);
    color: var(--stc-text-muted, #6b93b1);
}

.guide-card__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--stc-radius-pill, 999px);
    background: var(--stc-primary-soft, #e8f5fe);
    color: var(--stc-primary, #27a4f2);
    font-weight: var(--stc-weight-semibold, 600);
}

.guide-card__title {
    font-size: var(--stc-text-lg, 16px);
    font-weight: var(--stc-weight-bold, 700);
    line-height: var(--stc-leading-tight, 1.25);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.guide-card__title a {
    color: var(--stc-text-strong, #16324a);
    text-decoration: none;
}

.guide-card__title a:hover {
    color: var(--stc-primary, #27a4f2);
}

.guide-card__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    font-size: var(--stc-text-base, 14px);
    font-weight: var(--stc-weight-semibold, 600);
    color: var(--stc-primary, #27a4f2);
    text-decoration: none;
}

.guide-card__more:hover { text-decoration: underline; }

/* ---------- Empty states ---------- */
.guide__empty {
    background: var(--stc-surface, #ffffff);
    border: 1px dashed var(--stc-border-strong, #bfd8ea);
    border-radius: var(--stc-radius-md, 14px);
    text-align: center;
    padding: var(--stc-space-10, 40px) var(--stc-space-6, 24px);
}

.guide__empty h3 {
    font-size: var(--stc-text-xl, 18px);
    font-weight: var(--stc-weight-bold, 700);
    color: var(--stc-text-strong, #16324a);
    margin: 0 0 var(--stc-space-2, 8px);
}

.guide__empty p {
    font-size: var(--stc-text-base, 14px);
    color: var(--stc-text-muted, #6b93b1);
    margin: 0 0 var(--stc-space-4, 16px);
}

.guide__empty a {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--stc-radius-pill, 999px);
    background: var(--stc-primary, #27a4f2);
    color: var(--stc-white, #ffffff);
    font-size: var(--stc-text-base, 14px);
    font-weight: var(--stc-weight-semibold, 600);
    text-decoration: none;
    box-shadow: var(--stc-shadow-primary);
    transition: background var(--stc-duration-fast, 140ms) var(--stc-ease);
}

.guide__empty a:hover {
    background: var(--stc-primary-hover, #1b8fd9);
    color: var(--stc-white, #ffffff);
}

/* ---------- Pager ---------- */
.guide__pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--stc-space-4, 16px);
    margin-top: var(--stc-space-6, 24px);
}

.guide__pager span {
    font-size: var(--stc-text-base, 14px);
    color: var(--stc-text-muted, #6b93b1);
}

/* ---------- Sidebar ---------- */
.guide-side-card {
    background: var(--stc-surface, #ffffff);
    border: 1px solid var(--stc-border, #d9e8f3);
    border-radius: var(--stc-radius-md, 14px);
    padding: var(--stc-space-5, 20px);
    box-shadow: var(--stc-shadow-xs);
    margin-bottom: var(--stc-space-5, 20px);
}

.guide-side-card h2 {
    font-size: var(--stc-text-lg, 16px);
    font-weight: var(--stc-weight-bold, 700);
    color: var(--stc-text-strong, #16324a);
    margin: 0 0 var(--stc-space-3, 12px);
}

.guide-side-card__links {
    display: flex;
    flex-direction: column;
    gap: var(--stc-space-2, 8px);
}

.guide-side-card__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--stc-space-3, 12px);
    padding: 10px 14px;
    border-radius: var(--stc-radius-xs, 8px);
    font-size: var(--stc-text-base, 14px);
    color: var(--stc-text, #24425c);
    text-decoration: none;
    background: var(--stc-surface-subtle, #fafcff);
    border: 1px solid transparent;
    transition: border-color var(--stc-duration-fast, 140ms) var(--stc-ease),
                color var(--stc-duration-fast, 140ms) var(--stc-ease);
}

.guide-side-card__link:hover {
    border-color: var(--stc-border, #d9e8f3);
    color: var(--stc-primary, #27a4f2);
}

.guide-side-card__link--active {
    background: var(--stc-primary-soft, #e8f5fe);
    color: var(--stc-primary, #27a4f2);
    font-weight: var(--stc-weight-semibold, 600);
}

.guide-side-card__link b {
    font-size: var(--stc-text-base, 14px);
}

/* Video mới ở sidebar */
.guide-side-latest {
    display: flex;
    flex-direction: column;
    gap: var(--stc-space-3, 12px);
}

.guide-side-latest a {
    display: flex;
    align-items: center;
    gap: var(--stc-space-3, 12px);
    text-decoration: none;
}

.guide-side-latest__thumb {
    position: relative;
    width: 76px;
    height: 46px;
    flex: 0 0 76px;
    border-radius: var(--stc-radius-xs, 8px);
    overflow: hidden;
    background: var(--stc-neutral-100, #ebf4fa);
}

.guide-side-latest__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.guide-side-latest__thumb--empty::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--stc-primary-soft, #e8f5fe), var(--stc-neutral-100, #ebf4fa));
}

.guide-side-latest__thumb svg {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 14px;
    height: 14px;
    color: var(--stc-white, #ffffff);
    background: var(--stc-primary, #27a4f2);
    border-radius: 50%;
    padding: 4px;
    box-sizing: content-box;
}

.guide-side-latest b {
    font-size: var(--stc-text-base, 14px);
    font-weight: var(--stc-weight-semibold, 600);
    color: var(--stc-text-strong, #16324a);
    line-height: var(--stc-leading-tight, 1.25);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.guide-side-latest a:hover b {
    color: var(--stc-primary, #27a4f2);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .guide__layout {
        grid-template-columns: 1fr;
    }
    .guide__side {
        order: 2;
    }
}

@media (max-width: 720px) {
    .guide {
        padding: var(--stc-space-10, 40px) 0 var(--stc-space-16, 64px);
    }
    .guide__title {
        font-size: var(--stc-text-3xl, 28px);
    }
    .guide__filter {
        flex-direction: column;
        align-items: stretch;
    }
    .guide__toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
