/*
Theme Name: RankGA
Theme URI: https://rankga.com/
Author: RankGA
Description: Theme blog game tiếng Việt cho RankGA. Giao diện sáng, chừa sẵn vị trí quảng cáo.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: rankga
*/

/* ==========================================================
   Token màu và kích thước (bộ duy nhất, rule H2)
   ========================================================== */
:root {
    /* Bảng màu lấy từ logo RankGA: viền navy, vàng cam, xanh dương */
    --brand-ink: #030710;
    --brand-yellow: #fbca07;
    --brand-amber: #faa806;
    --brand-orange: #f76105;
    --brand-red: #f72004;
    --brand-cyan: #13ddf2;
    --brand-blue: #04a2f8;
    --brand-blue-deep: #0a6ce4;

    --bg: #f4f7fc;
    --surface: #ffffff;
    --surface-2: #eef2f9;
    --surface-3: #f7f9fd;
    --line: #dfe5f0;
    --line-soft: #ebeff6;
    --line-strong: #cfd6e4;
    --text: #0b1020;
    --text-2: #2f3650;
    --text-body: #222842;
    --muted: #5f6680;
    --placeholder: #d5dbe8;

    --accent: var(--brand-blue-deep);
    --accent-ink: #0857b8;
    --accent-hover: #064a9c;
    --accent-soft: #e6f1fe;
    --accent-tint: #d3e8fd;
    --accent-deep: #0a3a7a;
    --on-accent: #ffffff;
    --highlight: #d94f04;

    --cta: var(--brand-yellow);
    --cta-hover: var(--brand-amber);
    --cta-ink: var(--brand-ink);

    --tone-top-bg: #ffebe6;
    --tone-top-fg: #b3260f;
    --tone-guide-bg: #e6f1fe;
    --tone-guide-fg: #0857b8;
    --tone-dl-bg: #dff8fb;
    --tone-dl-fg: #00727f;
    --tone-code-bg: #fff5cc;
    --tone-code-fg: #7a5200;
    --tone-code-line: #e9b400;
    --tone-app-bg: #fff0e3;
    --tone-app-fg: #a84000;
    --tone-code-deep: #3d2a00;
    --tone-code-text: #5c4205;
    --tone-code-border: #f2dc8a;

    --ok-bg: #e5f8ef;
    --ok-fg: #0b5c3f;
    --ok-strong: #0f9d6b;
    --warn-bg: #ffebe6;
    --warn-fg: #8f1d0a;

    --ad-line: #c9d0e0;
    --ad-bg: #f9fbfe;

    --footer-bg: #070b18;
    --footer-text: #c9cee0;
    --footer-muted: #8f95ad;
    --footer-line: #1c2238;
    --footer-accent: var(--brand-yellow);

    --radius-lg: 18px;
    --radius: 16px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --wrap: 1200px;
    --gutter: 24px;
    --shadow: 0 1px 2px rgba(3, 7, 16, .05), 0 6px 20px -8px rgba(3, 7, 16, .14);

    --font-head: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

/* ==========================================================
   Nền tảng
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; margin: 0; letter-spacing: -.01em; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.skip-link:focus {
    position: fixed; top: 8px; left: 8px; z-index: 100;
    width: auto; height: auto; clip: auto;
    padding: 10px 16px; border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}

.rg-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* Tone theo chuyên mục */
.rg-tone-top { --tone-bg: var(--tone-top-bg); --tone-fg: var(--tone-top-fg); }
.rg-tone-guide { --tone-bg: var(--tone-guide-bg); --tone-fg: var(--tone-guide-fg); }
.rg-tone-dl { --tone-bg: var(--tone-dl-bg); --tone-fg: var(--tone-dl-fg); }
.rg-tone-code { --tone-bg: var(--tone-code-bg); --tone-fg: var(--tone-code-fg); }
.rg-tone-app { --tone-bg: var(--tone-app-bg); --tone-fg: var(--tone-app-fg); }

.rg-chip {
    display: inline-flex; align-items: center; align-self: flex-start;
    padding: 4px 10px; border-radius: var(--radius-pill);
    background: var(--tone-bg, var(--accent-soft)); color: var(--tone-fg, var(--accent-ink));
    font-size: 12px; font-weight: 700; line-height: 1.4;
}
a.rg-chip:hover { color: var(--tone-fg, var(--accent-ink)); filter: brightness(.97); }
.rg-chip--lg { padding: 5px 12px; font-size: 13px; }
.rg-chip--ok { background: var(--ok-bg); color: var(--ok-fg); }

.rg-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 22px; border-radius: 12px;
    font-weight: 700; font-size: 15px; border: 1px solid transparent; cursor: pointer;
}
.rg-btn--cta { background: var(--cta); color: var(--cta-ink); }
.rg-btn--cta:hover { background: var(--cta-hover); color: var(--cta-ink); }
.rg-btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.rg-btn--ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.rg-btn--block { display: flex; width: 100%; }

