/*
 * Chillveda trên affshelf-theme (2026-10-19): token màu/chữ của giao diện cũ, header một hàng, chữ thân bài,
 * thẻ sản phẩm (affshelf/list.php), khung tác giả, trang tĩnh, chân trang. Số đo lấy từ trang thật trước khi chuyển.
 * redesign.css (nạp sau) giữ nguyên các khối .cv-* của giao diện 2026-10-15. Chỉ có giao diện sáng.
 */

@font-face {
    font-family: 'Fraunces';
    src: url('../fonts/fraunces-latin-var.woff2') format('woff2');
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    --color-primary: #0d7377;
    --color-primary-hover: #0a5c5f;
    --color-primary-light: #e8f4f4;
    --color-accent: #e07a5f;
    --color-accent-hover: #c96b52;
    --color-accent-light: #fdf0ed;
    --color-bg: #fdfbf7;
    --color-bg-alt: #f7f5f0;
    --color-surface: #fff;
    --color-border: #e5e2dc;
    --color-border-strong: #d1cec6;
    --color-border-subtle: #efece6;
    --color-text: #1a1d21;
    --color-text-secondary: #4a5056;
    --color-text-muted: #6b7280;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.5rem;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-relaxed: 1.625;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --acms-space-4: 1rem;
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -4px rgba(0, 0, 0, .04);
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font: 16px/1.5 var(--font-sans);
}

a {
    color: var(--color-primary);
}

h1, h2, h3, h4 {
    font-family: var(--font-sans);
}

.cv-wrap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 600px) {
    .cv-wrap {
        padding: 0 16px;
    }
}

/* ---------- header ---------- */

.cv-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-subtle);
}

.admin-bar .cv-header {
    top: 32px;
}

.cv-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 72px;
    transition: height .2s ease;
}

.cv-header.is-scrolled .cv-header__inner {
    height: 56px;
}

.cv-header__logo {
    display: inline-flex;
    align-items: center;
    flex: none;
    max-width: 240px;
    text-decoration: none;
    color: var(--color-text);
}

.cv-header__logo-img {
    display: block;
    width: auto;
    height: 44px;
    max-width: 240px;
    transition: height .2s ease;
}

.cv-header.is-scrolled .cv-header__logo-img {
    height: 32px;
}

.cv-header__logo-text {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
}

.cv-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.cv-menu,
.cv-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cv-menu > li {
    position: relative;
}

.cv-menu a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 21px;
    text-decoration: none;
    white-space: nowrap;
}

.cv-menu a:hover,
.cv-menu .current-menu-item > a,
.cv-menu .current-menu-ancestor > a {
    color: var(--color-text);
    background: var(--color-bg-alt);
}

.cv-menu > .menu-item-has-children > a::after {
    content: "";
    width: 0;
    height: 0;
    margin-left: 2px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    opacity: .6;
}

.cv-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 224px;
    padding: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}

.cv-menu > li:hover > .sub-menu,
.cv-menu > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.cv-menu .sub-menu a {
    font-weight: 400;
}

.cv-header__tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.cv-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
}

.cv-icon-btn:hover,
.cv-icon-btn[aria-expanded="true"] {
    color: var(--color-text);
    background: var(--color-bg-alt);
}

.cv-nav-toggle {
    display: none;
}

.cv-search-panel {
    border-top: 1px solid var(--color-border-subtle);
    background: var(--color-surface);
    padding: 12px 0;
}

.cv-search-panel__form {
    display: flex;
    gap: 8px;
}

.cv-search-panel input {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg);
    font: inherit;
    font-size: 15px;
    color: var(--color-text);
}

.cv-search-panel input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.cv-search-panel button {
    padding: 10px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 960px) {
    .cv-header__inner {
        height: 60px;
        gap: 12px;
    }

    .cv-header__logo-img {
        height: 36px;
        max-width: 190px;
    }

    .cv-nav-toggle {
        display: inline-flex;
    }

    .cv-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        padding: 8px 16px 16px;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .cv-nav.is-open {
        display: block;
    }

    .cv-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .cv-menu a {
        padding: 12px 8px;
        font-size: 16px;
        color: var(--color-text);
    }

    .cv-menu > .menu-item-has-children > a::after {
        display: none;
    }

    .cv-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: 0;
        box-shadow: none;
        padding: 0 0 8px 12px;
        min-width: 0;
    }

    .cv-menu .sub-menu a {
        padding: 8px;
        font-size: 15px;
        color: var(--color-text-muted);
    }
}

/* ---------- disclosure ---------- */

.cv-disclosure {
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border-subtle);
}

.cv-disclosure__text {
    margin: 0;
    padding: 6px 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--color-text-muted);
    text-align: center;
}

.cv-disclosure__text a {
    color: var(--color-primary);
}

/* ---------- chữ thân bài ---------- */

.cv-post .post-content {
    font-size: 18px;
    line-height: 1.625;
    color: var(--color-text);
    overflow-wrap: break-word;
}

.cv-post .post-content > p,
.cv-post .post-content .dpq-rest > p,
.page-content > p {
    margin: 0 0 24px;
}

