/*
Theme Name: WikiReturnPolicy
Theme URI: https://wikireturnpolicy.com
Description: Theme STANDALONE cho WikiReturnPolicy.com. Không có parent theme (PRD mục 2.1). Đen trắng thuần, system font, không icon font, tối ưu cho trang tra cứu data heavy.
Author: WikiReturnPolicy.com
Version: 0.1.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: wrp
*/

/* ==========================================================================
   1. TOKEN, 1 BỘ DUY NHẤT (CLAUDE.md rule F3)
   Đổi màu toàn site CHỈ sửa block này. KHÔNG hardcode hex ở bất kỳ chỗ nào khác.
   ========================================================================== */
:root {
  /* Brand: đen trắng thuần (PRD mục 14.1) */
  --bg:          #ffffff;
  --ink:         #1a1a1a;
  --ink-soft:    #404040;
  --muted:       #6e6e6e;   /* đạt WCAG AA trên nền trắng */
  --line:        #e4e4e4;
  --panel:       #f6f6f6;
  --dark:        #111111;
  --accent:      #1a1a1a;
  --accent-deep: #000000;
  --link:        #1a1a1a;
  --on-dark:     #ffffff;   /* chữ trên nền tối, luôn trắng */

  /* Semantic: CHỈ dùng trong bảng dữ liệu, KHÔNG phải màu brand (PRD mục 14.2) */
  --good: #1e8e5a;
  --bad:  #c0392b;

  /* Layout */
  --wrap:   1100px;
  --narrow: 760px;
  --radius: 10px;
  --gap:    24px;

  /* System font: KHÔNG web font (PageSpeed, site tra cứu) */
  /* Arial theo yêu cầu user. Websafe nên 0KB tải về. Chất Swiss đến từ
     tương phản cỡ chữ và tracking, không phải từ bản thân typeface. */
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ==========================================================================
   2. RESET + BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

/*
 * Icon inline SVG: ràng buộc kích thước MỘT CHỖ cho toàn site.
 *
 * BUG ĐÃ SỬA (2026-08-17): trước đây chỉ `.logo svg` có kích thước, còn icon
 * trong bảng At a Glance không có, nên SVG nở ra kích thước mặc định của trình
 * duyệt (300x150) và che gần hết ô.
 *
 * Bài học: khi dùng inline SVG thay icon font, PHẢI có rule mặc định cho MỌI
 * svg, vì SVG không tự co theo font-size như glyph của icon font.
 */
svg { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -.125em; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: .6rem; }
h3 { font-size: 1.15rem; margin-top: 1.5rem; margin-bottom: .4rem; }
p { margin-bottom: 1rem; }
ul, ol { margin: 0 0 1rem 1.25rem; }
li { margin-bottom: .3rem; }

/* Chỉ hiện cho screen reader. Dùng cho nhãn a11y của ô Yes/No. */
.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 8px; top: 8px; z-index: 100;
  background: var(--dark); color: var(--on-dark); padding: 10px 16px; border-radius: var(--radius);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ==========================================================================
   3. LAYOUT
   ========================================================================== */
.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: var(--narrow); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.layout__side { position: sticky; top: 20px; align-self: start; }

.site-main { padding: 32px 0 56px; }

/* ==========================================================================
   4. HEADER + LOGO (PRD mục 14.3)
   Wordmark CSS text 2 trọng lượng, KHÔNG dùng ảnh, KHÔNG dùng web font.
   ========================================================================== */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header__inner { display: flex; align-items: center; gap: 20px; height: 66px; }

.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo svg { height: .85em; width: auto; fill: currentColor; flex: none; }
.logo__name { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.logo__tld  { font-size: 24px; font-weight: 400; color: var(--muted); letter-spacing: -.03em; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-soft);
}
.site-nav a:hover { background: var(--panel); color: var(--ink); text-decoration: none; }

/*
 * BUG ĐÃ SỬA (2026-08-18): `.nav-toggle__box` chỉ được ẩn BÊN TRONG media query
 * 760px, nên ở desktop cái checkbox hiện ra cạnh logo như một ô vuông trống.
 * Ẩn ở đây, tức mặc định cho mọi bề rộng.
 */
.nav-toggle { display: none; }
.nav-toggle__box { display: none; }

/* ==========================================================================
   5. FOOTER
   ========================================================================== */
.site-footer { background: var(--dark); color: var(--on-dark); margin-top: 60px; padding: 40px 0 48px; }
.site-footer a { color: var(--on-dark); }
.site-footer .logo { color: var(--on-dark); }
.site-footer .logo__name { font-size: 22px; }
.site-footer .logo__tld  { font-size: 22px; color: rgba(255, 255, 255, .6); }
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; margin-top: 24px; }
.site-footer h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255, 255, 255, .6); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; }
.site-footer li { margin-bottom: 6px; font-size: 14px; }
.site-footer__legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: 13px; color: rgba(255, 255, 255, .65); }

