gitrust-branding.css 382 lignes · 11338 octets
/* =====================================================================
   Gitrust branding — override du thème mdBook pour aligner la doc
   sur la charte graphique de gitrust.eu
   (palette rouille/ambre/teal sur fond beige, no CDN, no framework JS)
   ===================================================================== */

/* ---- Polices ---- */
:root {
  --gitrust-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gitrust-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- Palette gitrust ---- */
  --gitrust-cream:       #fbf6ee;
  --gitrust-ink:         #2b2b3c;
  --gitrust-ink-soft:    #3a3a4a;
  --gitrust-ink-mute:    #4a4a5c;
  --gitrust-rust:        #b7410e;
  --gitrust-rust-hover:  #d4501a;
  --gitrust-rust-tint:   rgba(183, 65, 14, 0.10);
  --gitrust-rust-border: rgba(183, 65, 14, 0.20);
  --gitrust-line:        rgba(43, 43, 60, 0.12);
  --gitrust-line-soft:   rgba(43, 43, 60, 0.08);
  --gitrust-card:        rgba(255, 255, 255, 0.70);
  --gitrust-card-soft:   rgba(255, 255, 255, 0.50);
  --gitrust-shadow:      0 2px 12px rgba(43, 43, 60, 0.05);
  --gitrust-shadow-hv:   0 6px 20px rgba(43, 43, 60, 0.10);
}

/* ===================================================================
   Thème CLAIR — override des variables mdBook
   =================================================================== */
.light,
html.light {
  --bg: var(--gitrust-cream);
  --fg: var(--gitrust-ink);

  --sidebar-bg: rgba(255, 252, 245, 0.92);
  --sidebar-fg: var(--gitrust-ink);
  --sidebar-non-existant: #b5b3a8;
  --sidebar-active: var(--gitrust-rust);
  --sidebar-spacer: var(--gitrust-line-soft);

  --scrollbar: rgba(43, 43, 60, 0.22);

  --icons: var(--gitrust-ink-soft);
  --icons-hover: var(--gitrust-rust);

  --links: var(--gitrust-rust);

  --inline-code-color: var(--gitrust-rust);

  --theme-popup-bg: #fff8ec;
  --theme-popup-border: var(--gitrust-line);
  --theme-hover: var(--gitrust-rust-tint);

  --quote-bg: rgba(255, 255, 255, 0.55);
  --quote-border: var(--gitrust-rust);

  --table-border-color: var(--gitrust-line);
  --table-header-bg: rgba(183, 65, 14, 0.08);
  --table-alternate-bg: rgba(255, 255, 255, 0.45);

  --searchbar-border-color: var(--gitrust-line);
  --searchbar-bg: rgba(255, 255, 255, 0.75);
  --searchbar-fg: var(--gitrust-ink);
  --searchbar-shadow-color: rgba(43, 43, 60, 0.08);
  --searchresults-header-fg: var(--gitrust-ink-mute);
  --searchresults-border-color: var(--gitrust-line);
  --searchresults-li-bg: rgba(255, 255, 255, 0.6);
  --search-mark-bg: rgba(240, 150, 40, 0.45);

  --warning-border: var(--gitrust-rust);
}

/* ===================================================================
   Thème SOMBRE ("ayu" / "navy") — palette inversée adaptée
   =================================================================== */
.ayu, .navy, .coal,
html.ayu, html.navy, html.coal {
  --bg: #1c1b22;
  --fg: #f0e7d8;

  --sidebar-bg: #171720;
  --sidebar-fg: #d9cdb8;
  --sidebar-non-existant: #6a6a75;
  --sidebar-active: #ff8e3c;
  --sidebar-spacer: rgba(255, 255, 255, 0.07);

  --scrollbar: rgba(255, 255, 255, 0.18);

  --icons: #c8c0af;
  --icons-hover: #ff8e3c;

  --links: #ffb066;

  --inline-code-color: #ffb066;

  --theme-popup-bg: #23222b;
  --theme-popup-border: rgba(255, 255, 255, 0.08);
  --theme-hover: rgba(255, 142, 60, 0.14);

  --quote-bg: rgba(255, 255, 255, 0.04);
  --quote-border: #ff8e3c;

  --table-border-color: rgba(255, 255, 255, 0.08);
  --table-header-bg: rgba(255, 142, 60, 0.12);
  --table-alternate-bg: rgba(255, 255, 255, 0.03);

  --searchbar-border-color: rgba(255, 255, 255, 0.10);
  --searchbar-bg: rgba(255, 255, 255, 0.04);
  --searchbar-fg: var(--fg);
  --search-mark-bg: rgba(255, 142, 60, 0.45);

  --warning-border: #ff8e3c;
}

