/* ============================================================
   page-default.css — khung giao diện cho template FALLBACK
   resources/views/pages/show.blade.php

   Đây là view dùng chung cho MỌI Page chưa có view riêng (nhóm
   quảng cáo/SEO/social/tiện ích). Nội dung là rich-text nhập tay
   qua CMS nên độ dài bất kỳ → khung phải đẹp cả khi content dài,
   ngắn, hoặc RỖNG. Prefix `pgd-` để không đụng post-detail (`pd-`)
   hay các trang khác.

   Chất kính theo liquid-glass-ui §1 (alpha .55–.74, blur 16–20px,
   saturate 155–160%, fallback @supports). Màu qua var(--site-primary…),
   COLOR LOCK 1 accent. Giao thoa nền fade về trắng (§4b).
   ============================================================ */

.pgd-page {
    position: relative;
    color: #0f172b;
    background: #ffffff;
}

/* ---------- HERO: tiêu đề + mô tả + ảnh bìa ----------
   Wash tông site rất nhạt ở đỉnh, fade về TRẮNG ở đáy → không
   tạo đường kẻ với vùng nội dung phía dưới (liquid-glass §4b). */
.pgd-hero {
    position: relative;
    /* Clearance cho header dính overlay (site chuẩn 120px). Cấu trúc mới có
       .pgd-page là con đầu <main> nên KHÔNG trúng rule 120px của header.css
       (main > .breadcrumb:first-child) → tự cấp ở đây, không đụng header.css. */
    padding: 120px 0 20px;
    background:
        radial-gradient(760px 320px at 82% -6%, rgba(var(--site-primary-rgb, 59, 79, 232), .10), transparent 60%),
        linear-gradient(180deg, rgba(var(--site-primary-rgb, 59, 79, 232), .05) 0, rgba(var(--site-primary-rgb, 59, 79, 232), 0) 100%),
        #ffffff;
}
.pgd-hero__inner { max-width: 860px; }

/* Breadcrumb pill kính (thay .breadcrumb xám dùng chung) — giữ nguyên
   ngữ nghĩa nav>ol, chỉ đổi trình bày. */
