/* ==========================================================================
   Artaun Hosting — Documentation
   Style sobre et professionnel façon GitBook/Docusaurus — pas d'effet de
   verre, pas de glow, un seul accent de couleur utilisé avec parcimonie.
   ========================================================================== */

:root {
  color-scheme: light;

  --paper:     #ffffff;
  --ink:       #14151a;
  --ink-soft:  #3a3c46;
  --muted:     #6b6d78;
  --line:      #e7e7ec;
  --line-soft: #f0f0f4;

  --brand:      #2f6feb;
  --brand-hi:   #1d55c9;
  --brand-ink:  #ffffff;
  --brand-wash: #eef3fe;

  --surface:   #ffffff;
  --surface-2: #f6f6f8;
  --code-bg:   #f3f3f6;

  --warn-bg: #fdf5e6; --warn-ink: #8a5a0a; --warn-line: #f0dcb0;
  --tip-bg:  #eef3fe; --tip-ink:  #1d4ed8; --tip-line:  #d3e0fb;
  --info-bg: #f0f6f0; --info-ink: #2f7a3d; --info-line: #d3ead6;

  --shadow-sm: 0 1px 2px rgba(20, 21, 26, .06);
  --shadow:    0 10px 24px -12px rgba(20, 21, 26, .18);

  --r-sm: 7px;
  --r:    10px;
  --r-lg: 14px;

  --f-display: "Space Grotesk", system-ui, sans-serif;
  --f-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  --hdr-h: 58px;
  --sidebar-w: 268px;
  --toc-w: 216px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper:     #121317;
  --ink:       #eeeef1;
  --ink-soft:  #cfd0d6;
  --muted:     #92939c;
  --line:      #26272e;
  --line-soft: #1c1d23;

  --brand:      #5b8def;
  --brand-hi:   #7ba4f2;
  --brand-ink:  #0d1420;
  --brand-wash: #182335;

  --surface:   #17181d;
  --surface-2: #1c1d23;
  --code-bg:   #1a1b21;

  --warn-bg: #241c0e; --warn-ink: #e3ab54; --warn-line: #3d3018;
  --tip-bg:  #14203a; --tip-ink:  #8fb0f7; --tip-line:  #223458;
  --info-bg: #14251a; --info-ink: #79c98c; --info-line: #234030;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow:    0 16px 32px -16px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; color: var(--ink); line-height: 1.25; }
button { font-family: inherit; }
svg { width: 1em; height: 1em; }

.only-mobile { display: none !important; }
@media (max-width: 900px) { .only-desktop { display: none !important; } .only-mobile { display: inline-flex !important; } }

/* ----------------------------------------------------------------- Topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--hdr-h);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  height: 100%; width: 100%; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: relative;
}
.topbar-left { display: flex; align-items: center; gap: 22px; min-width: 0; }
.topbar-center {
  display: flex; justify-content: center;
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  pointer-events: none;
}
.topbar-center .search-wrap { pointer-events: auto; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }

.brand { display: flex; align-items: center; gap: 9px; font-family: var(--f-display); font-weight: 700; font-size: 16px; color: var(--ink); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; display: block; }

.topbar-links { display: flex; align-items: center; gap: 4px; }
.topbar-links a { padding: 7px 10px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--muted); }
.topbar-links a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.topbar-links a.is-active { color: var(--brand); }

.search-wrap { position: relative; width: 100%; max-width: 480px; }
.search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search-input {
  width: 100%; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); padding: 0 12px 0 34px; font-size: 13.6px;
}
.search-input:focus { outline: none; border-color: var(--brand); background: var(--paper); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); max-height: 360px; overflow-y: auto; z-index: 50;
}
.search-results a { display: block; padding: 10px 14px; color: var(--ink); font-size: 14px; border-bottom: 1px solid var(--line-soft); }
.search-results a:hover { background: var(--brand-wash); text-decoration: none; }
.search-results a small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.search-results .search-empty { padding: 14px; color: var(--muted); font-size: 13.5px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--ink-soft); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .flag { width: 23px; height: 16px; border-radius: 2px; }

#themeToggle .ic-moon { display: none; }
[data-theme="dark"] #themeToggle .ic-sun { display: none; }
[data-theme="dark"] #themeToggle .ic-moon { display: inline-flex; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 168px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 6px; display: none; z-index: 50;
}
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); font-size: 13.6px; }
.dropdown-item:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-item.is-active { color: var(--brand); font-weight: 600; }
.dropdown-item .flag { width: 19px; height: 13px; border-radius: 2px; }
.dropdown-item svg:last-child { width: 13px; height: 13px; margin-left: auto; }

/* ------------------------------------------------------------------ Shell */
.shell { display: flex; width: 100%; align-items: flex-start; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: var(--hdr-h); height: calc(100vh - var(--hdr-h));
  overflow-y: auto; padding: 22px 12px 40px;
  border-right: 1px solid var(--line);
}
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar-home {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--ink-soft); font-size: 13.8px; font-weight: 500; margin-bottom: 4px;
}
.sidebar-home svg { width: 15px; height: 15px; }
.sidebar-home:hover, .sidebar-home.is-active { background: var(--brand-wash); color: var(--brand); text-decoration: none; }
.sidebar-home + .sidebar-home { margin-bottom: 14px; }

