/**
 * Gear Guide category archives and standard posts.
 *
 * Parent templates and behavior remain intact. This layer is enabled only
 * when Homepage Gear Guide is the site's assigned static front-page template.
 */

.acms-gear-content {
    color: var(--ggh-ink);
    background: var(--ggh-background);
}

.acms-gear-content .site-main {
    color: var(--ggh-ink);
    background: var(--ggh-background);
}

.acms-gear-content :where(a, button, input, textarea, select):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ggh-gold) 72%, transparent);
    outline-offset: 3px;
}

.acms-gear-content .breadcrumb a {
    color: color-mix(in srgb, var(--ggh-gold) 72%, var(--ggh-ink));
}

.acms-gear-content .breadcrumb a:hover,
.acms-gear-content .breadcrumb a:focus-visible {
    color: var(--ggh-ink);
}

/* Category archive */
.acms-gear-category .cat-header--centered {
    position: relative;
    padding: clamp(42px, 6vw, 76px) 0 clamp(38px, 5vw, 64px);
    overflow: hidden;
    text-align: left;
    border-bottom: 1px solid var(--ggh-line);
    background:
        radial-gradient(circle at 86% 24%, color-mix(in srgb, var(--ggh-gold) 10%, transparent), transparent 23rem),
        linear-gradient(120deg, var(--ggh-surface) 0%, var(--ggh-surface-soft) 100%);
}

.acms-gear-category .cat-header--centered::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: max(24px, calc((100vw - 1240px) / 2));
    width: 72px;
    border-top: 4px solid var(--ggh-gold);
    pointer-events: none;
}

.acms-gear-category .cat-header--centered .container {
    position: relative;
    width: min(1240px, calc(100% - 48px));
    max-width: none;
    margin-inline: auto;
    padding-inline: 0;
}

.acms-gear-category .cat-header__icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 0 18px;
    place-items: center;
    color: var(--ggh-navy);
    border: 1px solid color-mix(in srgb, var(--ggh-gold) 50%, var(--ggh-line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--ggh-gold) 13%, var(--ggh-surface));
    font-size: 22px;
}

.acms-gear-category .cat-header--centered .cat-header__title {
    max-width: 900px;
    margin: 0 0 16px;
    color: var(--ggh-ink);
    font-size: clamp(40px, 6vw, 68px);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -0.055em;
    text-align: left;
    text-wrap: balance;
}

.acms-gear-category .cat-header--centered .breadcrumb {
    margin: 0 0 18px;
}

.acms-gear-category .cat-header--centered .breadcrumb__list {
    justify-content: flex-start;
}

.acms-gear-category .cat-header--centered .cat-header__description {
    max-width: 760px;
    margin: 0 0 22px;
    color: var(--ggh-muted);
    font-size: 16px;
    line-height: 1.7;
    text-align: left;
}

.acms-gear-category .cat-header--centered .cat-header__description p {
    margin: 0;
}

.acms-gear-category .cat-header--centered .cat-header__meta {
    justify-content: flex-start;
    gap: 10px;
    margin: 0;
}

.acms-gear-category .cat-header--centered .cat-header__meta-item {
    padding: 8px 12px;
    color: var(--ggh-muted);
    border: 1px solid var(--ggh-line);
    border-radius: 999px;
    background: var(--ggh-surface);
    box-shadow: none;
    font-size: 11px;
    font-weight: 800;
}

.acms-gear-category .cat-header--centered .cat-header__meta-item i {
    color: color-mix(in srgb, var(--ggh-gold) 70%, var(--ggh-ink));
}

.acms-gear-category .cat-header--centered .cat-children {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 1000px;
    margin: 28px 0 0;
}

.acms-gear-category .cat-header--centered .cat-child {
    padding: 13px;
    color: var(--ggh-ink);
    border: 1px solid var(--ggh-line);
    border-radius: 8px;
    background: var(--ggh-surface);
    box-shadow: none;
}

.acms-gear-category .cat-header--centered .cat-child:hover,
.acms-gear-category .cat-header--centered .cat-child:focus-visible {
    border-color: var(--ggh-gold);
    background: color-mix(in srgb, var(--ggh-gold) 7%, var(--ggh-surface));
    transform: none;
}