/* ==========================================================
   Header
   ========================================================== */
.rg-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.rg-header__inner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
    padding-top: 10px; padding-bottom: 10px;
}
.rg-logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.rg-logo:hover { color: var(--text); }
.rg-logo__mark {
    width: 38px; height: 38px; border-radius: 11px;
    background: var(--accent); color: var(--on-accent);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-head); font-weight: 900; font-size: 20px;
}
.rg-logo__text { font-family: var(--font-head); font-weight: 900; font-size: 24px; letter-spacing: -.02em; }
.rg-logo__accent { color: var(--accent); }
.rg-logo__img { display: block; height: 72px; width: auto; max-width: 100%; }

.rg-nav { flex: 1 1 auto; }
.rg-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.rg-nav a {
    display: block; padding: 10px 14px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 15px; color: var(--text-2);
}
.rg-nav a:hover { background: var(--surface-2); color: var(--text); }
.rg-nav .current-menu-item > a,
.rg-nav .current-menu-ancestor > a,
.rg-nav .current-cat > a,
.rg-nav .is-current > a { background: var(--tone-bg, var(--accent-soft)); color: var(--tone-fg, var(--accent-ink)); }

.rg-search {
    display: flex; align-items: center; gap: 8px;
    flex: 0 1 240px; min-width: 200px; height: 44px;
    padding: 0 5px 0 14px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--line);
}
.rg-search:focus-within { border-color: var(--accent); }
.rg-search__input {
    flex: 1; min-width: 0; border: 0; background: transparent;
    font-size: 14px; color: var(--text); outline: none;
}
.rg-search__btn, .rg-search-toggle {
    display: flex; align-items: center; justify-content: center;
    border: 0; cursor: pointer;
}
.rg-search__btn { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--on-accent); }
.rg-search-toggle { display: none; width: 44px; height: 44px; margin-left: auto; background: transparent; color: var(--text); border-radius: var(--radius-sm); }
.rg-icon { width: 20px; height: 20px; flex: none; }

/* ==========================================================
   Khung trang, panel, section
   ========================================================== */
.rg-page { padding-top: 28px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 36px; }
.rg-panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 20px;
    display: flex; flex-direction: column; gap: 6px;
}
.rg-panel__title { font-weight: 900; font-size: 19px; margin-bottom: 6px; }
.rg-panel--soft { background: var(--accent-soft); border-color: transparent; gap: 8px; }
.rg-panel--soft .rg-panel__title { color: var(--accent-deep); margin-bottom: 0; }
.rg-panel--soft p { margin: 0; font-size: 14px; color: var(--text-2); }

.rg-section { display: flex; flex-direction: column; gap: 18px; }
.rg-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rg-section__title { font-weight: 900; font-size: 26px; }
.rg-section__more { font-weight: 600; font-size: 14px; white-space: nowrap; }

