/* ═══════════════════════════════════════════════════════════════════════════
   single.css — WordPress Post Template Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS CUSTOM PROPERTIES ─────────────────────────────────────────────── */
:root {
    --accent: #5B6CFF;
    --accent-light: rgba(91, 108, 255, 0.15);
    --accent-dark: #8b99ff;
    --h-grad-start: #a78bfa;
    --h-grad-end: #38bdf8;

    --sp-text: #e2e8f0;
    --sp-text-muted: #94a3b8;
    --sp-surface: #0b1224;
    --sp-surface-card: #111827;
    --sp-border: rgba(255, 255, 255, 0.08);
    --sp-radius: 12px;
    --sp-radius-sm: 8px;
    --sp-max-w: 740px;
    --sp-wide-w: 1080px;

    --anim-dur: 0.5s;
    --anim-ease: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ─── BASE ───────────────────────────────────────────────────────────────── */
.sp-main {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--sp-text);
    line-height: 1.75;
    font-size: 17px;
    padding-bottom: 80px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 1 — SCROLL ANIMATION SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */
.observe-me {
    animation-fill-mode: both;
    animation-duration: var(--anim-dur);
    animation-timing-function: var(--anim-ease);
    animation-name: kf-fallback;
    animation-delay: 0.5s;
}

@keyframes kf-fallback {
    to {
        opacity: 1;
        transform: none;
    }
}

.fx-A1 {
    opacity: 0;
    transform: translateY(24px);
}

.fx-A1.is-visible {
    animation-name: kf-A1;
}

@keyframes kf-A1 {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fx-A2 {
    opacity: 0;
    transform: translateY(-20px);
}

.fx-A2.is-visible {
    animation-name: kf-A2;
}

@keyframes kf-A2 {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fx-A3 {
    opacity: 0;
    transform: translateX(-24px);
}

.fx-A3.is-visible {
    animation-name: kf-A3;
}

@keyframes kf-A3 {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fx-A4 {
    opacity: 0;
    transform: translateX(24px);
}

.fx-A4.is-visible {
    animation-name: kf-A4;
}

@keyframes kf-A4 {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fx-A5 {
    opacity: 0;
    transform: scale(0.95);
}

.fx-A5.is-visible {
    animation-name: kf-A5;
}

@keyframes kf-A5 {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fx-A7 {
    opacity: 0;
    filter: blur(6px);
}

.fx-A7.is-visible {
    animation-name: kf-A7;
}

@keyframes kf-A7 {
    from {
        opacity: 0;
        filter: blur(6px);
    }

    to {
        opacity: 1;
        filter: blur(0);
    }
}

.fx-A11 {
    opacity: 1;
}

.fx-A11 .stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

.fx-A11 .stagger-item.is-visible {
    animation-name: kf-A11;
}

@keyframes kf-A11 {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fx-A12 {
    opacity: 0;
}

.fx-A12.is-visible {
    animation-name: kf-A12;
}

@keyframes kf-A12 {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
        text-shadow: 0 0 20px var(--accent-light);
    }
}

.fx-A13 {
    opacity: 0;
    transform: scale(0.96) rotate(-1.5deg);
}

.fx-A13.is-visible {
    animation-name: kf-A13;
}

@keyframes kf-A13 {
    from {
        opacity: 0;
        transform: scale(0.96) rotate(-1.5deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@media (prefers-reduced-motion: reduce) {

    .observe-me,
    .fx-A11 .stagger-item {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 2 — HOVER EFFECTS
   ═══════════════════════════════════════════════════════════════════════════ */
.hx-H1 {
    transition: transform 0.28s var(--anim-ease), box-shadow 0.28s var(--anim-ease);
}

.hx-H1:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
}

.hx-H2 {
    position: relative;
    text-decoration: none;
}

.hx-H2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.28s var(--anim-ease);
    border-radius: 0;
}

.hx-H2:hover::after {
    width: 100%;
}

.hx-H3 {
    transition: background-color 0.24s ease, color 0.24s ease;
    border-radius: var(--sp-radius-sm);
}

.hx-H3:hover {
    background-color: var(--accent-light);
    color: var(--accent-dark);
}

.hx-H4 {
    transition: color 0.24s ease;
}

.hx-H4 .sp-icon,
.hx-H4 .sp-arrow {
    display: inline-block;
    transition: transform 0.24s var(--anim-ease);
}

.hx-H4:hover .sp-icon,
.hx-H4:hover .sp-arrow {
    transform: translateX(4px);
}

.hx-H4:hover {
    color: var(--accent);
}

.hx-H5 {
    overflow: hidden;
    display: block;
}

.hx-H5 img {
    transition: transform 0.40s var(--anim-ease);
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hx-H5:hover img {
    transform: scale(1.04);
}

.hx-H7 .sp-flip-icon {
    display: inline-block;
    transition: transform 0.28s var(--anim-ease);
}

.hx-H7:hover .sp-flip-icon,
.hx-H7[aria-expanded="true"] .sp-flip-icon {
    transform: rotate(180deg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 3 — IMAGE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
/* I1 — Hình tròn */
.img-I1 { border-radius: 50% !important; overflow: hidden !important; }
.img-I1 img { border-radius: 50% !important; display: block; }

/* I2 — Hình chữ nhật bo góc 16px */
.img-I2 { border-radius: 16px !important; overflow: hidden !important; }
.img-I2 img { border-radius: 16px !important; display: block; }

/* I3 — Hình đa giác lục giác */
.img-I3 { clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%) !important; overflow: hidden !important; }
.img-I3 img { display: block; }

/* I4 — Khung viền + shadow */
.img-I4 { border: 4px solid white !important; box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important; border-radius: var(--sp-radius-sm) !important; overflow: hidden !important; }
.img-I4 img { display: block; }

/* I5 — Glassmorphism */
.img-I5 { position: relative; border-radius: var(--sp-radius) !important; overflow: hidden !important; }
.img-I5::after { content: ''; position: absolute; inset: 0; backdrop-filter: blur(8px) !important; background: rgba(255,255,255,0.05) !important; pointer-events: none; }
.img-I5 img { display: block; }

/* I6 — Grayscale mặc định, hover đổi màu */
.img-I6 img { display: block; filter: grayscale(100%) !important; transition: filter 0.40s var(--anim-ease), transform 0.40s var(--anim-ease); }
.img-I6:hover img, .img-I6 a:hover img { filter: grayscale(0%) !important; transform: scale(1.03); }

/* I7 — Hình cut-out (cắt xéo) */
.img-I7 { clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%) !important; overflow: hidden !important; }
.img-I7 img { display: block; }

/* I8 — Border radius khác nhau */
.img-I8 { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40% !important; overflow: hidden !important; }
.img-I8 img { display: block; border-radius: 60% 40% 30% 70% / 60% 30% 70% 40% !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 4 — BACKGROUND STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
.bg-B1 {
    background-color: var(--sp-surface);
}

.bg-B2 {
    background: linear-gradient(160deg, var(--accent-light) 0%, var(--sp-surface) 45%);
}

.bg-B2 .sp-hero {
    background: transparent;
}

.bg-B3 .sp-hero {
    position: relative;
}

.bg-B3 .sp-dot-bg {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--accent) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
}

.bg-B3 .sp-hero-inner {
    position: relative;
    z-index: 1;
}

.bg-B4 .sp-hero {
    position: relative;
    padding-bottom: 80px;
}

.bg-B4 .sp-wave-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    line-height: 0;
    pointer-events: none;
}

.bg-B4 .sp-wave-bg svg {
    display: block;
    width: 100%;
    height: 80px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 5 — HERO + FEATURED IMAGE (bố cục mới: chồng lên nhau)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Wrapper bọc hero + ảnh thành 1 khối ── */
.sp-hero-block {
    position: relative;
    width: 100%;
    margin-bottom: 48px;
    overflow: hidden;
}

/* ── Ảnh nền hero — full-width, cố định chiều cao ── */
.sp-hero-bg {
    position: relative;
    width: 100%;
    height: clamp(380px, 55vh, 580px);
    overflow: hidden;
}

.sp-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    /* Không filter, không grayscale */
    filter: none;
    transition: transform 0.6s var(--anim-ease);
}

.sp-hero-block:hover .sp-hero-bg img {
    transform: scale(1.03);
}

/* Overlay gradient: tối dần từ dưới để chữ đọc được */
.sp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(11, 18, 36, 0.15) 0%,
            rgba(11, 18, 36, 0.55) 50%,
            rgba(11, 18, 36, 0.90) 100%);
    pointer-events: none;
}

/* ── Nội dung hero — nằm phía dưới ảnh, trên overlay ── */
.sp-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 40px 36px;
    z-index: 2;
}

.sp-hero-content-inner {
    max-width: var(--sp-wide-w);
    margin: 0 auto;
}

/* ── Meta (category + date) ── */
.sp-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.sp-cat {
    display: inline-block;
    padding: 3px 12px;
    background: var(--accent);
    color: #fff;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.22s ease, transform 0.22s ease;
}

.sp-cat:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.sp-date {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
}

/* ── Tiêu đề hero — cỡ vừa, không quá to ── */
.sp-title {
    font-size: clamp(22px, 3.5vw, 40px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0 0 14px;
    max-width: 760px;
    /* Gradient text */
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.82) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    /* Subtle glow */
    filter: drop-shadow(0 1px 8px rgba(0, 0, 0, 0.4));
}

/* ── Excerpt ── */
.sp-excerpt {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.6;
    margin: 0;
    max-width: 640px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Caption nếu có */
.sp-caption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--sp-text-muted);
    text-align: center;
    font-style: italic;
    padding: 0 24px;
}

/* Giữ sp-hero-inner cho B3/B4 fallback */
.sp-hero-inner {
    max-width: var(--sp-max-w);
    margin: 0 auto;
}

/* Fallback khi không có ảnh: hero dạng text thường */
.sp-hero--no-img {
    padding: 56px 40px 40px;
    max-width: var(--sp-wide-w);
    margin: 0 auto 48px;
}

.sp-hero--no-img .sp-title {
    font-size: clamp(24px, 4vw, 44px);
    background: linear-gradient(135deg, var(--h-grad-start) 0%, var(--h-grad-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    filter: none;
    max-width: 740px;
}

.sp-hero--no-img .sp-excerpt {
    color: var(--sp-text-muted);
    font-size: 18px;
    -webkit-line-clamp: unset;
}

.sp-hero--no-img .sp-meta {
    margin-bottom: 20px;
}

.sp-hero--no-img .sp-cat {
    background: var(--sp-surface-card);
    color: var(--accent);
    border: 1px solid var(--sp-border);
}

.sp-hero--no-img .sp-date {
    color: var(--sp-text-muted);
}

/* ── Author line (dùng trong cả hai layout) ── */
.sp-author-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.sp-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.sp-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-author-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sp-author-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.sp-read-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 7 — BODY LAYOUTS
   ═══════════════════════════════════════════════════════════════════════════ */
.sp-body {
    max-width: var(--sp-wide-w);
    margin: 0 auto;
    padding: 0 24px;
}

.sp-article--center {
    max-width: var(--sp-max-w);
    margin: 0 auto;
}

.sp-article--split {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    align-items: start;
}

@media (max-width: 768px) {
    .sp-article--split {
        grid-template-columns: 1fr;
    }
}

.sp-content-col {
    min-width: 0;
    overflow: hidden;
}

/* ── SIDEBAR sticky ── */
.sp-sidebar {
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--sp-border) transparent;
    background: var(--sp-surface-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 24px;
    font-size: 15px;
}

.sp-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sp-text-muted);
    margin: 0 0 12px;
}

.sp-article--zigzag {
    max-width: var(--sp-wide-w);
}

.sp-zigzag-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin: 48px 0;
}

.sp-zigzag-row--right {
    direction: rtl;
}

.sp-zigzag-row--right>* {
    direction: ltr;
}

.sp-zigzag-fig {
    line-height: 0;
}

.sp-zigzag-text {
    max-width: 520px;
}

@media (max-width: 640px) {
    .sp-zigzag-row {
        grid-template-columns: 1fr;
        direction: ltr !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 8 — CONTENT TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */
.sp-content {
    max-width: var(--sp-max-w);
}

/* ── Headings — gradient, không dùng !important trên color ── */
.sp-content h1,
.sp-content h2,
.sp-content h3,
.sp-content h4,
.sp-content h5,
.sp-content h6 {
    line-height: 1.3;
    margin: 2em 0 0.6em;
    background: linear-gradient(135deg, var(--h-grad-start) 0%, var(--h-grad-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.sp-content h1 *,
.sp-content h2 *,
.sp-content h3 *,
.sp-content h4 *,
.sp-content h5 *,
.sp-content h6 * {
    background: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* h2: border-left */
.sp-content h2 {
    font-size: 1.6em;
    font-weight: 700;
    border-left: 3px solid var(--accent);
    padding-left: 14px;
    border-radius: 0;
}

.sp-content h3 {
    font-size: 1.3em;
    font-weight: 700;
}

.sp-content h4 {
    font-size: 1.1em;
    font-weight: 600;
}

/* Body text */
.sp-content p,
.sp-content li,
.sp-content div,
.sp-content span {
    color: var(--sp-text) !important;
}

.sp-content p {
    margin: 0 0 1.4em;
}

.sp-content ul,
.sp-content ol {
    margin: 0 0 1.4em;
    padding-left: 1.5em;
    color: var(--sp-text) !important;
}

.sp-content li {
    margin-bottom: 0.5em;
}

.sp-content a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--accent);
    transition: all 0.2s ease;
    -webkit-text-fill-color: initial;
    background-clip: initial;
    -webkit-background-clip: initial;
    background-image: none;
}

.sp-content a:hover {
    color: #fff;
    background-color: var(--accent);
    background-image: none;
    -webkit-text-fill-color: #fff;
    border-radius: 2px;
}

/* Links dentro de headings */
.sp-content h1 a,
.sp-content h2 a,
.sp-content h3 a,
.sp-content h4 a {
    background: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: none;
}

/* ── CSS cho Wrapper Hình ảnh (AI Single Post Engine) ── */
.sp-post-image-wrapper {
    max-width: 100% !important;
    width: max-content !important;
    height: auto !important;
    display: block;
    margin: 32px auto !important;
    box-sizing: border-box !important;
}

.sp-post-image-wrapper img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    border-radius: var(--sp-radius-sm);
    box-sizing: border-box !important;
}

/* ── Xoá margin/width bừa bãi của WordPress block mặc định ── */
.sp-content figure,
.sp-content .wp-block-image,
.sp-content .wp-block-embed {
    max-width: 100% !important;
    margin: 32px auto !important;
    box-sizing: border-box !important;
}

/* ── Phục hồi tính năng alignleft / alignright cho Gutenberg và Classic Editor ── */
.sp-content .alignleft,
.sp-content figure.alignleft,
.sp-post-image-wrapper.alignleft {
    float: left !important;
    margin: 8px 32px 24px 0 !important;
    display: block !important;
}

.sp-content .alignright,
.sp-content figure.alignright,
.sp-post-image-wrapper.alignright {
    float: right !important;
    margin: 8px 0 24px 32px !important;
    display: block !important;
}

.sp-content .aligncenter,
.sp-content figure.aligncenter,
.sp-post-image-wrapper.aligncenter {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Đảm bảo hình ảnh bên trong thẻ có class align không bị phá layout */
.sp-content .alignleft .sp-post-image-wrapper,
.sp-content .alignright .sp-post-image-wrapper {
    margin: 0 !important;
}

.sp-content .alignwide {
    max-width: 900px !important;
    margin: 32px auto !important;
    display: block;
}

.sp-content .alignfull {
    max-width: 100% !important;
    width: 100% !important;
}

.sp-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 24px;
    margin: 24px 0;
    background: var(--accent-light);
    border-radius: 0 var(--sp-radius-sm) var(--sp-radius-sm) 0;
    font-style: italic;
    color: var(--sp-text-muted);
}

.sp-content pre,
.sp-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.88em;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}

.sp-content code {
    padding: 2px 6px;
}

.sp-content pre {
    padding: 20px;
    overflow-x: auto;
}

.sp-content pre code {
    background: none;
    padding: 0;
}

.sp-content figure {
    margin: 2em 0;
}

.sp-content figcaption {
    font-size: 13px;
    color: var(--sp-text-muted);
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 9 — POST FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */
.sp-post-footer {
    max-width: var(--sp-max-w);
    margin: 48px auto 0;
    padding: 32px 24px 0;
    border-top: 1px solid var(--sp-border);
}

.sp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.sp-tag {
    display: inline-block;
    padding: 5px 14px;
    border: 1px solid var(--sp-border);
    border-radius: 40px;
    font-size: 13px;
    color: var(--sp-text-muted);
    text-decoration: none;
    transition: border-color 0.22s ease, color 0.22s ease, background 0.22s ease;
}

.sp-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.sp-share {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.sp-share-label {
    font-size: 14px;
    color: var(--sp-text-muted);
    font-weight: 500;
}

.sp-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--sp-radius-sm);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: transform 0.22s var(--anim-ease), box-shadow 0.22s ease, opacity 0.22s ease;
}

.sp-share-btn--facebook {
    background: #1877F2;
    color: #fff;
}

.sp-share-btn--twitter {
    background: #000;
    color: #fff;
}

.sp-share-btn--linkedin {
    background: #0077B5;
    color: #fff;
}

.sp-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

.sp-author-bio {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 24px;
    background: var(--accent-light);
    border-radius: var(--sp-radius);
    margin-top: 8px;
}

.sp-bio-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.sp-bio-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-bio-text {
    flex: 1;
    min-width: 0;
}

.sp-bio-name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.sp-bio-desc {
    margin: 0;
    font-size: 14px;
    color: var(--sp-text-muted);
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 10 — POST NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */
.sp-post-nav {
    max-width: var(--sp-max-w);
    margin: 40px auto 0;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sp-nav-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    text-decoration: none;
    color: var(--sp-text);
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s var(--anim-ease);
}

.sp-nav-link:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}

.sp-nav-link--next {
    text-align: right;
}

.sp-nav-dir {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
}

.sp-nav-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 480px) {
    .sp-post-nav {
        grid-template-columns: 1fr;
    }

    .sp-nav-link--next {
        text-align: left;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 11 — RELATED POSTS
   ═══════════════════════════════════════════════════════════════════════════ */
.sp-related {
    max-width: var(--sp-wide-w);
    margin: 64px auto 0;
    padding: 0 24px;
}

.sp-related-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sp-text-muted);
    margin: 0 0 24px;
}

.sp-related-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.sp-related-grid .sp-related-card {
    /* 3 columns default */
    width: calc(33.333% - 16px);
}

.sp-related-grid--sidebar {
    flex-direction: column;
    gap: 16px;
}

.sp-related-grid--sidebar .sp-related-card {
    width: 100% !important;
}

@media (max-width: 900px) {
    .sp-related-grid .sp-related-card {
        width: calc(50% - 12px);
    }
}

@media (max-width: 480px) {
    .sp-related-grid .sp-related-card {
        width: 100%;
    }
}

.sp-related-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    overflow: hidden;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s var(--anim-ease);
}

.sp-related-card:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.sp-related-link {
    text-decoration: none;
    color: var(--sp-text);
    display: block;
}

.sp-related-img {
    line-height: 0;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.sp-related-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
    transition: transform 0.40s var(--anim-ease);
}

.sp-related-card:hover .sp-related-img img {
    transform: scale(1.04);
}

.sp-related-body {
    padding: 16px;
}

.sp-related-cat {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    margin-bottom: 6px;
}

.sp-related-post-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px;
    color: var(--sp-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-related-date {
    font-size: 12px;
    color: var(--sp-text-muted);
}

/* ─── OVERRIDE FOR SIDEBAR RELATED POSTS ─── */
.sp-related-grid--sidebar {
    grid-template-columns: 1fr !important;
    gap: 12px;
}

.sp-related-grid--sidebar .sp-related-card {
    border-radius: var(--sp-radius-sm);
    background: transparent;
    border: none;
    box-shadow: none;
    transition: none;
}

.sp-related-sidebar {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 24px;
    margin-top: 32px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.03);
}

.sp-sidebar-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sp-border);
    font-weight: 700;
}

.sp-related-grid--sidebar .sp-related-card {
    background: transparent;
    border: none;
    box-shadow: none;
    transition: none;
}

.sp-related-grid--sidebar .sp-related-card:hover {
    transform: none;
    box-shadow: none;
    border: none;
}

.sp-related-grid--sidebar .sp-related-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 10px;
    margin: -10px; /* Offset padding */
    border-radius: var(--sp-radius-sm);
    transition: background 0.3s ease, transform 0.3s ease;
}

.sp-related-grid--sidebar .sp-related-link:hover {
    background: var(--accent-light);
    transform: translateX(4px);
}

.sp-related-grid--sidebar .sp-related-img {
    width: 84px;
    height: 60px;
    min-width: 84px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.sp-related-grid--sidebar .sp-related-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--anim-ease);
}

