/*
Theme Name: My Blog
Theme URI: http://localhost:8080
Author: builtai
Description: TrendHub 매거진 스타일 WordPress 테마 — 3-컬럼 앱 셸, 히어로 캐러셀, 라이트/다크 모드. wp-content가 bind-mount라 저장 즉시 반영됩니다.
Version: 0.2.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: myblog
*/

/* ============================================================
   Tokens
   ============================================================ */
:root {
  --bg:        #ffffff;
  --panel:     #ffffff;
  --panel-2:   #f7f8fa;
  --text:      #15171c;
  --text-2:    #5b6470;
  --text-3:    #98a1ad;
  --border:    #ebedf1;
  --border-2:  #e3e6ea;
  --accent:    #2f6bff;
  --accent-press: #1d4ed8;
  --accent-soft: #eef3ff;
  --up:        #16a34a;
  --down:      #ef4444;
  --ink-card:  linear-gradient(160deg, #1b2336 0%, #0d1320 100%);
  --radius:    16px;
  --radius-sm: 11px;
  --shadow:    0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --sans: "Pretendard Variable", Pretendard, system-ui, "Segoe UI", "Malgun Gothic", sans-serif;
  /* Sidebar nav palette (overridden inline per light/dark by the theme admin) */
  --nav-fg:        #5b6470;
  --nav-active-fg: #2f6bff;
  --nav-active-bg: #eef3ff;
  --nav-hover-bg:  #f7f8fa;
}

[data-theme="dark"] {
  --bg:        #0d0f13;
  --panel:     #15181e;
  --panel-2:   #1b1f27;
  --text:      #e9ebef;
  --text-2:    #99a2ae;
  --text-3:    #6a7380;
  --border:    #242a33;
  --border-2:  #2c333d;
  --accent:    #4f86ff;
  --accent-press: #3b6fe0;
  --accent-soft: #16233e;
  --nav-fg:        #99a2ae;
  --nav-active-fg: #4f86ff;
  --nav-active-bg: #16233e;
  --nav-hover-bg:  #1b1f27;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --ink-card:  linear-gradient(160deg, #1d2740 0%, #10151f 100%);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}
/* Kill ALL transitions during a theme switch (no dizzying color fade) */
html.th-anim-off * { transition: none !important; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
.icon { display: block; flex: none; }
.dot { margin: 0 7px; color: var(--text-3); }

/* ============================================================
   App shell
   ============================================================ */
/* ---- Top header (sticky) ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1480px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 11px 28px; min-height: 64px;
}
.site-logo { display: flex; align-items: center; gap: 9px; flex: none; }
.site-logo .brand-mark { width: 34px; height: 34px; }
.site-logo .brand-text strong { font-size: 1.18rem; font-weight: 800; letter-spacing: -.02em; }
.site-logo .brand-logo { max-height: 32px; width: auto; }

.top-nav { display: flex; min-width: 0; }
.top-nav .nav-menu { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.top-nav .nav-menu > li { position: relative; }
.top-nav .nav-menu a { display: block; padding: 9px 13px; border-radius: 9px; font-size: .95rem; font-weight: 700; color: var(--text-2); white-space: nowrap; transition: background .15s, color .15s; }
.top-nav .nav-menu a:hover { background: var(--panel-2); color: var(--text); }
.top-nav .nav-menu .current-menu-item > a,
.top-nav .nav-menu .current_page_item > a,
.top-nav .nav-menu .current-cat > a { color: var(--accent); }
.top-nav .sub-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 184px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; list-style: none; margin: 0; display: none; z-index: 90;
}
.top-nav .menu-item-has-children:hover > .sub-menu { display: block; }
.top-nav .sub-menu a { font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ---- Mobile drawer (off-canvas, holds the same menu) ---- */
.drawer {
  position: fixed; top: 0; left: 0; width: 290px; height: 100vh; z-index: 210;
  background: var(--panel); border-right: 1px solid var(--border);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
body.ov-drawer .drawer { transform: none; box-shadow: 30px 0 70px rgba(0,0,0,.22); }
body.th-resizing .drawer { transition: none !important; }
.drawer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.drawer-menu a { display: block; padding: 11px 12px; border-radius: 10px; font-size: .98rem; font-weight: 600; color: var(--text-2); }
.drawer-menu a:hover { background: var(--panel-2); color: var(--text); }
.drawer-menu .current-menu-item > a, .drawer-menu .current-cat > a { color: var(--accent); background: var(--accent-soft); }
.drawer-menu .sub-menu { list-style: none; margin: 2px 0 2px 12px; padding-left: 10px; border-left: 1.5px solid var(--border); }
.drawer .side-social { margin-top: auto; }
.drawer-btn {
  width: 40px; height: 40px; align-items: center; justify-content: center;
  border: 1px solid var(--border-2); border-radius: 11px;
  background: var(--panel); color: var(--text-2); cursor: pointer;
}
.drawer-btn:hover { background: var(--panel-2); color: var(--text); }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
}
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #7aa2ff);
  box-shadow: 0 6px 16px rgba(47,107,255,.35);
}
.brand.brand-has-logo { padding: 4px 8px 18px; }
.brand-logo { max-width: 100%; height: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.18rem; font-weight: 800; letter-spacing: -.02em; }
.brand-text small { font-size: .72rem; color: var(--text-3); margin-top: 2px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--nav-fg);
  font-size: .94rem;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.nav-link .nav-ico { color: var(--nav-fg); display: grid; place-items: center; transition: color .15s ease; }
.nav-link .nav-ico svg { width: 20px; height: 20px; }
.nav-link:hover { background: var(--nav-hover-bg); color: var(--text); }
.nav-link.is-active { background: var(--nav-active-bg); color: var(--nav-active-fg); }
.nav-link.is-active .nav-ico { color: var(--nav-active-fg); }

/* Submenu (drag-nested children) */
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 2px 18px; padding-left: 10px; border-left: 1.5px solid var(--border); }
.nav-link-sub { padding: 8px 10px; font-size: .88rem; font-weight: 500; }
.nav-link-sub .nav-ico svg { width: 17px; height: 17px; }

.side-social {
  display: flex; gap: 6px;
  padding: 16px 8px 12px;
  margin-top: auto;
}
.side-social a {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--text-3);
  transition: background .15s, color .15s;
}
.side-social a:hover { background: var(--panel-2); color: var(--text); }
.side-copy {
  padding: 0 8px;
  font-size: .72rem;
  color: var(--text-3);
  line-height: 1.5;
  margin: 0;
}

