/* ————————————————————————————————————————————————————————————
   Blog perso — feuille de style épurée
   Inspirée des blogs minimalistes type steipete.me
   ———————————————————————————————————————————————————————————— */

:root {
  --bg: #fdfdfc;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --subtle: #e6e6e3;
  --accent: #8b5a2b;
  --accent-hover: #6e4520;
  --code-bg: #f4f1ec;
  --max-width: 680px;
  --font-serif: "Iowan Old Style", "Charter", "Georgia", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15151a;
    --fg: #e8e6e1;
    --muted: #8a8680;
    --subtle: #2a2a2f;
    --accent: #d4a574;
    --accent-hover: #e6b989;
    --code-bg: #1e1e24;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* —— En-tête —— */
header.site {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--subtle);
  font-family: var(--font-sans);
}
header.site .brand {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}
header.site nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.92rem;
}
header.site nav a:hover { color: var(--fg); }

/* —— Typographie —— */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 2.2rem 0 0.8rem;
}
h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p, ul, ol, blockquote { margin: 0 0 1.1rem; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease;
}
a:hover { border-bottom-color: var(--accent); }

blockquote {
  border-left: 2px solid var(--subtle);
  padding: 0.1rem 0 0.1rem 1rem;
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}
pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.88rem;
}
pre code { background: none; padding: 0; }

hr {
  border: none;
  border-top: 1px solid var(--subtle);
  margin: 2.5rem 0;
}

img { max-width: 100%; height: auto; border-radius: 4px; }

/* —— Accueil / listes —— */
.intro {
  font-size: 1.15rem;
  color: var(--fg);
  margin-bottom: 2.5rem;
  max-width: 560px;
}

ul.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.post-list li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--subtle);
  align-items: baseline;
}
ul.post-list li:last-child { border-bottom: none; }
ul.post-list time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}
ul.post-list a {
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1rem;
}
ul.post-list a:hover { color: var(--accent); }

@media (max-width: 560px) {
  ul.post-list li { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* —— Article —— */
article.post header {
  margin-bottom: 2rem;
}
article.post .meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
article.post h1 { margin-bottom: 0.3rem; }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--subtle);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.3rem;
}

/* —— Projets —— */
.project-card {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--subtle);
}
.project-card:last-child { border-bottom: none; }
.project-card h3 { margin: 0 0 0.3rem; }
.project-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.project-card .links { margin-top: 0.4rem; font-family: var(--font-sans); font-size: 0.88rem; }

/* —— Newsletter —— */
.newsletter-box {
  background: var(--subtle);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 3rem 0;
  font-family: var(--font-sans);
}
.newsletter-box h3 { margin-top: 0; font-size: 1.05rem; }
.newsletter-box form { display: flex; gap: 0.5rem; margin-top: 0.8rem; flex-wrap: wrap; }
.newsletter-box input[type="email"] {
  flex: 1 1 200px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--muted);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.95rem;
}
.newsletter-box button {
  padding: 0.55rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.newsletter-box button:hover { background: var(--accent-hover); }

/* —— Pied de page —— */
footer.site {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--subtle);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
footer.site a { color: var(--muted); }

/* —— Zone privée —— */
.private-gate {
  max-width: 420px;
  margin: 4rem auto;
  text-align: center;
  font-family: var(--font-sans);
}
.private-gate h1 { font-size: 1.4rem; margin-bottom: 0.3rem; }
.private-gate p { color: var(--muted); font-size: 0.95rem; }
.private-gate form { margin-top: 1.5rem; display: flex; gap: 0.5rem; }
.private-gate input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--muted);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.95rem;
}
.private-gate button {
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.private-gate .error {
  color: #c0392b;
  font-size: 0.88rem;
  margin-top: 0.8rem;
  min-height: 1.2em;
}
.private-gate .lock {
  font-size: 2rem;
  opacity: 0.3;
  margin-bottom: 0.5rem;
}
.private-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}