.nav-category-toggle {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border: none; background: transparent; border-radius: var(--r-sm); cursor: pointer;
  color: var(--ink); font-size: 14px; font-weight: 600; text-align: left; margin-top: 6px;
}
.nav-category-toggle:hover { background: var(--surface-2); }
.nav-category-icon { display: inline-flex; width: 16px; height: 16px; flex-shrink: 0; color: var(--brand); }
.nav-category-icon svg { width: 16px; height: 16px; }
.nav-chevron { margin-left: auto; width: 13px; height: 13px; color: var(--muted); transition: transform .15s; }
.nav-chevron svg { width: 13px; height: 13px; }
.nav-category.is-open .nav-chevron { transform: rotate(90deg); }
.nav-category.is-open > .nav-category-toggle { color: var(--brand); }

.nav-articles { list-style: none; margin: 2px 0 6px; padding-left: 29px; border-left: 1px solid var(--line); }
.nav-articles li { margin: 0; }
.nav-articles a {
  display: block; padding: 5.5px 10px; margin-left: -1px; border-left: 2px solid transparent;
  color: var(--muted); font-size: 13.4px; line-height: 1.4; border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.nav-articles a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav-articles a.is-active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; background: var(--brand-wash); }

.sidebar-scrim { display: none; }

.main { flex: 1; min-width: 0; padding: 44px 32px 90px; }

/* -------------------------------------------------------------- Home page */
.page-home { max-width: 1120px; margin: 0 auto; }
.hero-banner {
  display: flex; align-items: center; gap: 22px;
  padding: 30px 32px; margin-bottom: 34px; width: 100%;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.hero-banner img { width: 56px; height: 56px; border-radius: 13px; flex-shrink: 0; }
.hero-banner h1 { font-size: clamp(24px, 3.4vw, 30px); margin: 0 0 6px; }
.hero-banner p { color: var(--muted); font-size: 15.5px; margin: 0; max-width: 60ch; }

.hero { max-width: 760px; margin: 0 auto 36px; text-align: left; }
.hero h1 { font-size: clamp(26px, 4vw, 34px); margin: 0 0 10px; }
.hero p { color: var(--muted); font-size: 16px; max-width: 60ch; margin: 0; }
.hero-compact { margin-bottom: 30px; }

.section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 12px; }

.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 12px; width: 100%; margin-bottom: 34px;
}
.cat-card {
  display: flex; flex-direction: column; gap: 12px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  color: var(--ink); position: relative;
}
.cat-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); text-decoration: none; }
.cat-card-icon { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 9px; background: var(--brand-wash); color: var(--brand); }
.cat-card-icon svg { width: 18px; height: 18px; }
.cat-card-title { font-family: var(--f-display); font-weight: 600; font-size: 15.5px; }
.cat-card-count { color: var(--muted); font-size: 12.6px; }

.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; width: 100%; }
.quick-link { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); font-size: 14px; font-weight: 500; }
.quick-link:hover { border-color: var(--brand); background: var(--brand-wash); text-decoration: none; }
.quick-link svg { width: 16px; height: 16px; color: var(--brand); flex-shrink: 0; }

/* ---------------------------------------------------------- Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

/* --------------------------------------------------------- Category page */
.page-category { max-width: 760px; margin: 0 auto; }
.category-hero { padding: 4px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 26px; display: flex; align-items: center; gap: 14px; }
.category-hero-icon { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 11px; background: var(--brand-wash); color: var(--brand); flex-shrink: 0; }
.category-hero-icon svg { width: 22px; height: 22px; }
.category-hero h1 { margin: 0 0 3px; font-size: 24px; }
.category-hero p { color: var(--muted); margin: 0; font-size: 13.5px; }

.article-list { display: flex; flex-direction: column; gap: 8px; }
.article-card {
  display: flex; flex-direction: column; gap: 3px; padding: 15px 18px;
  border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); background: var(--surface);
}
.article-card:hover { border-color: var(--brand); text-decoration: none; background: var(--brand-wash); }
.article-card-title { font-weight: 600; font-size: 15px; }
.article-card-desc { color: var(--muted); font-size: 13.6px; }

/* ----------------------------------------------------------- Article page */
.page-article { display: flex; gap: 40px; align-items: flex-start; max-width: 1060px; margin: 0 auto; }
.article { flex: 1; min-width: 0; max-width: 760px; }