.acms-gear-category .cat-header--centered .cat-child__icon {
    color: var(--ggh-navy);
    border-radius: 6px;
    background: color-mix(in srgb, var(--ggh-gold) 12%, var(--ggh-surface));
}

.acms-gear-category .cat-header--centered .cat-child__name {
    color: var(--ggh-ink);
    font-weight: 850;
}

.acms-gear-category .cat-header--centered .cat-child__count {
    color: var(--ggh-muted);
}

.acms-gear-category .posts-section {
    padding: clamp(38px, 5vw, 64px) 0 clamp(54px, 7vw, 88px);
    background: var(--ggh-surface-soft);
}

.acms-gear-category .posts-section > .container,
.acms-gear-post .site-main--post > .container,
.acms-gear-post .post-article > .container,
.acms-gear-post .post-footer > .container,
.acms-gear-post .related-posts > .container,
.acms-gear-post .comments-section > .container {
    width: min(1240px, calc(100% - 48px));
    max-width: none;
    margin-inline: auto;
    padding-inline: 0;
}

.acms-gear-category .content-layout {
    gap: 24px;
}

.acms-gear-category .posts-grid-v2 {
    gap: 16px;
}

.acms-gear-category .post-card {
    min-height: 100%;
    overflow: hidden;
    border: 1px solid var(--ggh-line);
    border-radius: 8px;
    background: var(--ggh-surface);
    box-shadow: none;
}

.acms-gear-category .post-card--grid-v2 {
    transition: border-color 180ms ease, background-color 180ms ease;
}

.acms-gear-category .post-card--grid-v2:hover {
    border-color: color-mix(in srgb, var(--ggh-gold) 62%, var(--ggh-line));
    background: color-mix(in srgb, var(--ggh-gold) 3%, var(--ggh-surface));
    box-shadow: none;
    transform: none;
}

.acms-gear-category .post-card--grid-v2 .post-card__image {
    aspect-ratio: 3 / 2;
    background: var(--ggh-surface-soft);
}

.acms-gear-category .post-card__content {
    gap: 10px;
    padding: 18px;
}

.acms-gear-category .post-card__title {
    color: var(--ggh-ink);
    font-size: clamp(17px, 1.5vw, 20px);
    font-weight: 850;
    line-height: 1.3;
    letter-spacing: -0.025em;
}

.acms-gear-category .post-card__title a:hover,
.acms-gear-category .post-card__title a:focus-visible {
    color: color-mix(in srgb, var(--ggh-gold) 70%, var(--ggh-ink));
}

.acms-gear-category .post-card__excerpt {
    color: var(--ggh-muted);
    font-size: 13px;
    line-height: 1.6;
}

.acms-gear-category .post-card__footer-grid {
    margin-top: auto;
    padding-top: 13px;
    color: var(--ggh-muted);
    border-top-color: var(--ggh-line);
    font-size: 11px;
}

.acms-gear-category .sidebar-widget,
.acms-gear-post .sidebar-widget {
    padding: 20px;
    border: 1px solid var(--ggh-line);
    border-radius: 8px;
    background: var(--ggh-surface);
    box-shadow: none;
}

.acms-gear-category .sidebar-widget__header,
.acms-gear-post .sidebar-widget__header {
    border-bottom-color: var(--ggh-line);
}

.acms-gear-category .sidebar-widget__title,
.acms-gear-post .sidebar-widget__title {
    color: var(--ggh-ink);
}

.acms-gear-category .sidebar-widget__title i,
.acms-gear-category .sidebar-widget__link,
.acms-gear-post .sidebar-widget__title i,
.acms-gear-post .sidebar-widget__link {
    color: color-mix(in srgb, var(--ggh-gold) 72%, var(--ggh-ink));
}

.acms-gear-category .load-more__btn {
    min-height: 48px;
    color: var(--ggh-navy);
    border-color: var(--ggh-gold-dark);
    border-radius: 6px;
    background: var(--ggh-gold);
    box-shadow: none;
    font-weight: 900;
}