.cv-post .post-content h2,
.page-content h2 {
    margin: 48px 0 16px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.025em;
    color: var(--color-text);
}

.cv-post .post-content h3,
.page-content h3 {
    margin: 32px 0 16px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.025em;
}

.cv-post .post-content > ul,
.cv-post .post-content > ol,
.cv-post .post-content .dpq-rest > ul,
.cv-post .post-content .dpq-rest > ol,
.page-content ul,
.page-content ol {
    margin: 0 0 32px;
    padding-left: 24px;
}

.cv-post .post-content > ul > li,
.cv-post .post-content > ol > li,
.cv-post .post-content .dpq-rest > ul > li,
.cv-post .post-content .dpq-rest > ol > li,
.page-content li {
    margin-bottom: 12px;
    padding-left: 4px;
}

.cv-post .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.cv-post .post-content figure {
    margin: 32px 0;
}

.cv-post .post-content figcaption {
    margin-top: 8px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.cv-post .post-content table,
.page-content table {
    width: 100%;
    margin: 32px 0;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.75;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.cv-post .post-content th,
.page-content th {
    padding: 12px 16px;
    background: var(--color-bg-alt);
    font-weight: 600;
    text-align: left;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.cv-post .post-content td,
.page-content td {
    padding: 12px 16px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border-subtle);
    vertical-align: top;
}

.cv-post .post-content tr:last-child td,
.page-content tr:last-child td {
    border-bottom: 0;
}

.cv-post .post-content blockquote {
    margin: 32px 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--color-primary);
    color: var(--color-text-secondary);
}

@media (max-width: 760px) {
    .cv-post .post-content {
        font-size: 17px;
    }

    .cv-post .post-content h2,
    .page-content h2 {
        margin-top: 40px;
        font-size: 25px;
    }

    .cv-post .post-content h3,
    .page-content h3 {
        font-size: 21px;
    }
}

/* ---------- thẻ sản phẩm (affshelf/list.php) ---------- */

.cv-pl {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 24px 0 32px;
}

.cv-pl .affshelf-card {
    position: relative;
    margin-left: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    font-size: 16px;
    line-height: 1.5;
    scroll-margin-top: 90px;
}

.cv-pl--single .affshelf-card {
    margin-left: 0;
}

.cv-pl__rank {
    position: absolute;
    top: 8px;
    left: -14px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    background: var(--color-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .07), 0 2px 4px -2px rgba(0, 0, 0, .05);
}

.cv-pl__main {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px 16px 0;
}

.cv-pl__img {
    display: block;
}

.cv-pl__img img {
    display: block;
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 4px;
    margin: 0;
}

.cv-pl__badge {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-accent-light);
    color: var(--color-accent-hover);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cv-post .post-content .cv-pl__title,
.cv-pl__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.025em;
}

.cv-pl__title a {
    color: var(--color-text);
    text-decoration: none;
}

.cv-pl__title a:hover {
    color: var(--color-primary);
}

.cv-pl__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    font-size: 12px;
    line-height: 1.75;
}

.cv-pl__brand {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    color: var(--color-text);
}

.cv-pl__score {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text);
}

.cv-pl__score-ico {
    color: var(--color-text-muted);
    margin-right: 4px;
}

.cv-pl__score b {
    font-weight: 700;
}

.cv-pl__score-of {
    color: var(--color-text-muted);
}

.cv-pl__score-label {
    margin-left: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.cv-pl__tip {
    display: inline-block;
    margin-left: 4px;
}

.cv-pl__tip summary {
    display: flex;
    align-items: center;
    list-style: none;
    color: var(--color-text-muted);
    cursor: pointer;
}

.cv-pl__tip summary::-webkit-details-marker {
    display: none;
}

.cv-pl__tip-body {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 5;
    width: min(300px, 80vw);
    padding: 10px 12px;
    background: var(--color-text);
    color: #fff;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.5;
    box-shadow: var(--shadow-md);
}

.cv-pl__tip-body a {
    color: #9fe3e1;
}

.cv-pl__action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.cv-pl__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border: 1px solid var(--color-accent);
    border-radius: 8px;
    background: var(--color-accent);
    color: #fff !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 21px;
    letter-spacing: .025em;
    text-decoration: none !important;
    white-space: nowrap;
}

.cv-pl__btn:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

.cv-pl__stock {
    font-size: 12px;
    color: var(--color-text-muted);
}

.cv-post .post-content .cv-pl__review,
.cv-pl__review {
    margin: 0;
    padding: 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.cv-pl__pc {
    border-top: 1px solid var(--color-border-subtle);
}

.cv-pl__pc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    list-style: none;
    cursor: pointer;
}

.cv-pl__pc summary::-webkit-details-marker {
    display: none;
}

.cv-pl__pc-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .025em;
    text-transform: uppercase;
    color: var(--color-text);
}

.cv-pl__pc-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.cv-pl__pc-more svg {
    transition: transform .15s ease;
}

.cv-pl__pc[open] .cv-pl__pc-more svg {
    transform: rotate(180deg);
}

