@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;1,8..60,300&display=swap');

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17px;
  line-height: 1.75;
  color: #1a1a18;
  background: #f7f5f0;
  min-height: 100vh;
}

/* ── Header / Nav ─────────────────────────────────────────── */
#preamble {
  border-bottom: 1px solid #d4cfc4;
  background: #f7f5f0;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

#preamble nav {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 0.25rem;
}

/* Site title — premier lien = accueil */
#preamble nav a:first-child {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  color: #1a1a18;
  margin-right: auto;
  letter-spacing: -0.3px;
}

#preamble nav a {
  font-size: 14px;
  color: #6b6860;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.01em;
}

#preamble nav a:hover {
  color: #1a1a18;
  background: #ede9e0;
}

/* ── Page title (index & articles) ───────────────────────── */
h1.title {
  font-family: 'Playfair Display', serif;
  font-size: 38px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: #1a1a18;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 15px;
  color: #8a8680;
  margin-bottom: 2.5rem;
}

/* ── Sitemap / index entries ──────────────────────────────── */
#content ul {
  list-style: none;
  border-top: 1px solid #ddd9d0;
}

#content ul li {
  padding: 1.4rem 0;
  border-bottom: 1px solid #ddd9d0;
  line-height: 1.5;
}

#content ul li a {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  color: #1a1a18;
  text-decoration: none;
  display: block;
  margin-bottom: 0.25rem;
  transition: color 0.15s;
}

#content ul li a:hover { color: #4a4540; }

#content ul li .entry-meta,
#content ul li > em,
#content ul li > i {
  font-size: 13px;
  color: #8a8680;
  font-style: normal;
  letter-spacing: 0.04em;
}

/* Tags inline (style ~tag~) */
code {
  font-size: 12px;
  background: #ede9e0;
  color: #6b6860;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: inherit;
  letter-spacing: 0.03em;
}

/* ── Article body ─────────────────────────────────────────── */
#content p {
  margin-bottom: 1.4rem;
  color: #2a2a28;
}

#content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 600;
  color: #1a1a18;
  margin: 2.5rem 0 0.9rem;
  line-height: 1.3;
}

#content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  color: #1a1a18;
  margin: 2rem 0 0.7rem;
}

#content h4 {
  font-size: 16px;
  font-weight: 600;
  color: #3a3a38;
  margin: 1.5rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Code blocks ──────────────────────────────────────────── */
pre {
  background: #1e1e1c;
  color: #d4d0c8;
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  font-size: 13.5px;
  line-height: 1.65;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* ── Blockquotes ──────────────────────────────────────────── */
blockquote {
  border-left: 3px solid #d4cfc4;
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: #5a5650;
  font-style: italic;
}

/* ── Tables ───────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 1.5rem 0;
}

th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a8680;
  border-bottom: 2px solid #d4cfc4;
  padding: 0.5rem 0.75rem;
}

td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #ede9e0;
  color: #2a2a28;
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

/* ── Links ────────────────────────────────────────────────── */
#content a {
  color: #3a5a8a;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}

#content a:hover { color: #1a3a6a; }

/* ── Footer ───────────────────────────────────────────────── */
#postamble {
  border-top: 1px solid #d4cfc4;
  text-align: center;
  padding: 1.5rem 2rem;
  font-size: 13px;
  color: #8a8680;
  background: #f7f5f0;
}

/* ── Org-mode specifics ───────────────────────────────────── */
.org-src-container { margin: 1.5rem 0; }

.tag {
  font-size: 11px;
  background: #ede9e0;
  color: #6b6860;
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  font-family: 'Source Serif 4', serif;
  margin-left: 6px;
}

/* Date dans les articles */
#content .org-agenda-date,
.date {
  font-size: 13px;
  color: #8a8680;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 1.5rem;
}

/* TOC si activé */
#table-of-contents {
  background: #ede9e0;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  font-size: 15px;
}

#table-of-contents h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a8680;
  margin: 0 0 0.75rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  h1.title { font-size: 28px; }
  #content { padding: 2rem 1.25rem; }
  #preamble { padding: 0 1.25rem; }
  pre { font-size: 12.5px; padding: 1rem; }
}

/* ── Layout deux colonnes ─────────────────────────────────── */
body {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
}

/* Sur grands écrans : colonne principale + sidebar */
@media (min-width: 1100px) {
  body {
    grid-template-columns: 1fr 220px;
    grid-template-areas:
      "header  header"
      "content sidebar"
      "footer  footer";
    gap: 0 3rem;
    max-width: 1140px;
    margin: 0 auto;
  }

  #preamble  { grid-area: header; }
  #content   { grid-area: content; }
  #sidebar   { grid-area: sidebar; padding-top: 3rem; }
  #postamble { grid-area: footer; }
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  font-size: 14px;
  align-self: start;
  position: sticky;
  top: 80px;
}

.sidebar-section { margin-bottom: 2rem; }

.sidebar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8a8680;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ddd9d0;
}

#sidebar a {
  display: block;
  color: #4a4540;
  text-decoration: none;
  padding: 0.25rem 0;
  font-size: 14px;
  line-height: 1.4;
  transition: color 0.15s;
}

#sidebar a:hover { color: #1a1a18; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; }

.tag-cloud .tag {
  display: inline-block;
  font-size: 11px;
  background: #ede9e0;
  color: #6b6860;
  padding: 2px 8px;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.15s;
}

.tag-cloud .tag:hover { background: #d4cfc4; color: #1a1a18; }

@media (max-width: 1099px) {
  #sidebar { display: none; }
}
