/* ── Tài liệu page (template-tai-lieu.php) ──────────────────────────── */

.tai-lieu-page {
    background: #F8FAFF;
}

.doc-layout {
    display: flex;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 4rem;
    gap: 2rem;
}

.tai-lieu-single-page .doc-layout {
    max-width: 1680px;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.doc-sidebar {
    flex: 0 0 280px;
    width: 280px;
    position: sticky;
    top: 104px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 1.25rem 1.25rem 1.25rem 0;
    border-right: 1px solid #E8ECF4;
    transition: width 0.2s ease, opacity 0.2s ease, padding 0.2s ease;
}

.doc-layout.is-sidebar-collapsed .doc-sidebar {
    width: 0;
    flex-basis: 0;
    padding: 1.25rem 0;
    opacity: 0;
    overflow: hidden;
    border: none;
    pointer-events: none;
}

.doc-sidebar-collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.doc-sidebar-collapse:hover {
    background: #185ADB;
    color: #fff;
    border-color: #185ADB;
}

.doc-layout.is-sidebar-collapsed .doc-sidebar-collapse svg {
    transform: rotate(180deg);
}

.doc-sidebar-search {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #F3F4F6;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1.25rem;
    color: #9CA3AF;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.doc-sidebar-search:focus-within {
    background: #fff;
    border-color: #185ADB;
}

.doc-sidebar-search svg {
    flex-shrink: 0;
}

.doc-sidebar-search input {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.9rem;
    font-family: 'Mulish', sans-serif;
    color: #374151;
}

.doc-sidebar-search input::placeholder {
    color: #9CA3AF;
}

.doc-sidebar-search input::-webkit-search-decoration,
.doc-sidebar-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.doc-sidebar-overview {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #185ADB;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    text-decoration: none;
}

.doc-sidebar-overview.is-active {
    background: #EEF3FF;
}

.doc-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.doc-sidebar-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.doc-sidebar-link {
    flex: 1;
    display: block;
    padding: 0.7rem 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1F2937;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.doc-sidebar-link:hover {
    background: #F5F7FA;
    color: #185ADB;
}

.doc-sidebar-link.is-active {
    background: #EEF3FF;
    color: #185ADB;
}

.doc-sidebar-count {
    font-weight: 400;
    color: #9CA3AF;
    font-size: 0.85rem;
}

.doc-sidebar-toggle {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    border-radius: 6px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.doc-sidebar-toggle:hover {
    background: #F5F7FA;
    color: #185ADB;
}

.doc-sidebar-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.doc-sidebar-toggle svg {
    transition: transform 0.2s ease;
}

.doc-sidebar-submenu {
    display: none;
    flex-direction: column;
    padding: 0 0 0.5rem 0.9rem;
    gap: 0.15rem;
}

.doc-sidebar-submenu.is-open {
    display: flex;
}

.doc-sidebar-submenu a {
    display: block;
    padding: 0.4rem 0.6rem;
    font-size: 0.84rem;
    color: #6B7280;
    text-decoration: none;
    border-left: 2px solid #E8ECF4;
    line-height: 1.4;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.doc-sidebar-submenu a:hover,
.doc-sidebar-submenu a.is-active {
    color: #185ADB;
    border-color: #185ADB;
}

.doc-sidebar-empty {
    padding: 0.4rem 0.6rem;
    font-size: 0.84rem;
    color: #B0B7C3;
    font-style: italic;
    border-left: 2px solid #E8ECF4;
    line-height: 1.4;
}

/* ── Main content ────────────────────────────────────────────────────── */
.doc-main {
    flex: 1;
    min-width: 0;
}

/* Hero */
.doc-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(91deg, #155EEF 0.98%, #155EEF 50.49%, #0119A3 100%);
    border-radius: 8px;
    padding: 1rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.doc-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(100deg,
            rgba(255, 255, 255, 0.05) 0px,
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px,
            transparent 46px);
    pointer-events: none;
}

.doc-hero::after {
    content: '';
    position: absolute;
    top: -30%;
    left: 10%;
    width: 60%;
    height: 160%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 65%);
    pointer-events: none;
}

.doc-hero-text {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

#onepro-wrapper .doc-hero-text h1 {
    font-size: 2.15rem;
    color: #fff;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.doc-hero-text p {
    font-size: 1.02rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 1.85rem;
}

.doc-hero-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.doc-hero-stat {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75);
}

.doc-hero-stat strong {
    display: block;
    font-size: 1.35rem;
    color: #F5BE61 !important;
    line-height: 1.25;
}

.doc-hero-stat.is-accent strong,
.doc-hero-stat--docs strong {
    color: #F5BE61 !important;
}

.doc-hero-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.25);
}

.doc-hero-illustration {
    position: relative;
    z-index: 1;
    align-self: flex-end;
    flex-shrink: 1;
    width: 100%;
    max-width: 320px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: -1rem;
}

.doc-hero-illustration img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* Link columns */
.doc-columns-section {
    margin: 2.5rem 0;
}

.doc-columns-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.doc-column h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1.1rem;
}

