/*
Theme Name:  ReadMangaThai
Theme URI:   https://readmangathai.com
Author:      ReadMangaThai
Author URI:  https://readmangathai.com
Description: Minimal manga review theme with Light/Dark mode, category strip, featured grid and sidebar.
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: readmangathai
Tags: blog, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&family=Noto+Serif+Thai:wght@400;600;700&display=swap');

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg { max-width: 100%; display: block; }
a { text-decoration: none; }

/* ─── Tokens (Light) ─── */
:root {
  --amber:     #f59e0b;
  --amber-dim: rgba(245,158,11,.12);
  --bg:        #fafaf8;
  --bg2:       #ffffff;
  --bg3:       #f3f0e8;
  --border:    #e8e4dc;
  --text:      #1a1714;
  --dim:       #6b6456;
  --muted:     #9e9386;
  --radius:    9px;
  --shadow:    0 2px 8px rgba(0,0,0,.06);
}

/* ─── Tokens (Dark) ─── */
body.dark-mode {
  --bg:     #0f0e0d;
  --bg2:    #1a1814;
  --bg3:    #242018;
  --border: #2a2620;
  --text:   #f0ede6;
  --dim:    #a09880;
  --muted:  #665e50;
}

/* ─── Base ─── */
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans Thai', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  transition: background .25s, color .25s;
}

/* ─── NAV ─── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  transition: background .25s, border-color .25s;
}
.nav-inner {
  max-width: 1440px; margin: 0 auto;
  height: 58px; padding: 0 44px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.site-branding a {
  font-family: 'Noto Serif Thai', serif;
  font-size: 18px; font-weight: 700; letter-spacing: -.4px;
  color: var(--text); display: flex; align-items: center; gap: 0;
}
.site-branding .brand-accent { color: var(--amber); }

.main-navigation ul {
  list-style: none; display: flex; align-items: center; gap: 4px;
}
.main-navigation a {
  padding: 6px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--dim);
  transition: background .15s, color .15s;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a {
  background: var(--amber); color: #fff; font-weight: 600;
}

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--border); background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--dim);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg3); color: var(--text); }

/* ─── SEARCH OVERLAY ─── */
.search-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center; padding-top: 120px;
}
.search-overlay.open { display: flex; }
.search-box {
  background: var(--bg2); border-radius: 12px; padding: 24px;
  width: 100%; max-width: 600px; margin: 0 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.search-box form { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.search-box input[type="search"] {
  flex: 1; height: 48px; padding: 0 16px; border: none;
  background: var(--bg3); font-size: 16px; font-family: inherit; color: var(--text); outline: none;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button[type="submit"] {
  width: 52px; height: 48px; background: var(--amber); border: none;
  cursor: pointer; font-size: 18px; color: #fff;
}

/* ─── CATEGORY STRIP ─── */
.category-strip {
  background: var(--bg3); border-bottom: 1px solid var(--border);
  transition: background .25s, border-color .25s;
  overflow-x: auto; scrollbar-width: none;
}
.category-strip::-webkit-scrollbar { display: none; }
.category-strip-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 0 44px; height: 42px;
  display: flex; align-items: center; gap: 4px;
}
.category-strip a {
  padding: 4px 14px; border-radius: 20px; white-space: nowrap; flex-shrink: 0;
  font-size: 12px; font-weight: 500; color: var(--dim);
  transition: background .15s, color .15s;
}
.category-strip a:hover { background: var(--border); color: var(--text); }
.category-strip a.current { background: var(--amber); color: #fff; font-weight: 600; }

/* ─── PAGE LAYOUT ─── */
.site-main {
  max-width: 1440px; margin: 0 auto;
  padding: 36px 44px 64px;
  display: flex; gap: 32px;
}
.content-area { flex: 1; min-width: 0; }
.widget-area   { width: 268px; flex-shrink: 0; }

/* ─── SECTION HEADER ─── */
.section-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 22px;
}
.section-bar  { width: 4px; height: 20px; background: var(--amber); border-radius: 2px; flex-shrink: 0; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text); }
.section-line  { flex: 1; height: 1px; background: var(--border); }
.section-more  { font-size: 12px; color: var(--amber); font-weight: 600; }
.section-more:hover { text-decoration: underline; }

/* ─── POST GRID (3-col) ─── */
.posts-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 18px; margin-bottom: 40px;
}
@media (max-width: 1024px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .posts-grid { grid-template-columns: 1fr; } }