.cv-pl__pc-close,
.cv-pl__pc[open] .cv-pl__pc-open {
    display: none;
}

.cv-pl__pc[open] .cv-pl__pc-close {
    display: inline;
}

.cv-pl__pc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 0 16px 16px;
}

.cv-post .post-content .cv-pl h4,
.cv-pl h4 {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.cv-pl__pros h4 {
    color: var(--color-success);
}

.cv-pl__cons h4 {
    color: var(--color-danger);
}

.cv-post .post-content .cv-pl ul,
.cv-pl ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cv-post .post-content .cv-pl li,
.cv-pl li {
    position: relative;
    margin: 0;
    padding: 4px 0 4px 18px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--color-text-secondary);
}

.cv-pl li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.cv-pl__pros li::before {
    background: var(--color-success);
}

.cv-pl__cons li::before {
    background: var(--color-danger);
}

.cv-pl .affshelf-note {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

@media (max-width: 600px) {
    .cv-pl .affshelf-card {
        margin-left: 0;
    }

    .cv-pl__rank {
        top: 12px;
        left: 12px;
    }

    .cv-pl__main {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
    }

    .cv-pl__img img {
        width: 96px;
        height: 96px;
    }

    .cv-pl__action {
        grid-column: 1 / -1;
        align-items: stretch;
    }

    .cv-pl__btn {
        justify-content: center;
        padding: 10px 16px;
        font-size: 17px;
        border-radius: 10px;
    }

    .cv-pl__pc-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ---------- khung tác giả ---------- */

.cv-author {
    margin: 40px 0 8px;
    padding: 28px 24px;
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
}

.cv-author__label {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.cv-author__avatar {
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    border-radius: 50%;
    object-fit: cover;
}

.cv-author__name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.cv-author__name a {
    color: var(--color-text);
    text-decoration: none;
}

.cv-author__role {
    margin: 2px 0 10px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.cv-author__bio {
    max-width: 560px;
    margin: 0 auto 12px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.cv-author__all {
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

/* ---------- trang tĩnh (tiêu đề căn giữa, cột chữ 880px như giao diện cũ) ---------- */

.cv-page {
    padding: 28px 0 56px;
}

.cv-page__inner {
    max-width: 880px;
    margin: 0 auto;
}

.cv-page .cv-hero__crumbs {
    text-align: center;
}

.cv-page__title {
    margin: 8px 0 32px;
    font-family: var(--font-display);
    font-size: 46px;
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -.01em;
    text-align: center;
}

.page-content {
    font-size: 16px;
    line-height: 1.65;
    color: var(--color-text-secondary);
}

.page-content strong {
    color: var(--color-text);
}

.cv-page .page-content h2 {
    margin: 36px 0 14px;
    font-size: 24px;
}

.cv-page .page-content h3 {
    margin: 28px 0 12px;
    font-size: 20px;
}

.page-content .cv-score-card {
    max-width: 560px;
    margin: 0 auto 32px;
}

@media (max-width: 760px) {
    .cv-page__title {
        font-size: 34px;
    }
}

/* ---------- lưu trữ (tác giả, tìm kiếm) dùng template theme cha ---------- */

.ast-archive {
    padding-top: 28px;
    padding-bottom: 56px;
}

.ast-archive__title {
    font-family: var(--font-display);
    font-weight: 600;
}

/* ---------- chân trang ---------- */

.cv-footer {
    padding: 40px 0 24px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-subtle);
}

.cv-footer__grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 32px;
}

.cv-footer__logo-img {
    display: block;
    width: auto;
    height: 40px;
}

.cv-footer__social {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.cv-footer__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--color-bg-alt);
    color: var(--color-text-secondary);
}

.cv-footer__social a:hover {
    color: var(--color-primary);
}

.cv-footer__copy {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--color-text-muted);
}

@media (max-width: 900px) {
    .cv-footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .cv-footer__brand {
        grid-column: 1 / -1;
    }
}

/* ---------- trang tác giả ---------- */

.cv-author-head {
    padding: 40px 0 28px;
    text-align: center;
    border-bottom: 1px solid var(--color-border-subtle);
}

.cv-author-head__avatar {
    display: block;
    width: 112px;
    height: 112px;
    margin: 0 auto 14px;
    border: 4px solid var(--color-surface);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    object-fit: cover;
}

.cv-author-head__name {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 28px;
    font-weight: 700;
}

.cv-author-head__role {
    margin: 4px 0 12px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.cv-author-head__bio {
    max-width: 560px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

/* bảng rộng trong trang tĩnh: cuộn ngang trên điện thoại thay vì ép cột */
@media (max-width: 760px) {
    .page-content table {
        display: block;
        overflow-x: auto;
    }

    .page-content th,
    .page-content td {
        min-width: 140px;
    }
}

/* chú thích Chill Score trên điện thoại: bám theo thẻ (thẻ là position:relative), không tràn mép phải */
@media (max-width: 600px) {
    .cv-pl__score {
        position: static;
    }

    .cv-pl__tip-body {
        left: 12px;
        right: 12px;
        top: auto;
        width: auto;
        margin-top: 6px;
    }
}