/* ===================================================================
   Fond radial façon gitrust.eu (clair uniquement)
   =================================================================== */
html.light body,
.light body {
  position: relative;
}
html.light body::before,
.light body::before {
  content: "";
  position: fixed;
  inset: -30%;
  z-index: -2;
  background:
    radial-gradient(ellipse 120% 90% at 12% 12%,  rgba(240, 150, 40, 0.28),  transparent 55%),
    radial-gradient(ellipse  95% 110% at 88% 18%, rgba(255, 200, 120, 0.38), transparent 60%),
    radial-gradient(ellipse 100% 80% at 50% 80%,  rgba(183, 65, 14, 0.14),   transparent 60%),
    radial-gradient(ellipse  80% 100% at 78% 85%, rgba(80, 180, 180, 0.18),  transparent 55%),
    radial-gradient(ellipse  70% 90% at 5% 60%,   rgba(255, 220, 150, 0.32), transparent 55%);
  filter: blur(60px);
  pointer-events: none;
}

/* ===================================================================
   Typographie
   =================================================================== */
html {
  font-size: 112.5%; /* 18px base au lieu de 16px */
}
@media (min-width: 1200px) {
  html { font-size: 118.75%; } /* 19px sur écran large */
}

html, body {
  font-family: var(--gitrust-sans);
}
.content {
  font-size: 1.0625rem; /* ~20.2px pour le corps de doc */
  line-height: 1.7;
}
code, pre, .hljs, .mono, kbd {
  font-family: var(--gitrust-mono);
}

/* Titres — recalibrés pour la nouvelle base */
.content h1 { font-size: 2.25rem; margin-top: 1.5em; }
.content h2 { font-size: 1.7rem; }
.content h3 { font-size: 1.3rem; }
.content h4 { font-size: 1.1rem; }

.content h1, .content h2, .content h3, .content h4 {
  letter-spacing: -0.01em;
}
.content h1 {
  border-bottom: 1px solid var(--gitrust-line);
  padding-bottom: 0.3em;
}
.content h2 {
  margin-top: 2em;
}
.content h1, .content h2 {
  color: var(--fg);
}
.content h3, .content h4 {
  color: var(--gitrust-rust);
}
.ayu .content h3, .navy .content h3, .coal .content h3,
.ayu .content h4, .navy .content h4, .coal .content h4 {
  color: #ff8e3c;
}

/* Liens inline */
.content a:link,
.content a:visited {
  color: var(--links);
  text-decoration: none;
  border-bottom: 1px dashed rgba(183, 65, 14, 0.35);
  transition: color 0.15s, border-color 0.15s;
}
.content a:hover {
  color: var(--gitrust-rust-hover);
  border-bottom-color: currentColor;
}

/* ===================================================================
   Sidebar — style gitrust (translucide + accent rouille)
   =================================================================== */
.sidebar {
  border-right: 1px solid var(--gitrust-line-soft);
}
.sidebar .chapter li.chapter-item {
  margin: 0;
}
.sidebar .chapter li a {
  padding: 0.35em 0.75em;
  border-radius: 0.3rem;
  transition: background 0.12s, color 0.12s;
}
.sidebar .chapter li a:hover {
  background: var(--gitrust-rust-tint);
  color: var(--gitrust-rust);
}
.sidebar .chapter li.chapter-item a.active {
  color: var(--gitrust-rust);
  background: var(--gitrust-rust-tint);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--gitrust-rust);
}
.ayu .sidebar .chapter li.chapter-item a.active,
.navy .sidebar .chapter li.chapter-item a.active,
.coal .sidebar .chapter li.chapter-item a.active {
  color: #ff8e3c;
  background: rgba(255, 142, 60, 0.12);
  box-shadow: inset 2px 0 0 #ff8e3c;
}