/* ============================================================
   Main column + topbar
   ============================================================ */
.main-area { min-width: 0; max-width: 1480px; margin: 0 auto; padding: 26px 28px 56px; }

/* drawer + search button hidden on desktop */
.drawer-btn, .drawer-overlay { display: none; }
.icon-btn.search-btn { display: none; }   /* tablet/mobile only — beats .icon-btn */

.topbar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 26px;
}
.header-search {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.search-ico {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--text-3);
}
.header-search input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-size: .92rem;
  transition: border-color .15s, box-shadow .15s;
}
.header-search input::placeholder { color: var(--text-3); }
.header-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.theme-toggle.is-dark { display: none; }
[data-theme="dark"] .theme-toggle:not(.is-dark) { display: none; }
[data-theme="dark"] .theme-toggle.is-dark { display: grid; }
.badge-dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px;
  background: var(--down);
  border: 2px solid var(--panel);
  border-radius: 50%;
}
.user-menu { position: relative; }
.user-trigger {
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--border-2); border-radius: 50%;
  background: var(--panel); cursor: pointer;
  transition: box-shadow .15s;
}
.user-trigger:hover { box-shadow: 0 0 0 3px var(--accent-soft); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7aa2ff) center/cover no-repeat;
}
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 168px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 80;
}
.user-dropdown[hidden] { display: none; }
.user-dropdown a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 9px;
  font-size: .88rem; font-weight: 600; color: var(--text-2);
  transition: background .15s, color .15s;
}
.user-dropdown a:hover { background: var(--panel-2); color: var(--text); }
.user-dropdown a .icon { color: var(--text-3); }

/* ============================================================
   Grid: feed + rail
   ============================================================ */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}
.feed { min-width: 0; display: flex; flex-direction: column; gap: 36px; }