.post-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s; cursor: pointer;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.09); }

.post-card-thumb {
  height: 180px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--bg3), var(--border));
  display: block;
}
.post-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s;
}
.post-card:hover .post-card-thumb img { transform: scale(1.04); }

.post-card-body {
  padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; gap: 7px;
}
.post-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.post-category-tag {
  display: inline-block;
  background: var(--amber-dim); color: var(--amber);
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: .4px;
}
.post-date { font-size: 11px; color: var(--muted); }
.post-card-title {
  font-family: 'Noto Serif Thai', serif;
  font-size: 16px; font-weight: 700;
  color: var(--text); line-height: 1.45;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--amber); }
.post-card-excerpt { font-size: 13px; color: var(--dim); line-height: 1.7; flex: 1; }
.post-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border);
}
.post-read-time { font-size: 11px; color: var(--muted); }
.post-read-more { font-size: 12px; color: var(--amber); font-weight: 600; }
.post-read-more:hover { text-decoration: underline; }

/* ─── POST LIST (small cards) ─── */
.posts-list .post-list-item {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: opacity .15s;
}
.posts-list .post-list-item:hover { opacity: .82; }
.posts-list .post-list-item:last-child { border-bottom: none; }

.post-list-thumb {
  width: 96px; height: 62px; border-radius: 6px; overflow: hidden; flex-shrink: 0;
  background: var(--bg3);
}
.post-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-list-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.post-list-title {
  font-family: 'Noto Serif Thai', serif;
  font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.45;
}
.post-list-title a { color: inherit; }
.post-list-title a:hover { color: var(--amber); }
.post-list-meta { font-size: 11px; color: var(--muted); }

/* ─── PAGINATION ─── */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 40px;
}
.pagination a, .pagination span {
  min-width: 36px; height: 36px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; color: var(--dim);
  border: 1px solid var(--border); transition: background .15s, color .15s;
}
.pagination a:hover { background: var(--bg3); color: var(--text); }
.pagination .current { background: var(--amber); color: #fff; border-color: var(--amber); }

/* ─── SINGLE POST ─── */
.single-post { max-width: 760px; margin: 0 auto; padding: 48px 0 80px; }
.single-header { margin-bottom: 32px; }
.single-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.single-title {
  font-family: 'Noto Serif Thai', serif;
  font-size: 36px; font-weight: 700; color: var(--text);
  line-height: 1.3; margin-bottom: 20px;
}
.single-lede {
  font-size: 18px; color: var(--dim); line-height: 1.8;
  border-left: 3px solid var(--amber); padding-left: 20px;
  font-style: italic; margin-bottom: 32px;
}
.single-thumbnail {
  border-radius: 12px; overflow: hidden; margin-bottom: 36px; height: 380px;
}
.single-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.entry-content { font-size: 16px; color: var(--dim); line-height: 1.9; }
.entry-content p       { margin-bottom: 20px; }
.entry-content h2      { font-family: 'Noto Serif Thai', serif; font-size: 24px; font-weight: 700; color: var(--text); margin: 36px 0 14px; }
.entry-content h3      { font-family: 'Noto Serif Thai', serif; font-size: 20px; font-weight: 700; color: var(--text); margin: 28px 0 10px; }
.entry-content strong  { color: var(--text); font-weight: 600; }
.entry-content a       { color: var(--amber); text-decoration: underline; }
.entry-content blockquote {
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 4px solid var(--amber); border-radius: 0 8px 8px 0;
  padding: 20px 24px; margin: 28px 0;
  font-family: 'Noto Serif Thai', serif; font-size: 18px; color: var(--text);
  line-height: 1.7; font-weight: 600; font-style: normal;
}
.entry-content ul, .entry-content ol { padding-left: 24px; margin-bottom: 20px; }
.entry-content li { margin-bottom: 8px; }
.entry-content img { width: 100%; border-radius: 8px; margin: 24px 0; }

.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.post-tag {
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; color: var(--dim); transition: background .15s;
}
.post-tag:hover { background: var(--amber-dim); color: var(--amber); border-color: var(--amber); }

/* related posts */
.related-posts { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
@media (max-width: 768px) { .related-grid { grid-template-columns: 1fr; } }

/* ─── SIDEBAR WIDGETS ─── */
.widget {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 18px; overflow: hidden;
  transition: background .25s, border-color .25s;
}
.widget-header {
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.widget-bar  { width: 3px; height: 14px; background: var(--amber); border-radius: 2px; }
.widget-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text); }
.widget-body { padding: 10px 16px; }

/* search widget */
.widget-search { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.widget-search input[type="search"] {
  flex: 1; height: 36px; padding: 0 12px; border: none;
  background: var(--bg3); font-size: 13px; font-family: inherit; color: var(--text); outline: none;
}
.widget-search input::placeholder { color: var(--muted); }
.widget-search button { width: 38px; height: 36px; background: var(--amber); border: none; cursor: pointer; font-size: 15px; }

/* category widget */
.widget-cat-list { list-style: none; }
.widget-cat-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--dim);
}
.widget-cat-list li:last-child { border-bottom: none; }
.widget-cat-list a { color: inherit; transition: color .15s; }
.widget-cat-list a:hover { color: var(--amber); }
.widget-cat-count { font-size: 11px; color: var(--muted); }