.acms-gear-category .load-more__btn:hover:not(:disabled),
.acms-gear-category .load-more__btn:focus-visible:not(:disabled) {
    color: var(--ggh-navy);
    border-color: var(--ggh-gold-dark);
    background: color-mix(in srgb, var(--ggh-gold) 82%, #fff);
    box-shadow: none;
}

/* Single post */
.acms-gear-post .post-hero--centered {
    position: relative;
    padding: clamp(20px, 2.2vw, 30px) 0 clamp(22px, 2.4vw, 32px);
    overflow: hidden;
    border-bottom: 1px solid var(--ggh-line);
    background: linear-gradient(120deg, var(--ggh-surface) 0%, var(--ggh-surface-soft) 100%);
}

.acms-gear-post .post-hero__background {
    inset: 0;
    mask-image: none;
    -webkit-mask-image: none;
}

.acms-gear-post .post-hero__gradient {
    background: radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--ggh-gold) 11%, transparent), transparent 25rem);
}

.acms-gear-post .post-hero__pattern {
    opacity: 0.12;
}

.acms-gear-post .post-hero--centered > .container {
    width: min(1180px, calc(100% - 48px));
    max-width: none;
    margin-inline: auto;
    padding-inline: 0;
}

.acms-gear-post .post-hero__content {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    align-items: end;
    max-width: none;
    text-align: left;
}

.acms-gear-post .post-hero .breadcrumb,
.acms-gear-post .post-hero__title,
.acms-gear-post .post-hero__excerpt {
    grid-column: 1 / -1;
}

.acms-gear-post .post-hero .breadcrumb {
    margin: 0;
}

.acms-gear-post .post-hero .breadcrumb__list {
    justify-content: flex-start;
}

.acms-gear-post .post-hero__title {
    width: 100%;
    max-width: 100%;
    margin: 0;
    color: var(--ggh-ink);
    font-size: clamp(30px, 2.65vw, 38px);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.03em;
    text-align: left;
    text-wrap: wrap;
}

.acms-gear-post .post-hero__excerpt {
    width: 100%;
    max-width: 100%;
    margin: 0;
    color: var(--ggh-muted);
    font-size: 15px;
    line-height: 1.55;
    text-align: left;
    text-wrap: pretty;
}


.acms-gear-post .post-hero__meta {
    justify-content: flex-start;
    gap: 10px;
}

.acms-gear-post .post-hero__author-avatar {
    width: 36px;
    height: 36px;
    border: 2px solid var(--ggh-surface);
    box-shadow: 0 0 0 1px var(--ggh-line);
}

.acms-gear-post .post-hero__author-name {
    color: var(--ggh-ink);
    font-size: 12px;
    font-weight: 850;
}

.acms-gear-post .post-hero__details {
    gap: 8px 10px;
    color: var(--ggh-muted);
    font-size: 11px;
}

.acms-gear-post .post-hero__details i {
    color: color-mix(in srgb, var(--ggh-gold) 72%, var(--ggh-ink));
}

.acms-gear-post .post-hero__rating {
    justify-self: end;
    margin: 0;
    color: var(--ggh-ink);
    border: 1px solid var(--ggh-line);
    border-radius: 7px;
    background: var(--ggh-surface);
    box-shadow: none;
    padding: 8px 12px;
    font-size: 11px;
}

.acms-gear-post .post-article,
.acms-gear-post .site-main--post > .container {
    padding-top: clamp(34px, 5vw, 64px);
    padding-bottom: clamp(34px, 5vw, 64px);
    background: var(--ggh-background);
}

.acms-gear-post .post-content {
    --content-width: 840px;
    --content-text: var(--ggh-ink);
    --content-text-secondary: var(--ggh-muted);
    --content-text-muted: var(--ggh-muted);
    --content-link: color-mix(in srgb, var(--ggh-gold) 72%, var(--ggh-ink));
    --content-link-hover: var(--ggh-ink);
    --content-border: var(--ggh-line);
    --content-bg-subtle: var(--ggh-surface-soft);
    color: var(--ggh-ink);
    font-size: 18px;
    line-height: 1.78;
}