.pgd-crumb {
    display: inline-flex;
    max-width: 100%;
    margin-bottom: 18px;
    padding: 7px 15px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 6px 18px rgba(15, 23, 43, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
}
.pgd-crumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    min-width: 0;
}
.pgd-crumb li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: #64748b;
}
.pgd-crumb li:not(:last-child)::after {
    content: "";
    width: 5px;
    height: 5px;
    border-right: 1.6px solid #cbd5e1;
    border-bottom: 1.6px solid #cbd5e1;
    transform: rotate(-45deg);
    flex: 0 0 auto;
}
.pgd-crumb a {
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s ease;
}
.pgd-crumb a:hover { color: var(--site-primary, #3B4FE8); }
.pgd-crumb li[aria-current] {
    color: #0f172b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pgd-title {
    margin: 0;
    color: #0f172b;
    font-size: clamp(1.9rem, 4vw, 2.85rem);
    line-height: 1.14;
    font-weight: 850;
    letter-spacing: -0.01em;
    text-wrap: balance;
}
.pgd-lead {
    margin: 16px 0 0;
    max-width: 62ch;
    color: #475569;
    font-size: clamp(1rem, 1.4vw, 1.12rem);
    line-height: 1.7;
    text-wrap: pretty;
}
.pgd-cover {
    margin: 26px 0 0;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 20px 50px rgba(15, 23, 43, .12), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.pgd-cover img { width: 100%; height: auto; display: block; }

/* ---------- BODY: nội dung + sidebar TOC ---------- */

/* Mặc định 1 cột (content ngắn / TOC < 3 h2): giới hạn bề rộng đọc tốt. */
.pgd-layout { display: block; }
.pgd-main { min-width: 0; }

/* Có TOC (≥ 3 h2): 2 cột — nội dung trái, mục lục dính phải. */
.pgd-layout.has-toc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 262px;
    gap: 48px;
    align-items: start;
}
.pgd-layout.has-toc .pgd-main { max-width: none; }

/* ---------- PROSE: typography cho rich content CMS ----------
   Tự chứa (KHÔNG dùng chung class .prose global) để kiểm soát trọn vẹn
   và không rò rỉ sang FAQ/nơi khác. Accent qua var(--site-primary…). */
.pgd-prose { color: #384253; font-size: 1.02rem; line-height: 1.8; }
.pgd-prose > :first-child { margin-top: 0; }
.pgd-prose > :last-child { margin-bottom: 0; }

.pgd-prose h2,
.pgd-prose h3,
.pgd-prose h4 {
    color: #0f172b;
    line-height: 1.28;
    font-weight: 800;
    letter-spacing: -0.005em;
    scroll-margin-top: 100px;   /* để anchor TOC không lọt dưới header dính */
    text-wrap: balance;
}
.pgd-prose h2 { margin: 38px 0 14px; font-size: 1.55rem; }
.pgd-prose h3 { margin: 30px 0 12px; font-size: 1.25rem; }
.pgd-prose h4 { margin: 24px 0 10px; font-size: 1.06rem; }
/* Vạch accent mảnh trước H2 — nhịp thị giác, KHÔNG phải chấm trang trí. */
.pgd-prose h2 {
    position: relative;
    padding-left: 16px;
}
.pgd-prose h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: .18em;
    bottom: .18em;
    width: 4px;
    border-radius: 999px;
    background: var(--site-primary, #3B4FE8);
}

.pgd-prose p { margin: 0 0 18px; }
.pgd-prose a {
    color: var(--site-primary, #3B4FE8);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    font-weight: 600;
}
.pgd-prose a:hover { color: var(--site-primary-dark, #2B3FD9); }
.pgd-prose strong { color: #0f172b; font-weight: 700; }

.pgd-prose ul,
.pgd-prose ol { margin: 0 0 18px; padding-left: 4px; list-style: none; }
.pgd-prose li { position: relative; margin: 0 0 10px; padding-left: 30px; }
.pgd-prose ul > li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: .62em;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--site-primary, #3B4FE8);
    transform: rotate(45deg);
}
.pgd-prose ol { counter-reset: pgd-ol; }
.pgd-prose ol > li { counter-increment: pgd-ol; }
.pgd-prose ol > li::before {
    content: counter(pgd-ol);
    position: absolute;
    left: 0;
    top: .05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--site-primary-soft, #eef2ff);
    color: var(--site-primary, #3B4FE8);
    font-size: .8rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.pgd-prose li > ul,
.pgd-prose li > ol { margin-top: 10px; }

.pgd-prose blockquote {
    margin: 24px 0;
    padding: 16px 22px;
    border-left: 4px solid var(--site-primary, #3B4FE8);
    border-radius: 0 14px 14px 0;
    background: rgba(var(--site-primary-rgb, 59, 79, 232), .05);
    color: #334155;
    font-style: normal;
}
.pgd-prose blockquote > :last-child { margin-bottom: 0; }

.pgd-prose img,
.pgd-prose figure img {
    display: block;
    width: 100%;
    height: auto;
    margin: 24px 0;
    border-radius: 14px;
    border: 1px solid #eef2ff;
    box-shadow: 0 12px 30px rgba(15, 23, 43, .08);
}
.pgd-prose figure { margin: 24px 0; }
.pgd-prose figure img { margin: 0; }
.pgd-prose figcaption {
    margin-top: 10px;
    color: #64748b;
    font-size: .85rem;
    line-height: 1.5;
    text-align: center;
}

.pgd-prose hr {
    margin: 34px 0;
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
}

/* Bảng: cuộn ngang khi chật, không phá body ngang (mobile). */
.pgd-prose table {
    width: 100%;
    margin: 24px 0;
    border-collapse: collapse;
    font-size: .95rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.pgd-prose thead th {
    background: var(--site-primary-soft, #eef2ff);
    color: #0f172b;
    font-weight: 800;
}
.pgd-prose th,
.pgd-prose td {
    padding: 11px 15px;
    border: 1px solid #e6ebf3;
    text-align: left;
    vertical-align: top;
}
.pgd-prose tbody tr:nth-child(even) { background: #f8fafc; }

.pgd-prose code {
    padding: 2px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #b91c1c;
    font-size: .9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.pgd-prose pre {
    margin: 24px 0;
    padding: 18px 20px;
    border-radius: 14px;
    background: #0f172b;
    color: #e2e8f0;
    overflow-x: auto;
    font-size: .9rem;
    line-height: 1.7;
}
.pgd-prose pre code { padding: 0; background: none; color: inherit; }

/* ---------- TOC sidebar (sticky) + scrollspy ---------- */
.pgd-sidebar { min-width: 0; }
.pgd-toc {
    position: sticky;
    top: 96px;
    padding: 20px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 30px rgba(15, 23, 43, .09), inset 0 1px 0 rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
}
.pgd-toc__title {
    margin: 0 0 12px;
    color: #0f172b;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.pgd-toc__list {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: pgd-toc;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}
.pgd-toc__list a {
    display: block;
    padding: 8px 10px 8px 12px;
    border-left: 2px solid transparent;
    border-radius: 0 8px 8px 0;
    color: #64748b;
    font-size: .88rem;
    line-height: 1.45;
    text-decoration: none;
    transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.pgd-toc__list a:hover { color: #0f172b; background: rgba(15, 23, 43, .035); }
.pgd-toc__list a.is-active {
    color: var(--site-primary, #3B4FE8);
    border-left-color: var(--site-primary, #3B4FE8);
    background: rgba(var(--site-primary-rgb, 59, 79, 232), .06);
    font-weight: 700;
}

/* Mục lục thu gọn cho mobile — bản <details> hiện khi sidebar bị ẩn. */
.pgd-toc-mobile { display: none; margin: 0 0 24px; }
.pgd-toc-mobile > details {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 22px rgba(15, 23, 43, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    overflow: hidden;
}
.pgd-toc-mobile summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    font-size: .92rem;
    font-weight: 800;
    color: #0f172b;
    -webkit-user-select: none;
    user-select: none;
}
.pgd-toc-mobile summary::-webkit-details-marker { display: none; }
.pgd-toc-mobile__count { color: var(--site-primary, #3B4FE8); font-size: .8rem; font-weight: 700; }
.pgd-toc-mobile summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    transition: transform .22s ease;
}
.pgd-toc-mobile > details[open] summary::after { transform: rotate(-135deg); }
.pgd-toc-mobile ol {
    margin: 0;
    padding: 0 10px 12px;
    list-style: none;
    display: grid;
    gap: 2px;
}
.pgd-toc-mobile ol a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: #475569;
    font-size: .88rem;
    text-decoration: none;
}
.pgd-toc-mobile ol a:hover { color: var(--site-primary, #3B4FE8); background: rgba(15, 23, 43, .035); }

/* ---------- FAQ section (component tự lo chất kính) ---------- */
.pgd-faq { padding: 34px 0 8px; }
.pgd-faq .faq-block__title { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }

/* ---------- CTA cuối trang (glass panel + nút primary đặc) ---------- */
.pgd-cta { padding: 40px 0 60px; }
.pgd-cta__box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    flex-wrap: wrap;
    padding: 32px 36px;
    border-radius: 24px;
    overflow: hidden;
    background:
        radial-gradient(420px 200px at 88% 12%, rgba(var(--site-primary-rgb, 59, 79, 232), .16), transparent 62%),
        rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.74);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.95),
        0 0 0 1px rgba(148, 163, 184, 0.10),
        0 22px 50px rgba(15, 23, 43, 0.10);
    -webkit-backdrop-filter: blur(20px) saturate(158%);
    backdrop-filter: blur(20px) saturate(158%);
}
.pgd-cta__text { min-width: 0; flex: 1 1 340px; }
.pgd-cta__text h2 {
    margin: 0 0 8px;
    color: #0f172b;
    font-size: clamp(1.3rem, 2.4vw, 1.75rem);
    line-height: 1.22;
    font-weight: 850;
    letter-spacing: -0.01em;
    text-wrap: balance;
}
.pgd-cta__text p { margin: 0; color: #475569; font-size: 1rem; line-height: 1.65; }
.pgd-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; flex: 0 0 auto; }
.pgd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 50px;
    padding: 13px 24px;
    border-radius: 13px;
    font-weight: 800;
    font-size: .98rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.pgd-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.pgd-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--site-primary, #3B4FE8), var(--site-primary-dark, #2B3FD9));
    box-shadow: 0 14px 30px rgba(var(--site-primary-rgb, 59, 79, 232), .30);
}
.pgd-btn--primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 18px 38px rgba(var(--site-primary-rgb, 59, 79, 232), .38); }
.pgd-btn--ghost {
    color: #0f172b;
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(15, 23, 43, .1);
}
.pgd-btn--ghost:hover { color: var(--site-primary, #3B4FE8); border-color: var(--site-primary, #3B4FE8); transform: translateY(-2px); }

/* ---------- CONTACT: thông tin doanh nghiệp cuối trang ----------
   NAP lặp trên nhiều trang (giống footer) → GIỮ SEO-SAFE: KHÔNG thẻ heading
   (tiêu đề là <p>, section mang aria-label) nên cây heading không đổi (vẫn 1 h1);
   KHÔNG thêm JSON-LD (tránh trùng Organization). Chỉ trình bày. */
.pgd-contact { padding: 8px 0 64px; }
/* Editorial split: đầu (tiêu đề + tagline) bên trái, lưới thông tin 2×2 bên phải
   ngăn nhau bằng hairline — khác nhịp với CTA phía trên, cân đối hơn lưới 4 cột. */
.pgd-contact__box {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.5fr);
    gap: 36px 44px;
    align-items: center;
    padding: 34px 38px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.74);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.95),
        0 0 0 1px rgba(148, 163, 184, 0.10),
        0 22px 50px rgba(15, 23, 43, 0.10);
    -webkit-backdrop-filter: blur(20px) saturate(158%);
    backdrop-filter: blur(20px) saturate(158%);
}
.pgd-contact__head { display: grid; gap: 10px; min-width: 0; }
.pgd-contact__title {
    margin: 0;
    color: #0f172b;
    font-size: clamp(1.2rem, 2.2vw, 1.5rem);
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: -0.01em;
}
.pgd-contact__tagline { margin: 0; color: #64748b; font-size: .95rem; line-height: 1.65; max-width: 42ch; }
.pgd-contact__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 34px;
    margin: 0;
    padding-left: 44px;
    list-style: none;
    border-left: 1px solid rgba(15, 23, 43, 0.09);
}
.pgd-contact__item { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pgd-contact__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 13px;
    background: var(--site-primary-soft, #eef2ff);
    color: var(--site-primary, #3B4FE8);
}
.pgd-contact__icon svg { width: 20px; height: 20px; }
.pgd-contact__meta { display: grid; gap: 3px; min-width: 0; }
.pgd-contact__label {
    color: #94a3b8;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.pgd-contact__value {
    color: #0f172b;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
a.pgd-contact__value { text-decoration: none; transition: color .2s ease; }
a.pgd-contact__value:hover { color: var(--site-primary, #3B4FE8); }
.pgd-contact a:focus-visible {
    outline: 3px solid rgba(var(--site-primary-rgb, 59, 79, 232), .28);
    outline-offset: 3px;
    border-radius: 8px;
}

/* ---------- EMPTY STATE: content rỗng, khung "đang cập nhật" ---------- */
.pgd-empty { padding: 8px 0 60px; }
.pgd-empty__box {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 8px;
    max-width: 640px;
    margin: 0 auto;
    padding: 52px 32px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.74);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.95),
        0 0 0 1px rgba(148, 163, 184, 0.10),
        0 22px 50px rgba(15, 23, 43, 0.10);
    -webkit-backdrop-filter: blur(20px) saturate(158%);
    backdrop-filter: blur(20px) saturate(158%);
}
.pgd-empty__icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 6px;
    border-radius: 18px;
    background: var(--site-primary-soft, #eef2ff);
    color: var(--site-primary, #3B4FE8);
}
.pgd-empty__icon svg { width: 28px; height: 28px; }
.pgd-empty__box h2 {
    margin: 0;
    color: #0f172b;
    font-size: 1.4rem;
    font-weight: 850;
    letter-spacing: -0.01em;
}
.pgd-empty__box p { margin: 0; max-width: 46ch; color: #64748b; line-height: 1.7; }
.pgd-empty__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }

/* Fallback backdrop-filter cho MỌI hộp kính của template. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .pgd-crumb,
    .pgd-toc,
    .pgd-toc-mobile > details,
    .pgd-cta__box,
    .pgd-contact__box,
    .pgd-empty__box { background: rgba(255, 255, 255, 0.93); }
}

/* ---------- Focus ring (a11y) ---------- */
.pgd-crumb a:focus-visible,
.pgd-prose a:focus-visible,
.pgd-toc__list a:focus-visible,
.pgd-toc-mobile a:focus-visible,
.pgd-btn:focus-visible {
    outline: 3px solid rgba(var(--site-primary-rgb, 59, 79, 232), .28);
    outline-offset: 3px;
    border-radius: 8px;
}

/* ---------- Reveal (chỉ transform/opacity, gate .pgd-anim) ---------- */
.pgd-anim [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .6s cubic-bezier(.16, 1, .3, 1), transform .6s cubic-bezier(.16, 1, .3, 1);
    will-change: transform, opacity;
}
.pgd-anim [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .pgd-anim [data-reveal] { opacity: 1 !important; transform: none !important; }
    .pgd-toc-mobile summary::after,
    .pgd-btn { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
    .pgd-layout.has-toc { grid-template-columns: 1fr; gap: 0; }
    .pgd-layout.has-toc .pgd-main { max-width: 760px; }
    .pgd-sidebar { display: none; }         /* sidebar dính ẩn → dùng bản mobile */
    .pgd-toc-mobile { display: block; }
    /* Contact: xếp dọc, bỏ vách trái + padding của lưới. */
    .pgd-contact__box { grid-template-columns: 1fr; gap: 26px; align-items: start; }
    .pgd-contact__list { padding-left: 0; border-left: 0; }
}
@media (max-width: 640px) {
    .pgd-hero { padding: 104px 0 14px; }   /* giữ clearance header, giảm đáy */
    .pgd-cta__box { padding: 26px 22px; }
    .pgd-contact__box { padding: 24px 20px; }
    .pgd-contact__list { grid-template-columns: 1fr; gap: 18px; }
    .pgd-cta__actions,
    .pgd-empty__actions { width: 100%; }
    .pgd-cta__actions .pgd-btn,
    .pgd-empty__actions .pgd-btn { flex: 1 1 auto; }
    .pgd-prose h2 { font-size: 1.35rem; }
    .pgd-empty__box { padding: 40px 22px; }
}
