/*
Theme Name: TrueTale
Theme URI: https://example.com/
Author: G\u1ea5u
Description: Web truy\u1ec7n ng\u1eafn t\u1ed1i \u01b0u \u0111\u1ecdc tr\u00ean mobile v\u00e0 Google AdSense: nh\u00e3n chapter, table of contents, popular posts, ch\u1ec9nh theme/c\u1ee1 ch\u1eef.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: truetale
*/
/* TrueTale Stories — mobile-first, siêu nhẹ, không framework */
:root {
  --ink: #1a1a2e;
  --muted: #6b7280;
  --accent: #b91c1c;
  --accent-dark: #7f1d1d;
  --bg: #faf9f7;
  --card: #ffffff;
  --line: #e8e4dc;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* ---------- homepage v2: featured + news grid ---------- */
.section-label { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: .9rem; letter-spacing: 2.5px; margin: 28px 0 16px; text-transform: uppercase; }
.section-label::before { content: ""; width: 4px; height: 20px; background: #d61f26; border-radius: 2px; flex: none; }
.featured-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .featured-grid { grid-template-columns: 1.6fr 1fr; } }
.feat-big, .feat-small { position: relative; display: flex; align-items: flex-end; border-radius: 16px; overflow: hidden; text-decoration: none; background-color: #23232e; background-size: cover; background-position: center; }
.feat-big { min-height: 320px; padding: 26px; }
@media (min-width: 900px) { .feat-big { min-height: 430px; } }
.feat-col { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .feat-col { grid-template-columns: 1fr; } }
.feat-small { min-height: 200px; padding: 18px; }
.feat-big::after, .feat-small::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.28) 55%, rgba(0,0,0,0) 100%); }
.feat-text { position: relative; z-index: 1; }
.feat-big h2 { color: #fff; font-size: 1.65rem; line-height: 1.28; margin-bottom: 10px; }
@media (min-width: 900px) { .feat-big h2 { font-size: 2.05rem; } }
.feat-small h3 { color: #fff; font-size: 1rem; line-height: 1.42; }
.feat-meta { color: rgba(255,255,255,.78); font-size: .82rem; }
.badge { position: absolute; top: 14px; right: 14px; z-index: 2; background: #d61f26; color: #fff; font-size: .66rem; font-weight: 800; letter-spacing: 1.2px; padding: 6px 12px; border-radius: 6px; text-transform: uppercase; }
.home-layout { display: grid; grid-template-columns: 1fr; gap: 30px; }
@media (min-width: 960px) { .home-layout { grid-template-columns: minmax(0,1fr) 320px; align-items: start; } .home-layout .sidebar { position: sticky; top: 84px; } }
.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .news-grid { grid-template-columns: 1fr; } }
.news-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.news-card a { text-decoration: none; color: inherit; display: block; }
.news-thumb { position: relative; }
.news-thumb img { width: 100%; height: 190px; object-fit: cover; display: block; }
.news-thumb .badge { top: 10px; right: 10px; }
.news-card h2 { font-size: 1rem; line-height: 1.42; padding: 14px 16px 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card .card-meta { padding: 0 16px 16px; }
.pop-thumbs .pop-title { flex: 1; }
.pop-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: none; }
.clock { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid var(--muted); position: relative; }
.clock::after { content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 4px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 18px; }

/* header — kiểu NEWS: menu + logo + kính lúp */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; height: 62px; gap: 14px; }
.logo { color: var(--ink); font-weight: 900; font-size: 1.65rem; text-decoration: none; letter-spacing: 2px; }
.hamburger { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; gap: 5px; padding: 10px 6px; }
.hamburger span { display: block; width: 24px; height: 3px; border-radius: 2px; background: var(--ink); }
.search-icon { margin-left: auto; color: var(--ink); display: flex; padding: 8px; }
.mobile-nav { display: none; border-top: 1px solid var(--line); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 13px 4px; text-decoration: none; color: var(--ink);
  font-weight: 600; border-bottom: 1px solid var(--line); }
.mobile-nav a:last-child { border-bottom: none; }

/* hero */
.hero { text-align: center; padding: 44px 10px 30px; }
.hero h1 { font-size: 1.9rem; line-height: 1.25; margin-bottom: 10px; }
.hero p { color: var(--muted); font-size: 1.05rem; }

/* grid */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 10px 0 30px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.card a { text-decoration: none; color: inherit; display: block; padding: 20px; }
.card h2 { font-size: 1.15rem; margin-bottom: 8px; line-height: 1.35; }
.card-desc { color: var(--muted); font-size: .93rem; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.read-more { color: var(--accent); font-weight: 700; font-size: .95rem; }

/* story — layout 2 cột kiểu web mẫu */
.reading-layout { display: grid; grid-template-columns: 1fr; gap: 30px; padding: 24px 0 8px; }
@media (min-width: 960px) {
  .reading-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .sidebar { position: sticky; top: 84px; }
}
.story { min-width: 0; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }
.cat-kicker {
  display: flex; align-items: center; gap: 10px;
  color: #d61f26; font-weight: 800; font-size: .85rem;
  letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 12px;
}
.cat-kicker::before { content: ""; width: 4px; height: 22px; background: #d61f26; border-radius: 2px; flex: none; }
.story h1 { font-size: 2rem; line-height: 1.28; margin-bottom: 10px; letter-spacing: -.5px; }
@media (min-width: 640px) { .story h1 { font-size: 2.4rem; } }
.story-meta { color: var(--muted); font-size: .88rem; margin-bottom: 4px; }

/* sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.toc-card, .pop-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; box-shadow: 0 2px 14px rgba(0,0,0,.05);
}
.toc-title { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc-head {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: 1.8px;
  border-bottom: 2px solid var(--ink); padding: 10px 0; margin-bottom: 6px;
}
.toc-list { list-style: none; max-height: 320px; overflow-y: auto; }
.toc-list a {
  display: flex; align-items: center; gap: 12px; padding: 9px 8px;
  text-decoration: none; color: var(--ink); font-size: .93rem; border-radius: 8px;
}
.toc-list a:hover { background: var(--bg); }
.toc-list .num, .pop-list .num {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: #e8f0fe; color: #1a73e8; font-weight: 800; font-size: .78rem;
  display: flex; align-items: center; justify-content: center;
}
.toc-list li.active a { background: #eef4ff; color: #1a73e8; font-weight: 700; }
.toc-list li.active .num { background: #1a73e8; color: #fff; }
body[data-theme="dark"] .toc-list li.active a { background: #1e2a44; }
body[data-theme="dark"] .toc-list .num { background: #24304d; }
.pop-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.02rem; padding-bottom: 10px;
  border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.pop-head .flame {
  width: 14px; height: 14px; flex: none; border-radius: 50% 50% 50% 4px;
  background: linear-gradient(135deg, #fbbf24, #ef4444); transform: rotate(-45deg);
}
.pop-head .pop-arrow { margin-left: auto; color: #1a73e8; font-weight: 400; }
.pop-list { list-style: none; }
.pop-list a {
  display: flex; align-items: center; gap: 12px; padding: 10px 4px;
  text-decoration: none; color: var(--ink); font-size: .92rem;
  border-bottom: 1px solid var(--line);
}
.pop-list li:last-child a { border-bottom: none; }
.pop-list .pop-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }

/* related */
.related { margin: 26px 0 40px; display: grid; gap: 12px; }
@media (min-width: 640px) { .related { grid-template-columns: 1fr 1fr; } }

/* search */
.search-page input[type="search"] {
  width: 100%; font-size: 1.05rem; padding: 14px 18px; margin: 18px 0 8px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
}
.search-page input[type="search"]:focus { outline: none; border-color: #1a73e8; }
.story-body { font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; line-height: 1.85; }
.story-body p { margin-bottom: 1.3em; }
.story-body h2 { font-family: inherit; font-size: 1.35rem; margin: 1.4em 0 .7em; }
.part-cta { text-align: center; margin: 34px 0 10px; }
.next-part {
  display: inline-block; background: var(--accent); color: #fff !important;
  font-weight: 800; font-size: 1.15rem; text-decoration: none;
  padding: 16px 42px; border-radius: 12px; box-shadow: 0 6px 20px rgba(185,28,28,.35);
}
.next-part:hover { background: var(--accent-dark); }
.the-end { text-align: center; color: var(--muted); font-style: italic; font-size: 1.1rem; }

/* related */
.related { margin: 26px 0 40px; display: grid; gap: 12px; }
@media (min-width: 640px) { .related { grid-template-columns: 1fr 1fr; } }
.related .rel { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
.related .rel span { font-size: .8rem; color: var(--muted); display: block; margin-bottom: 4px; }
.related .rel strong { font-size: 1rem; line-height: 1.35; }

/* static pages */
.page { max-width: 760px; margin: 0 auto; padding: 30px 0 50px; }
.page h1 { font-size: 1.7rem; margin-bottom: 16px; }
.page-body p { margin-bottom: 1em; }
.page-body h2 { font-size: 1.25rem; margin: 1.5em 0 .6em; }

/* contact form note */
.contact-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-top: 18px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 20px; padding: 26px 0 40px;
  color: var(--muted); font-size: .88rem; text-align: center; }
.foot-links { margin-top: 8px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }

/* ad slots */
.ads-slot { margin: 26px auto; max-width: 720px; }

/* ---------- reader themes (giống web truyện Eva) ---------- */
body[data-theme="dark"] {
  --bg: #141419; --ink: #e9e6df; --muted: #9a97a3;
  --card: #1e1e26; --line: #2e2e3a;
}
body[data-theme="sepia"] {
  --bg: #f3ead6; --ink: #43331f; --muted: #8d7c5c;
  --card: #faf3e2; --line: #ddd0b2;
}
body[data-fs="s"] .story-body { font-size: 1rem; }
body[data-fs="m"] .story-body { font-size: 1.12rem; }
body[data-fs="l"] .story-body { font-size: 1.28rem; }
body[data-fs="xl"] .story-body { font-size: 1.45rem; }

/* thanh điều khiển đọc */
.reader-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin: 14px 0 16px; font-size: .85rem;
}
.rb-label { color: var(--muted); margin-right: 2px; }
.rb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.reader-bar button {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: 5px 13px; font-size: .83rem; cursor: pointer;
}
.reader-bar button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }

/* nhãn chapter + hook mở đầu */
.chapter-kicker, .card-kicker {
  font-size: .8rem; font-weight: 800; letter-spacing: 2px;
  color: var(--accent); margin-bottom: 4px;
}
.card-kicker { margin-bottom: 6px; }
.lede {
  font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; font-style: italic;
  line-height: 1.7; color: var(--muted);
  border-left: 3px solid var(--accent); padding-left: 16px; margin: 4px 0 22px;
}

/* ---------- WordPress ---------- */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
img { max-width: 100%; height: auto; }
.pagination { text-align: center; margin: 6px 0 36px; }
.pagination .nav-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pagination a, .pagination span {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 8px 15px; text-decoration: none; font-weight: 600;
}
.pagination .current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.foot-links ul { list-style: none; display: flex; gap: 4px 14px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.search-form { display: flex; gap: 8px; margin: 14px 0; }
.search-form input[type="search"] {
  flex: 1; font-size: 1rem; padding: 12px 16px;
  border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
}
.search-form input[type="search"]:focus { outline: none; border-color: #1a73e8; }
.search-form button {
  background: var(--ink); color: var(--bg); border: none; border-radius: 10px;
  padding: 0 24px; font-weight: 700; cursor: pointer; font-size: .95rem;
}
.header-search { border-top: 1px solid var(--line); padding: 4px 0 10px; }
.header-search .search-form { margin: 8px 0 4px; }

/* ---------- card thumbnail ---------- */
.card a { padding: 0; }
.card-body { padding: 18px 20px 20px; }
.card-thumb { overflow: hidden; border-radius: 12px 12px 0 0; }
.card-thumb img { width: 100%; height: 190px; object-fit: cover; display: block; }