.acms-gear-post .post-content :is(h1, h2, h3, h4, h5, h6) {
    color: var(--ggh-ink);
    font-weight: 850;
    letter-spacing: -0.03em;
}

.acms-gear-post .post-content h2 {
    padding: 0 0 10px;
    border-bottom: 2px solid var(--ggh-line);
    border-left: 0;
    font-size: clamp(26px, 3vw, 36px);
}

.acms-gear-post .post-content h2::after {
    content: "";
    display: block;
    width: 54px;
    height: 3px;
    margin-top: 10px;
    background: var(--ggh-gold);
}

.acms-gear-post .post-content h3 {
    font-size: clamp(21px, 2.2vw, 28px);
}

.acms-gear-post .post-content a:not([class]) {
    color: color-mix(in srgb, var(--ggh-gold) 72%, var(--ggh-ink));
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.acms-gear-post .post-content :is(img, figure, table, blockquote) {
    border-radius: 8px;
}

.acms-gear-post .post-content blockquote {
    border-left-color: var(--ggh-gold);
    background: var(--ggh-surface-soft);
}

.acms-gear-post .toc-expandable__card,
.acms-gear-post .comments-section,
.acms-gear-post .related-posts {
    border-color: var(--ggh-line);
    background: var(--ggh-surface-soft);
}

.acms-gear-post .toc-expandable__card {
    border-radius: 8px;
    box-shadow: none;
}

.acms-gear-post .post-footer--recommended {
    border: 0;
    padding: 0;
    margin-top: 24px;
    background: transparent;
    box-shadow: none;
}

.acms-gear-post .post-footer__top-row {
    background: var(--ggh-surface, #fff);
    border: 1px solid var(--ggh-line);
    border-radius: 14px;
    padding: 12px 18px;
    box-shadow: 0 4px 16px rgba(7, 21, 44, 0.04);
}

.acms-gear-post .post-footer__share-btn {
    min-height: 42px;
    padding: 8px 20px;
    border: 1px solid var(--ggh-gold);
    border-radius: 999px;
    color: #fff;
    background: var(--ggh-gold);
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.acms-gear-post .post-footer__share-btn:hover {
    background: var(--ggh-gold-dark);
    border-color: var(--ggh-gold-dark);
}

.acms-gear-post .post-footer__author-centered {
    max-width: 580px;
    margin: 28px auto 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    box-sizing: border-box;
    text-align: center;
}

.acms-gear-post .post-footer__author-label {
    display: block;
    color: var(--ggh-gold-dark, var(--ggh-gold));
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.acms-gear-post .post-footer__author-avatar {
    display: block;
    margin: 0 auto 12px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--ggh-surface), 0 0 0 4px var(--ggh-line);
}

.acms-gear-post .post-footer__author-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ggh-ink);
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

.acms-gear-post .post-footer__author-name:hover {
    color: var(--ggh-gold-dark, var(--ggh-gold));
}

.acms-gear-post .post-footer__author-name i {
    color: var(--ggh-gold);
}

.acms-gear-post .post-footer__author-role {
    color: var(--ggh-muted);
    font-size: 13px;
    margin: 4px 0 12px;
}

.acms-gear-post .post-footer__author-bio {
    max-width: 620px;
    margin: 0 auto 20px;
    color: var(--ggh-muted);
    font-size: 14px;
    line-height: 1.65;
}

.acms-gear-post .post-footer__author-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 28px;
    border: 1px solid var(--ggh-gold);
    border-radius: 999px;
    color: #fff !important;
    background: var(--ggh-gold) !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--ggh-gold) 30%, transparent);
    transition: all 0.2s ease;
}

.acms-gear-post .post-footer__author-link:hover {
    background: var(--ggh-gold-dark) !important;
    border-color: var(--ggh-gold-dark) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--ggh-gold) 40%, transparent);
}

.acms-gear-post .related-posts__title,
.acms-gear-post .comments-section__title {
    color: var(--ggh-ink);
}

