/* =========================================================
   MonoCMS Frontend - static site styles
   ========================================================= */
:root {
  --primary: #0a84ff;
  --text: #1a1a1a;
  --muted: #666;
  --border: #eee;
  --bg: #fff;
  --max-w: 1200px;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex; align-items: center;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.site-header .logo { font-size: 20px; font-weight: 700; color: var(--text); }
.site-header nav ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.site-header nav a { color: var(--text); font-size: 14px; font-weight: 500; }
.site-header nav a:hover { color: var(--primary); text-decoration: none; }

/* Hero */
.hero { padding: 60px 0 40px; text-align: center; }
.hero h1 { font-size: 42px; margin: 0 0 12px; letter-spacing: -0.02em; }
.hero p { font-size: 18px; color: var(--muted); margin: 0; max-width: 640px; margin: 0 auto; }

/* Article grid */
main.home, main.category-page, main.article-page { padding: 40px 0; }
.article-grid {
  display: grid; gap: 32px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  margin-top: 40px;
}
.article-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.article-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.card-image { display: block; aspect-ratio: 16/9; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px; }
.card-cat { display: inline-block; font-size: 12px; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.card-body h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.4; }
.card-body h3 a { color: var(--text); }
.card-summary { color: var(--muted); font-size: 14px; margin: 0 0 12px; line-height: 1.5; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.author-avatar { width: 24px; height: 24px; border-radius: 50%; }

/* Article page */
main.article-page {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px;
}
article h1 { font-size: 36px; line-height: 1.3; margin: 0 0 16px; letter-spacing: -0.02em; }
.author-info-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.author-info-bar img { width: 40px; height: 40px; border-radius: 50%; }
.author-info-bar time { color: var(--muted); }
.featured-image { width: 100%; height: auto; border-radius: var(--radius); margin: 24px 0; aspect-ratio: 16/9; object-fit: cover; }
.entry-content { font-size: 17px; line-height: 1.8; }
.entry-content h2 { font-size: 26px; margin: 40px 0 16px; letter-spacing: -0.01em; }
.entry-content h3 { font-size: 22px; margin: 32px 0 12px; }
.entry-content p { margin: 0 0 20px; }
.entry-content img { border-radius: var(--radius); margin: 24px 0; }
.entry-content ul, .entry-content ol { margin: 20px 0; padding-left: 28px; }
.entry-content li { margin: 8px 0; }
.entry-content blockquote { border-left: 4px solid var(--primary); margin: 24px 0; padding: 8px 24px; color: var(--muted); background: #f9f9f9; }
.entry-content code { background: #f4f4f4; padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.9em; }
.entry-content pre { background: #1a1a1a; color: #e6e8ee; padding: 20px; border-radius: var(--radius); overflow-x: auto; }
.entry-content pre code { background: transparent; color: inherit; padding: 0; }

/* Sidebar */
.sidebar { position: sticky; top: 80px; align-self: start; }
.author-card-fixed { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; margin-bottom: 20px; }
.author-card-fixed img { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 12px; }
.author-card-fixed h3 { margin: 0 0 4px; font-size: 16px; }
.author-card-fixed .title { font-size: 13px; color: var(--muted); margin: 0 0 12px; font-style: italic; }
.author-card-fixed .bio { font-size: 13px; color: var(--text); margin: 0 0 12px; line-height: 1.5; text-align: left; }
.social-proof-links { display: flex; gap: 8px; justify-content: center; }
.social-proof-links a { font-size: 12px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; }

/* TOC */
.table-of-contents { background: #f9f9f9; padding: 16px 24px; border-radius: var(--radius); margin: 24px 0; }
.table-of-contents:empty { display: none; }
.table-of-contents h2 { font-size: 14px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; letter-spacing: 0.5px; }

/* FAQ */
.faq-accordion-box { margin: 40px 0; }
.faq-accordion-box h2 { font-size: 24px; margin: 0 0 20px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; padding: 16px 20px; }
.faq-item summary { font-weight: 600; cursor: pointer; }
.faq-item .faq-a { margin-top: 12px; color: var(--text); }

/* Ad shield (Anti-CLS) */
.ad-shield-slot {
  display: block; width: 100%;
  margin: 30px 0;
  background: #fafafa;
  border: 1px dashed #e0e0e0;
  position: relative;
  overflow: hidden;
}
.ad-shield-slot::before {
  content: "ADVERTISEMENT";
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 9px;
  color: #bfbfbf;
  letter-spacing: 1.5px;
  font-weight: 600;
  z-index: 1;
}
.ad-slot-top { margin-top: 24px; }
.ad-slot-bottom { margin: 40px 0; }
.ad-slot-sidebar { margin-top: 20px; }

/* Compliance pages */
main.compliance-page { max-width: 800px; margin: 0 auto; padding: 60px 24px; }
main.compliance-page h1 { font-size: 36px; margin: 0 0 24px; }
main.compliance-page h2 { font-size: 22px; margin: 32px 0 12px; }
main.compliance-page p { margin: 0 0 16px; line-height: 1.8; }
main.compliance-page .muted { color: var(--muted); font-size: 13px; margin-top: 40px; }

/* Footer */
.site-footer { background: #111; color: #ccc; padding: 40px 0; margin-top: 80px; text-align: center; }
.site-footer .compliance-links { margin-bottom: 16px; }
.site-footer .compliance-links a { color: #ccc; margin: 0 12px; font-size: 14px; }
.site-footer .compliance-links a:hover { color: #fff; }
.site-footer .copyright { font-size: 12px; color: #666; margin: 0; }

/* Empty */
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.muted { color: var(--muted); }

/* Responsive */
@media (max-width: 768px) {
  main.article-page { grid-template-columns: 1fr; padding: 24px 16px; }
  .sidebar { position: static; }
  .hero h1 { font-size: 32px; }
  article h1 { font-size: 28px; }
  .site-header nav ul { gap: 12px; }
  .site-header nav a { font-size: 13px; }
  .entry-content { font-size: 16px; }
}
