/* ============================================================
   SITE-COMMON.CSS — Unified Design System for agentnote.site
   ============================================================
   Shared styles extracted from the homepage visual language.
   Include this file on every page for consistent look & feel.
   ============================================================ */

/* ── 1. CSS Reset ────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body, h1, h2, h3, h4, h5, h6, p, ol, ul, li, figure, figcaption,
blockquote, dl, dd {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

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

a {
  text-decoration: none;
  color: inherit;
}

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

/* ── 2. Design Tokens (CSS Custom Properties) ───────────── */

:root {
  /* Colors */
  --bg: #f4f6f9;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  --text-light: #64748b;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --blue: #3b82f6;
  --blue-light: #eef2ff;
  --border: #e2e8f0;

  /* Shadows */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 40px rgba(99, 102, 241, 0.15);

  /* Layout */
  --header-height: 72px;
  --content-max-width: 900px;
  --content-padding: 24px;
}

/* ── 3. Body Defaults ────────────────────────────────────── */

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, sans-serif;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 4. Header ───────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(244, 246, 249, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  transition: box-shadow 0.3s;
}

.site-header.scrolled {
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--blue-light);
  color: var(--accent);
}

/* ── 5. Article Page Layout ──────────────────────────────── */

.article-container,
.main-content {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: calc(var(--header-height) + 28px) var(--content-padding) 80px;
}

/* ── 6. Article Header ───────────────────────────────────── */

.article-header {
  margin-bottom: 40px;
}

.article-header .article-date {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 12px;
  display: block;
}

.article-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.article-header .article-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 700px;
}

/* ── 7. Article Hero Image ───────────────────────────────── */

.article-hero-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

/* ── 8. Article Typography ───────────────────────────────── */

.article-body h1,
.article-content h1,
.article-container h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.article-body h2,
.article-content h2,
.article-container h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 56px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  letter-spacing: -0.3px;
}

.article-body h3,
.article-content h3,
.article-container h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 40px;
  margin-bottom: 16px;
}

.article-body p,
.article-content p,
.article-container p {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.article-body a,
.article-content a,
.article-container a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.article-body a:hover,
.article-content a:hover,
.article-container a:hover {
  color: var(--accent-light);
}

.article-body strong,
.article-content strong,
.article-container strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-body ul,
.article-body ol,
.article-content ul,
.article-content ol,
.article-container ul,
.article-container ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.article-body li,
.article-content li,
.article-container li {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 8px;
  list-style: disc;
}

.article-body ol li,
.article-content ol li,
.article-container ol li {
  list-style: decimal;
}

.article-body code,
.article-content code,
.article-container code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  color: var(--text-primary);
}

.article-body pre,
.article-content pre,
.article-container pre {
  background: #f5f5f5;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.article-body pre code,
.article-content pre code,
.article-container pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.7;
}

.article-body blockquote,
.article-content blockquote,
.article-container blockquote {
  background: #f5f5f5;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  margin-bottom: 20px;
  font-style: italic;
  color: var(--text-muted);
}

.article-body blockquote p,
.article-content blockquote p,
.article-container blockquote p {
  margin-bottom: 0;
}

/* ── 9. Footer ───────────────────────────────────────────── */

.site-footer {
  text-align: center;
  border-top: 1px solid var(--border);
  padding: 40px 48px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.8;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ── 10. Buttons ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── 11. Responsive: Tablet (≤1024px) ────────────────────── */

@media (max-width: 1024px) {
  :root {
    --content-padding: 32px;
  }

  .site-header {
    padding: 0 32px;
  }

  .site-footer {
    padding: 36px 32px;
  }
}

/* ── 12. Responsive: Small Tablet (≤768px) ───────────────── */

@media (max-width: 768px) {
  :root {
    --content-padding: 20px;
  }

  .site-header {
    padding: 0 20px;
  }

  .nav-links {
    gap: 20px;
  }

  .article-header h1 {
    font-size: 28px;
  }

  .article-body h2,
  .article-content h2,
  .article-container h2 {
    font-size: 22px;
    margin-top: 40px;
  }

  .article-body h3,
  .article-content h3,
  .article-container h3 {
    font-size: 18px;
    margin-top: 32px;
  }

  .article-hero-img {
    border-radius: 12px;
    max-height: 300px;
  }

  .site-footer {
    padding: 32px 20px;
  }
}

/* ── 13. Responsive: Mobile (≤480px) ─────────────────────── */

@media (max-width: 480px) {
  :root {
    --content-padding: 16px;
    --header-height: 64px;
  }

  .site-header {
    padding: 0 16px;
  }

  .logo-text {
    font-size: 17px;
  }

  .logo-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .nav-links {
    gap: 14px;
  }

  .nav-links a {
    font-size: 13px;
  }

  .article-header h1 {
    font-size: 24px;
  }

  .article-header .article-subtitle {
    font-size: 15px;
  }

  .article-body p,
  .article-content p,
  .article-container p,
  .article-body li,
  .article-content li,
  .article-container li {
    font-size: 15px;
  }

  .article-hero-img {
    border-radius: 10px;
    margin-bottom: 28px;
  }

  .site-footer {
    padding: 28px 16px;
    font-size: 12px;
  }

  .btn {
    padding: 10px 18px;
    font-size: 13px;
  }
}
