/* ─────────────────────────────────────────────────────────
   Raspberry Pi Experiments — raguenaud.earth family style
   ───────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=Outfit:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:          #fafaf8;
  --bg-alt:      #f2f2ef;
  --surface:     #ffffff;
  --border:      #e2e2dc;
  --text:        #1c1c1a;
  --text-muted:  #7a7a72;
  --accent:      #c5003e;
  --accent-soft: #f7e8ec;
  --code-bg:     #1e1e2e;
  --code-text:   #cdd6f4;
  --radius:      8px;
  --max-w:       720px;
  --transition:  0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Site Header ───────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: calc(var(--max-w) + 80px);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.site-logo__monogram {
  width: 34px;
  height: 34px;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.5px;
  transition: background var(--transition);
}

.site-logo:hover .site-logo__monogram {
  background: var(--accent);
}

.site-logo__text {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
}

.site-logo__sub {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  display: block;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 20px;
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.02em;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.site-nav a.active {
  color: var(--accent);
}

/* ── Page Wrapper ──────────────────────────────────────── */
.page-wrap {
  max-width: calc(var(--max-w) + 80px);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Hero / Page Title ─────────────────────────────────── */
.page-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.page-hero__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.page-hero__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}

.page-hero__title em {
  font-style: italic;
  color: var(--accent);
}

.page-hero__sub {
  margin-top: 14px;
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 480px;
}

/* ── Series Tags ───────────────────────────────────────── */
.series-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.series-tag {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.series-tag:hover, .series-tag.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── Post List ─────────────────────────────────────────── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  align-items: start;
}

.post-item:hover {
  background: transparent;
}

.post-item:hover .post-item__title {
  color: var(--accent);
}

.post-item__date-col {
  text-align: right;
  padding-top: 3px;
}

.post-item__date {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}

.post-item__series {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 4px;
}

.post-item__content {}

.post-item__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  transition: color var(--transition);
  margin-bottom: 6px;
}

.post-item__excerpt {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.6;
}

/* ── Single Post ───────────────────────────────────────── */
.post-header {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.post-header__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color var(--transition);
  letter-spacing: 0.01em;
}

.post-header__back:hover { color: var(--accent); }

.post-header__back svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  transition: transform var(--transition);
}

.post-header__back:hover svg { transform: translateX(-3px); }

.post-header__series {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.post-header__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 14px;
}

.post-header__meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.post-header__meta span::before {
  content: '·';
  margin-right: 16px;
  opacity: 0.4;
}

.post-header__meta span:first-child::before { display: none; }

/* ── Post Body ─────────────────────────────────────────── */
.post-body {
  max-width: var(--max-w);
  padding-bottom: 64px;
}

.post-body p {
  margin-bottom: 1.4em;
  font-size: 16px;
  line-height: 1.75;
}

.post-body p:last-child { margin-bottom: 0; }

.post-body h2, .post-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  margin: 2em 0 0.6em;
  color: var(--text);
  line-height: 1.25;
}

.post-body h2 { font-size: 1.7rem; }
.post-body h3 { font-size: 1.3rem; }

.post-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.post-body a:hover { border-bottom-color: var(--accent); }

.post-body strong { font-weight: 600; }
.post-body em { font-style: italic; }

/* ── Code ──────────────────────────────────────────────── */
.post-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.825em;
  background: var(--bg-alt);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

.post-body pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.8em 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  border-left: 3px solid var(--accent);
}

.post-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* ── Images ────────────────────────────────────────────── */
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.6em 0;
  display: block;
  border: 1px solid var(--border);
}

.post-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 1.6em 0;
}

.post-img-grid img {
  margin: 0;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.img-caption {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: -8px;
  margin-bottom: 1.4em;
  padding-left: 4px;
}

/* ── Note / Aside ──────────────────────────────────────── */
.post-note {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.6em 0;
  font-size: 14px;
  color: var(--text);
}

/* ── Post Nav (prev/next) ──────────────────────────────── */
.post-nav {
  display: flex;
  gap: 16px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  max-width: var(--max-w);
  margin-top: 0;
}

.post-nav__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.post-nav__btn:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(197,0,62,0.08);
}

.post-nav__btn--next { text-align: right; }

.post-nav__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.post-nav__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

/* ── Footer ────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 32px 0;
}

.site-footer__inner {
  max-width: calc(var(--max-w) + 80px);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer__copy {
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer__links {
  display: flex;
  gap: 20px;
}

.site-footer__links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* ── Index Stats bar ───────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 36px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat__num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.stat__label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── Raspberry Pi icon SVG accent ──────────────────────── */
.pi-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 20px;
}

/* ── Language Switching ────────────────────────────────── */
html[lang="en"] [lang="fr"] { display: none !important; }
html[lang="fr"] [lang="en"] { display: none !important; }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.lang-btn {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.6;
}

.lang-btn:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.lang-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-header__inner { height: 54px; }
  .site-logo__text span.site-logo__sub { display: none; }
  .site-nav a { padding: 4px 8px; }

  .page-hero { padding: 36px 0 28px; }

  .post-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .post-item__date-col {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .post-item__series { margin-top: 0; }

  .post-nav { flex-direction: column; }

  .stats-bar { gap: 20px; }

  pre { font-size: 0.75rem; padding: 14px 16px; }
}

@media (max-width: 400px) {
  .site-nav { display: none; }
}
