/* Luna Invicta — site des transcripts. Design minimaliste, thème clair/sombre. */

:root {
  --bg: #fbfaf7;
  --bg-soft: #f1eee6;
  --fg: #1d1b18;
  --fg-soft: #5a554d;
  --muted: #8a837a;
  --accent: #7a4f2a;        /* brun chaud, rappelle la lune / le cuir */
  --accent-soft: #d9c7b3;
  --border: #e3ddd2;
  --link: #7a4f2a;
  --link-hover: #a35f33;
  --code-bg: #f0ece3;
  --maxw: 44rem;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
}

[data-theme="dark"] {
  --bg: #18171a;
  --bg-soft: #221f24;
  --fg: #ece8e1;
  --fg-soft: #b3aca1;
  --muted: #847d74;
  --accent: #d6a877;
  --accent-soft: #4a3724;
  --border: #322e35;
  --link: #e0b384;
  --link-hover: #f0c897;
  --code-bg: #221f24;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
               Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--link-hover); }

/* --- header --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--fg);
}
.brand:hover { color: var(--accent); }

.theme-toggle {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--fg-soft);
  border-radius: 999px;
  width: 2.1rem;
  height: 2.1rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, border-color .15s;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}

/* --- layout --- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--muted);
}
.site-footer p { margin: .3rem 0; }

/* --- intro / accueil --- */
.intro h1 {
  font-size: 2.4rem;
  margin: 1.5rem 0 .2rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.intro .subtitle {
  margin: 0 0 1.5rem;
  color: var(--accent);
  font-size: 1.05rem;
  font-style: italic;
}
.intro p { margin: .8rem 0; }

.dim { color: var(--muted); font-size: .9rem; }

.episodes { margin-top: 2.5rem; }

.note-transcription {
  margin-top: 2.5rem;
  padding: 1.1rem 1.2rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  color: var(--fg-soft);
}
.note-transcription h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 .5rem;
  color: var(--fg);
}
.note-transcription p { margin: .4rem 0; line-height: 1.6; }
.episodes h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 .8rem;
  color: var(--fg-soft);
}

.episode-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.episode-item {
  border-bottom: 1px solid var(--border);
}
.episode-item a {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: .7rem .2rem;
  text-decoration: none;
  color: var(--fg);
  transition: background .12s;
}
.episode-item a:hover { background: var(--bg-soft); }
.ep-num {
  color: var(--muted);
  font-size: .85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .02em;
}
.ep-title { font-weight: 500; }
.ep-meta {
  color: var(--muted);
  font-size: .8rem;
  white-space: nowrap;
}

@media (max-width: 30rem) {
  .episode-item a {
    grid-template-columns: 1fr;
    gap: .1rem;
  }
  .ep-meta { font-size: .75rem; }
}

/* --- page épisode --- */
.episode .back {
  margin: 1.5rem 0 1rem;
  font-size: .9rem;
}
.episode .back a { text-decoration: none; color: var(--muted); }
.episode .back a:hover { color: var(--link); }

.episode h1 {
  font-size: 1.9rem;
  font-weight: 600;
  margin: .2rem 0 1rem;
  line-height: 1.2;
}

.meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .25rem 1rem;
  margin: 1rem 0 1.2rem;
  padding: 1rem 1.1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
}
.meta dt {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .72rem;
}
.meta dd { margin: 0; }

.description {
  font-style: italic;
  color: var(--fg-soft);
  margin: 0 0 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent-soft);
}

.transcript-actions {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1.5rem 0 .5rem;
}
.copy-btn,
.download-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .45rem .9rem;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.download-btn { text-decoration: none; display: inline-block; }
.copy-btn:hover,
.download-btn:hover { background: var(--link-hover); }
.copy-btn:active,
.download-btn:active { transform: translateY(1px); }
[data-theme="dark"] .copy-btn,
[data-theme="dark"] .download-btn { color: #1a1612; }

.copy-feedback {
  font-size: .82rem;
  color: var(--muted);
  min-height: 1.1em;
}
.copy-feedback.ok { color: var(--accent); }

.transcript {
  margin-top: .5rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--fg);
}
.transcript p { margin: 0 0 1rem; }
.transcript p:first-letter {
  /* discrète lettrine sur le 1er paragraphe */
}