/* ==========================================================================
   6. COMPONENT DÙNG CHUNG
   Theme không có parent nên đây là bộ component gốc. Trước khi thêm class mới:
   grep xem đã có class dùng được chưa (CLAUDE.md rule F2).
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--on-dark); text-decoration: none;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--panel); color: var(--ink); }
.btn--block { width: 100%; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.5;
  background: var(--panel); color: var(--ink-soft); border: 1px solid var(--line);
}
.badge--verified { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.badge--stale    { background: transparent; color: var(--muted); }

.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb ol { list-style: none; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li::after { content: "›"; margin-left: 6px; color: var(--line); }
.breadcrumb li:last-child::after { content: ""; }

.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; background: var(--bg);
}
.card h3 { margin-top: 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

.meta { font-size: 13px; color: var(--muted); }

/* Bảng: PHẢI scroll ngang trên mobile, không vỡ layout (CLAUDE.md Responsive) */
.table-scroll { overflow-x: auto; margin: 16px 0; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 480px; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--panel); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.table tr:last-child td { border-bottom: none; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 32px; }
.pagination .page-numbers {
  padding: 8px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; font-size: 14px; font-weight: 600;
}
.pagination .page-numbers.current { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }

.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
  flex: 1; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 15px; font-family: inherit; color: var(--ink);
}

/* ==========================================================================
   7. AT A GLANCE, component đặc thù dự án
   RÀNG BUỘC A11Y (PRD 14.2): trạng thái KHÔNG BAO GIỜ chỉ truyền đạt bằng màu.
   Mỗi ô luôn có icon cộng chữ. CSS dưới đây chỉ tô màu THÊM lên nội dung đã đọc được.
   ========================================================================== */
.glance { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 22px 0; }
.glance__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.glance__title { font-size: 15px; font-weight: 700; margin: 0; }
.glance__verified { margin-left: auto; font-size: 13px; color: var(--muted); }
.glance__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.glance__item { padding: 14px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.glance__label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.glance__value { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 6px; }

/* Icon cộng màu. Icon là ký tự thật trong markup nên bỏ CSS vẫn đọc được. */
.glance__value--yes  { color: var(--good); }
.glance__value--no   { color: var(--bad); }
.glance__value--none { color: var(--muted); font-weight: 400; font-style: italic; }

/* Nguồn cộng disclaimer: luôn hiện, không được ẩn (CLAUDE.md rule C4, C6) */
.source-note { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 26px; }
.source-note a { color: var(--muted); }

/* Cột đọc: giới hạn bề rộng cho dễ đọc. Prose dài 900px là mỏi mắt. */
.entry-content > p,
.entry-content > ul,
.entry-content > ol { max-width: 68ch; }
.entry-content h2 {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 40px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}
.entry-content h3 { font-size: 16px; margin-top: 26px; }
.wrp-lede { font-size: 17px; line-height: 1.55; color: var(--ink); max-width: 62ch; }

/* Heading của khối dữ liệu dùng chung nhịp với entry-content. */
.layout__main > article > section > h2,
.layout__main > article > h2 {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 40px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}

.statutory {
  border: 1px solid var(--line); border-left: 4px solid var(--ink);
  border-radius: var(--radius); padding: 16px 18px; margin: 22px 0; background: var(--bg);
}
.statutory h2 { margin-top: 0; font-size: 1.15rem; }

/* Danh sách số liệu ở sidebar trang store. */
.sidefacts { list-style: none; margin: 14px 0 18px; }
.sidefacts li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.sidefacts li:last-child { border-bottom: 0; }
.sidefacts__label { font-size: 12.5px; color: var(--muted); }
.sidefacts__val { font-size: 14px; font-weight: 700; text-align: right; }
.sidefacts__val--none { font-weight: 400; color: #9a9a9a; font-size: 13px; }

.changelog { list-style: none; margin: 0; }
.changelog li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.changelog li:last-child { border-bottom: none; }
.changelog time { color: var(--muted); font-size: 13px; display: block; }

/* ==========================================================================
   7b. HOMEPAGE
   Thứ bậc rõ ràng thay cho lưới ô đồng dạng. Con số là nhân vật chính.
   ========================================================================== */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 46px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}
.side-title {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}

/* Hero 2 cột, bất đối xứng: nội dung chính rộng, cột phụ hẹp. */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 56px; align-items: start;
  padding: 46px 0 40px; border-bottom: 1px solid var(--ink);
}
.hero__title {
  font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.04;
  letter-spacing: -.035em; margin-bottom: 18px; max-width: 15ch;
}
.hero__sub { font-size: 1rem; color: var(--ink-soft); max-width: 54ch; }
.hero__search { margin-top: 24px; max-width: 460px; }