.sp-related-grid--sidebar .sp-related-card:hover .sp-related-img img,
.sp-related-grid--sidebar .sp-related-link:hover .sp-related-img img {
    transform: scale(1.1);
}

.sp-related-grid--sidebar .sp-related-body {
    padding: 0;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sp-related-date {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sp-text-muted);
    font-weight: 600;
}

.sp-related-grid--sidebar .sp-related-post-title {
    font-size: 13px;
    line-height: 1.45;
    color: var(--sp-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 600;
    transition: color 0.3s ease;
}

.sp-related-grid--sidebar .sp-related-link:hover .sp-related-post-title {
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 12 — AUTHOR BOX
   ═══════════════════════════════════════════════════════════════════════════ */
.sp-author-box {
    max-width: var(--sp-max-w);
    margin: 64px auto 0;
    padding: 32px;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    display: flex;
    align-items: center;
    gap: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.sp-author-avatar {
    flex-shrink: 0;
}

.sp-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--h-grad-start) 0%, var(--h-grad-end) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.sp-author-info {
    flex-grow: 1;
}

.sp-author-name {
    font-size: 1.4rem;
    margin: 0 0 12px;
    color: var(--accent);
    font-weight: 700;
}

.sp-author-desc {
    color: var(--sp-text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 16px;
}

.sp-author-links {
    display: flex;
    gap: 16px;
}

.sp-author-link {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--sp-border);
    color: var(--sp-text);
    text-decoration: none;
    border-radius: var(--sp-radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sp-author-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

@media (max-width: 600px) {
    .sp-author-box {
        flex-direction: column;
        text-align: center;
        gap: 24px;
        padding: 24px 16px;
    }

    .sp-author-links {
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 13 — TAG CLOUD
   ═══════════════════════════════════════════════════════════════════════════ */
.sp-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 14 — RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sp-hero-content {
        padding: 24px 20px 28px;
    }

    .sp-title {
        font-size: clamp(20px, 5.5vw, 32px);
    }

    .sp-hero-bg {
        height: clamp(280px, 50vw, 400px);
    }

    .sp-hero--no-img {
        padding: 36px 20px 28px;
    }

    .sp-post-footer,
    .sp-post-nav,
    .sp-related,
    .sp-comments {
        padding: 0 16px;
    }

    .sp-body {
        padding: 0 16px;
    }

    .sp-author-bio {
        flex-direction: column;
    }

    .sp-bio-avatar {
        width: 56px;
        height: 56px;
    }

    .sp-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

@media print {

    .sp-share,
    .sp-post-nav,
    .sp-related,
    .sp-comments {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION 14 — PRICING TABLE (CARDS)
   ═══════════════════════════════════════════════════════════════════════════ */
.sp-content .wp-block-table,
.sp-content table {
    margin: 48px 0;
    width: 100%;
    overflow: visible;
}

.sp-content .wp-block-table table,
.sp-content table {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    border: none;
    background: transparent;
    padding: 0;
}

.sp-content .wp-block-table thead,
.sp-content table thead,
.sp-content .wp-block-table th,
.sp-content table th {
    display: none;
}

.sp-content .wp-block-table tbody,
.sp-content table tbody {
    display: contents;
}

.sp-content .wp-block-table tr,
.sp-content table tr {
    display: flex;
    flex-direction: column;
    flex: 1 1 250px;
    max-width: 320px;
    background: var(--sp-surface-card);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 32px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sp-content .wp-block-table tr:hover,
.sp-content table tr:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.sp-content table tr::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--h-grad-start) 0%, var(--h-grad-end) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sp-content table tr:hover::before {
    opacity: 1;
}

.sp-content .wp-block-table td,
.sp-content table td {
    display: block;
    border: none;
    padding: 0;
    margin-bottom: 16px;
    line-height: 1.5;
    background: transparent;
}

.sp-content .wp-block-table td:last-child,
.sp-content table td:last-child {
    margin-bottom: 0;
}

.sp-content table td:nth-child(1) {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sp-content table td:nth-child(2) {
    font-size: 2rem;
    font-weight: 800;
    color: var(--sp-text);
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.sp-content table td:nth-child(n+3) {
    font-size: 0.95rem;
    color: var(--sp-text-muted);
    position: relative;
    padding-left: 28px;
}

.sp-content table td:nth-child(n+3)::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #10b981;
    font-weight: bold;
    font-size: 1.1rem;
}

.sp-content table tr:nth-child(3) {
    border-color: var(--accent);
    transform: scale(1.05);
    z-index: 1;
}

.sp-content table tr:nth-child(3)::before {
    opacity: 1;
}

.sp-content table tr:nth-child(3) td:nth-child(1)::after {
    content: "Phổ Biến";
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0;
    text-transform: none;
}

@media (max-width: 768px) {

    .sp-content .wp-block-table table,
    .sp-content table {
        grid-template-columns: 1fr;
    }

    .sp-content table tr:nth-child(3) {
        transform: none;
    }
}