@media (max-width: 900px) {
    .acms-gear-category .cat-header--centered .cat-children {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .acms-gear-post .post-hero__content {
        grid-template-columns: 1fr;
    }

    .acms-gear-post .post-hero__meta,
    .acms-gear-post .post-hero__rating {
        grid-column: 1;
        justify-self: start;
    }
}

@media (max-width: 680px) {
    .acms-gear-category .cat-header--centered .container,
    .acms-gear-category .posts-section > .container,
    .acms-gear-post .post-hero--centered > .container,
    .acms-gear-post .site-main--post > .container,
    .acms-gear-post .post-article > .container,
    .acms-gear-post .post-footer > .container,
    .acms-gear-post .related-posts > .container,
    .acms-gear-post .comments-section > .container {
        width: min(100% - 28px, 1240px);
    }

    .acms-gear-category .cat-header--centered::before {
        left: 14px;
        width: 52px;
    }

    .acms-gear-category .cat-header--centered .cat-header__title,
    .acms-gear-post .post-hero__title {
        font-size: clamp(26px, 7vw, 32px);
    }

    .acms-gear-post .post-hero--centered {
        padding: 18px 0 20px;
    }

    .acms-gear-post .post-hero__excerpt {
        font-size: 14px;
    }

    .acms-gear-category .cat-header--centered .cat-children {
        grid-template-columns: 1fr;
    }

    .acms-gear-post .post-hero__meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .acms-gear-post .post-hero__details {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .acms-gear-post .post-content {
        font-size: 16px;
        line-height: 1.72;
    }
}

@media (prefers-reduced-motion: reduce) {
    .acms-gear-content *,
    .acms-gear-content *::before,
    .acms-gear-content *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ============================================================
   RESPONSIVE SPECS TABLE: STICKY FIRST COLUMN ON MOBILE
   ============================================================ */

/* 1. Reset Gutenberg Block Table Wrapper để không bị nhân đôi border hoặc bẫy scroll */
.post-content .wp-block-table,
.acms-gear-post .post-content .wp-block-table {
    overflow-x: visible !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 24px 0 !important;
}

/* 2. Container bảng cuộn mượt, cho phép chữ tự xuống dòng */
.post-content table,
.acms-gear-post .post-content table,
.acms-gear-post .post-content :is(table, .wp-block-table) {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: normal !important; /* Hủy bỏ ép dãn 1 hàng */
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 24px 0 !important;
    border: 1px solid var(--content-border, #e2e8f0) !important;
    border-radius: 8px !important;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* 3. Cố định chiều rộng các ô để không bị xô lệch khi cuộn */
.post-content table th,
.post-content table td {
    padding: 12px 16px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    vertical-align: middle !important;
    border-bottom: 1px solid var(--content-border, #e2e8f0) !important;
    border-right: 1px solid var(--content-border, #e2e8f0) !important;
}

/* 4. Ghim chặt cột đầu tiên (Tên thông số) ở mép trái màn hình */
.post-content table th:first-child,
.post-content table td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 2 !important;
    min-width: 140px !important;
    max-width: 160px !important;
    font-weight: 600 !important;
    background-color: #f8fafc !important; /* Nền sáng tránh đè chữ khi cuộn */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.08) !important; /* Đổ bóng tách biệt cột */
}

/* Hỗ trợ Dark Mode nếu site có bật giao diện tối */
[data-theme="dark"] .post-content table th:first-child,
[data-theme="dark"] .post-content table td:first-child {
    background-color: #1e293b !important;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3) !important;
}

/* 5. Các cột sản phẩm phía sau (AMD, Intel...) */
.post-content table th:not(:first-child),
.post-content table td:not(:first-child) {
    min-width: 180px !important; /* Đảm bảo đủ độ rộng đọc thoải mái trên điện thoại */
}

/* 6. Tùy chỉnh thanh cuộn ngang mảnh đẹp trên điện thoại */
.post-content table::-webkit-scrollbar {
    height: 5px !important;
}
.post-content table::-webkit-scrollbar-track {
    background: transparent !important;
}
.post-content table::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 4px !important;
}

