:root {
  --bg: #FAF7F2;
  --text: #1A1A1A;
  --muted: #999;
  --border: #E5E0D8;
  --card: #FFFFFF;
  --accent: #C41E3A;
  --serif: 'Libre Baskerville', Georgia, serif;
  --display: 'Playfair Display', Georgia, serif;
  --mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--serif); background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── HEADER ── */
.header { text-align: center; padding: 32px 24px 0; }
.header-sub { font-family: var(--mono); font-size: 11px; letter-spacing: 4px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.header h1 { font-family: var(--display); font-size: clamp(28px, 5vw, 48px); font-weight: 900; line-height: 1; letter-spacing: -1px; }
.header h1 em { font-style: italic; color: var(--accent); }
.header-line { width: 60px; height: 3px; background: var(--text); margin: 12px auto; }

/* ── NAV ── */
nav { display: flex; justify-content: center; gap: 8px; margin-top: 32px; border-bottom: 1px solid var(--border); }
nav button, nav a.nav-link { cursor: pointer; padding: 8px 16px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; border: none; background: none; font-family: var(--mono); color: var(--muted); transition: color 0.3s; position: relative; text-decoration: none; }
nav button:hover, nav button.active, nav a.nav-link:hover, nav a.nav-link.active { color: var(--text); }
nav button.active::after, nav a.nav-link.active::after { content: ''; position: absolute; bottom: 0; left: 16px; right: 16px; height: 2px; background: var(--accent); }

/* ── MAIN ── */
main { max-width: 1100px; margin: 0 auto; padding: 40px 24px 80px; }

/* ── FEATURED ARTICLE ── */
.featured { background: var(--card); border: 1px solid var(--border); padding: 40px; margin-bottom: 40px; cursor: pointer; transition: all 0.4s; animation: fadeUp 0.6s ease-out; }
.featured:hover { box-shadow: 0 20px 60px rgba(0,0,0,0.08); transform: translateY(-4px); }
.featured-meta { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-bottom: 12px; }
.featured-title { font-family: var(--display); font-size: clamp(24px, 4vw, 36px); font-weight: 700; margin-bottom: 16px; line-height: 1.3; }
.featured-preview { font-size: 16px; line-height: 1.8; color: #555; margin-bottom: 24px; font-style: italic; }
.featured-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.featured .read-btn { display: inline-block; }

/* ── ARTICLE LIST ── */
.article-list-item { background: var(--card); border: 1px solid var(--border); padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; cursor: pointer; transition: all 0.3s; animation: fadeUp 0.5s ease both; text-decoration: none; color: inherit; }
.article-list-item:hover { transform: translateX(4px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.article-list-title { font-family: var(--display); font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.article-list-meta { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }

/* ── CATEGORY TAG ── */
.category-tag { display: inline-block; padding: 3px 10px; font-family: var(--mono); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }

/* ── VIEW COUNT ── */
.view-count { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted); }

/* ── READ BUTTON ── */
.read-btn { cursor: pointer; border: none; font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; padding: 8px 16px; transition: all 0.3s; color: white; text-decoration: none; display: inline-block; background: var(--accent); }
.read-btn:hover { opacity: 0.85; transform: translateX(4px); }

/* ── SHARE BUTTON ── */
.share-btn { cursor: pointer; border: 1px solid var(--border); background: var(--card); font-family: var(--mono); font-size: 11px; letter-spacing: 1px; padding: 7px 12px; transition: all 0.3s; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.share-btn:hover { border-color: var(--text); color: var(--text); }

/* ── ARTICLE OVERLAY ── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); z-index: 100; display: flex; justify-content: flex-end; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.overlay.open { opacity: 1; pointer-events: auto; }
.panel { width: 100%; max-width: 640px; background: var(--bg); height: 100%; overflow-y: auto; padding: 48px 40px; transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); }
.overlay.open .panel { transform: translateX(0); }
.panel-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.close-btn { cursor: pointer; background: none; border: 2px solid var(--text); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 20px; transition: all 0.3s; color: var(--text); }
.close-btn:hover { background: var(--text); color: var(--bg); }
.panel-divider { width: 100%; height: 1px; background: var(--border); margin-bottom: 28px; }
.panel-topic { font-family: var(--display); font-size: 26px; font-weight: 700; margin-bottom: 28px; line-height: 1.4; }
.panel-content { font-size: 16px; line-height: 2; white-space: pre-wrap; color: #333; }
.panel-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.panel-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ── ARCHIVE ── */
.archive-title { font-family: var(--display); font-size: 32px; font-weight: 700; margin-bottom: 32px; text-align: center; }
.archive-item { background: var(--card); border: 1px solid var(--border); padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; animation: fadeUp 0.5s ease both; text-decoration: none; color: inherit; cursor: pointer; transition: all 0.3s; }
.archive-item:hover { transform: translateX(4px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.archive-date { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--muted); margin-bottom: 6px; }
.archive-topic { font-family: var(--display); font-size: 18px; font-weight: 700; }
.archive-right { display: flex; align-items: center; gap: 16px; }

/* ── SSR ARTICLE PAGE ── */
.article-page { max-width: 720px; margin: 0 auto; padding: 40px 24px 80px; }
.article-meta { font-family: var(--mono); font-size: 10px; letter-spacing: 3px; color: var(--muted); margin-bottom: 12px; text-transform: uppercase; }
.article-topic { font-family: var(--display); font-size: 32px; font-weight: 700; margin-bottom: 16px; line-height: 1.3; }
.article-body { font-size: 16px; line-height: 2; white-space: pre-wrap; color: #333; margin-bottom: 40px; }
.cta-vote { display: block; text-align: center; margin-top: 32px; padding: 16px 32px; font-family: var(--mono); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; text-decoration: none; border: 2px solid var(--accent); color: var(--accent); transition: all 0.3s; }
.cta-vote:hover { background: var(--accent); color: white; }

/* ── LOADING ── */
.loading { text-align: center; padding: 80px 24px; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: 2px; }

.not-ready { text-align: center; padding: 80px 24px; }
.not-ready h2 { font-family: var(--display); font-size: 28px; margin-bottom: 12px; }
.not-ready p { color: var(--muted); font-size: 15px; }

/* ── FOOTER ── */
footer { text-align: center; padding: 32px 24px; border-top: 1px solid var(--border); background: var(--card); }
footer .brand { font-family: var(--display); font-size: 18px; font-weight: 700; margin-bottom: 12px; }
footer .brand em { color: var(--accent); font-style: italic; }
footer .disclaimer { font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--muted); }

/* ── SECTION TITLE ── */
.section-title { font-family: var(--mono); font-size: 11px; letter-spacing: 3px; color: var(--muted); text-transform: uppercase; margin-bottom: 24px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 640px) {
  .panel { padding: 32px 20px; }
  .featured { padding: 24px; }
  .featured-title { font-size: 22px; }
  .article-page { padding: 24px 16px 60px; }
  .article-list-item { flex-direction: column; align-items: flex-start; }
}
