/*
Theme Name: Storyvia
Theme URI: https://example.com/storyvia
Description: Theme đọc truyện ngắn Storyvia — chuyển từ bộ HTML/CSS tĩnh (home + single).
Version: 1.0.16
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: storyvia
*/
:root {
  --ink: #092235;
  --accent: #c23f24;
  --muted: #707073;
  --paper: #fffdf8;
  --line: #e9e6df;
  --ad: #efede7;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Times New Roman', Times, serif;
  font-size: 16px;
  line-height: 1.15;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input { font: inherit; }
button, summary { cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 {
  font-family: 'Times New Roman', Times, serif;
  color: var(--ink);
  opacity: 1;
  text-shadow: none;
  filter: none;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.site-shell {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--paper);
}
.container { padding-inline: 16px; }
.site-header {
  justify-content: space-between;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 44px;
  position: relative;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1.1px;
  line-height: 1;
  white-space: nowrap;
}
.brand img { width: 30px; height: 25px; object-fit: contain; }
.brand svg { width: 30px; height: 28px; color: var(--accent); }
.primary-nav { flex: 1; display: flex; align-items: stretch; gap: 16px; height: 100%; font-size: 14px; }
.primary-nav::-webkit-scrollbar { display: none; }
.primary-nav a { flex-shrink: 0; display: flex; align-items: center; position: relative; }
.primary-nav .active::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: #e64727; }
.search-menu { position: relative; }
.search-menu summary { list-style: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; transition: background .2s; }
.search-menu summary::-webkit-details-marker { display: none; }
.search-menu summary:hover, .search-menu[open] summary { background: var(--ad); color: var(--accent); }
.search-menu summary svg { display: block; width: 19px; height: 19px; }
.search-menu .icon-close, .search-menu[open] .icon-search { display: none; }
.search-menu[open] .icon-close { display: block; }
.search-panel { position: absolute; z-index: 20; right: -6px; top: calc(100% + 12px); width: min(440px, calc(100vw - 32px)); padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(9, 34, 53, .12); }
.search-form { position: relative; display: flex; align-items: center; gap: 8px; }
.search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border: 1px solid #d9d6ce; border-radius: 22px; background: #fff; }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194, 63, 36, .15); }
.search-form__icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--muted); }
.search-form input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-form input::placeholder { color: #9a9a9c; }
.search-form input:focus { outline: none; }
.search-form button { flex-shrink: 0; height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: var(--accent); color: #fff; font-size: 15px; transition: background .2s; }
.search-form button:hover { background: #a6331b; }
.hero { height: 234px; position: relative; display: flex; align-items: center; overflow: hidden; }
.hero-art { position: absolute; top: 0; right: 0; width: 453px; height: 234px; max-width: none; object-fit: cover; }
.hero-copy { position: relative; z-index: 1; padding: 0 0 0 2px; }
.eyebrow, .story-category { font-family: Arial, sans-serif; font-weight: 700; text-transform: uppercase; color: #df2a0a; letter-spacing: 1.5px; }
.eyebrow { font-size: 11px; line-height: 13px; margin-bottom: 6px; }
.hero h1 { font-size: 52px; line-height: .95; letter-spacing: -1.7px; margin-bottom: 5px; }
.hero-subtitle { font-size: 23px; line-height: 1.1; margin-bottom: 16px; }
.genre-tabs { display: flex; gap: 8px; }
.genre-tabs a { display: inline-flex; justify-content: center; align-items: center; min-width: 66px; padding: 7px 16px; border: 1px solid #dad9d4; border-radius: 22px; background: #fffdf8e0; font-size: 13px; line-height: 16px; }
.genre-tabs .selected { border-color: var(--accent); background: var(--accent); color: white; }
h2 { font-size: 26px; line-height: 1.1; letter-spacing: -.7px; }
h3 { font-size: 21px; line-height: 1; letter-spacing: -.45px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 594px) minmax(180px, 1fr); gap: 16px; padding-top: 6px; }
.home-grid h2 { margin-bottom: 6px; }
.story-list { display: grid; gap: 14px; }
.story-card { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: 16px; align-items: center; }
.story-card .thumbnail img { width: 100%; object-fit: cover; border-radius: 5px; }
.story-card .card-copy { position: relative; }
.story-card .card-copy::after { content: ''; position: absolute; bottom: -10px; left: 0; right: 0; height: 1px; background: var(--line); }
.story-category { display: inline-block; font-size: 11px; line-height: 14px; }
.story-card h3 { font-size: 21px; line-height: .98; margin: 3px 0 6px; }
.story-card .excerpt { font-size: 16px; line-height: 1.03; margin-bottom: 8px; color: #3e4146; }
.meta { font-size: 13px; line-height: 1.1; color: var(--muted); }
.story-card .meta { font-size: 12.5px; white-space: nowrap; }
.ad { display: flex; align-items: center; justify-content: center; min-height: 56px; border: 1px solid #e2dfd8; border-radius: 3px; background: var(--ad); color: var(--muted); font-size: 14px; line-height: 1; }
.sidebar { padding-left: 16px; border-left: 1px solid var(--line); }
.sidebar h2 { font-size: 20px; letter-spacing: -.4px; margin: 7px 0 10px; }
.mini-list { display: grid; gap: 16px; }
.mini-card { display: grid; grid-template-columns: 65px minmax(0, 1fr); gap: 15px; align-items: start; }
.mini-card img { width: 65px; height: 63px; border-radius: 4px; object-fit: cover; }
.mini-card h3 { font-size: 15px; line-height: 1.04; letter-spacing: -.1px; margin-bottom: 5px; }
.mini-card .meta { font-size: 13px; line-height: 1.15; }
.sidebar .ad { height: 147px; margin: 16px 0 14px; }
.sidebar #genres h2 { font-size: 25px; line-height: 1.05; margin-bottom: 9px; }
.genre-list { list-style: none; padding: 0; margin: 0; }
.genre-list li { border-top: 1px solid var(--line); }
.genre-list li:last-child { border-bottom: 1px solid var(--line); }
.genre-list a { display: block; padding: 7px 14px; font-size: 15px; line-height: 16px; }
.editors { padding-top: 10px; }
.editors h2 { margin-bottom: 6px; font-size: 25px; }
.editor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.editor-card img { width: 100%; height: 80px; object-fit: cover; border-radius: 4px; margin-bottom: 5px; }
.editor-card h3 { font-size: 15px; line-height: 1; letter-spacing: -.1px; }
.editor-card p { font-size: 15px; line-height: 1; color: #555; margin-top: 3px; }
.moods { padding-top: 11px; padding-bottom: 7px; }
.moods h2 { font-size: 24px; margin-bottom: 4px; }
.mood-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mood-card img { width: 100%; height: 60px; border-radius: 4px; object-fit: cover; margin-bottom: 5px; }
.mood-card h3 { font-size: 14px; line-height: 1.1; letter-spacing: -.15px; }
.site-footer { min-height: 28px; display: flex; align-items: center; gap: 12px; padding-block: 3px; position: relative; }
.site-footer .brand { font-size: 20px; letter-spacing: -.6px; gap: 5px; }
.site-footer .brand img { width: 22px; height: 18px; }
.tagline { font-size: 11px; color: var(--muted); }
.footer-nav { flex: 1; display: flex; justify-content: flex-end; gap: 16px; font-size: 12px; }
.socials { display: flex; gap: 16px; align-items: center; margin-left: 16px; font-size: 15px; }
.socials svg { width: 14px; height: 14px; }
/* Detail reference has a slightly narrower outer frame. */
.page-single { padding-top: 0; }
.page-single .container { padding-inline: 16px; }
.page-single .site-header { gap: 16px; height: 44px; }
.page-single .primary-nav { gap: 16px; }
.page-single .brand { font-size: 30px; }
.post-layout { display: grid; grid-template-columns: minmax(0, 565px) minmax(180px, 1fr); gap: 16px; padding-top: 8px; }
.breadcrumb { display: flex; gap: 9px; color: var(--muted); font-size: 14px; line-height: 17px; margin-bottom: 13px; }
.breadcrumb .current { color: #df2a0a; }
.post-header h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.65px; margin-bottom: 1px; }
.post-deck { font-size: 21px; line-height: 1.1; margin-bottom: 2px; }
.post-header .meta { font-size: 14px; line-height: 16px; margin-bottom: 7px; }
.post-cover { width: 100%; height: 203px; object-fit: cover; border-radius: 5px; margin-bottom: 10px; }
.post-content { font-size: 16px; line-height: 18px; color: #373b40; }
.post-content p { margin-bottom: 4px; }
.post-content .ad { margin: 9px 0 10px; height: 56px; }
.post-sidebar { padding: 10px 0 0; border: 0; }
.post-sidebar .ad { height: 113px; margin: 0 0 14px; }
.post-sidebar h2 { font-size: 20px; margin: 0 0 10px; }
.post-sidebar .mini-card { grid-template-columns: 84px minmax(0, 1fr); gap: 15px; }
.post-sidebar .mini-card img { width: 84px; height: 65px; }
.post-sidebar .mini-card h3 { font-weight: 400; font-size: 15px; line-height: 1.08; }
.post-sidebar .mini-card .meta { font-size: 12px; }
.post-sidebar .mini-list { gap: 14px; }
.reading-column { width: 565px; max-width: 100%; }
.story-end { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 15px; color: #45484c; margin: 6px 0 9px; }
.story-end::before, .story-end::after { content: ''; height: 1px; background: #c7c5be; flex: 1; }
.author-share { display: grid; grid-template-columns: minmax(0, 1fr) 195px; gap: 16px; margin-bottom: 7px; }
.author-box { display: flex; align-items: center; gap: 16px; }
.author-box img { width: 68px; height: 64px; border-radius: 50%; object-fit: cover; }
.author-box h2 { font-size: 15px; line-height: 1.1; letter-spacing: 0; margin-bottom: 5px; }
.author-box p { font-size: 13px; line-height: 1.1; color: var(--muted); }
.share-box { border-left: 1px solid var(--line); padding-left: 16px; }
.share-box p { font-size: 13px; margin-bottom: 8px; }
.share-links { display: flex; gap: 14px; }
.share-links a { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #a8afb4; border-radius: 50%; font: 700 19px 'Times New Roman', serif; }
.share-links .facebook { background: #203649; color: white; border-color: #203649; }
.share-links .pinterest { background: #bd0011; color: white; border-color: #bd0011; }
.related { padding-bottom: 9px; }
.related h2 { font-size: 20px; margin-bottom: 5px; }
.related .editor-grid { gap: 16px; }
.related img { height: 53px; margin-bottom: 4px; }
.related h3 { font-size: 15px; font-weight: 400; line-height: 1.05; }
.related .meta { margin-top: 2px; font-size: 13px; color: var(--muted); }
.page-single .site-footer { min-height: 36px; }
.page-single .site-footer .brand { font-size: 22px; }
.page-single .site-footer .tagline { font-size: 12px; }
.page-single .site-footer .socials { margin-left: 7px; }
.skip-link { position: absolute; left: 12px; top: -80px; padding: 10px; background: var(--ink); color: white; z-index: 20; }
.skip-link:focus { top: 8px; }
/* ---------- Desktop width (thay cho tỷ lệ screenshot 1024px) ---------- */
.container, .page-single .container { padding-inline: 16px; }
.site-header, .page-single .site-header { height: 64px; gap: 16px; }
.brand, .page-single .brand { font-size: 32px; }
.primary-nav, .page-single .primary-nav { gap: 16px; font-size: 15px; white-space: nowrap; }
h3 { line-height: 1.2; }
.hero { height: 340px; }
.hero-art { width: 52%; height: 100%; }
.hero-copy { max-width: 56%; }
.hero h1 { font-size: 64px; line-height: 1; margin-bottom: 10px; }
.hero-subtitle { font-size: 24px; margin-bottom: 16px; }
.eyebrow { font-size: 12px; margin-bottom: 10px; }
.genre-tabs { flex-wrap: wrap; }
.genre-tabs a { font-size: 14px; padding: 8px 16px; }
.home-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding-top: 16px; }
.home-grid h2 { margin-bottom: 14px; }
h2 { font-size: 30px; }
.story-list { gap: 16px; }
.story-card { grid-template-columns: 44% minmax(0, 1fr); gap: 16px; }
.story-card { align-items: start; }
.story-card .thumbnail img { aspect-ratio: 3 / 2; height: auto; }
.story-card .card-copy::after { bottom: -14px; }
.story-category { font-size: 11px; line-height: 14px; }
.story-card h3 { font-size: 24px; line-height: 1.2; margin: 6px 0 8px; }
.story-card .excerpt { font-size: 16.5px; line-height: 1.4; margin-bottom: 10px; }
.story-card .meta { font-size: 13px; white-space: normal; }
.meta { line-height: 1.3; }
.ad { min-height: 90px; }
.sidebar { padding-left: 16px; }
.sidebar h2 { font-size: 22px; margin: 0 0 14px; }
.sidebar .ad { height: auto; min-height: 250px; margin: 16px 0; }
.mini-card { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; }
.mini-card img { width: 84px; height: 63px; }
.mini-card h3 { font-size: 16px; line-height: 1.25; }
.sidebar #genres h2 { font-size: 24px; margin-bottom: 10px; }
.genre-list a { padding: 10px 4px; font-size: 16px; line-height: 1.3; }
.editors { padding-top: 16px; }
.editors h2, .moods h2 { font-size: 28px; margin-bottom: 14px; }
.editor-grid { gap: 16px; }
.editor-card img { height: auto; aspect-ratio: 4 / 3; margin-bottom: 10px; }
.editor-card h3 { font-size: 19px; line-height: 1.25; }
.editor-card p { font-size: 15px; line-height: 1.35; margin-top: 6px; }
.moods { padding-top: 16px; padding-bottom: 16px; }
.mood-grid { gap: 16px; }
.mood-card img { height: auto; aspect-ratio: 16 / 9; margin-bottom: 8px; }
.mood-card h3 { font-size: 17px; }
.site-footer, .page-single .site-footer { min-height: 60px; gap: 16px; padding-block: 12px; }
.site-footer .brand, .page-single .site-footer .brand { font-size: 24px; }
.tagline, .page-single .site-footer .tagline { font-size: 13px; }
.footer-nav { font-size: 14px; }
.post-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding-top: 16px; }
.breadcrumb { font-size: 14px; margin-bottom: 16px; }
.post-header h1 { font-size: 42px; line-height: 1.15; margin-bottom: 8px; }
.post-deck { font-size: 22px; line-height: 1.35; margin-bottom: 10px; }
.post-header .meta { font-size: 14px; margin-bottom: 16px; }
.post-cover { height: auto; aspect-ratio: 16 / 9; margin-bottom: 16px; }
.post-content { font-size: 18px; line-height: 1.7; }
.post-content p { margin-bottom: 16px; }
.post-content .ad { height: auto; min-height: 90px; margin: 10px 0 16px; }
.reading-column { width: calc(100% - 340px); }
.post-sidebar { padding-top: 0; }
.post-sidebar .ad { height: auto; min-height: 250px; margin-bottom: 16px; }
.post-sidebar .mini-card { grid-template-columns: 96px minmax(0, 1fr); }
.post-sidebar .mini-card img { width: 96px; height: 72px; }
.post-sidebar .mini-card h3 { font-size: 16px; line-height: 1.3; }
.post-sidebar .mini-list { gap: 16px; }
.story-end { font-size: 16px; margin: 16px 0 16px; }
.author-share { grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; margin-bottom: 16px; }
.author-box img { width: 80px; height: 80px; }
.author-box h2 { font-size: 18px; }
.author-box p { font-size: 14.5px; line-height: 1.45; }
.share-links a { width: 38px; height: 38px; }
.related { padding-bottom: 16px; }
.related h2 { font-size: 26px; margin-bottom: 14px; }
.related .editor-grid { gap: 16px; }
.related img { height: auto; aspect-ratio: 3 / 2; margin-bottom: 10px; }
.related h3 { font-size: 18px; line-height: 1.3; }
@media (min-width: 921px) and (max-width: 1140px) {
  .home-grid, .post-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; }
  .reading-column { width: calc(100% - 292px); }
  .hero h1 { font-size: 54px; }
  .site-header { gap: 16px; }
  .primary-nav { gap: 16px; }
}

/* Reflow is separate from the desktop reference proportions. */
@media (min-width: 641px) and (max-width: 920px) {
  .site-header, .page-single .site-header { gap: 16px; }
  .primary-nav, .page-single .primary-nav { flex: 1; min-width: 0; gap: 16px; overflow-x: auto; scrollbar-width: none; }
  .hero { height: auto; min-height: 290px; padding-block: 16px; }
  .hero h1 { font-size: 46px; }
  .hero-copy { max-width: 62%; }
  .home-grid, .post-layout { gap: 16px; }
  .sidebar { padding-left: 16px; }
  .story-card h3 { font-size: 21px; }
  .author-share { grid-template-columns: minmax(0, 1fr) 210px; }
  .container { padding-inline: 16px; }
  .site-header { gap: 16px; }
  .home-grid { grid-template-columns: minmax(0, 1fr) 205px; }
  .story-card { grid-template-columns: 48.5% minmax(0, 1fr); gap: 16px; }
  .story-card .meta { white-space: normal; }
  .footer-nav { gap: 16px; }
  .socials { margin-left: 12px; gap: 13px; }
  .post-layout { grid-template-columns: minmax(0, 1fr) 196px; }
  .reading-column { width: calc(100% - 224px); }
}
@media (min-width: 641px) and (max-width: 800px) {
  .site-footer .tagline { display: none; }
}
@media (max-width: 640px) {
  .primary-nav, .page-single .primary-nav { justify-content: flex-start; gap: 16px; overflow-x: auto; scrollbar-width: none; }
  .hero-copy { max-width: none; }
  .home-grid, .post-layout { gap: 0; }
  .sidebar .ad, .post-sidebar .ad { min-height: 120px; }
  .post-header h1 { margin-bottom: 4px; }
  .container, .page-single .container { padding-inline: 16px; }
  .site-header, .page-single .site-header { height: auto; min-height: 52px; padding-top: 12px; flex-wrap: wrap; gap: 12px; }
  .brand, .page-single .brand { font-size: 29px; }
  .primary-nav { order: 3; flex: 0 0 100%; width: 100%; height: 42px; justify-content: flex-start; font-size: 15px; gap: 16px; }
  .hero { height: auto; min-height: 265px; padding-block: 16px; }
  .hero-art { opacity: .3; height: 100%; width: auto; right: -90px; }
  .hero h1 { font-size: 44px; letter-spacing: -1.5px; }
  .hero-subtitle { font-size: 20px; max-width: 300px; }
  .hero-copy { width: 100%; }
  .genre-tabs { gap: 6px; flex-wrap: wrap; }
  .genre-tabs a { min-width: 0; padding-inline: 12px; }
  .home-grid, .post-layout { display: block; padding-top: 12px; }
  .home-grid h2 { margin-bottom: 10px; }
  .story-list { gap: 16px; }
  .story-card { grid-template-columns: 40% minmax(0, 1fr); gap: 14px; align-items: start; }
  .story-card h3 { font-size: 20px; line-height: 1.05; }
  .story-card .excerpt { font-size: 15px; line-height: 1.15; }
  .story-card .meta { white-space: normal; font-size: 12px; line-height: 1.25; }
  .sidebar { border-left: 0; border-top: 1px solid var(--line); padding: 15px 0; margin-top: 16px; }
  .sidebar h2 { font-size: 22px; }
  .mini-card { grid-template-columns: 75px minmax(0, 1fr); }
  .mini-card img, .post-sidebar .mini-card img { width: 80px; height: 60px; }
  .mini-card h3 { font-size: 17px; }
  .genre-list { display: grid; grid-template-columns: 1fr 1fr; }
  .genre-list a { padding-left: 0; }
  .editors { padding-top: 6px; }
  .editor-grid { gap: 14px; }
  .editor-card h3 { font-size: 16px; line-height: 1.1; }
  .editor-card p { font-size: 14px; line-height: 1.15; }
  .moods { padding-top: 16px; padding-bottom: 12px; }
  .mood-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
  .mood-card h3 { font-size: 15px; }
  .site-footer { flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 12px; }
  .tagline { display: none; }
  .footer-nav { order: 3; width: 100%; justify-content: space-between; margin-left: 0; gap: 12px; font-size: 13px; }
  .socials { margin-left: 0; }
  .breadcrumb { font-size: 14px; }
  .post-header h1 { font-size: 30px; line-height: 1.08; }
  .post-deck { font-size: 21px; margin-block: 6px; }
  .post-cover { height: auto; aspect-ratio: 16 / 9; margin-top: 10px; }
  .post-content { font-size: 18px; line-height: 1.45; }
  .post-content p { margin-bottom: 12px; }
  .post-sidebar { display: none; }
  .reading-column { width: 100%; }
  .author-share { grid-template-columns: 1fr; gap: 16px; margin-block: 14px; }
  .author-box { gap: 15px; }
  .author-box p { font-size: 14px; line-height: 1.2; }
  .share-box { border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; }
  .share-links a { width: 36px; height: 36px; }
  .related { padding-bottom: 15px; }
  .related h2 { font-size: 23px; }
  .related .meta { font-size: 12px; }
}
@media (max-width: 420px) {
  .hero h1 { font-size: 42px; }
  .story-card { grid-template-columns: 36% minmax(0, 1fr); gap: 12px; }
  .story-card h3 { font-size: 19px; }
  .editor-grid, .related .editor-grid { grid-template-columns: 1fr; }
  .editor-card { display: grid; grid-template-columns: 38% minmax(0, 1fr); column-gap: 12px; }
  .editor-card > a:first-child { grid-row: 1 / 3; }
  .editor-card img, .related img { margin: 0; }
  .post-header h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- WordPress additions ---------- */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.ad > * { max-width: 100%; }
.ad-slot { display: block; }
.post-content img { border-radius: 4px; margin: 10px 0; }
.post-content h2, .post-content h3 { margin: 14px 0 6px; }
.post-content blockquote { margin: 10px 0; padding-left: 16px; border-left: 3px solid var(--accent); font-style: italic; }
.post-content a { color: var(--accent); text-decoration: underline; }
.alignleft { float: left; margin: 0 16px 8px 0; }
.alignright { float: right; margin: 0 0 8px 16px; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, .wp-element-caption { font-size: 13px; color: var(--muted); }
.page-links { margin: 12px 0; font-size: 14px; }
.archive-header { padding: 14px 0 10px; }
.archive-header p { margin-top: 4px; color: var(--muted); }
.pagination { padding: 16px 0 16px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid #dad9d4; border-radius: 18px; font-size: 14px; }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }
.no-results { padding: 16px 0; color: var(--muted); }
.page-content-wrap { padding: 8px 0 16px; }

/* ---------- Images: hero blend, hover, frame ---------- */
.hero-art {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 30%, #000 88%, transparent 100%);
}
.story-card .thumbnail, .editor-card > a:first-child, .mini-card > a:first-child, .mood-card { display: block; }
.story-card .thumbnail, .editor-card > a:first-child, .mini-card > a:first-child { overflow: hidden; border-radius: 5px; }
.mood-card { overflow: hidden; }
.story-card .thumbnail img, .editor-card img, .mini-card img, .mood-card img, .post-cover {
  outline: 1px solid rgba(9, 34, 53, .08);
  outline-offset: -1px;
  background: var(--ad);
}
.story-card .thumbnail img, .editor-card img, .mini-card img, .mood-card img { transition: transform .35s ease; }
.story-card:hover .thumbnail img, .editor-card:hover img, .mini-card:hover img, .mood-card:hover img { transform: scale(1.03); }
.story-card:hover h3 a, .editor-card:hover h3 a, .mini-card:hover h3 a, .mood-card:hover h3 { color: var(--accent); }
.editor-card .meta { margin-top: 6px; font-size: 13px; }
.editor-card .meta .story-category { font-size: 11px; margin-right: 6px; }
@media (prefers-reduced-motion: reduce) {
  .story-card .thumbnail img, .editor-card img, .mini-card img, .mood-card img { transition: none; }
}

/* ---------- Search results ---------- */
.search-hero { padding-top: 16px; padding-bottom: 16px; position: relative; }
.search-hero h1 { font-size: 38px; line-height: 1.15; letter-spacing: -.8px; }
.search-count { margin: 6px 0 16px; color: var(--muted); font-size: 15px; }
.search-hero .search-form { max-width: 560px; }
.no-results h2 { font-size: 22px; color: var(--ink); }
.no-results p { margin-top: 6px; }
.share-only { display: flex; justify-content: center; }
.share-only .share-box { display: flex; align-items: center; gap: 16px; border: 0; padding: 0; }
.share-only .share-box p { margin: 0; }
@media (max-width: 640px) {
  .search-hero { padding-top: 16px; padding-bottom: 16px; }
  .search-hero h1 { font-size: 28px; }
  .search-form button { padding: 0 16px; }
  .share-only .share-box { border-top: 0; padding-top: 0; }
}
.mini-list + #genres { margin-top: 16px; }

/* Vùng widget quảng cáo đã có nội dung (khác ô .ad giữ chỗ). */
.ad-area { display: grid; gap: 16px; margin-block: 16px; min-width: 0; }
.post-sidebar .ad-area { margin-top: 0; }
.ad-area .ad-slot { min-width: 0; }
.ad-area .search-form { width: 100%; }
.ad-area .search-form button { padding: 0 16px; }
.ad-area img { height: auto; border-radius: 4px; }

/* Đường kẻ header/footer chạy hết chiều ngang màn hình (nội dung vẫn giới hạn 1200px). */
.site-header::after, .search-hero::after, .site-footer::before {
  content: '';
  position: absolute;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  height: 1px;
  background: var(--line);
  pointer-events: none;
}
.site-header::after, .search-hero::after { bottom: 0; }
.site-footer::before { top: 0; }

/* ---------- Archive (chuyên mục, thẻ...) ---------- */
.archive-description { max-width: 640px; margin-top: 8px; color: #3e4146; font-size: 16px; line-height: 1.5; }
.archive-description p + p { margin-top: 8px; }
.archive-hero .search-count { margin-bottom: 0; }
.archive-hero .genre-tabs { margin-top: 16px; }
.genre-list a.is-current { color: var(--accent); font-weight: 700; }
.no-results .search-form { max-width: 480px; margin-top: 16px; }
.home-grid > section > .pagination { padding-bottom: 16px; }

/* ---------- Mobile polish ---------- */
@media (max-width: 640px) {
  /* Tab genre & menu: 1 hàng, vuốt ngang thay vì xuống 3 dòng. */
  .genre-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .genre-tabs::-webkit-scrollbar { display: none; }
  .genre-tabs a { flex-shrink: 0; white-space: nowrap; }
  .primary-nav, .page-single .primary-nav {
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .primary-nav a:last-child { padding-right: 16px; }

  /* Card: tiêu đề gọn, mô tả tối đa 2 dòng. */
  .story-card { grid-template-columns: 36% minmax(0, 1fr); gap: 12px; }
  .story-card h3 { font-size: 18px; line-height: 1.25; margin: 4px 0 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .story-card .excerpt { font-size: 14.5px; line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .story-card .card-copy::after { bottom: -10px; }
  .story-list { gap: 20px; }

  /* Editor's picks: nhãn chuyên mục 1 dòng riêng, ngày bên dưới. */
  .editor-card .meta .story-category { display: block; margin: 0 0 4px; }

  /* Vùng bấm tối thiểu ~32px. */
  .breadcrumb a { padding-block: 6px; }
  .breadcrumb { align-items: center; margin-bottom: 8px; }
  .footer-nav a { display: inline-flex; align-items: center; min-height: 32px; }
  .socials a { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; }
  .socials { gap: 4px; }
}

/* Logo upload trong Customizer (Site Identity). */
.brand .custom-logo { width: auto; height: auto; max-width: 200px; max-height: 40px; object-fit: contain; }
.site-footer .brand .custom-logo { width: auto; height: auto; max-width: 140px; max-height: 28px; }
@media (max-width: 640px) {
  .brand .custom-logo { max-width: 160px; max-height: 34px; }
}
/* Menu desktop căn giữa header: logo và nút search chia đều 2 bên. */
@media (min-width: 921px) {
  .site-header .brand, .site-header .search-menu { flex: 1 1 0; min-width: 0; }
  .site-header .primary-nav { flex: 0 1 auto; justify-content: center; }
  .site-header .search-menu summary { margin-left: auto; }
}
/* Footer 2 hàng: logo + menu + icon / mô tả + bản quyền. */
.site-footer, .page-single .site-footer { display: block; min-height: 0; padding-block: 20px 16px; }
.footer-top { display: flex; align-items: center; gap: 24px; }
.footer-top .footer-nav { flex: 1; justify-content: flex-end; }
.footer-nav a { white-space: nowrap; }
.footer-top .socials { margin-left: 0; gap: 14px; }
.socials svg { width: 16px; height: 16px; }
.socials a { color: var(--muted); transition: color .2s; }
.socials a:hover { color: var(--accent); }
.footer-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.footer-bottom .tagline { display: block; max-width: 760px; font-size: 13px; line-height: 1.5; }
.footer-bottom .copyright { flex-shrink: 0; }
@media (max-width: 640px) {
  .footer-top { flex-wrap: wrap; justify-content: space-between; gap: 12px; }
  .footer-top .footer-nav { order: 3; flex: 0 0 100%; justify-content: space-between; gap: 12px; }
  .footer-bottom { flex-direction: column; gap: 6px; margin-top: 8px; }
  .footer-bottom .tagline { font-size: 12.5px; }
}
/* Hero: tách tiêu đề khỏi mô tả. */
.hero h1 { line-height: 1.05; margin-bottom: 18px; }
.hero-subtitle { margin-bottom: 20px; }
@media (max-width: 640px) {
  .hero h1 { margin-bottom: 12px; }
  .hero-subtitle { margin-bottom: 16px; }
}
/* Font hệ thống + màu tương phản cao cho dễ đọc. */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ink: #0b1f33;
  --text: #1f2933;
  --text-soft: #333b45;
  --muted: #5a6370;
  --accent: #b5351c;
  --paper: #fffefa;
}
body, h1, h2, h3, button, input, .eyebrow, .story-category { font-family: var(--font); }
body { color: var(--text); }
.post-content, .search-form input { color: var(--text); }
.story-card .excerpt, .editor-card p, .archive-description, .footer-bottom { color: var(--text-soft); }
.eyebrow, .story-category, .breadcrumb .current, .post-content a { color: var(--accent); }
.search-form input::placeholder { color: #7b838d; }
.search-form button:hover { background: #962b16; }
/* Tiêu đề dịu hơn: bớt đậm, bớt tối, nới giãn chữ cho font sans. */
:root { --ink: #26333f; }
h1, h2, h3 { font-weight: 600; }
.hero h1 { letter-spacing: -.02em; }
.post-header h1, .search-hero h1 { letter-spacing: -.015em; }
h2, .sidebar h2 { letter-spacing: -.01em; }
h3, .mini-card h3, .editor-card h3, .mood-card h3 { letter-spacing: 0; }
/* Footer mobile: menu 6 mục được xuống dòng trên màn hẹp. */
@media (max-width: 640px) {
  .footer-top .footer-nav { flex-wrap: wrap; justify-content: flex-start; gap: 4px 18px; }
}