.doc-column ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.doc-column a {
    font-size: 0.92rem;
    color: #4B5563;
    text-decoration: none;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.doc-column a:hover {
    color: #185ADB;
    text-decoration: underline;
}

/* Bottom CTA row */
.doc-cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.doc-cta-card {
    background: #EFF4FE;
    border: 1px solid #E8ECF4;
    border-radius: 16px;
    padding: 1rem 2rem;
    display: flex;
    gap: 0.25rem;
    align-items: flex-start;
}

.doc-cta-support {
    background: linear-gradient(135deg, #ffffff 0%, #F4F7FF 55%, #E9EFFE 100%);
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
}

.doc-cta-signup {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
}

.doc-cta-signup-top {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.doc-cta-support-illustration {
    flex-shrink: 0;
}

.doc-cta-support-illustration img {
    display: block;
    max-width: 135px;
    height: auto;
}

.doc-cta-icon {
    flex-shrink: 0;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-cta-icon img {
    display: block;
    width: 80%;
    height: auto;
}

.doc-cta-body {
    flex: 1;
    min-width: 0;
}

.doc-cta-body h3 {
    font-size: 1.1rem;
    color: #111827;
    line-height: 1.4;
    margin: 0 0 0.4rem;
}

.doc-cta-body h3 a {
    color: #185ADB;
    text-decoration: none;
}

.doc-cta-body h3 a:hover {
    text-decoration: underline;
}

.doc-cta-body p {
    font-size: 0.9rem;
    color: #6B7280;
    margin: 0;
}

.doc-cta-signup .doc-cta-form {
    margin: 0;
}

.doc-cta-signup .doc-cta-form p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.doc-cta-signup .doc-cta-form .wpcf7-form-control-wrap {
    display: block;
    flex: 1 1 200px;
    min-width: 0;
}

.doc-cta-signup .wpcf7-not-valid-tip {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
}

.doc-cta-signup .wpcf7-response-output {
    width: 100%;
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
}

.doc-cta-signup .wpcf7-spinner {
    position: absolute;
    margin: 0;
}

.doc-cta-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.65rem 1rem;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #374151;
    background: #fff;
    outline: none;
    font-family: 'Mulish', sans-serif;
    transition: border-color 0.2s ease;
}

.doc-cta-input:focus {
    border-color: #185ADB;
}

.doc-cta-btn {
    flex-shrink: 0;
    padding: 0.65rem 1.4rem;
    background: #185ADB;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Mulish', sans-serif;
    transition: background 0.2s ease;
}

.doc-cta-btn:hover {
    background: #144CB3;
}

/* ── Single tài liệu article (single-tai-lieu.php) ──────────────────────── */
.doc-single-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
    margin-bottom: 2rem;
}

.doc-article {
    background: #fff;
    border: 1px solid #E8ECF4;
    border-radius: 16px;
    padding: 2.5rem 3rem;
}

.tai-lieu-single-page .single-post-cta {
    margin: 0 0 2.5rem;
}

.tai-lieu-single-page .single-post-nav {
    margin: 0 0 2.5rem;
    border-top: 1px solid #E8ECF4;
    padding-top: 2rem;
}

/* Right sidebar */
.doc-right-sidebar {
    position: sticky;
    top: 104px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.doc-next-card {
    display: block;
    background: #EFF4FE;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    transition: box-shadow 0.2s ease;
}

.doc-next-card:hover {
    box-shadow: 0 4px 14px rgba(24, 90, 219, 0.12);
}

.doc-next-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #185ADB;
    margin-bottom: 0.35rem;
}

.doc-next-title {
    display: block;
    font-size: 0.98rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
}

.doc-siblings-nav ul {
    display: flex;
    flex-direction: column;
}

.doc-siblings-nav li {
    border-left: 2px solid #E8ECF4;
}

.doc-siblings-nav a {
    display: block;
    padding: 0.7rem 1rem;
    font-size: 0.92rem;
    color: #4B5563;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.doc-siblings-nav a:hover {
    color: #185ADB;
}

.doc-siblings-nav a.is-active {
    color: #185ADB;
    font-weight: 700;
}

.doc-siblings-nav li.is-active {
    border-left-color: #185ADB;
}

.doc-right-cta {
    background: #EFF4FE;
    border-radius: 16px;
    padding: 1.75rem;
}

.doc-right-cta-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.doc-right-cta-header .doc-cta-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}

.doc-right-cta h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.3;
    margin: 0;
}

.doc-right-cta h3 span {
    color: #185ADB;
}

.doc-right-cta p {
    font-size: 0.9rem;
    color: #6B7280;
    margin: 0 0 1.1rem;
}

.doc-right-cta .doc-cta-input {
    width: 100%;
    margin-bottom: 0.75rem;
}

.doc-cta-btn-block {
    width: 100%;
}

@media (max-width: 576px) {
    .doc-article {
        padding: 1.75rem;
    }
}

@media (max-width: 992px) {
    .doc-single-layout {
        grid-template-columns: 1fr;
    }

    .doc-right-sidebar {
        position: static;
    }
}

@media (max-width: 400px) {
    .doc-cta-signup .doc-cta-form p {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Responsive */
@media (max-width: 1100px) {
    .doc-hero-illustration {
        display: none;
    }
}

@media (max-width: 992px) {
    .doc-layout {
        flex-direction: column;
    }

    .doc-sidebar {
        position: static;
        width: 100%;
        flex-basis: auto;
        max-height: none;
        padding: 1.25rem 0;
        border-right: none;
        border-bottom: 1px solid #E8ECF4;
    }

    .doc-columns-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .doc-cta-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .doc-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
    }

    .doc-hero-text h1 {
        font-size: 1.6rem;
    }

    .doc-columns-section {
        padding: 1.5rem;
    }

    .doc-cta-card {
        flex-direction: column;
    }
}