/* ===== FONTS =====
   Polices système uniquement — aucune dépendance externe (Google Fonts supprimé).
   Lora → Georgia / "Palatino Linotype" (serif élégant)
   DM Sans → ui-sans-serif / system-ui (sans-serif natif)
   DM Mono → ui-monospace / "Cascadia Code" / Consolas
*/

/* ===== RESET & VARIABLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f9f8f6;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --text-light: #9a9a9a;
  --border: #e8e6e1;
  --accent: #1a6cf6;
  --serif: Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, "Courier New", monospace;
  --max-w: 720px;
  --nav-h: 60px;
}

html { font-size: 18px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 248, 246, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.nav-links,
.nav-links .nav {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-links a,
.nav-links .nav a {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links .nav a:hover { color: var(--text); }

/* ===== HOME ===== */
.home-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
}

.home-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.home-description {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* ===== POST GRID ===== */
.post-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.post-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.post-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--border);
}
.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.post-card:hover .post-card-image img { transform: scale(1.03); }

.post-card-body { padding: 1.25rem 1.5rem 1.5rem; }

.post-card-tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.post-card-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.post-card-title:hover { color: var(--accent); }

.post-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

.post-card-author-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== ARTICLE ===== */
.article {
  max-width: 100%;
}

/* Hero image */
.article-hero {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 2rem;
  border-radius: 12px;
  overflow: visible;
  background: none;
}
.article-hero img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

/* Article header */
.article-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 2rem 0;
}

.article-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.78rem;
}

.article-meta-label {
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}

.article-meta-value {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
}

.article-share {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.share-btn:hover { border-color: var(--text-muted); color: var(--text); }
.share-btn svg { width: 14px; height: 14px; }

.article-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* Article content */
.article-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.gh-content p {
  margin-bottom: 1.5rem;
  line-height: 1.75;
  font-size: 1rem;
  color: #2a2a2a;
}

.gh-content h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  line-height: 1.25;
}

.gh-content h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.gh-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gh-content ul, .gh-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.gh-content li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.gh-content blockquote {
  border-left: 3px solid var(--border);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin: 2rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.gh-content pre {
  background: #f4f3f0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
}

.gh-content code {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: #f0ede8;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.gh-content pre code {
  background: none;
  padding: 0;
}

.gh-content figure {
  margin: 2rem 0;
}
.gh-content figure img {
  border-radius: 8px;
  width: 100%;
}
.gh-content figcaption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* Wide images */
.kg-width-wide {
  max-width: min(1100px, 100vw - 4rem);
  margin-left: calc(50% - min(550px, 50vw - 2rem));
}

.kg-width-full {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

/* ===== TAGS ===== */
.article-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.article-tag {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #efeee9;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  color: var(--text-muted);
}

/* ===== PAGINATION ===== */
.pagination {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
}
.pagination a, .pagination span {
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--surface);
  transition: all 0.15s;
}
.pagination a:hover { border-color: var(--text); color: var(--text); }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
}
.site-footer p {
  font-size: 0.8rem;
  color: var(--text-light);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ===== 404 ===== */
.error-page {
  max-width: var(--max-w);
  margin: 8rem auto;
  padding: 0 2rem;
  text-align: center;
}
.error-page h1 {
  font-family: var(--serif);
  font-size: 6rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
}
.error-page p { color: var(--text-muted); margin: 1rem 0 2rem; }
.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  background: var(--text);
  color: #fff;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  html { font-size: 16px; }
  .post-grid { grid-template-columns: 1fr; padding: 1rem; }
  .article-header, .article-content { padding-left: 1.25rem; padding-right: 1.25rem; }
  .article-meta-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