/* popular posts */
.widget-popular-list { list-style: none; }
.widget-popular-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.widget-popular-list li:last-child { border-bottom: none; }
.popular-num { font-size: 18px; font-weight: 800; font-family: serif; width: 22px; flex-shrink: 0; color: var(--border); line-height: 1.2; }
.popular-num.first { color: var(--amber); }
.popular-title { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.45; margin-bottom: 2px; }
.popular-title a { color: inherit; }
.popular-title a:hover { color: var(--amber); }
.popular-cat { font-size: 11px; color: var(--muted); }

/* tag cloud */
.widget-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.widget-tag-cloud a {
  padding: 4px 11px; border-radius: 4px; border: 1px solid var(--border);
  font-size: 11px; color: var(--dim); background: var(--bg3);
  transition: background .15s, color .15s, border-color .15s;
}
.widget-tag-cloud a:hover { background: var(--amber-dim); color: var(--amber); border-color: var(--amber); }

/* ─── FOOTER ─── */
.site-footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 32px 44px; margin-top: 0;
  transition: background .25s, border-color .25s;
}
.footer-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-logo {
  font-family: 'Noto Serif Thai', serif; font-size: 16px; font-weight: 700;
}
.footer-logo .brand-accent { color: var(--amber); }
.footer-copy { font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--dim); }
.footer-links a:hover { color: var(--amber); }

/* ─── ARCHIVE ─── */
.archive-header { margin-bottom: 32px; }
.archive-title {
  font-family: 'Noto Serif Thai', serif; font-size: 28px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 12px; margin-bottom: 6px;
}
.archive-title .archive-accent { color: var(--amber); }
.archive-desc { font-size: 14px; color: var(--dim); }

/* ─── 404 ─── */
.not-found-page { text-align: center; padding: 80px 20px; }
.not-found-page h1 { font-family: 'Noto Serif Thai', serif; font-size: 96px; font-weight: 700; color: var(--border); line-height: 1; margin-bottom: 16px; }
.not-found-page h2 { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.not-found-page p  { font-size: 15px; color: var(--dim); margin-bottom: 28px; }
.btn-primary {
  display: inline-flex; align-items: center; height: 44px; padding: 0 24px;
  background: var(--amber); color: #fff; border-radius: 8px;
  font-size: 14px; font-weight: 600; transition: opacity .15s;
}
.btn-primary:hover { opacity: .88; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .site-main { flex-direction: column; padding: 24px 24px 48px; }
  .widget-area { width: 100%; }
  .nav-inner { padding: 0 24px; }
  .category-strip-inner { padding: 0 24px; }
  .single-post { padding: 32px 0 60px; }
}
@media (max-width: 768px) {
  .single-title { font-size: 26px; }
  .single-lede  { font-size: 16px; }
  .posts-grid   { grid-template-columns: 1fr; }
  .main-navigation { display: none; }
}