/* Khối số liệu thay cho changefeed khi chưa có thay đổi nào. */
.factlist { list-style: none; margin: 0; }
.factlist li { padding: 13px 0; border-top: 1px solid var(--line); }
.factlist li:first-child { border-top: 0; }
.factlist__num { display: block; font-size: 30px; font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.factlist__label { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.changefeed { list-style: none; margin: 0; }
.changefeed li { padding: 11px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.45; }
.changefeed li:first-child { border-top: 0; }
.changefeed a { font-weight: 700; text-decoration: none; }
.changefeed a:hover { text-decoration: underline; }
.changefeed__what { display: block; color: var(--ink-soft); }
.changefeed time { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* 3 store dẫn đầu: con số to là điểm neo thị giác của cả trang. */
.lead-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.lead {
  display: flex; flex-direction: column; background: var(--bg);
  padding: 22px 24px 24px; text-decoration: none; min-height: 168px;
}
.lead:hover { background: var(--panel); text-decoration: none; }
.lead__store { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.lead__num {
  font-size: 62px; font-weight: 700; line-height: .92;
  letter-spacing: -.05em; margin: 4px 0 2px;
}
.lead__num--none { color: var(--muted); }
.lead__unit { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.lead__free { margin-top: auto; padding-top: 12px; font-size: 12.5px; color: var(--ink-soft); }

/* Danh sách store: hairline, KHÔNG hộp. 2 cột cho đỡ cao. */
.storelist { list-style: none; margin: 0; columns: 2; column-gap: 48px; }
.storelist li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  break-inside: avoid; margin: 0;
}
.storelist a { text-decoration: none; font-size: 14.5px; font-weight: 600; }
.storelist a:hover { text-decoration: underline; }
.storelist__num { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.storelist__num--pending { color: #b0b0b0; font-style: italic; }
.more-link { margin-top: 16px; font-size: 13.5px; font-weight: 700; }

/* Danh mục: 3 cột, cùng ngôn ngữ hairline. */
.catlist { list-style: none; margin: 0; columns: 3; column-gap: 44px; }
.catlist li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line); break-inside: avoid; margin: 0;
}
.catlist a { text-decoration: none; font-size: 14px; }
.catlist a:hover { text-decoration: underline; }
.catlist__count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Thanh nhảy A-Z ở trang danh bạ store. */
.azjump { display: flex; flex-wrap: wrap; gap: 2px; margin: 18px 0 4px; border-top: 1px solid var(--ink); padding-top: 14px; }
.azjump a {
  min-width: 30px; text-align: center; padding: 5px 6px; border-radius: 4px;
  font-size: 13px; font-weight: 700; text-decoration: none; color: var(--ink-soft);
}
.azjump a:hover { background: var(--ink); color: var(--on-dark); text-decoration: none; }

.method { margin-top: 10px; }
.method__cols { columns: 2; column-gap: 48px; font-size: 14.5px; color: var(--ink-soft); }
.method__cols p { break-inside: avoid; }

/* ==========================================================================
   7c. TRANG DANH MỤC
   ========================================================================== */
/*
 * BUG ĐÃ SỬA (2026-08-18): `th` toàn cục có text-transform:uppercase (dành cho
 * hàng tiêu đề), nhưng ô tên store cũng là `th` (scope=row) nên tên store hiện
 * thành "1STOPBEDROOMS", "TEMPUR-PEDIC". Vừa xấu vừa khó đọc.
 */
.table--compare th[scope="row"] {
  position: sticky; left: 0; background: var(--bg);
  border-right: 1px solid var(--line);
  font-weight: 700; font-size: 14.5px;
  text-transform: none; letter-spacing: normal; color: var(--ink);
}
.table--compare th[scope="row"] a { text-decoration: none; }
.table--compare th[scope="row"] a:hover { text-decoration: underline; }
.table--compare td { font-variant-numeric: tabular-nums; }
.cell { font-weight: 600; }
.cell--yes { color: var(--good); }
.cell--no { color: var(--bad); }
.cell--neutral { color: var(--ink-soft); }
.cell--none { color: #9a9a9a; font-weight: 400; font-size: 13px; }

/* Dòng tóm tắt đầu trang danh mục: trả lời ngay câu hỏi chính. */
.cat-summary {
  display: flex; flex-wrap: wrap; gap: 0; margin: 18px 0 6px;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line);
}
.cat-summary__item { padding: 14px 26px 14px 0; margin-right: 26px; border-right: 1px solid var(--line); }
.cat-summary__item:last-child { border-right: 0; }
.cat-summary__label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cat-summary__value { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-top: 2px; }
.cat-summary__note { display: block; font-size: 12.5px; color: var(--ink-soft); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1px; background: var(--line); margin: 16px 0; }
.cat-card {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  background: var(--bg); padding: 13px 16px; text-decoration: none;
}
.cat-card:hover { background: var(--panel); text-decoration: none; }
.cat-card__name { font-weight: 600; font-size: 14px; }
.cat-card__count { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ==========================================================================
   8. RESPONSIVE (CLAUDE.md: kiểm 1080 / 760 / 480)
   ========================================================================== */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout__side { position: static; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .catlist { columns: 2; }
}

@media (max-width: 760px) {
  h1 { font-size: 1.7rem; }
  .glance__grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

  /* Nav gọn vào toggle. Dùng checkbox nên không cần JS. */
  .nav-toggle { display: block; margin-left: auto; }
  .nav-toggle__box { display: none; }
  .nav-toggle__btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius);
    font-size: 14px; font-weight: 600;
  }
  .site-nav { display: none; margin-left: 0; }
  .nav-toggle__box:checked ~ .site-nav {
    display: block; position: absolute; left: 0; right: 0; top: 66px; z-index: 20;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 16px;
  }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { padding: 12px 8px; border-bottom: 1px solid var(--line); } /* tap target đủ lớn */
  .site-header__inner { position: relative; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .cat-grid { grid-template-columns: 1fr; }
  .hero { padding: 26px 0 22px; }
  .lead-row { grid-template-columns: 1fr; }
  .lead { min-height: 0; padding: 18px 0; }
  .lead__num { font-size: 46px; }
  .storelist, .catlist, .method__cols { columns: 1; }
  .logo__name, .logo__tld { font-size: 18px; }
  .glance__grid { grid-template-columns: 1fr; }
  .glance__item { border-right: none; }
  h1 { font-size: 1.5rem; }
}

@media print {
  .site-header, .site-footer, .layout__side, .btn { display: none; }
  .layout { grid-template-columns: 1fr; }
  /* In đen trắng: màu semantic biến mất nên icon cộng chữ trong markup là thứ giữ nghĩa. */
}
