/**
 * Xuan Cuong Handicraft - Module: legal.css
 * Trang Chính sách bảo mật / Điều khoản sử dụng (page-chinh-sach.php) & trang 404 (404.php)
 */


/* ==========================================================================
   TRANG CHÍNH SÁCH & ĐIỀU KHOẢN
   ========================================================================== */
.legal-hero {
    background: #F8F5EE;
    border-bottom: 1px solid var(--xc-border, #E5E1D8);
    padding: 40px 0 56px;
}

.legal-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    font-size: 16px;
    line-height: 24px;
    color: var(--text-gray, #60606B);
}

.legal-breadcrumb a {
    color: var(--text-gray, #60606B);
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-breadcrumb a:hover {
    color: var(--primary-color, #881111);
}

.legal-breadcrumb .current {
    color: var(--text-black, #1E262B);
}

.legal-title {
    margin: 0;
}

.legal-updated {
    margin: 12px 0 0;
    font-size: 16px;
    line-height: 24px;
    color: var(--text-gray, #60606B);
}

.legal-container {
    padding-top: 64px;
    padding-bottom: 96px;
}

.legal-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 820px);
    gap: 80px;
    align-items: start;
}

.legal-layout.no-toc {
    grid-template-columns: minmax(0, 820px);
}

/* Mục lục */
.legal-toc {
    position: sticky;
    top: 120px;
}

.legal-toc-box {
    border-top: 2px solid var(--primary-color, #881111);
    padding-top: 20px;
}

.legal-toc-title {
    list-style: none;
    cursor: default;
    margin-bottom: 16px;
    color: var(--text-black, #1E262B);
    font-size: var(--fs-body);
    font-weight: 700;
    line-height: 28px;
}

.legal-toc-title::-webkit-details-marker {
    display: none;
}

.legal-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: legal-toc;
}

.legal-toc-list li {
    counter-increment: legal-toc;
}

.legal-toc-list a {
    display: flex;
    gap: 10px;
    padding: 8px 0 8px 14px;
    border-left: 2px solid var(--xc-border, #E5E1D8);
    color: var(--text-gray, #60606B);
    font-size: 16px;
    line-height: 24px;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.legal-toc-list a::before {
    content: counter(legal-toc) ".";
    flex-shrink: 0;
    min-width: 20px;
}

.legal-toc-list a:hover,
.legal-toc-list a.is-active {
    color: var(--primary-color, #881111);
    border-left-color: var(--primary-color, #881111);
}

/* Nội dung */
.legal-content {
    color: var(--text-black, #1E262B);
}

.legal-content p,
.legal-content li {
    font-size: var(--fs-body);
    font-weight: 400;
    line-height: 30px;
}

.legal-content p {
    margin: 0 0 20px;
}

.legal-content h2 {
    margin: 48px 0 16px;
    padding-top: 8px;
    color: var(--text-black, #1E262B);
    font-size: var(--fs-card-title);
    font-weight: 700;
    line-height: 1.3;
    scroll-margin-top: 120px;
}

.legal-content h3 {
    margin: 28px 0 12px;
    font-size: var(--fs-body);
    font-weight: 700;
}

.legal-content ul,
.legal-content ol {
    margin: 0 0 24px;
    padding-left: 0;
    list-style: none;
}

.legal-content li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
}

.legal-content ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 12px;
    width: 7px;
    height: 7px;
    background: var(--xc-cta, #D6BF89);
    transform: rotate(45deg);
}

.legal-content ol {
    counter-reset: legal-ol;
}

.legal-content ol li {
    counter-increment: legal-ol;
}

.legal-content ol li::before {
    content: counter(legal-ol) ".";
    position: absolute;
    left: 0;
    color: var(--primary-color, #881111);
    font-weight: 700;
}

.legal-content strong {
    font-weight: 700;
}

.legal-content a {
    color: var(--primary-color, #881111);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Gợi ý trang chính sách còn lại */
.legal-content a.legal-related {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 56px;
    padding: 24px 28px;
    border: 1px solid var(--xc-border, #E5E1D8);
    border-radius: var(--radius-middle, 8px);
    background: #F8F5EE;
    color: var(--text-black, #1E262B);
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.legal-related-label {
    color: var(--text-gray, #60606B);
    font-size: 16px;
}

.legal-related-title {
    flex: 1;
    font-size: var(--fs-body);
    font-weight: 700;
}

.legal-content a.legal-related:hover {
    border-color: var(--primary-color, #881111);
    color: var(--primary-color, #881111);
}


/* ==========================================================================
   TRANG 404
   ========================================================================== */

@media (max-width: 1024px) {
    .legal-hero {
        padding: 28px 0 40px;
    }

    .legal-breadcrumb {
        margin-bottom: 20px;
    }

    .legal-container {
        padding-top: 32px;
        padding-bottom: 64px;
    }

    .legal-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    /* Mục lục thành khối thu gọn được ở đầu trang */
    .legal-toc {
        position: static;
    }

    .legal-toc-box {
        border: 1px solid var(--xc-border, #E5E1D8);
        border-radius: var(--radius-middle, 8px);
        padding: 0;
        background: #FFFFFF;
    }

    .legal-toc-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 0;
        padding: 14px 18px;
        cursor: pointer;
    }

    .legal-toc-title::after {
        content: "";
        width: 8px;
        height: 8px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        transition: transform 0.2s ease;
    }

    .legal-toc-box[open] .legal-toc-title::after {
        transform: rotate(-135deg);
    }

    .legal-toc-list {
        padding: 0 18px 14px;
    }
}

.error-404-section {
    position: relative;
    overflow: hidden;
    background: #F8F5EE;
    padding: 96px 0 120px;
    min-height: calc(100vh - 200px);
    min-height: calc(100dvh - 200px);
    display: flex;
    align-items: center;
}

.error-404-inner {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

/* Số 404 lớn dạng viền chữ, đặt chìm phía sau tiêu đề */
.error-404-code {
    font-family: var(--font-main);
    font-size: clamp(120px, 22vw, 260px);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: 0.04em;
    color: transparent;
    -webkit-text-stroke: 2px var(--xc-cta, #D6BF89);
    margin-bottom: -0.08em;
    user-select: none;
}

.error-404-inner .script-accent-gold {
    position: relative;
    color: var(--primary-color, #881111);
    font-size: clamp(36px, 3.4vw, 48px);
}

.error-404-title {
    position: relative;
    margin: 4px 0 16px;
}

.error-404-desc {
    max-width: 600px;
    margin: 0 auto 32px;
    color: var(--text-gray, #60606B);
    font-size: var(--fs-body);
    line-height: 28px;
}

.error-404-search {
    position: relative;
    max-width: 480px;
    margin: 0 auto 24px;
}

.error-404-search-input {
    width: 100%;
    height: 52px;
    padding: 0 56px 0 20px;
    border: 1px solid var(--xc-border, #E5E1D8);
    border-radius: var(--radius-middle, 8px);
    background: #FFFFFF;
    color: var(--text-black, #1E262B);
    font-family: var(--font-main);
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.error-404-search-input:focus {
    outline: none;
    border-color: var(--xc-cta, #D6BF89);
    box-shadow: 0 0 0 3px rgba(214, 191, 137, 0.25);
}

.error-404-search-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-black, #1E262B);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.error-404-search-btn:hover {
    color: var(--primary-color, #881111);
}

.error-404-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.error-404-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 28px;
    padding-top: 28px;
    border-top: 1px solid var(--xc-border, #E5E1D8);
}

.error-404-links a {
    color: var(--text-black, #1E262B);
    font-size: 16px;
    font-weight: 500;
    line-height: 28px;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.error-404-links a:hover {
    color: var(--primary-color, #881111);
    border-bottom-color: currentColor;
}


@media (max-width: 768px) {

    .legal-content p,
    .legal-content li {
        font-size: 16px;
        line-height: 26px;
    }

    .legal-content h2 {
        margin-top: 36px;
        font-size: 20px;
    }

    .legal-content a.legal-related {
        flex-wrap: wrap;
        padding: 18px 20px;
        margin-top: 24px;
    }

    .legal-related-title {
        flex-basis: 100%;
        order: 2;
    }

    .error-404-section {
        padding: 56px 0 72px;
        min-height: 0;
    }

    .error-404-desc {
        font-size: 16px;
        line-height: 26px;
    }

    .error-404-links {
        gap: 4px 20px;
    }
}