/* Scola Dialogica — Thème sombre inspiré du logo */

:root {
  /* Couleurs du logo */
  --bg-dark: #0d1117;
  --bg-alt: #161b22;
  --text: #e6e6e6;
  --text-muted: #8b949e;
  --cyan: #4dc9e6;
  --gold: #d4a574;
  --border: #30363d;
  --max-width: 720px;

  /* Glow effects */
  --glow-cyan: 0 0 20px rgba(77, 201, 230, 0.3);
  --glow-gold: 0 0 20px rgba(212, 165, 116, 0.3);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg-dark);
  margin: 0;
  padding: 0;
}

/* Container principal */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* En-tête avec logo */
header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  width: 48px;
  height: 48px;
}

header h1 {
  font-size: 1.5rem;
  font-weight: normal;
  margin: 0;
  letter-spacing: 0.05em;
}

header h1 a {
  color: var(--text);
  text-decoration: none;
  transition: text-shadow 0.3s ease;
}

header h1 a:hover {
  text-shadow: var(--glow-cyan);
}

/* Navigation */
nav {
  margin-top: 1rem;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-right: 1.5rem;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--cyan);
}

nav a.active {
  color: var(--cyan);
  border-bottom: 1px solid var(--cyan);
}

/* Titres */
h1, h2, h3, h4 {
  font-weight: normal;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 {
  font-size: 1.5rem;
  margin-top: 3rem;
  color: var(--gold);
}
h3 {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--cyan);
}
h4 { font-size: 1rem; }

/* Main h2 sans couleur spéciale */
main > h2:first-of-type {
  color: var(--text);
}

/* Paragraphes */
p {
  margin: 0 0 1.5rem 0;
  text-align: justify;
  hyphens: auto;
}

/* Citations */
blockquote {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--cyan);
  background: var(--bg-alt);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Listes */
ul, ol {
  margin: 1rem 0 1.5rem 0;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Liste corpus */
.corpus-list {
  list-style: none;
  padding-left: 0;
}

.corpus-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.corpus-list li:last-child {
  border-bottom: none;
}

.corpus-list a {
  color: var(--text);
}

.corpus-list a:hover {
  color: var(--cyan);
}

/* Liens */
a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  color: var(--gold);
  text-decoration: none;
}

/* Séparateurs */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* Page d'accueil — Parcours */
.parcours-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

@media (min-width: 600px) {
  .parcours-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.parcours-card {
  border: 1px solid var(--border);
  padding: 1.5rem;
  background: var(--bg-alt);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.parcours-card:hover {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.parcours-card h3 {
  margin-top: 0;
  font-style: normal;
  font-size: 1.1rem;
  color: var(--gold);
}

.parcours-card p {
  font-size: 0.95rem;
  text-align: left;
  margin-bottom: 1rem;
}

.parcours-card .duree {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.parcours-card a.entrer {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.parcours-card a.entrer:hover {
  background: var(--cyan);
  color: var(--bg-dark);
  text-decoration: none;
  box-shadow: var(--glow-cyan);
}

/* Sommaire / Table des matières */
.toc {
  background: var(--bg-alt);
  padding: 1.5rem;
  margin: 2rem 0;
  border: 1px solid var(--border);
}

.toc h4 {
  margin-top: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li {
  margin-bottom: 0.3rem;
}

.toc a {
  color: var(--text);
  font-size: 0.95rem;
}

.toc a:hover {
  color: var(--cyan);
}

/* Navigation document */
.doc-nav {
  display: flex;
  justify-content: space-between;
  margin: 3rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.doc-nav a {
  color: var(--text-muted);
}

.doc-nav a:hover {
  color: var(--cyan);
}

.doc-nav .prev::before { content: "← "; }
.doc-nav .next::after { content: " →"; }

/* Navigation chapitres (style ebook) */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3rem 0 1rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  gap: 1rem;
}

.chapter-nav a,
.chapter-nav span {
  flex: 1;
  text-align: center;
}

.chapter-nav .chapter-prev {
  text-align: left;
}

.chapter-nav .chapter-next {
  text-align: right;
}

.chapter-nav a {
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.chapter-nav a:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  text-decoration: none;
}

.chapter-nav .chapter-home {
  border: none;
  color: var(--gold);
}

.chapter-nav .chapter-home:hover {
  color: var(--cyan);
}

.chapter-nav .disabled {
  visibility: hidden;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Formulaire contact */
.contact-form {
  max-width: 500px;
}

.contact-form label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.7rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form button {
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.contact-form button:hover {
  background: var(--cyan);
  color: var(--bg-dark);
  box-shadow: var(--glow-cyan);
}

/* Italique pour termes techniques */
.terme {
  font-style: italic;
}

/* Petites capitales pour noms propres */
.nom {
  font-variant: small-caps;
}

/* Centré */
.center {
  text-align: center;
}

/* Note de bas de page */
.note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Épigraphe */
.epigraphe {
  font-style: italic;
  text-align: right;
  margin: 2rem 0 3rem 0;
  font-size: 0.95rem;
  color: var(--gold);
}

/* Spirale décorative subtile */
.spiral-bg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  opacity: 0.03;
  pointer-events: none;
  z-index: -1;
}

/* Strong/bold avec couleur */
strong, b {
  color: var(--gold);
  font-weight: normal;
}

/* Code inline */
code {
  background: var(--bg-alt);
  padding: 0.2rem 0.4rem;
  font-size: 0.9em;
  border-radius: 3px;
}

/* Selection */
::selection {
  background: var(--cyan);
  color: var(--bg-dark);
}

/* Print */
@media print {
  body {
    font-size: 12pt;
    background: white;
    color: black;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  nav, .doc-nav, footer, .spiral-bg {
    display: none;
  }

  a {
    color: black;
  }

  h2, h3, .epigraphe, strong, b {
    color: black;
  }
}
