/**
 * FSMAG Magazine Styles
 * Clean, typographic, magazine-style layout.
 * Reference: OWID, Foreign Affairs, The Economist.
 */
:root {
  --fs-bg: #F9F9F7;
  --fs-accent: #8B0000;
  --fs-ink: #1A1A1A;
  --fs-muted: #666;
  --fs-border: #eee;
  --fs-card-bg: #fff;
  --font-serif: "Noto Serif SC", "Songti SC", serif;
  --font-song: "Ma Shan Zheng", "KaiTi", cursive;
  --font-mono: "JetBrains Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fs-bg);
  color: var(--fs-ink);
  font-family: var(--font-serif);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Layout */
.fs-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 768px) { .fs-container { padding: 0 1.5rem; } }
@media (min-width: 1200px) { .fs-container { padding: 0 2rem; } }

.fs-hero { max-width: 1400px; margin: 0 auto; }

/* Cards */
.fs-card {
  background: var(--fs-card-bg);
  border: 1px solid var(--fs-border);
  transition: all 0.3s ease;
}
.fs-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

/* Line clamp */
.lc2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lc4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* Section header */
.fs-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.fs-section-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  white-space: nowrap;
}
.fs-section-header .line {
  flex: 1;
  height: 1px;
  background: var(--fs-border);
}
.fs-section-header a:hover h2,
.fs-section-header a:hover .more { color: var(--fs-accent); }
.fs-section-header .more {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fs-muted);
  white-space: nowrap;
}

/* Hero */
.fs-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 400px;
}
@media (min-width: 900px) {
  .fs-hero-grid { grid-template-columns: 1fr 1fr; min-height: 500px; }
}
.fs-hero-image {
  position: relative;
  overflow: hidden;
  background: #111;
}
.fs-hero-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fs-hero-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  background: var(--fs-card-bg);
}

/* Grid layouts */
.fs-grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.fs-grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 640px) {
  .fs-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .fs-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .fs-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Img lazy loading */
.fs-card .img-box {
  position: relative;
  overflow: hidden;
  background: #f3f4f6;
  aspect-ratio: 16/10;
}
.fs-card .img-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fs-card .img-box img[loading="lazy"] { content-visibility: auto; }

/* Section separators */
.border-t { border-top: 1px solid var(--fs-border); }
.w-full { width: 100%; }
.bg-black { background: #111; }
.block { display: block; }
.overflow-hidden { overflow: hidden; }
.rounded-sm { border-radius: 2px; }

/* Diary panel */
.diary-panel {
  background: var(--fs-card-bg);
  border: 1px solid var(--fs-border);
  padding: 1.5rem;
  transition: all 0.3s ease;
}
.diary-panel:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.diary-link { color: inherit; text-decoration: none; display: block; }
.diary-title { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 600; color: var(--fs-accent); }
.diary-date { font-size: 0.9rem; color: var(--fs-muted); font-family: var(--font-mono); }
.diary-excerpt { margin: 0.75rem 0 0; font-size: 0.9rem; color: var(--fs-muted); line-height: 1.6; }
.diary-empty { margin: 0; color: var(--fs-muted); font-size: 0.9rem; }
