/* Trang tài liệu Hướng Dẫn Thi Công (thi-cong-be-tong-vai-cuon.html) */

:root {
    --gd-danger: #dc2626;
    --gd-border: #e5e7eb;
    --gd-muted: #6b7280;
}

/* Thanh tiến độ đọc */
.gd-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent-color), #f97316);
    z-index: 1002;
    transition: width 0.1s linear;
}

/* ============ HERO TÀI LIỆU ============ */
.guide-hero {
    background: linear-gradient(135deg, #111827, #374151 60%, #4b5563);
    color: white;
    padding: 150px 0 70px;
    position: relative;
    overflow: hidden;
}

.guide-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><path d="M 64 0 L 0 0 0 64" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></svg>');
    background-size: 64px 64px;
}

.guide-hero .container {
    position: relative;
    z-index: 1;
}

.gd-breadcrumb {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 18px;
}

.gd-breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.gd-breadcrumb a:hover {
    color: var(--accent-color);
}

.gd-eyebrow {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
}

.guide-hero h1 {
    font-size: 42px;
    line-height: 1.25;
    margin-bottom: 18px;
    max-width: 800px;
}

.guide-hero .gd-lead {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    max-width: 740px;
    margin-bottom: 30px;
}

.gd-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.gd-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.gd-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.gd-btn-ghost {
    display: inline-block;
    padding: 15px 34px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: white;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.gd-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-3px);
}

/* ============ BỐ CỤC 2 CỘT ============ */
.guide-main {
    padding: 60px 0 80px;
    background: white;
}

.guide-layout {
    display: grid;
    grid-template-columns: 268px 1fr;
    gap: 56px;
    align-items: start;
}

/* Mục lục dính bên trái */
.guide-toc {
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    border-left: 2px solid var(--gd-border);
    padding-left: 4px;
}

.guide-toc h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gd-muted);
    padding: 0 0 12px 16px;
}

.guide-toc ul {
    list-style: none;
}

.guide-toc a {
    display: block;
    padding: 9px 16px;
    margin-left: -6px;
    border-left: 3px solid transparent;
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.25s;
}

.guide-toc a:hover {
    color: var(--primary-color);
    background: var(--light-gray);
}

.guide-toc a.active {
    border-left-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: 700;
    background: #fffbeb;
}

.guide-toc .gd-toc-sub a {
    padding-left: 30px;
    font-size: 13px;
    color: var(--gd-muted);
}

/* Nút mở mục lục trên mobile */
.gd-toc-toggle {
    display: none;
}

/* ============ NỘI DUNG ============ */
.guide-body {
    min-width: 0;
    max-width: 820px;
    font-size: 16px;
}

.guide-body section {
    scroll-margin-top: 90px;
    margin-bottom: 56px;
}

.gd-part-head {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: 30px;
}

.gd-part-num {
    flex-shrink: 0;
    width: 62px;
    height: 62px;
    border-radius: 10px;
    background: linear-gradient(135deg, #111827, #4b5563);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.gd-part-num span:first-child {
    font-size: 9px;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.gd-part-num span:last-child {
    font-size: 22px;
    font-weight: 800;
}

.gd-part-head h2 {
    font-size: 28px;
    color: var(--primary-color);
    line-height: 1.25;
}

.gd-part-head p {
    font-size: 14px;
    color: var(--gd-muted);
    margin-top: 4px;
}

.guide-body h3 {
    font-size: 21px;
    color: var(--primary-color);
    margin: 34px 0 14px;
}

.guide-body h4 {
    font-size: 16px;
    color: var(--primary-color);
    margin: 22px 0 10px;
}

.guide-body p {
    margin-bottom: 14px;
    color: #4b5563;
}

.guide-body ul,
.guide-body ol {
    margin: 0 0 16px 22px;
    color: #4b5563;
}

.guide-body li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.guide-body li::marker {
    color: var(--accent-color);
}

.guide-body strong {
    color: var(--primary-color);
}

.gd-intro {
    font-size: 17px;
    color: var(--gd-muted);
    padding-bottom: 8px;
}

/* ============ BẢNG ============ */
.gd-table-wrap {
    overflow-x: auto;
    margin: 18px 0 24px;
    border: 1px solid var(--gd-border);
    border-radius: 10px;
}

.gd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

/* Chỉ bảng từ 3 cột trở lên mới cần cuộn ngang trên màn hình nhỏ;
   bảng 2 cột co giãn vừa khít điện thoại. */
.gd-table--wide {
    min-width: 520px;
}

.gd-table th {
    background: var(--light-gray);
    color: var(--primary-color);
    text-align: left;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 2px solid var(--gd-border);
}

.gd-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--gd-border);
    color: #4b5563;
    vertical-align: top;
}

