/* Okyline Documentation Style */
/* Compatible Pandoc - Intégration site web */

:root {
  --primary-orange: #f97316;
  --primary-orange-dark: #ea580c;
  --primary-coral: #fb7185;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --border-light: #e5e7eb;
  --code-bg: #f3f4f6;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-light);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-dark);
  background: var(--bg-white);
  max-width: 1100px;
  margin: 40px auto;
  padding: 60px 80px;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

/* Mettre le titre h1 avant le TOC */
body > h1:first-of-type {
  order: -2;
  margin-bottom: 1.2em;
}

body > nav#TOC {
  order: -1;
}

/* Titres */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-dark);
  font-weight: 600;
  margin-top: 1.4em;
  margin-bottom: 0.5em;
  line-height: 1.25;
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-top: 0;
  padding-bottom: 0.4em;
  border-bottom: 2px solid var(--border-light);
}

h2 {
  font-size: 1.6rem;
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--border-light);
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Paragraphes */
p {
  margin-bottom: 0.8em;
  color: var(--text-dark);
}

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

a:hover {
  color: var(--primary-coral);
  text-decoration: underline;
}

/* Table des matières (TOC) */
nav#TOC {
  background: var(--bg-light);
  padding: 16px 24px;
  border-radius: var(--radius);
  margin-bottom: 1.5em;
  border-left: 4px solid var(--primary-orange);
}

nav#TOC > ul {
  margin: 0;
  padding-left: 0;
}

nav#TOC ul {
  list-style: none;
  padding-left: 1.2em;
}

nav#TOC > ul > li {
  padding-left: 0;
}

nav#TOC li {
  margin: 0.2em 0;
}

nav#TOC a {
  color: var(--text-dark);
  font-weight: 500;
}

nav#TOC ul ul ul a {
  font-weight: 400;
}

nav#TOC a:hover {
  color: var(--primary-orange);
}

/* Code inline */
code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.2em 0.5em;
  border-radius: 6px;
  color: var(--primary-orange-dark);
  font-weight: 500;
}

/* Blocs de code */
pre {
  background: #f8f9fa;
  color: var(--text-dark);
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 1em 0;
  border: 1px solid var(--border-light);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: 500;
}

/* Pandoc syntax highlighting - améliorer les couleurs */
pre code .kw { color: #d946ef; }  /* keywords - violet */
pre code .dt { color: #0891b2; }  /* data types - cyan */
pre code .st { color: #059669; }  /* strings - vert */
pre code .co, code span.co { color: #6b7280 !important; font-weight: 500 !important; font-style: italic !important; }  /* comments - gris */
code span.al { color: #6b7280 !important; font-weight: 500 !important; font-style: italic !important; }  /* alerts (used for // comments) - gris */
pre code .dv, pre code .fl { color: #f97316; }  /* numbers - orange */
pre code .op { color: #1f2937; }  /* operators */
pre code .at { color: #2563eb; }  /* attributes - bleu */

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95rem;
}

thead {
  background: var(--bg-light);
}

th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border-light);
}

td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light);
}

tr:hover {
  background: var(--bg-light);
}

/* Listes */
ul, ol {
  padding-left: 1.6em;
  margin-bottom: 0.8em;
}

li {
  margin: 0.25em 0;
}

li > ul, li > ol {
  margin-top: 0.25em;
  margin-bottom: 0;
}

/* Blockquotes */
blockquote {
  margin: 1em 0;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(251, 113, 133, 0.08));
  border-left: 4px solid var(--primary-orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dark);
}

blockquote p {
  margin: 0;
}

/* Séparateurs */
hr {
  border: none;
  height: 1px;
  background: var(--border-light);
  margin: 2em 0;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* Definition lists */
dt {
  font-weight: 600;
  margin-top: 1em;
}

dd {
  margin-left: 1.5em;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  body {
    margin: 20px 10px;
    padding: 30px 24px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

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

/* Print */
@media print {
  html, body {
    background: white;
  }

  body {
    box-shadow: none;
    margin: 0;
    padding: 0;
    max-width: none;
  }
}