/* ---- Pills ---- */
.pill {
  display: inline-block;
  font-size: .72rem; font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
}
.pill-accent { background: var(--accent); color: #fff; }
.pill-glass {
  background: rgba(15,20,35,.62);
  color: #fff;
  backdrop-filter: blur(6px);
}
.pill-soft { background: var(--accent-soft); color: var(--accent); }

/* ============================================================
   Hero carousel
   ============================================================ */
.hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-track { position: relative; height: 380px; }
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  display: flex; align-items: flex-end;
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}
.hero-slide.is-active { opacity: 1; pointer-events: auto; }
.hero-body { padding: 40px 44px 46px; max-width: 600px; color: #fff; }
.hero-title {
  font-size: 2.1rem; line-height: 1.22;
  font-weight: 800; letter-spacing: -.02em;
  margin: 16px 0 12px;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.hero-desc { font-size: 1rem; color: rgba(255,255,255,.86); margin: 0 0 18px; }
.hero-meta { font-size: .85rem; color: rgba(255,255,255,.82); margin: 0; }
.hero-meta strong { font-weight: 700; }

.hero-dots {
  position: absolute; left: 44px; bottom: 22px;
  display: flex; gap: 7px;
}
.hero-dot {
  width: 24px; height: 5px; border-radius: 3px;
  border: none; background: rgba(255,255,255,.4);
  transition: background .2s, width .2s;
}
.hero-dot.is-active { background: #fff; width: 30px; }

.hero-nav {
  position: absolute; right: 26px; bottom: 22px;
  display: flex; gap: 9px;
}
.round-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(20,25,40,.5);
  color: #fff;
  backdrop-filter: blur(8px);
  transition: background .15s, transform .15s;
}
.round-btn:hover { background: rgba(20,25,40,.78); transform: scale(1.06); }

/* ============================================================
   Section blocks
   ============================================================ */
.block-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.block-title { font-size: 1.22rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.see-all {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .84rem; font-weight: 600; color: var(--text-2);
  transition: color .15s;
}
.see-all:hover { color: var(--accent); }

/* ---- Category cards ---- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.cat-card {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  transition: transform .18s ease;
}
.cat-card:hover { transform: translateY(-4px); }
.cat-thumb {
  width: 100%; aspect-ratio: 1; border-radius: 16px;
  background: var(--panel-2) center/cover no-repeat;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}
.cat-ko { font-size: .92rem; font-weight: 700; }
.cat-en { font-size: .72rem; color: var(--text-3); margin-top: 2px; }

/* ---- Featured cards ---- */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.feat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feat-thumb {
  position: relative;
  aspect-ratio: 16/10;
  background: var(--panel-2) center/cover no-repeat;
}
.feat-thumb .pill { position: absolute; left: 12px; bottom: 12px; }
.feat-title { font-size: 1.02rem; font-weight: 700; line-height: 1.4; margin: 16px 16px 8px; }
.feat-title a:hover { color: var(--accent); }
.feat-desc {
  font-size: .85rem; color: var(--text-2); margin: 0 16px 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.feat-meta { font-size: .78rem; color: var(--text-3); margin: 0 16px 16px; }

/* ---- Latest list ---- */
.seg {
  display: inline-flex; gap: 2px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.seg-btn {
  border: none; background: transparent;
  font-size: .8rem; font-weight: 600; color: var(--text-2);
  padding: 6px 12px; border-radius: 7px;
  transition: background .15s, color .15s;
}
.seg-btn.is-active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }

.post-list {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--panel-2); }
.row-thumb {
  width: 72px; height: 72px; flex: none;
  border-radius: 12px;
  background: var(--panel-2) center/cover no-repeat;
}
.row-body { min-width: 0; flex: 1; }
.row-body .pill { margin-bottom: 6px; }
.row-title { font-size: 1rem; font-weight: 700; margin: 0 0 4px; line-height: 1.35; }
.row-title a:hover { color: var(--accent); }
.row-desc {
  font-size: .85rem; color: var(--text-2); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.row-stats {
  display: flex; flex-direction: column; gap: 8px;
  font-size: .82rem; color: var(--text-3);
  flex: none;
}
.row-stats span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

/* ---- Videos ---- */
.vid-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.vid-card { display: flex; flex-direction: column; gap: 10px; }
.vid-thumb {
  position: relative;
  aspect-ratio: 16/10; border-radius: 13px;
  background: var(--panel-2) center/cover no-repeat;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.vid-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.45));
}
.vid-play {
  position: relative; z-index: 1;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.92); color: #15171c;
  transition: transform .18s;
}
.vid-card:hover .vid-play { transform: scale(1.12); }
.vid-dur {
  position: absolute; z-index: 1; right: 8px; bottom: 8px;
  font-size: .72rem; font-weight: 700; color: #fff;
  background: rgba(0,0,0,.6); padding: 2px 7px; border-radius: 6px;
}
.vid-title {
  font-size: .9rem; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vid-card:hover .vid-title { color: var(--accent); }

/* ============================================================
   Right rail
   ============================================================ */
.rail {
  position: sticky; top: 18px;
  display: flex; flex-direction: column; gap: 20px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-title { font-size: 1.04rem; font-weight: 800; margin: 0 0 14px; letter-spacing: -.01em; }
.card-sub { font-size: .84rem; color: var(--text-2); margin: -6px 0 14px; }
.card-fine { font-size: .74rem; color: var(--text-3); margin: 10px 0 0; }
.card-more {
  display: block; text-align: center;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: .84rem; font-weight: 600; color: var(--text-2);
  transition: color .15s;
}
.card-more:hover { color: var(--accent); }

/* trends */
.trend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.trend-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 6px; border-radius: 9px;
  transition: background .15s;
}
.trend-item:hover { background: var(--panel-2); }
.trend-rank {
  width: 22px; flex: none; text-align: center;
  font-weight: 800; font-size: .95rem; color: var(--accent);
}
.trend-text {
  flex: 1; font-size: .88rem; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.trend-arrow { flex: none; display: inline-flex; align-items: center; }
.trend-up { color: #16a34a; }
.trend-down { color: #ef4444; transform: rotate(180deg); }
.trend-flat { color: var(--text-3); font-weight: 700; }

/* premium + quote (dark cards) */
.card-premium, .card-quote {
  background: var(--ink-card);
  border: none;
  color: #fff;
}
.premium-crown {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 11px; color: #ffd766;
  background: rgba(255,215,102,.14);
  margin-bottom: 14px;
}
.premium-title { font-size: 1.16rem; font-weight: 800; margin: 0 0 8px; }
.premium-desc { font-size: .86rem; color: rgba(255,255,255,.72); margin: 0 0 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .88rem; font-weight: 700;
  padding: 11px 18px; border-radius: 11px;
  border: none; transition: transform .12s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-light { background: #fff; color: #15171c; width: 100%; }
.btn-light:hover { opacity: .9; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-press); }
.btn-ghost {
  background: var(--accent-soft); color: var(--accent);
  padding: 7px 14px; font-size: .8rem; border-radius: 9px; flex: none;
}
.btn-ghost:hover { background: var(--accent); color: #fff; }

/* newsletter */
.news-form { display: flex; flex-direction: column; gap: 9px; }
.news-form input {
  height: 42px; padding: 0 14px;
  border: 1px solid var(--border-2); border-radius: 11px;
  background: var(--panel-2); color: var(--text); font-size: .88rem;
}
.news-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.news-form .btn { width: 100%; }

/* tags */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: .8rem; font-weight: 600; color: var(--text-2);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* creators */
.creator-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.creator { display: flex; align-items: center; gap: 11px; }
.creator-av {
  width: 42px; height: 42px; flex: none; border-radius: 50%;
  background: var(--panel-2) center/cover no-repeat;
}
.creator-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.creator-meta strong { font-size: .9rem; font-weight: 700; }
.creator-meta small { font-size: .76rem; color: var(--text-3); }

/* quote */
.quote-mark { color: var(--accent); opacity: .85; margin-bottom: 6px; }
.quote-text { font-size: 1.02rem; font-weight: 600; line-height: 1.55; margin: 0 0 12px; color: rgba(255,255,255,.94); }
.quote-by { font-size: .82rem; color: rgba(255,255,255,.6); margin: 0; }

/* ============================================================
   Page load reveal
   ============================================================ */
.feed > .block, .feed > .hero, .rail > .card {
  animation: rise .5s ease both;
}
.feed > *:nth-child(2) { animation-delay: .05s; }
.feed > *:nth-child(3) { animation-delay: .1s; }
.feed > *:nth-child(4) { animation-delay: .15s; }
.feed > *:nth-child(5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ---- Latest: grid layout ---- */
.grid-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.grid-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.grid-thumb { position: relative; display: block; aspect-ratio: 16/10; background: var(--panel-2) center/cover no-repeat; }
.grid-thumb .pill { position: absolute; left: 12px; bottom: 12px; }
.grid-title { font-size: 1rem; font-weight: 700; line-height: 1.4; margin: 14px 16px 6px; }
.grid-title a:hover { color: var(--accent); }
.grid-meta { font-size: .78rem; color: var(--text-3); margin: 0 16px 16px; }

/* ---- Latest: banner ---- */
.latest-banner {
  position: relative; display: flex; align-items: flex-end;
  min-height: 280px; border-radius: 18px; overflow: hidden;
  background-size: cover; background-position: center;
  margin-bottom: 18px; box-shadow: var(--shadow);
}
.latest-banner-body { padding: 30px 32px; color: #fff; }
.latest-banner-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; margin: 12px 0 10px; text-shadow: 0 2px 20px rgba(0,0,0,.35); }
.latest-banner-meta { font-size: .85rem; color: rgba(255,255,255,.85); margin: 0; }

/* video provider badge */
.vid-prov { position: absolute; z-index: 1; right: 8px; bottom: 8px; font-size: .66rem; font-weight: 800; letter-spacing: .03em; color: #fff; background: rgba(0,0,0,.62); padding: 3px 7px; border-radius: 6px; }

/* trend item as link */
a.trend-text { text-decoration: none; }
a.trend-text:hover { color: var(--accent); }

/* ============================================================
   Search popup (slides down from top; off-screen until opened)
   ============================================================ */
.search-pop {
  position: fixed; inset: 0; z-index: 220;
  display: flex; align-items: flex-start; justify-content: center;
  /* anchored toward the top so the on-screen keyboard doesn't cover it */
  padding: 13vh 16px 16px;
  background: rgba(10,12,20,.45);
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
body.ov-search .search-pop { opacity: 1; visibility: visible; }
.search-pop-form {
  width: 100%; max-width: 560px;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  padding: 8px 10px 8px 16px;
  transform: translateY(-14px); transition: transform .2s ease;
}
body.ov-search .search-pop-form { transform: none; }
.search-pop-form .search-ico { position: static; display: flex; align-items: center; color: var(--text-3); flex: none; }
.search-pop-form input {
  flex: 1; min-width: 0; height: 46px; border: none; background: transparent;
  font-size: 1.05rem; color: var(--text); outline: none;
}
.search-pop-close {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border: none; background: var(--panel-2); border-radius: 10px; color: var(--text-2); cursor: pointer;
}

/* ============================================================
   Single article
   ============================================================ */
/* Single / page: flush white content area (no card border) */
body.single, body.page { background: var(--panel); }
.article { background: transparent; border: none; box-shadow: none; padding: 0; max-width: 890px; }
.article-head { margin-bottom: 26px; }
.article-title { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; margin: 14px 0 14px; }
.article-meta { font-size: .88rem; color: var(--text-3); display: flex; align-items: center; }
.article-meta strong { color: var(--text-2); font-weight: 700; }
.article-cover { width: 100%; aspect-ratio: 16/8; border-radius: 16px; background: var(--panel-2) center/cover no-repeat; margin-bottom: 30px; }

.entry-content { font-size: 1.02rem; line-height: 1.8; color: var(--text); }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; margin-top: 1.8em; }
.entry-content h3 { font-size: 1.25rem; font-weight: 700; margin-top: 1.5em; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.entry-content img { max-width: 100%; height: auto; border-radius: 12px; background: var(--panel-2); }
/* reserve space for images that ship without width/height (prevents CLS) */
.entry-content img:not([width]) { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.entry-content blockquote { border-left: 3px solid var(--accent); padding: 2px 0 2px 18px; margin-left: 0; color: var(--text-2); font-style: italic; }
.entry-content code { background: var(--panel-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.entry-content pre { background: var(--panel-2); padding: 16px; border-radius: 12px; overflow: auto; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: .4em; }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.post-nav { display: flex; gap: 14px; margin-top: 22px; }
.post-nav a { flex: 1; min-width: 0; padding: 15px 18px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); transition: border-color .15s; }
.post-nav a:hover { border-color: var(--accent); }
.post-nav .pn-label { display: block; font-size: .74rem; color: var(--text-3); margin-bottom: 4px; }
.post-nav .pn-title { font-size: .9rem; font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.post-nav .pn-next { text-align: right; }
.empty-msg { color: var(--text-3); padding: 40px 0; }

/* ---- Secondary category nav ---- */
.sub-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 0 16px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.sub-nav-cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.sub-nav-cats::-webkit-scrollbar { display: none; }
.sub-nav-link {
  padding: 8px 14px; border-radius: 9px; white-space: nowrap;
  font-size: .92rem; font-weight: 700; color: var(--text-2);
  transition: background .15s, color .15s;
}
.sub-nav-link:hover { background: var(--panel-2); color: var(--text); }
.sub-nav-link.is-active { color: var(--accent); }
.sub-nav-cta {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 9px 16px; border-radius: 10px;
  background: var(--text); color: var(--panel);
  font-size: .88rem; font-weight: 700;
}
.sub-nav-cta:hover { opacity: .88; }

/* ---- Article layout ---- */
.article-layout {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 320px;
  grid-template-areas: "react main rail" "react comments rail";
  gap: 24px;
  align-items: start;
}
.react-bar { grid-area: react; }
.article { grid-area: main; }
.article-comments { grid-area: comments; min-width: 0; max-width: 890px; }
.article-rail { grid-area: rail; }

/* floating reactions */
.react-bar { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 10px; }
.react {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 56px; padding: 10px 0;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel); color: var(--text-2);
  font-size: .76rem; font-weight: 700; cursor: pointer;
  transition: border-color .15s, color .15s, transform .12s;
}
.react:hover { border-color: var(--accent); color: var(--text); }
.react:active { transform: scale(.94); }
.react.is-on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* article head */
.article-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.article-pills { display: flex; gap: 7px; }
.article-actions { display: flex; gap: 4px; }
.act-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: none; background: var(--panel-2); border-radius: 10px; color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s;
}
.act-btn:hover { background: var(--accent-soft); color: var(--accent); }
.act-btn.is-on { background: var(--accent); color: #fff; }
.article-lead { font-size: 1.08rem; color: var(--text-2); line-height: 1.6; margin: 4px 0 22px; }

.article-byline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .86rem; color: var(--text-3); }
.byline-av { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2) center/cover no-repeat; }
.byline-name { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--text); }
.verified { color: var(--accent); display: inline-flex; }
.verified .icon { width: 15px; height: 15px; }
.byline-sep { flex: 1; }
.byline-stat { display: inline-flex; align-items: center; gap: 4px; }
.byline-date { color: var(--text-3); }

.article-cover { aspect-ratio: 16 / 9; margin: 26px 0 30px; }

/* table of contents */
.article-toc {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 26px; margin-bottom: 32px;
}
.toc-title { font-size: 1.02rem; font-weight: 800; margin: 0 0 14px; }
.toc-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px;
}
.toc-list a { display: flex; gap: 6px; font-size: .92rem; color: var(--text-2); font-weight: 500; }
.toc-list a:hover { color: var(--accent); }
.toc-num { color: var(--accent); font-weight: 700; }

/* enriched content */
.entry-content blockquote {
  position: relative;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 18px 22px; margin: 1.6em 0;
  font-style: normal; color: var(--text);
  font-weight: 600;
}
.entry-content ul { list-style: none; padding-left: 0; }
.entry-content ul li { position: relative; padding-left: 28px; }
.entry-content ul li::before {
  content: ""; position: absolute; left: 0; top: .28em;
  width: 18px; height: 18px; border-radius: 6px;
  background: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232f6bff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}

/* feedback box */
.article-feedback {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 36px; padding: 20px 22px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2);
}
.fb-q { font-size: .9rem; font-weight: 700; display: block; margin-bottom: 10px; }
.fb-btns { display: flex; gap: 10px; }
.fb-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text-2); font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.fb-btn b { color: var(--text); }
.fb-btn:hover { border-color: var(--accent); color: var(--accent); }
.fb-btn.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.share-row { display: flex; gap: 8px; }
.share-ico {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.share-ico:hover { border-color: var(--accent); color: var(--accent); }

/* article rail */
.article-rail { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 20px; }
.author-box { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.author-av { width: 48px; height: 48px; border-radius: 50%; background: var(--panel-2) center/cover no-repeat; flex: none; }
.author-meta { display: flex; flex-direction: column; gap: 2px; }
.author-meta strong { font-size: .98rem; font-weight: 800; }
.author-more { font-size: .8rem; color: var(--accent); display: inline-flex; align-items: center; gap: 2px; }
.author-bio { font-size: .85rem; color: var(--text-2); line-height: 1.6; margin: 0 0 14px; }
.author-social { display: flex; gap: 8px; }
.author-social a {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: var(--panel-2); color: var(--text-2);
  transition: background .15s, color .15s;
}
.author-social a:hover { background: var(--accent-soft); color: var(--accent); }

.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.mini-item { display: flex; gap: 11px; }
.mini-thumb { width: 56px; height: 56px; flex: none; border-radius: 10px; background: var(--panel-2) center/cover no-repeat; }
.mini-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mini-title { font-size: .86rem; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-body:hover .mini-title { color: var(--accent); }
.mini-date { font-size: .74rem; color: var(--text-3); }

.card-news { background: linear-gradient(160deg, #6d5efc 0%, #8f7bff 100%); border: none; color: #fff; }
.card-news .card-title { color: #fff; }
.card-news .card-sub { color: rgba(255,255,255,.82); }
.card-news .card-fine { color: rgba(255,255,255,.7); }
.card-news .news-form input { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.25); color: #fff; }
.card-news .news-form input::placeholder { color: rgba(255,255,255,.7); }
.card-news .btn-accent { background: #fff; color: #5b4bdd; }
.card-news .btn-accent:hover { background: #f1efff; }

.pop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pop-item { display: flex; align-items: center; gap: 11px; padding: 8px 4px; border-radius: 9px; transition: background .15s; }
.pop-item:hover { background: var(--panel-2); }
.pop-rank { width: 18px; flex: none; text-align: center; font-weight: 800; color: var(--accent); }
.pop-title { flex: 1; min-width: 0; font-size: .87rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pop-item:hover .pop-title { color: var(--accent); }
.pop-like { flex: none; font-size: .76rem; color: var(--text-3); display: inline-flex; align-items: center; gap: 3px; }

/* copy / action toast */
.th-toast-pop {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg);
  padding: 11px 20px; border-radius: 12px; font-size: .88rem; font-weight: 600;
  box-shadow: var(--shadow); z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.th-toast-pop.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   Comments (custom design)
   ============================================================ */
.comments { margin-top: 46px; padding-top: 30px; border-top: 1px solid var(--border); }
.comments-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.comments-title { font-size: 1.3rem; font-weight: 800; margin: 0; }
.comments-count { color: var(--accent); }

/* sort dropdown */
.cmt-sort { position: relative; }
.cmt-sort-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 600; color: var(--text-2); }
.cmt-sort-btn:hover { color: var(--text); }
.cmt-sort-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow); padding: 5px; z-index: 30; min-width: 120px; }
.cmt-sort-menu[hidden] { display: none; }
.cmt-sort-menu button { display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer; font: inherit; font-size: .86rem; font-weight: 600; color: var(--text-2); padding: 8px 11px; border-radius: 8px; }
.cmt-sort-menu button:hover { background: var(--panel-2); color: var(--text); }
.cmt-sort-menu button.is-on { color: var(--accent); }

/* form */
.cmt-form { display: flex; gap: 14px; }
.cmt-form-av { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--panel-2) center/cover no-repeat; display: grid; place-items: center; color: var(--text-3); }
.cmt-form-box { flex: 1; min-width: 0; border: 1px solid var(--border-2); border-radius: 14px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.cmt-form-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cf-editor { min-height: 64px; padding: 14px 16px; font-size: .95rem; line-height: 1.6; color: var(--text); outline: none; }
.cf-editor.is-empty::before { content: attr(data-ph); color: var(--text-3); pointer-events: none; }
.cf-editor img { max-width: 220px; border-radius: 8px; margin: 4px 0; }
.cf-editor ul, .cf-editor ol { padding-left: 1.4em; margin: .4em 0; }
.cf-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--border); }
.cf-tools { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cf-tools::-webkit-scrollbar { display: none; }
.cf-tool { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: none; background: none; border-radius: 8px; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.cf-tool:hover { background: var(--panel-2); color: var(--text); }
.cf-sep { flex: none; width: 1px; height: 18px; background: var(--border); margin: 0 5px; }
.cf-submit-area { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.cf-count { font-size: .8rem; color: var(--text-3); white-space: nowrap; }
.cf-count b { color: var(--text-2); font-weight: 700; }
.cf-submit { padding: 9px 18px; }
.cf-emoji-pop { position: absolute; bottom: calc(100% + 6px); left: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; z-index: 40; }
.cf-emoji-pop button { width: 32px; height: 32px; border: none; background: none; cursor: pointer; font-size: 1.1rem; border-radius: 7px; }
.cf-emoji-pop button:hover { background: var(--panel-2); }

.cf-guest { display: flex; gap: 10px; margin: 12px 0 0 58px; }
.cf-guest input { flex: 1; min-width: 0; height: 40px; padding: 0 13px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; font-size: .88rem; }
.cf-guest input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cf-save { display: flex; align-items: center; gap: 8px; margin: 12px 0 0 58px; font-size: .85rem; color: var(--text-2); cursor: pointer; }
.cf-save input { accent-color: var(--accent); }
.cf-info { display: inline-flex; color: var(--text-3); }
.comments-closed { color: var(--text-3); font-size: .9rem; margin-left: 58px; }

/* list */
.cmt-list { list-style: none; margin: 30px 0 0; padding: 0; }
.cmt { padding: 22px 0; border-top: 1px solid var(--border); }
.cmt:first-child { border-top: none; }
.cmt-removing { opacity: 0; transition: opacity .2s; }
.cmt-row { display: flex; gap: 12px; }
.cmt-av { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--panel-2) center/cover no-repeat; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.cmt-name { font-size: .92rem; font-weight: 700; }
.cmt-badge { font-size: .68rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.cmt-dot { color: var(--text-3); }
.cmt-time { font-size: .82rem; color: var(--text-3); }
.cmt-pending-tag { font-size: .68rem; font-weight: 700; color: #b45309; background: #fef3c7; padding: 2px 8px; border-radius: 999px; }
.cmt-menu-wrap { position: relative; margin-left: auto; }
.cmt-more { width: 28px; height: 28px; display: grid; place-items: center; border: none; background: none; border-radius: 7px; color: var(--text-3); cursor: pointer; }
.cmt-more:hover { background: var(--panel-2); color: var(--text); }
.cmt-menu { position: absolute; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow); padding: 5px; min-width: 112px; z-index: 25; }
.cmt-menu[hidden] { display: none; }
.cmt-mi { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; font: inherit; font-size: .84rem; font-weight: 600; color: var(--text-2); padding: 8px 11px; border-radius: 8px; white-space: nowrap; }
.cmt-mi:hover { background: var(--panel-2); color: var(--text); }
.cmt-mi.cmt-del:hover { background: #fef2f2; color: #ef4444; }
.cmt-mi .icon { color: var(--text-3); }
.cmt-mi.cmt-del:hover .icon { color: #ef4444; }
.cmt-text { font-size: .94rem; line-height: 1.65; color: var(--text); }
.cmt-text img { max-width: 320px; border-radius: 10px; margin: 6px 0; }
.cmt-text ul, .cmt-text ol { padding-left: 1.4em; }
.cmt-actions { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.cmt-act { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 600; color: var(--text-3); padding: 5px 9px; border-radius: 8px; transition: background .15s, color .15s; }
.cmt-act:hover { background: var(--panel-2); color: var(--text-2); }
.cmt-like.is-on, .cmt-dislike.is-on { color: var(--accent); }
.cmt-like.is-on .icon { color: var(--accent); }

/* nested replies — light gray card */
.cmt-children { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cmt-children .cmt { border-top: none; background: var(--panel-2); border-radius: 14px; padding: 16px; }
.cmt-children .cmt-children { margin-top: 12px; }

/* reply / edit mini forms */
.cmt-reply-form, .cmt-edit-box { margin: 14px 0 0 52px; }
.cmt-children .cmt-reply-form, .cmt-children .cmt-edit-box { margin-left: 52px; }
.cf-mini { border: 1px solid var(--border-2); border-radius: 12px; min-height: 48px; padding: 11px 14px; font-size: .92rem; line-height: 1.6; outline: none; background: var(--panel); }
.cf-mini:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cf-mini.is-empty::before { content: attr(data-ph); color: var(--text-3); }
.cf-mini-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.cf-mini-actions .btn { padding: 7px 14px; font-size: .84rem; }

/* load more */
.cmt-more-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 18px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); font: inherit; font-size: .9rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background .15s, border-color .15s; }
.cmt-more-btn:hover { background: var(--panel-2); border-color: var(--accent); color: var(--text); }
.cmt-more-btn[hidden] { display: none; }

@media (max-width: 640px) {
  .cf-guest, .cf-save, .comments-closed { margin-left: 0; }
  .cmt-reply-form, .cmt-edit-box { margin-left: 0; }
  .cmt-text img { max-width: 100%; }
}

/* ============================================================
   Page template + 404
   ============================================================ */
.page-wrap { max-width: 820px; margin: 0 auto; }
.page-share { display: flex; align-items: center; gap: 14px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border); }
.page-share .fb-q { margin: 0; }

.error404 { max-width: 560px; margin: 40px auto; text-align: center; }
.e404-card { padding: 16px 0 30px; }
.e404-code { display: block; font-size: 4.5rem; font-weight: 800; letter-spacing: -.04em; color: var(--accent); line-height: 1; }
.e404-title { font-size: 1.6rem; font-weight: 800; margin: 10px 0 8px; }
.e404-desc { color: var(--text-2); margin: 0 0 24px; }
.e404-search { position: relative; max-width: 420px; margin: 0 auto 16px; }
.e404-search .search-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); }
.e404-search input { width: 100%; height: 46px; padding: 0 16px 0 44px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--panel); color: var(--text); font-size: .95rem; }
.e404-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.e404-home { display: inline-flex; }
.e404-popular { max-width: 420px; margin: 8px auto 0; text-align: left; border-top: 1px solid var(--border); padding-top: 24px; }
.e404-popular .block-title { font-size: 1rem; margin-bottom: 16px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; background: var(--panel); }
.footer-inner { max-width: 1480px; margin: 0 auto; padding: 30px 28px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-logo { display: flex; align-items: center; gap: 9px; flex: none; }
.footer-logo .brand-mark { width: 32px; height: 32px; }
.footer-logo .brand-text strong { font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; }
.footer-logo .brand-logo { max-height: 30px; width: auto; }
.footer-nav .footer-menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-nav a { display: block; padding: 6px 12px; border-radius: 8px; font-size: .9rem; font-weight: 600; color: var(--text-2); }
.footer-nav a:hover { background: var(--panel-2); color: var(--text); }
.footer-copy { margin-left: auto; font-size: .82rem; color: var(--text-3); }
@media (max-width: 640px) { .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; } .footer-copy { margin-left: 0; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1180px) {
  .main-grid { grid-template-columns: 1fr; }
  .rail { position: static; flex-direction: row; flex-wrap: wrap; }
  .rail .card { flex: 1 1 280px; }
  .article-layout { display: flex; flex-direction: column; }
  article.article { order: 1; }
  .react-bar {
    order: 2; position: static; display: flex; flex-direction: row;
    justify-content: center; gap: 10px; margin: 10px 0 4px;
  }
  .react { flex-direction: row; width: auto; padding: 9px 16px; }
  .article-comments { order: 3; max-width: none; }
  .article-rail { order: 4; position: static; flex-direction: row; flex-wrap: wrap; }
  .article-rail .card { flex: 1 1 280px; }
  .toc-list { grid-template-columns: 1fr; }
}

/* Tablet and below — drawer sidebar, mobile topbar, 2-column cards */
@media (max-width: 1024px) {
  .drawer-overlay {
    display: block; position: fixed; inset: 0; z-index: 200;
    background: rgba(10,12,20,.45);
    opacity: 0; pointer-events: none; transition: opacity .3s;
  }
  body.has-overlay .drawer-overlay { opacity: 1; pointer-events: auto; }
  body.has-overlay { overflow: hidden; }

  .top-nav { display: none; }
  .drawer-btn { display: inline-flex; }
  .icon-btn.search-btn { display: grid; }   /* show on tablet/mobile */
  .header-search { display: none; }
  .header-inner { gap: 10px; padding: 10px 16px; }

  .cat-grid, .feat-grid, .grid-list, .vid-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile — single-column cards */
@media (max-width: 640px) {
  .main-area { padding: 14px 16px 40px; }
  .search-kbd { display: none; }
  .drawer { width: 84vw; max-width: 310px; }
  .cat-grid, .feat-grid, .grid-list, .vid-grid { grid-template-columns: 1fr; }
  .hero-track { height: 320px; }
  .hero-title { font-size: 1.5rem; }
  .hero-body { padding: 26px 22px 30px; }
  .latest-banner-title { font-size: 1.35rem; }
  .row-stats { display: none; }
  .article { padding: 22px 20px 30px; }
  .article-title { font-size: 1.5rem; }
  .post-nav { flex-direction: column; }
}