.gd-table tr:last-child td {
    border-bottom: none;
}

.gd-table tbody tr:hover {
    background: #fafafa;
}

.gd-table td:first-child {
    color: var(--primary-color);
    font-weight: 600;
}

.gd-table .gd-num {
    width: 46px;
    text-align: center;
    color: var(--accent-color);
    font-weight: 800;
}

/* ============ HỘP CHÚ Ý ============ */
.gd-callout {
    border: 1px solid var(--gd-border);
    border-left: 4px solid var(--dark-gray);
    border-radius: 0 10px 10px 0;
    padding: 20px 24px;
    margin: 22px 0;
    background: var(--light-gray);
}

.gd-callout h4 {
    margin: 0 0 8px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gd-callout p:last-child,
.gd-callout ul:last-child,
.gd-callout ol:last-child {
    margin-bottom: 0;
}

.gd-callout--goal {
    border-left-color: var(--primary-color);
    background: #f9fafb;
}

.gd-callout--warn {
    border-left-color: var(--accent-color);
    background: linear-gradient(135deg, #fffbeb, #ffffff);
}

.gd-callout--warn h4 {
    color: #b45309;
}

.gd-callout--danger {
    border-left-color: var(--gd-danger);
    background: linear-gradient(135deg, #fef2f2, #ffffff);
}

.gd-callout--danger h4 {
    color: var(--gd-danger);
}

.gd-callout--ok {
    border-left-color: var(--secondary-color);
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

.gd-callout--ok h4 {
    color: #047857;
}

/* Câu khẩu hiệu nhấn mạnh */
.gd-rule {
    margin: 22px 0;
    padding: 22px 26px;
    border-radius: 10px;
    background: linear-gradient(135deg, #111827, #4b5563);
    color: white;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
}

.gd-rule.gd-rule--danger {
    background: linear-gradient(135deg, #991b1b, #dc2626);
}

.gd-rule.gd-rule--accent {
    background: linear-gradient(135deg, #b45309, #f59e0b);
}

/* ============ 4 NGUYÊN TẮC ============ */
.gd-principles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin: 24px 0 28px;
}

.gd-principle {
    background: white;
    border: 1px solid var(--gd-border);
    border-radius: 10px;
    padding: 24px 22px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
}

.gd-principle:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.gd-principle-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #111827, #4b5563);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 14px;
}

.gd-principle h4 {
    margin: 0 0 8px;
    font-size: 17px;
    color: var(--primary-color);
}

.gd-principle p {
    font-size: 14px;
    margin: 0;
    color: var(--gd-muted);
}

/* ============ THẺ BƯỚC THI CÔNG ============ */
.gd-step {
    border: 1px solid var(--gd-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 34px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
}

.gd-step-head {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #111827, #4b5563);
    color: white;
}

.gd-step-badge {
    flex-shrink: 0;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #f97316);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.gd-step-badge span:first-child {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.gd-step-badge span:last-child {
    font-size: 26px;
    font-weight: 800;
}

.gd-step-head h3 {
    color: white;
    margin: 0;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gd-step-head p {
    margin: 6px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
}

.gd-step-body {
    padding: 26px 28px 28px;
}

.gd-step-body> :first-child {
    margin-top: 0;
}

/* ============ DANH SÁCH NGHIỆM THU ============ */
.gd-check {
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
    padding: 22px 26px;
    margin: 26px 0 10px;
}

.gd-check h4 {
    margin: 0 0 14px;
    color: #047857;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gd-check ul {
    list-style: none;
    margin: 0;
}

.gd-check li {
    position: relative;
    padding: 7px 0 7px 32px;
    color: #4b5563;
    font-size: 15px;
    margin: 0;
    border-bottom: 1px solid rgba(5, 150, 105, 0.12);
}

.gd-check li:last-child {
    border-bottom: none;
}

.gd-check li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--secondary-color);
    border-radius: 4px;
}

/* Danh sách "cấm" đánh số */
.gd-forbid {
    list-style: none;
    margin: 0 0 16px !important;
    counter-reset: gdf;
}

.gd-forbid li {
    position: relative;
    padding: 10px 0 10px 40px;
    border-bottom: 1px solid var(--gd-border);
    counter-increment: gdf;
    color: #4b5563;
}

.gd-forbid li:last-child {
    border-bottom: none;
}

.gd-forbid li::before {
    content: counter(gdf);
    position: absolute;
    left: 0;
    top: 9px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--gd-danger);
    color: white;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ BẢNG TREO CÔNG TRƯỜNG (PHẦN IV) ============ */
.gd-poster {
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    overflow: hidden;
}

.gd-poster-block {
    border-bottom: 1px solid var(--gd-border);
    padding: 24px 28px;
}

.gd-poster-block:last-child {
    border-bottom: none;
}

.gd-poster-block h4 {
    margin: 0 0 14px;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: white;
    background: var(--primary-color);
    display: inline-block;
    padding: 7px 18px;
    border-radius: 50px;
}

.gd-poster-block ol,
.gd-poster-block ul {
    margin-bottom: 0;
}

.gd-poster-four {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin: 0;
    list-style: none;
}

.gd-poster-four li {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 16px 14px;
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 15px;
    margin: 0;
}

/* ============ KHỐI LIÊN HỆ CUỐI TRANG ============ */
.guide-cta {
    padding: 70px 0;
    background: var(--light-gray);
    text-align: center;
}

.guide-cta h2 {
    font-size: 30px;
    color: var(--primary-color);
    margin-bottom: 14px;
}

.guide-cta p {
    max-width: 640px;
    margin: 0 auto 28px;
    color: var(--gd-muted);
    font-size: 17px;
}

.guide-cta .gd-hero-actions {
    justify-content: center;
}

.guide-cta .gd-btn-ghost {
    color: var(--primary-color);
    border-color: #d1d5db;
    background: white;
}

.guide-cta .gd-btn-ghost:hover {
    background: white;
    border-color: var(--primary-color);
}

/* Nút về đầu trang */
.gd-top {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--gd-border);
    background: white;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.gd-top.show {
    opacity: 1;
    visibility: visible;
}

.gd-top:hover {
    background: var(--primary-color);
    color: white;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 968px) {
    .guide-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .guide-toc {
        position: static;
        max-height: none;
        border-left: none;
        border: 1px solid var(--gd-border);
        border-radius: 10px;
        padding: 0;
        margin-bottom: 34px;
        overflow: hidden;
    }

    .guide-toc h4 {
        display: none;
    }

    .gd-toc-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 16px 20px;
        background: var(--light-gray);
        border: none;
        font-family: inherit;
        font-size: 15px;
        font-weight: 700;
        color: var(--primary-color);
        cursor: pointer;
    }

    .gd-toc-toggle::after {
        content: '▾';
        transition: transform 0.3s;
    }

    .gd-toc-toggle.open::after {
        transform: rotate(180deg);
    }

    .guide-toc ul {
        display: none;
        padding: 8px 0;
    }

    .guide-toc ul.open {
        display: block;
    }

    .guide-toc a {
        margin-left: 0;
    }

    .guide-body {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .guide-hero {
        padding: 120px 0 50px;
    }

    .guide-hero h1 {
        font-size: 29px;
    }

    .guide-hero .gd-lead {
        font-size: 16px;
    }

    .gd-hero-actions .cta-button,
    .gd-hero-actions .gd-btn-ghost {
        padding: 13px 26px;
        font-size: 15px;
    }

    .gd-part-head {
        gap: 14px;
    }

    .gd-part-head h2 {
        font-size: 22px;
    }

    .gd-step-head {
        padding: 20px;
        gap: 16px;
    }

    .gd-step-badge {
        width: 54px;
        height: 54px;
    }

    .gd-step-badge span:last-child {
        font-size: 21px;
    }

    .gd-step-head h3 {
        font-size: 17px;
    }

    .gd-step-body {
        padding: 20px;
    }

    .gd-callout,
    .gd-check,
    .gd-poster-block {
        padding: 18px 20px;
    }

    .gd-rule {
        font-size: 16px;
        padding: 18px 20px;
    }

    .guide-body h3 {
        font-size: 19px;
    }

    .gd-top {
        left: 14px;
        bottom: 14px;
    }
}

@media (max-width: 414px) {
    .guide-hero h1 {
        font-size: 25px;
    }

    .gd-step-head {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .guide-body ul,
    .guide-body ol {
        margin-left: 18px;
    }
}

/* ============ IN ẤN ============ */
@media print {

    header,
    .floating-buttons,
    .gd-progress,
    .gd-top,
    .guide-toc,
    .gd-toc-toggle,
    .gd-hero-actions,
    .guide-cta,
    footer {
        display: none !important;
    }

    .guide-hero {
        background: none !important;
        color: #000;
        padding: 0 0 20px;
    }

    .guide-hero h1,
    .guide-hero .gd-lead,
    .gd-chip,
    .gd-breadcrumb {
        color: #000 !important;
    }

    .guide-hero::before {
        display: none;
    }

    .guide-layout {
        display: block;
    }

    .guide-main {
        padding: 0;
    }

    .gd-step,
    .gd-callout,
    .gd-check,
    .gd-table-wrap,
    .gd-principle,
    .gd-poster {
        break-inside: avoid;
        box-shadow: none;
    }

    .gd-step-head,
    .gd-rule,
    .gd-part-num,
    .gd-step-badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #part-4 {
        break-before: page;
    }
}

/* Phụ đề tên quốc tế trong hero */
.guide-hero .gd-subtitle {
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 18px;
}

@media (max-width: 768px) {
    .guide-hero .gd-subtitle {
        font-size: 12px;
        letter-spacing: 0.5px;
    }
}

/* Huy hiệu phần mở đầu dùng chữ thay vì số La Mã */
.gd-part-num--text span:first-child,
.gd-part-num--text span:last-child {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    opacity: 1;
    margin-bottom: 2px;
}

/* Hiệu ứng hiện dần — chỉ áp dụng khi JS đã bật cờ trên <html>.
   Không có JS, JS lỗi, hoặc khi in: nội dung luôn hiển thị đầy đủ. */
.gd-js-reveal .gd-step,
.gd-js-reveal .gd-principle,
.gd-js-reveal .gd-check {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.gd-js-reveal .gd-step.gd-shown,
.gd-js-reveal .gd-principle.gd-shown,
.gd-js-reveal .gd-check.gd-shown {
    opacity: 1;
    transform: translateY(0);
}

@media print {

    .gd-js-reveal .gd-step,
    .gd-js-reveal .gd-principle,
    .gd-js-reveal .gd-check {
        opacity: 1 !important;
        transform: none !important;
    }
}