.rg-layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.rg-main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.rg-sidebar { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.rg-empty {
    background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius);
    padding: 28px; text-align: center; color: var(--muted);
}

/* Ảnh và ảnh giữ chỗ */
.rg-media {
    display: block; position: relative; overflow: hidden;
    background: var(--tone-bg, var(--accent-tint)); aspect-ratio: 16 / 9;
}
.rg-media img { width: 100%; height: 100%; object-fit: cover; }
.rg-media--ph { display: flex; align-items: center; justify-content: center; color: var(--tone-fg, var(--accent-ink)); }
.rg-media--ph .rg-icon { width: 36px; height: 36px; opacity: .8; }

/* ==========================================================
   Thẻ bài viết
   ========================================================== */
.rg-grid { display: flex; flex-wrap: wrap; gap: 20px; }
.rg-card {
    flex: 1 1 250px; min-width: 0; display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.rg-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.rg-card__title { font-weight: 800; font-size: 18px; line-height: 1.3; }
.rg-card__title a { color: var(--text); }
.rg-card__title a:hover { color: var(--accent-ink); }
.rg-meta { font-size: 13px; color: var(--muted); }
.rg-card .rg-meta { margin-top: auto; }

.rg-row {
    display: flex; flex-wrap: wrap; gap: 18px; padding: 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.rg-row .rg-media { flex: 0 1 220px; min-width: 160px; border-radius: 12px; aspect-ratio: auto; min-height: 136px; }
.rg-row__body { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 4px 4px 4px 0; }
.rg-row__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rg-row__title { font-weight: 800; font-size: 20px; line-height: 1.3; }
.rg-row__title a { color: var(--text); }
.rg-row__title a:hover { color: var(--accent-ink); }
.rg-row__excerpt { margin: 0; font-size: 14px; color: var(--text-2); }
.rg-row .rg-meta { margin-top: auto; }

.rg-mini {
    flex: 1 1 240px; min-width: 0; display: flex; gap: 14px; align-items: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
    padding: 12px; color: var(--text);
}
.rg-mini:hover { color: var(--accent-ink); border-color: var(--line-strong); }
.rg-mini .rg-media { flex: none; width: 84px; height: 64px; border-radius: var(--radius-sm); aspect-ratio: auto; }
.rg-mini .rg-media--ph .rg-icon { width: 22px; height: 22px; }
.rg-mini__title { font-family: var(--font-head); font-weight: 800; font-size: 15px; line-height: 1.35; }

/* Danh sách nhỏ (gift code mới, mới cập nhật) */
.rg-list { display: flex; flex-direction: column; }
.rg-list__item {
    display: flex; align-items: center; gap: 12px; padding: 11px 2px;
    border-top: 1px solid var(--line-soft); color: var(--text);
}
.rg-list__item:hover { color: var(--accent-ink); }
.rg-list__thumb { width: 40px; height: 40px; border-radius: var(--radius-sm); flex: none; overflow: hidden; background: var(--tone-bg, var(--surface-2)); }
.rg-list__thumb img { width: 100%; height: 100%; object-fit: cover; }
.rg-list__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rg-list__title { font-weight: 700; font-size: 15px; line-height: 1.35; }
.rg-list__sub { font-size: 13px; color: var(--muted); }
.rg-list__num { font-family: var(--font-head); font-weight: 900; font-size: 22px; color: var(--highlight); width: 22px; flex: none; line-height: 1.1; align-self: flex-start; }

/* ==========================================================
   Trang chủ
   ========================================================== */
.rg-hero { display: flex; flex-wrap: wrap; gap: 24px; }
.rg-feature {
    flex: 999 1 560px; min-width: 0; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.rg-feature .rg-media { aspect-ratio: auto; height: 340px; }
.rg-feature__body { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 12px; }
.rg-feature__title { font-weight: 900; font-size: 32px; line-height: 1.2; }
.rg-feature__title a { color: var(--text); }
.rg-feature__title a:hover { color: var(--accent-ink); }
.rg-feature__excerpt { margin: 0; font-size: 16px; color: var(--text-2); }

.rg-giftbox { flex: 1 1 320px; min-width: 0; border-radius: var(--radius-lg); padding: 22px; gap: 14px; }
.rg-giftbox__head { display: flex; align-items: center; gap: 10px; }
.rg-giftbox__icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--tone-code-bg); color: var(--tone-code-fg);
    display: flex; align-items: center; justify-content: center;
}
.rg-giftbox .rg-panel__title { font-size: 20px; margin: 0; }
.rg-giftbox .rg-btn { margin-top: auto; }

.rg-cats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.rg-cat-tile {
    min-width: 0; display: flex; align-items: center; gap: 14px; padding: 18px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
}
.rg-cat-tile:hover { color: var(--text); border-color: var(--tone-fg); }
.rg-cat-tile__badge {
    width: 48px; height: 48px; border-radius: 13px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--tone-bg); color: var(--tone-fg);
    font-family: var(--font-head); font-weight: 900; font-size: 15px;
}
.rg-cat-tile__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rg-cat-tile__name { font-family: var(--font-head); font-weight: 800; font-size: 17px; }
.rg-cat-tile__desc { font-size: 13px; color: var(--muted); line-height: 1.4; }

