/* Drama Story — warm drama-blog theme */
:root {
  --bg: #faf6f1;
  --surface: #ffffff;
  --ink: #2b2320;
  --ink-soft: #6f625c;
  --line: #eadfd5;
  --accent: #b3264c;
  --accent-dark: #7d1b38;
  --gold: #c99a3f;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(64, 35, 24, 0.08);
  --font-body: "Noto Sans Thai", "Leelawadee UI", "Segoe UI", sans-serif;
  --font-head: "Noto Serif Thai", "Leelawadee UI", Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f1e8de; border-radius: 6px; padding: 1px 6px; font-size: 0.9em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 241, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #eadfd5;
}
.header-inner { display: flex; align-items: center; gap: 22px; min-height: 66px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; font-family: var(--font-head); font-size: 22px; font-weight: 800;
}
.brand-text { font-family: var(--font-head); font-weight: 800; font-size: 20px; line-height: 1.15; display: flex; flex-direction: column; }
.brand-text small { font-family: var(--font-body); font-weight: 400; font-size: 11px; color: var(--ink-soft); }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { color: var(--ink); padding: 6px 12px; border-radius: 999px; font-weight: 500; }
.main-nav a:hover { background: #f1e6da; text-decoration: none; }
.search-form { margin-left: auto; display: flex; gap: 6px; }
.search-form input {
  border: 1px solid #e0d2c2; background: var(--surface); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 14px; width: 150px;
}
.search-form button {
  border: 0; background: var(--ink); color: #fff; border-radius: 999px;
  padding: 7px 16px; font: inherit; font-size: 14px; cursor: pointer;
}
.search-form button:hover { background: var(--accent-dark); }

/* ---------- hero ---------- */
.hero { padding: 28px 0 8px; }
.hero-card {
  display: grid; grid-template-columns: minmax(220px, 340px) 1fr;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid #f0e6da;
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-body { padding: 34px 38px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; justify-content: center; }
.hero-title { font-family: var(--font-head); font-size: clamp(24px, 3.4vw, 38px); line-height: 1.3; margin: 0; }
.hero-title a { color: var(--ink); }
.hero-title a:hover { color: var(--accent); }
.hero-lead { color: var(--ink-soft); margin: 0; font-size: 17px; }
.hero-empty { text-align: center; padding: 70px 0; }
.hero-empty h1 { font-family: var(--font-head); }

/* ---------- badges / chips / buttons ---------- */
.badge {
  display: inline-block; padding: 2px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em;
}
.badge-story { background: #f7e3ea; color: var(--accent-dark); }
.badge-novel { background: #eee7f7; color: #5b3a99; }
.badge-review { background: #e2f2e5; color: #22682f; }
.badge-vlog { background: #e0ecf9; color: #1f5a94; }
.badge-draft { background: #eee7f7; color: #5b3a99; }
.badge-published { background: #e2f2e5; color: #22682f; }
.card-meta { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 13px; flex-wrap: wrap; }
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 10px 26px; border-radius: 999px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(179, 38, 76, 0.3);
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.tag-chip {
  display: inline-block; background: var(--surface); border: 1px solid #e8dccd;
  color: var(--ink); padding: 5px 14px; border-radius: 999px; font-size: 13.5px;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.tag-chip span { color: var(--ink-soft); font-size: 12px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- sections & cards ---------- */
.section { margin: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-family: var(--font-head); font-size: 24px; margin: 0; }
.see-all { font-size: 14px; font-weight: 600; }
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px;
}
.card {
  background: var(--surface); border: 1px solid #f0e6da; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(64, 35, 24, 0.14); }
.card-cover { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #efe5d8; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-cover-empty { display: grid; place-items: center; color: #b9a48d; font-family: var(--font-head); font-size: 22px; }
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-family: var(--font-head); font-size: 17.5px; line-height: 1.45; margin: 0; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--ink-soft); font-size: 14px; margin: 0; line-height: 1.65; }

/* ---------- breadcrumb / page head ---------- */
.breadcrumb { padding: 18px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: #c3b2a2; }
.page-head { padding: 30px 0 6px; }
.page-head h1 { font-family: var(--font-head); font-size: clamp(24px, 3vw, 32px); margin: 0 0 6px; }
.page-desc { color: var(--ink-soft); margin: 0; }
.empty { color: var(--ink-soft); background: var(--surface); border: 1px dashed #e3d5c4; padding: 26px; border-radius: var(--radius); text-align: center; }

/* ---------- story page ---------- */
.story { max-width: 780px; margin: 0 auto; padding: 10px 0 30px; }
.story-head { padding: 14px 0 6px; display: flex; flex-direction: column; gap: 12px; }
.story-title { font-family: var(--font-head); font-size: clamp(26px, 4vw, 40px); line-height: 1.35; margin: 0; }
.lead { font-size: 18.5px; color: var(--ink-soft); margin: 0; }
.chapter-kicker { margin: 0; font-size: 15px; }
.chapter-kicker a { color: var(--ink-soft); }
.chapter-kicker a:hover { color: var(--accent); }
.story-cover { margin: 12px 0 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.story-cover img { width: 100%; display: block; }
.story-cover figcaption { text-align: center; font-size: 13px; color: var(--ink-soft); padding: 8px 0 0; }
.video-embed { position: relative; aspect-ratio: 16 / 9; margin-top: 16px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose { font-size: 17.5px; line-height: 2; padding-top: 18px; }
.prose p { margin: 0 0 1.2em; }
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; padding-top: 22px;
}
.gallery-item { margin: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery-item img { width: 100%; display: block; }
.gallery-item figcaption { font-size: 13.5px; color: var(--ink-soft); padding: 8px 12px; border-top: 1px solid #f2e9de; }

/* ---------- chapters ---------- */
.chapters { padding-top: 26px; }
.chapters h2 { font-family: var(--font-head); font-size: 22px; }
.chapter-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chapter-list a {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid #f0e6da; border-radius: 12px;
  padding: 14px 18px; color: var(--ink); box-shadow: var(--shadow);
}
.chapter-list a:hover { border-color: var(--accent); text-decoration: none; }
.chapter-no { font-weight: 700; color: var(--accent); font-size: 14px; white-space: nowrap; }
.chapter-title { font-weight: 600; }
.chapter-list time { color: var(--ink-soft); font-size: 12.5px; }
.chapter-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 26px; }
.pager-btn {
  display: inline-block; background: var(--surface); border: 1px solid #e8dccd;
  color: var(--ink); padding: 9px 20px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
}
.pager-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- pager ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 30px 0 10px; }
.pager-info { color: var(--ink-soft); font-size: 14px; }

/* ---------- tag cloud section ---------- */
.tag-cloud-section .tag-cloud { padding-bottom: 10px; }

/* ---------- admin ---------- */
.stat-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0 8px; }
.stat {
  background: var(--surface); border: 1px solid #f0e6da; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 22px; display: flex; flex-direction: column; min-width: 130px;
}
.stat strong { font-size: 26px; font-family: var(--font-head); }
.stat span { color: var(--ink-soft); font-size: 13px; }
.warn { background: #fdf3d7; border: 1px solid #ecd9a0; border-radius: 10px; padding: 10px 16px; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #f2e9de; }
th { background: #f8f1e8; font-size: 13px; }
.key-list { padding-left: 18px; }

/* ---------- footer ---------- */
.site-footer { background: #241d1b; color: #d8cdc4; margin-top: 60px; padding: 38px 0 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; padding-bottom: 26px; }
.footer-brand { font-family: var(--font-head); font-size: 20px; color: #fff; margin: 0 0 6px; }
.site-footer p { margin: 0 0 8px; font-size: 14px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.footer-nav a { color: #d8cdc4; font-size: 14px; }
.footer-nav a:hover { color: #fff; }
.copyright { text-align: center; border-top: 1px solid #3a302c; padding: 16px 0; margin: 0; font-size: 13px; color: #9c8d83; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .hero-card { grid-template-columns: 1fr; }
  .hero-cover img { max-height: 380px; }
  .hero-body { padding: 24px; }
  .header-inner { gap: 10px; }
  .search-form { margin-left: 0; width: 100%; }
  .search-form input { flex: 1; width: auto; }
}
