/* ============================================================
   ARIA — clair, doux, aéré · avec mode sombre
   ============================================================ */

:root {
  --bg:           #FBFAF8; /* blanc cassé chaud */
  --surface:      #FFFFFF; /* cartes */
  --surface-soft: #F4F2EE; /* renfoncement doux */
  --text:         #2A2A28;
  --text-soft:    #6B6A65;
  --text-faint:   #9A988F;
  --border:       #ECE9E3;
  --accent:       #6E8B6E; /* sauge */
  --accent-soft:  #E8EFE8;
  --accent-text:  #3E573E;

  --radius-card: 20px;
  --radius-chip: 999px;
  --radius-img:  16px;

  --font-display: var(--gh-font-heading, 'Fraunces', Georgia, serif);
  --font-body:    var(--gh-font-body, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);

  --max: 1140px;
  --narrow: 720px;

  --shadow: 0 1px 2px rgba(40,40,35,0.04), 0 6px 20px rgba(40,40,35,0.05);
}

:root[data-theme="dark"] {
  --bg:           #161614;
  --surface:      #1F1F1C;
  --surface-soft: #26261F;
  --text:         #EDEBE5;
  --text-soft:    #A8A69E;
  --text-faint:   #76746C;
  --border:       #2E2E29;
  --accent:       #8FB08F;
  --accent-soft:  #232B23;
  --accent-text:  #B6CFB6;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 6px 20px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

.wrap--narrow { max-width: var(--narrow); }

/* ---------- en-tête ---------- */

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 28px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--accent-text); }

.header__right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav ul.nav,
.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-soft);
}
.nav a:hover, .nav .nav-current a { color: var(--text); text-decoration: none; }

/* ---------- bascule de thème ---------- */

.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-chip);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-soft);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { background: var(--surface-soft); }
.theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: inline; }

/* ---------- hero ---------- */

.hero {
  padding: 56px 0 44px;
  max-width: 640px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.hero__desc {
  font-size: 19px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.55;
}

/* ---------- grille de cartes ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card__link { display: block; color: var(--text); }
.card__link:hover { text-decoration: none; }

.card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-soft);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card__body { padding: 22px 22px 26px; }

.card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.card__date { font-size: 13px; color: var(--text-faint); }

.card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.card__excerpt {
  font-size: 15px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.55;
}

/* ---------- chip / catégorie ---------- */

.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: var(--radius-chip);
  padding: 4px 12px;
}

/* ---------- pagination ---------- */

.pagination {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 32px;
  padding: 28px 0 64px;
  font-size: 15px;
}
.pagination a { color: var(--accent-text); font-weight: 500; }

/* ---------- article ---------- */

.article { padding-bottom: 80px; }

.article__header { padding: 48px 0 8px; }

.article__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.article__date { font-size: 14px; color: var(--text-faint); }

.article__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 5.5vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.article__dek {
  font-size: 20px;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0 0 18px;
}

.article__byline {
  font-size: 14px;
  color: var(--text-faint);
  margin: 0;
}

.article__image {
  margin: 32px 0 8px;
}
.article__image img {
  width: 100%;
  border-radius: var(--radius-img);
  display: block;
}

/* ---------- prose ---------- */

.prose {
  font-size: 18px;
  line-height: 1.75;
  padding-top: 28px;
}

.prose h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 44px 0 16px;
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  margin: 34px 0 12px;
}

.prose p { margin: 0 0 22px; }

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

.prose blockquote {
  margin: 30px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: 21px;
  color: var(--text);
}

.prose ul, .prose ol { margin: 0 0 22px; padding-left: 1.3em; }
.prose li { margin-bottom: 8px; }

.prose img { max-width: 100%; border-radius: var(--radius-img); }

.prose code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.88em;
  background: var(--surface-soft);
  padding: 2px 6px;
  border-radius: 6px;
}

.prose pre {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 14px;
  overflow-x: auto;
  font-size: 14px;
}
.prose pre code { background: none; padding: 0; }

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ---------- pied de page ---------- */

.footer { border-top: 1px solid var(--border); }
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 30px 28px;
}
.footer__name { font-family: var(--font-display); font-weight: 500; font-size: 16px; }
.footer__by { font-size: 14px; color: var(--text-faint); }
.footer__by a { color: var(--text-soft); }

/* ---------- classes éditeur Koenig (requises par Ghost) ---------- */

.prose :not(.kg-card):not(table) {
  /* contenu standard contraint à la largeur de lecture (--narrow via .wrap) */
}

.kg-width-wide {
  position: relative;
  width: calc(100% + 160px);
  margin-left: -80px;
}

.kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.kg-width-full img { border-radius: 0; }

figure.kg-card { margin: 32px 0; }

figcaption,
.kg-card figcaption {
  text-align: center;
  font-size: 14px;
  color: var(--text-faint);
  margin-top: 10px;
  line-height: 1.4;
}

.kg-image { max-width: 100%; border-radius: var(--radius-img); }

.kg-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kg-gallery-row { display: flex; gap: 12px; }
.kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-img);
}

.kg-embed-card,
.kg-bookmark-card { margin: 32px 0; }

.kg-bookmark-container {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
}
.kg-bookmark-container:hover { text-decoration: none; box-shadow: var(--shadow); }
.kg-bookmark-content { padding: 18px 20px; flex: 1; }
.kg-bookmark-title { font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.kg-bookmark-description { font-size: 14px; color: var(--text-soft); }
.kg-bookmark-thumbnail img { width: 180px; height: 100%; object-fit: cover; }

.kg-callout-card {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface-soft);
  margin: 28px 0;
}

.kg-button-card { text-align: center; margin: 28px 0; }
.kg-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: var(--radius-chip);
  text-decoration: none;
}
.kg-btn:hover { text-decoration: none; opacity: 0.92; }

@media (max-width: 760px) {
  .kg-width-wide { width: 100%; margin-left: 0; }
  .kg-bookmark-container { flex-direction: column-reverse; }
  .kg-bookmark-thumbnail img { width: 100%; height: 180px; }
}

/* ---------- mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .card:hover { transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero { padding: 40px 0 32px; }
  .grid { grid-template-columns: 1fr; gap: 18px; }
  .header__inner { padding: 20px; }
  .nav ul { gap: 16px; }
}