/* ==========================================================
   Quảng cáo (khung giữ sẵn chiều cao, chống CLS)
   ========================================================== */
.rg-ad {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; overflow: hidden;
}
.rg-ad__label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rg-ad--leader { min-height: 110px; }
.rg-ad--inarticle { min-height: 120px; }
.rg-ad--rect { min-height: 250px; }
.rg-ad--tall { min-height: 600px; }

/* ==========================================================
   Breadcrumb
   ========================================================== */
.rg-breadcrumb, .rank-math-breadcrumb p { margin: 0; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.rg-breadcrumb__current { color: var(--text-2); }

/* ==========================================================
   Bài viết
   ========================================================== */
.rg-single { padding-top: 20px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 18px; }
.rg-article {
    flex: 999 1 620px; min-width: 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 32px clamp(18px, 4vw, 44px) 40px;
    display: flex; flex-direction: column; gap: 20px;
}
.rg-article__title { font-weight: 900; font-size: clamp(28px, 4vw, 38px); line-height: 1.18; }
.rg-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 14px; color: var(--muted); }
.rg-byline__text { display: flex; flex-direction: column; gap: 2px; }
.rg-byline__name { font-weight: 700; color: var(--text); }
.rg-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--placeholder); overflow: hidden; flex: none; }
.rg-avatar--lg { width: 64px; height: 64px; }
.rg-article__cover { border-radius: var(--radius-md); overflow: hidden; }
.rg-article__cover img { width: 100%; height: auto; }