.sidebar .part-title {
  display: block;
  margin: 1.5em 0.5em 0.6em 0.5em;
  padding: 0.7em 1em;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--gitrust-rust) 0%, var(--gitrust-rust-hover) 100%);
  border-radius: 0.4rem;
  box-shadow: 0 2px 8px rgba(183, 65, 14, 0.25);
}
.sidebar .part-title:first-child {
  margin-top: 0.5em;
}
.ayu .sidebar .part-title,
.navy .sidebar .part-title,
.coal .sidebar .part-title {
  background: linear-gradient(135deg, #ff8e3c 0%, #d4501a 100%);
  color: #1c1b22;
  box-shadow: 0 2px 8px rgba(255, 142, 60, 0.35);
}

/* ===================================================================
   Top bar (mdbook-toolbar / menu-bar)
   =================================================================== */
#menu-bar,
.menu-bar {
  border-bottom: 1px solid var(--gitrust-line-soft);
  background: rgba(255, 252, 245, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ayu #menu-bar, .navy #menu-bar, .coal #menu-bar,
.ayu .menu-bar, .navy .menu-bar, .coal .menu-bar {
  background: rgba(23, 23, 32, 0.85);
}

/* ===================================================================
   Contenu — cards, blockquotes, tables, code
   =================================================================== */
.content blockquote {
  background: var(--quote-bg);
  border-left: 3px solid var(--quote-border);
  padding: 0.9em 1.1em;
  margin: 1.25em 0;
  border-radius: 0.4rem;
  box-shadow: var(--gitrust-shadow);
}

.content table {
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 0.4rem;
  box-shadow: var(--gitrust-shadow);
}
.content th {
  background: var(--table-header-bg);
  color: var(--gitrust-rust);
  font-weight: 600;
}
.ayu .content th, .navy .content th, .coal .content th {
  color: #ff8e3c;
}
.content tr:nth-child(even) td {
  background: var(--table-alternate-bg);
}

/* Code inline */
.content :not(pre) > code {
  background: var(--gitrust-rust-tint);
  color: var(--gitrust-rust);
  padding: 0.1em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.92em;
  border: 1px solid var(--gitrust-rust-border);
}
.ayu .content :not(pre) > code,
.navy .content :not(pre) > code,
.coal .content :not(pre) > code {
  background: rgba(255, 142, 60, 0.14);
  color: #ff8e3c;
  border: 1px solid rgba(255, 142, 60, 0.25);
}

/* Code block */
.content pre {
  border-radius: 0.5rem;
  box-shadow: var(--gitrust-shadow);
  border: 1px solid var(--gitrust-line-soft);
}
.content pre > code {
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ===================================================================
   Boutons CTA (bouton "edit" + "print")
   =================================================================== */
.menu-bar .right-buttons a,
.menu-bar a.icon-button {
  color: var(--gitrust-ink-soft);
  transition: color 0.12s, background 0.12s;
  border-radius: 0.3rem;
}
.menu-bar .right-buttons a:hover,
.menu-bar a.icon-button:hover {
  color: var(--gitrust-rust);
  background: var(--gitrust-rust-tint);
}

/* ===================================================================
   Page title / nav / footer
   =================================================================== */
.nav-chapters {
  color: var(--gitrust-ink-soft);
}
.nav-chapters:hover {
  color: var(--gitrust-rust);
}

/* Mermaid : harmoniser le fond des diagrammes */
.mermaid {
  background: var(--gitrust-card);
  border: 1px solid var(--gitrust-line-soft);
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: var(--gitrust-shadow);
}
.ayu .mermaid, .navy .mermaid, .coal .mermaid {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Badge "Gitrust" dans le menu en haut (ajouté via index.hbs plus tard si besoin) */
.gitrust-wordmark {
  font-family: var(--gitrust-mono);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gitrust-ink);
}
.gitrust-wordmark .rust { color: var(--gitrust-rust); }

/* Focus accessibilité */
:focus-visible {
  outline: 2px solid var(--gitrust-rust);
  outline-offset: 2px;
}