.article h1 { font-size: 28px; margin: 0 0 22px; }

.callout {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: var(--r);
  border: 1px solid var(--line); margin: 18px 0; font-size: 14.3px;
}
.callout svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; }
.callout p { margin: 0; }
.callout-tip  { background: var(--tip-bg);  color: var(--tip-ink);  border-color: var(--tip-line); }
.callout-warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.callout-info { background: var(--info-bg); color: var(--info-ink); border-color: var(--info-line); }

.article-body { font-size: 15.8px; line-height: 1.75; color: var(--ink-soft); }
.article-body h2 { font-size: 21px; margin: 38px 0 13px; scroll-margin-top: calc(var(--hdr-h) + 16px); }
.article-body h3 { font-size: 17.5px; margin: 26px 0 9px; scroll-margin-top: calc(var(--hdr-h) + 16px); }
.article-body p { margin: 0 0 15px; }
.article-body ul, .article-body ol { margin: 0 0 15px; padding-left: 22px; }
.article-body li { margin-bottom: 6px; }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body code { font-family: var(--f-mono); background: var(--code-bg); border-radius: 5px; padding: 2px 6px; font-size: .9em; color: var(--brand-hi); }
.article-body pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 17px; overflow-x: auto; margin: 0 0 18px; }
.article-body pre code { background: none; padding: 0; color: var(--ink-soft); font-size: 13.3px; line-height: 1.6; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line); }
.pager-link { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); flex: 1; max-width: 48%; }
.pager-link:hover { border-color: var(--brand); text-decoration: none; background: var(--brand-wash); }
.pager-link svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); }
.pager-next { margin-left: auto; text-align: right; flex-direction: row-reverse; }
.pager-link small { display: block; color: var(--muted); font-size: 11.6px; }
.pager-link strong { display: block; font-size: 13.6px; font-weight: 600; margin-top: 2px; }

.toc { width: var(--toc-w); flex-shrink: 0; position: sticky; top: calc(var(--hdr-h) + 32px); padding-top: 2px; }
.toc-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 2px 0 2px 14px; color: var(--muted); font-size: 13px; border-left: 2px solid transparent; margin-left: -1px; }
.toc li a:hover { color: var(--brand); text-decoration: none; }
.toc-h3 a { padding-left: 26px; font-size: 12.5px; }

/* -------------------------------------------------------------- Changelog */
.changelog-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; }
.changelog-entry { padding: 26px 0; border-top: 1px solid var(--line); }
.changelog-entry:first-child { border-top: none; padding-top: 0; }
.changelog-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.changelog-date { color: var(--muted); font-size: 13px; font-family: var(--f-mono); }
.changelog-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.changelog-tag svg { width: 11px; height: 11px; }
.tag-added   { background: var(--info-bg); color: var(--info-ink); }
.tag-changed { background: var(--tip-bg);  color: var(--tip-ink); }
.tag-fixed   { background: var(--brand-wash); color: var(--brand-hi); }
.tag-removed { background: var(--warn-bg); color: var(--warn-ink); }
.changelog-entry h2 { font-size: 19px; margin: 0 0 10px; scroll-margin-top: calc(var(--hdr-h) + 16px); }
.changelog-body { font-size: 15px; }
.changelog-empty { color: var(--muted); }

/* -------------------------------------------------------------------- 404 */
.page-404 { max-width: 520px; margin: 60px auto; text-align: center; }
.page-404 h1 { font-size: 26px; }
.page-404 p { color: var(--muted); margin: 10px 0 24px; }
.btn { display: inline-flex; padding: 10px 18px; background: var(--brand); color: var(--brand-ink); border-radius: var(--r-sm); font-weight: 600; font-size: 14px; }
.btn:hover { text-decoration: none; opacity: .92; }

/* ------------------------------------------------------------------ Mobile */
@media (max-width: 900px) {
  .topbar-center { display: none; }
  #menuToggle { width: 46px; height: 46px; }
  #menuToggle svg { width: 24px; height: 24px; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 60;
    background: var(--paper); transform: translateX(-100%); transition: transform .2s ease;
    width: 280px; padding-top: calc(var(--hdr-h) + 12px); box-shadow: var(--shadow);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; }
  .sidebar-scrim.is-open { display: block; }
  .main { padding: 28px 18px 60px; }
  .page-article { flex-direction: column; gap: 0; }
  .toc { display: none; }
  .cat-grid, .quick-links { grid-template-columns: 1fr 1fr; }
  .hero-banner { flex-direction: column; align-items: flex-start; padding: 22px; }
  .pager { flex-direction: column; }
  .pager-link { max-width: 100%; }
}
@media (max-width: 520px) {
  .cat-grid, .quick-links { grid-template-columns: 1fr; }
  .topbar-inner { gap: 6px; padding: 0 12px; }
  .brand span { display: none; }
}