/* Nội dung bài */
.rg-content { font-size: 17px; line-height: 1.75; color: var(--text-body); overflow-wrap: break-word; }
.rg-content > * { margin-top: 0; margin-bottom: 1.1em; }
.rg-content > *:last-child { margin-bottom: 0; }
.rg-content h2 { font-weight: 900; font-size: 26px; color: var(--text); margin-top: 1.6em; margin-bottom: .6em; scroll-margin-top: 20px; }
.rg-content h3 { font-weight: 800; font-size: 21px; color: var(--text); margin-top: 1.4em; margin-bottom: .5em; scroll-margin-top: 20px; }
.rg-content ul, .rg-content ol { padding-left: 1.4em; }
.rg-content li + li { margin-top: .4em; }
.rg-content a { text-decoration: underline; text-underline-offset: 3px; }
.rg-content img { border-radius: var(--radius-md); }
.rg-content figure { margin-left: 0; margin-right: 0; }
.rg-content figcaption, .rg-content .wp-caption-text { font-size: 14px; color: var(--muted); margin-top: 8px; text-align: center; }
.rg-content .wp-caption { max-width: 100%; }
.rg-content .aligncenter { margin-left: auto; margin-right: auto; }
.rg-content blockquote {
    margin-left: 0; margin-right: 0; padding: 14px 18px; border-radius: var(--radius-md);
    background: var(--surface-3); border: 1px solid var(--line); color: var(--text-2);
}
.rg-content blockquote p { margin: 0; }
.rg-content code {
    font-family: var(--font-mono); font-size: .9em; padding: 2px 6px; border-radius: 6px;
    background: var(--surface-2);
}
.rg-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* Bảng: luôn cuộn ngang gọn trên mobile */
.rg-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); -webkit-overflow-scrolling: touch; }
.rg-content table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.rg-content th, .rg-content td { padding: 12px 16px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line-soft); }
.rg-content thead th, .rg-content tr:first-child th {
    background: var(--text); color: var(--surface); border-top: 0;
    font-family: var(--font-head); font-weight: 800; font-size: 14px; letter-spacing: .01em; white-space: nowrap;
}
.rg-content tbody tr:nth-child(even) td { background: var(--surface-3); }
.rg-content tbody tr:hover td { background: var(--accent-soft); }
/* Cột code và cột tình trạng không xuống dòng, cột phần thưởng co giãn */
.rg-content td:has(> code), .rg-content td:has(> .rg-code) { width: 1%; white-space: nowrap; }
.rg-content td:has(> .rg-chip:only-child) { width: 1%; white-space: nowrap; text-align: center; }
.rg-content td .rg-chip { font-size: 11px; letter-spacing: .04em; }

/* Code trong bảng: bấm vào code để chép (JS đổi thẻ code thành nút) */
.rg-content td code, .rg-code {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-weight: 700; font-size: 15px; line-height: 1.2;
    padding: 7px 10px 7px 12px; border-radius: 8px;
    background: var(--tone-code-bg); color: var(--tone-code-deep); border: 1.5px dashed var(--tone-code-line);
}
.rg-code { cursor: pointer; transition: background-color .15s, border-color .15s; }
.rg-code:hover { background: var(--brand-yellow); border-style: solid; color: var(--brand-ink); }
.rg-code__icon { width: 16px; height: 16px; flex: none; opacity: .7; }
.rg-code:hover .rg-code__icon { opacity: 1; }
.rg-code__icon--done { display: none; }
.rg-code.is-done { background: var(--ok-strong); border: 1.5px solid var(--ok-strong); color: var(--surface); }
.rg-code.is-done .rg-code__icon--copy { display: none; }
.rg-code.is-done .rg-code__icon--done { display: block; opacity: 1; }
.rg-expired { text-decoration: line-through; color: var(--muted); }

/* Hộp ghi chú: thêm class vào thẻ p hoặc div trong bài */
.rg-note { display: block; padding: 14px 16px; border-radius: var(--radius-md); font-size: 15px; line-height: 1.6; }
.rg-note--ok { background: var(--ok-bg); color: var(--ok-fg); }
.rg-note--warn { background: var(--warn-bg); color: var(--warn-fg); }

/* Mục lục tự sinh */
.rg-toc {
    border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-3);
    padding: 16px 20px; font-size: 15px; line-height: 1.5;
}
.rg-toc__title { display: block; font-family: var(--font-head); font-weight: 900; font-size: 17px; margin-bottom: 8px; color: var(--text); }
.rg-content .rg-toc ol { margin: 0; padding-left: 1.3em; }
.rg-content .rg-toc a { text-decoration: none; }
.rg-content .rg-toc a:hover { text-decoration: underline; }

.rg-sources { font-size: 14px; color: var(--muted); }

