/* ============================================================================
   FLAVOR THEME — Dark Editorial Blog CSS
   A cinematic dark blog theme inspired by Dan Koe's "future/proof" Substack.
   Designed for Gridea Pro.
   ============================================================================ */


/* ============================================================================
   § 1. CSS CUSTOM PROPERTIES
   ============================================================================ */

:root {
  /* ── Colors ── */
  --color-bg: #000000;
  --color-surface: #111111;
  --color-border: #222222;
  --color-border-light: #1a1a1a;
  --color-border-hover: #444444;
  --color-text-primary: #ffffff;
  --color-text-secondary: #999999;
  --color-text-muted: #666666;
  --color-text-body: #e0e0e0;
  --color-accent: #54675e;
  --color-accent-hover: #FFFF00;
  --color-badge-gold: #e8c547;

  /* ── Typography (Apple-style system font stack) ── */
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Display", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, monospace;
  --font-size-base: 16px;
  --line-height-base: 1.58824;

  /* ── Layout ── */
  --max-width: 1200px;
  --content-width: 900px;
  --sidebar-width: 280px;
  --grid-gap: 48px;

  /* ── Spacing ── */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 80px;

  /* ── Transitions ── */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;

  /* ── Header heights ── */
  --top-bar-height: 56px;
  --header-total: 56px;
}


/* ============================================================================
   § 2. RESET & BASE
   ============================================================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  letter-spacing: 0.01em;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  word-break: break-word;
  overflow-wrap: break-word;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

mark {
  background-color: rgba(255, 255, 0, 0.25);
  color: var(--color-accent-hover);
  padding: 1px 2px;
  border-radius: 2px;
  white-space: nowrap;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
}

h1 {
  font-size: 2.2rem;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}


/* ============================================================================
   § 3. SCROLLBAR STYLING
   ============================================================================ */

body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: var(--color-bg);
}

body::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
  background: #555555;
}

/* Firefox */
body {
  scrollbar-width: thin;
  scrollbar-color: #333333 var(--color-bg);
}


/* ============================================================================
   § 4. UTILITY CLASSES
   ============================================================================ */

/* ── Container ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.hero-section + .container {
  margin-top: 40px;
}

/* ── Meta text ── */
.meta-text {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.007em;
  font-weight: 400;
}

/* ── Line clamp ── */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Mobile-only visibility ── */
.mobile-only {
  display: none !important;
}


/* ============================================================================
   § 5. LIGHT THEME OVERRIDES
   ============================================================================ */

:root.theme-light {
  --color-bg: #ffffff;
  --color-surface: #f7f7f8;
  --color-border: #e5e5e7;
  --color-border-light: #f0f0f2;
  --color-border-hover: #c4c4c6;
  --color-text-primary: #111111;
  --color-text-secondary: #555555;
  --color-text-muted: #8a8a8a;
  --color-text-body: #222222;
  --color-accent: #1f1f1f;
  --color-accent-hover: #b88a00;
  --color-badge-gold: #b88a00;
}

.theme-light body::-webkit-scrollbar-thumb {
  background: #cfcfd2;
}

.theme-light body::-webkit-scrollbar-thumb:hover {
  background: #a8a8ab;
}

.theme-light body {
  scrollbar-color: #cfcfd2 var(--color-bg);
}

.theme-light mark {
  background-color: rgba(255, 235, 59, 0.45);
  color: #6a5200;
}

/* 文章内容：blockquote / 行内代码 在浅色下需要单独处理硬编码颜色 */
.theme-light .article-content blockquote,
.theme-light .post-content blockquote {
  border-left-color: #d6d6d8;
}

.theme-light .article-content code,
.theme-light .post-content code {
  background-color: #f3f3f5;
  color: #8f2a17;
}

/* 卡片 hover：原硬编码 #161616（极深）在浅色下需反向 */
.theme-light .post-nav-card:hover,
.theme-light .link-card:hover {
  background-color: #f0f0f2;
}

/* 搜索遮罩：浅色下用轻微灰色遮罩代替纯黑 */
.theme-light .search-overlay {
  background: rgba(20, 20, 20, 0.35);
}

.theme-light .search-result-item__tag--hit {
  color: #6a5200;
  background: rgba(255, 235, 59, 0.45);
}

.theme-light .search-result-item__date {
  color: var(--color-text-muted);
}

.theme-light .btn--primary:hover {
  background-color: #3a3a3a;
  border-color: #3a3a3a;
}

.theme-light .footer-powered {
  color: var(--color-text-muted);
}

.theme-light .link-card:hover .link-card__arrow {
  color: #ffffff;
}

/* Hero 区有深色渐变遮罩，文字在浅色模式下仍需保持白色 */
.theme-light .hero-title,
.theme-light .hero-cta {
  color: #ffffff;
}

.theme-light .hero-subtitle {
  color: rgba(255, 255, 255, 0.78);
}


