@import url("./variables.css");
@import url("./components.css");
@import url("./responsive.css");

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--secondary); }
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 800; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(28px, 4vw, 48px); letter-spacing: -.02em; }
h2 { font-size: clamp(22px, 2.6vw, 32px); margin-bottom: var(--space-4); }
h3 { font-size: 20px; }
p { margin-bottom: var(--space-3); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 var(--space-5); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: var(--space-5); padding: var(--space-3) var(--space-5); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); }
.logo-mark { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(90deg, var(--primary) 50%, var(--secondary) 50%); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; }
.main-nav { display: flex; gap: var(--space-4); flex: 1; }
.main-nav a { color: var(--text); font-weight: 600; padding: 6px 10px; border-radius: 6px; }
.main-nav a:hover, .main-nav a.active { background: rgba(21,101,192,.08); color: var(--primary); }
.search-wrap { position: relative; flex: 0 0 280px; }
.search-wrap input { width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--border); border-radius: 999px; background: var(--card-bg); font-size: 14px; }
.search-wrap input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.search-wrap::before { content: "🔍"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .5; }
.search-hint { position: absolute; left: 38px; top: 50%; transform: translateY(-50%); color: #999; font-size: 14px; pointer-events: none; }

/* Hero */
.hero {
  position: relative; color: #fff;
  background: linear-gradient(135deg, rgba(13,71,161,.85), rgba(142,0,0,.85)), url("../images/51-chigua-debate-hero.webp") center/cover no-repeat;
  padding: var(--space-8) 0;
  overflow: hidden;
}
.hero h1 { color: #fff; text-shadow: 0 4px 24px rgba(0,0,0,.4); margin-bottom: var(--space-4); }
.hero .lede { font-size: 18px; max-width: 760px; opacity: .92; margin-bottom: var(--space-5); }
.hero-meta { display: flex; gap: var(--space-5); flex-wrap: wrap; font-size: 14px; opacity: .85; margin-bottom: var(--space-5); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* Vote bar */
.vote-bar { background: rgba(255,255,255,.1); border-radius: 999px; height: 28px; overflow: hidden; display: flex; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.vote-bar .pro { background: var(--gradient-pro); display: flex; align-items: center; padding: 0 14px; font-weight: 700; font-family: var(--font-mono); transition: width .8s cubic-bezier(.4,0,.2,1); }
.vote-bar .con { background: var(--gradient-con); display: flex; align-items: center; justify-content: flex-end; padding: 0 14px; font-weight: 700; font-family: var(--font-mono); transition: width .8s cubic-bezier(.4,0,.2,1); }
.vote-actions { display: flex; gap: var(--space-3); margin-top: var(--space-4); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: var(--radius-md); font-weight: 700; cursor: pointer; border: 0; transition: transform .15s, box-shadow .2s; font-size: 15px; }
.btn:active { transform: translateY(1px); }
.btn-pro { background: var(--gradient-pro); color: #fff; box-shadow: 0 6px 20px rgba(21,101,192,.45); }
.btn-con { background: var(--gradient-con); color: #fff; box-shadow: 0 6px 20px rgba(198,40,40,.45); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3); }

/* Marquee */
.marquee { background: #0D2A4D; color: #fff; padding: 10px 0; overflow: hidden; }
.marquee-track { display: inline-flex; gap: var(--space-6); white-space: nowrap; animation: scroll 40s linear infinite; padding-left: 100%; }
.marquee-track span { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; opacity: .92; }
.marquee-track .tag-pro { color: #64B5F6; }
.marquee-track .tag-con { color: #EF9A9A; }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* Section */
section.block { padding: var(--space-8) 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: var(--space-5); }
.section-head h2 { display: flex; align-items: center; gap: var(--space-3); }
.section-head h2::before { content: ""; display: inline-block; width: 6px; height: 28px; background: linear-gradient(180deg, var(--primary), var(--secondary)); border-radius: 4px; }
.section-head .more { font-size: 14px; color: var(--accent); font-weight: 600; }

/* Matrix grid */
.matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: var(--space-5); }
.debate-card { background: var(--card-bg); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .25s, box-shadow .25s; display: flex; flex-direction: column; }
.debate-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.debate-card .cover { aspect-ratio: 16/9; overflow: hidden; background: #eef1f5; }
.debate-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.debate-card:hover .cover img { transform: scale(1.05); }
.debate-card .body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.debate-card .tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.tag-hot { background: #FFEBEE; color: var(--secondary); }
.tag-new { background: #E3F2FD; color: var(--primary); }
.tag-end { background: #FFF3E0; color: #E65100; }
.debate-card h3 a { color: var(--text); }
.debate-card h3 a:hover { color: var(--secondary); }
.debate-card .summary { font-size: 14px; color: var(--text-muted); }

/* Mini opinion */
.mini-opinions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.mini-opinions .side { padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.mini-opinions .pro { background: rgba(21,101,192,.08); border-left: 3px solid var(--primary); color: var(--primary-dark); }
.mini-opinions .con { background: rgba(198,40,40,.08); border-left: 3px solid var(--secondary); color: var(--secondary-dark); }
.mini-bar { height: 6px; border-radius: 999px; overflow: hidden; display: flex; }
.mini-bar > div:first-child { background: var(--primary); }
.mini-bar > div:last-child { background: var(--secondary); }
.mini-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

/* Two-column page layout */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-6); }
.sidebar { display: flex; flex-direction: column; gap: var(--space-5); }
.panel { background: var(--card-bg); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: var(--space-5); }
.panel h3 { margin-bottom: var(--space-3); display: flex; align-items: center; gap: 8px; }

/* Ranking */
.rank-tabs { display: flex; gap: 6px; margin-bottom: var(--space-3); }
.rank-tab { flex: 1; padding: 8px; border-radius: 8px; background: #f1f3f6; text-align: center; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-muted); border: 0; }
.rank-tab.active { background: linear-gradient(90deg, var(--primary), var(--secondary)); color: #fff; }
.rank-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rank-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list .num { flex: 0 0 24px; height: 24px; border-radius: 6px; background: #eef1f5; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 800; font-size: 12px; }
.rank-list li:nth-child(1) .num { background: linear-gradient(135deg, #FFD54F, #FF8F00); color: #fff; }
.rank-list li:nth-child(2) .num { background: linear-gradient(135deg, #B0BEC5, #607D8B); color: #fff; }
.rank-list li:nth-child(3) .num { background: linear-gradient(135deg, #BCAAA4, #6D4C41); color: #fff; }

/* Footer */
.site-footer { background: #0E1E33; color: #BFC9D6; padding: var(--space-8) 0 var(--space-5); margin-top: var(--space-8); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: var(--space-6); margin-bottom: var(--space-6); }
.footer-grid h4 { color: #fff; margin-bottom: var(--space-3); font-size: 15px; }
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-grid a { color: #BFC9D6; font-size: 14px; }
.footer-grid a:hover { color: #fff; }
.copyright { border-top: 1px solid rgba(255,255,255,.08); padding-top: var(--space-4); font-size: 13px; text-align: center; opacity: .7; }

/* Breadcrumb */
.crumb { padding: var(--space-3) 0; font-size: 13px; color: var(--text-muted); }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--primary); }
.crumb .sep { margin: 0 6px; opacity: .5; }