.rg-author-box {
    display: flex; flex-wrap: wrap; gap: 16px; padding: 20px;
    border-radius: var(--radius); background: var(--surface-3); border: 1px solid var(--line);
}
.rg-author-box__text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 6px; }
.rg-author-box__label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rg-author-box__name { font-family: var(--font-head); font-weight: 900; font-size: 18px; color: var(--text); }
.rg-author-box__bio { margin: 0; font-size: 14px; color: var(--text-2); }

.rg-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.rg-tags a { padding: 4px 12px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; }

/* Bình luận */
.rg-comments { display: flex; flex-direction: column; gap: 16px; }
.rg-comments ol { list-style: none; margin: 0; padding: 0; }
.rg-comments .comment-body { padding: 14px 0; border-top: 1px solid var(--line-soft); font-size: 15px; }
.rg-comments .avatar { border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 8px; }
.rg-comments textarea, .rg-comments input[type="text"], .rg-comments input[type="email"], .rg-comments input[type="url"] {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.rg-comments .submit {
    min-height: 44px; padding: 0 20px; border: 0; border-radius: 12px;
    background: var(--accent); color: var(--on-accent); font-weight: 700; cursor: pointer;
}

/* ==========================================================
   Trang chuyên mục / lưu trữ
   ========================================================== */
.rg-term-head { background: var(--tone-bg, var(--accent-soft)); border-bottom: 1px solid var(--line); }
.rg-term-head__inner { padding-top: 22px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 12px; }
.rg-term-head__title { font-weight: 900; font-size: clamp(30px, 4vw, 42px); line-height: 1.15; color: var(--text); }
.rg-author-head { display: flex; align-items: center; gap: 16px; }
.rg-term-head__desc { margin: 0; max-width: 680px; font-size: 16px; color: var(--text-2); }
.rg-term-head__desc p { margin: 0; }
.rg-subcats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; list-style: none; padding: 0; }
.rg-subcats a {
    display: flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--radius-pill);
    background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-weight: 600; font-size: 14px;
}
.rg-subcats a:hover { border-color: var(--tone-fg, var(--accent)); color: var(--text); }
.rg-subcats .is-current a { background: var(--text); border-color: var(--text); color: var(--surface); font-weight: 700; }

.rg-catlist { display: flex; flex-direction: column; gap: 4px; }
.rg-catlist a { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); color: var(--text); font-weight: 600; font-size: 15px; }
.rg-catlist a:hover { color: var(--accent-ink); }
.rg-catlist__dot { width: 12px; height: 12px; border-radius: 4px; background: var(--tone-fg); flex: none; }

/* Phân trang (the_posts_pagination) */
.rg-main .pagination { margin-top: 8px; }
.rg-main .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rg-main .page-numbers {
    min-width: 44px; height: 44px; padding: 0 14px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 700;
}
.rg-main a.page-numbers:hover { border-color: var(--accent); color: var(--accent-ink); }
.rg-main .page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.rg-main .page-numbers.dots { background: transparent; border-color: transparent; }

/* Trang tĩnh, 404 */
.rg-narrow { max-width: 820px; margin: 0 auto; width: 100%; flex: none; }
.rg-404 { text-align: center; align-items: center; }
.rg-404__code { font-family: var(--font-head); font-weight: 900; font-size: 88px; line-height: 1; color: var(--accent); }
.rg-404 .rg-search { flex: none; width: 100%; max-width: 420px; }

/* ==========================================================
   Footer
   ========================================================== */
.rg-footer { background: var(--footer-bg); color: var(--footer-text); }
.rg-footer__inner { padding-top: 44px; padding-bottom: 24px; display: flex; flex-wrap: wrap; gap: 32px 48px; }
.rg-footer__brand { flex: 2 1 280px; display: flex; flex-direction: column; gap: 12px; }
.rg-footer__logo { font-family: var(--font-head); font-weight: 900; font-size: 24px; color: var(--surface); }
.rg-footer__logo span { color: var(--footer-accent); }
.rg-footer__logo-img { display: block; height: 64px; width: auto; max-width: 100%; }
.rg-footer__brand p { margin: 0; font-size: 14px; line-height: 1.65; max-width: 360px; }
.rg-footer__col { flex: 1 1 180px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.rg-footer__heading { font-weight: 700; color: var(--surface); margin-bottom: 4px; font-size: 14px; font-family: var(--font); letter-spacing: 0; }
.rg-footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rg-footer a { color: var(--footer-text); }
.rg-footer a:hover { color: var(--surface); }
.rg-footer__bottom { flex: 1 1 100%; border-top: 1px solid var(--footer-line); padding-top: 18px; font-size: 13px; color: var(--footer-muted); }

/* ==========================================================
   Responsive: 1080 / 760 / 480
   ========================================================== */
@media (max-width: 1080px) {
    .rg-header__inner { gap: 10px 16px; }
    .rg-nav a { padding: 10px 10px; }
    .rg-search { flex-basis: 200px; min-width: 180px; }
    .rg-logo__img { height: 60px; }
    .rg-feature .rg-media { height: 300px; }
    .rg-feature__title { font-size: 28px; }
    .rg-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    :root { --gutter: 16px; }
    .rg-header__inner { padding-top: 8px; padding-bottom: 8px; gap: 8px; }
    .rg-logo__mark { width: 32px; height: 32px; font-size: 17px; border-radius: 9px; }
    .rg-logo__text { font-size: 21px; }
    .rg-logo__img { height: 50px; }
    .rg-search-toggle { display: flex; }
    .rg-js .rg-header .rg-search { display: none; }
    .rg-js .rg-header.is-search-open .rg-search { display: flex; }
    .rg-header .rg-search { order: 3; flex: 1 1 100%; }
    /* Menu thành dải chip cuộn ngang */
    .rg-nav { order: 4; flex: 1 1 100%; margin: 0 calc(var(--gutter) * -1); }
    .rg-nav ul { flex-wrap: nowrap; overflow-x: auto; padding: 4px var(--gutter) 2px; gap: 8px; scrollbar-width: none; }
    .rg-nav ul::-webkit-scrollbar { display: none; }
    .rg-nav li { flex: none; }
    .rg-nav a { padding: 8px 14px; border-radius: var(--radius-pill); background: var(--surface-2); font-size: 14px; }

    .rg-page { padding-top: 16px; gap: 24px; }
    .rg-feature .rg-media { height: auto; aspect-ratio: 16 / 9; }
    .rg-feature__body { padding: 16px 16px 18px; gap: 10px; }
    .rg-feature__title { font-size: 23px; }
    .rg-feature__excerpt { font-size: 15px; }
    .rg-giftbox { padding: 16px; }
    .rg-section__title { font-size: 21px; }
    .rg-cats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .rg-cat-tile { padding: 14px; }
    .rg-ad--leader { min-height: 100px; }

    .rg-single { padding-top: 14px; }
    .rg-article { padding-top: 22px; padding-bottom: 28px; gap: 16px; border-radius: var(--radius); }
    .rg-content { font-size: 16px; }
    .rg-content h2 { font-size: 22px; }
    .rg-content h3 { font-size: 19px; }

    .rg-term-head__inner { padding-top: 16px; padding-bottom: 20px; }
    .rg-row .rg-media { flex-basis: 100%; min-height: 0; aspect-ratio: 16 / 9; }
    .rg-row__title { font-size: 18px; }
}

@media (max-width: 480px) {
    .rg-card { flex-basis: 100%; }
    .rg-card .rg-media { aspect-ratio: 2 / 1; }
    .rg-mini { flex-basis: 100%; }
    .rg-row { padding: 10px; gap: 12px; }
    .rg-feature__title { font-size: 21px; }
    .rg-article__title { font-size: 26px; }
    .rg-footer__inner { padding-top: 28px; gap: 24px; }
}
