/*
Theme Name: Baselink
Theme URI: https://baselink.fr
Author: Webolog
Author URI: https://webolog.fr
Description: Thème technique dark pour base de connaissances alarme et contrôle d'accès
Version: 1.0.1
License: GNU General Public License v2 or later
Text Domain: baselink
*/

/* ── VARIABLES — MODE SOMBRE (défaut) ── */
:root {
  --bg:       #0d0f14;
  --surface:  #13161d;
  --surface2: #1a1e28;
  --border:   #252a38;
  --accent:   #00e5a0;
  --accent2:  #0084ff;
  --warn:     #ffb020;
  --danger:   #ff4d4d;
  --text:     #e2e8f0;
  --muted:    #64748b;
  --mono:     'IBM Plex Mono', monospace;
  --sans:     'DM Sans', sans-serif;
  --radius:   8px;
  --max-w:    920px;
  color-scheme: dark;
}

/* ══════════════════════════════════════
   MODE CLAIR — REVUE COMPLÈTE
   Contrastes vérifiés WCAG AA (ratio ≥ 4.5:1)
══════════════════════════════════════ */
[data-theme="light"] {
  --bg:       #f0f2f7;
  --surface:  #ffffff;
  --surface2: #e8ecf4;
  --border:   #c8d0e0;
  --accent:   #007a55;
  --accent2:  #0055aa;
  --warn:     #92500a;
  --danger:   #b91c1c;
  --text:     #111827;
  --muted:    #4b5675;
  color-scheme: light;
}

/* ── TOPBAR mode clair ── */
[data-theme="light"] .topbar {
  background: #ffffff;
  border-bottom-color: #c8d0e0;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
[data-theme="light"] .topbar-logo { color: #007a55; }
[data-theme="light"] .topbar-nav li a { color: #4b5675; }
[data-theme="light"] .topbar-nav li a:hover,
[data-theme="light"] .topbar-nav li.current-menu-item a {
  color: #111827;
  background: #e8ecf4;
}
[data-theme="light"] .topbar-search input {
  background: #f0f2f7;
  border-color: #c8d0e0;
  color: #111827;
}
[data-theme="light"] .topbar-search input::placeholder { color: #4b5675; }
[data-theme="light"] .topbar-search input:focus { border-color: #007a55; }
[data-theme="light"] .burger span { background: #4b5675; }

/* ── SECTIONS mode clair ── */
[data-theme="light"] .section { border-color: #c8d0e0; }
[data-theme="light"] .section-header {
  background: #e8ecf4;
  border-bottom-color: #c8d0e0;
  color: #007a55;
}
[data-theme="light"] .section-body { background: #ffffff; }

/* ── FICHE HEADER mode clair ── */
[data-theme="light"] .fiche-header { border-left-color: #007a55; }
[data-theme="light"] .fiche-title  { color: #111827; }
[data-theme="light"] .fiche-subtitle { color: #4b5675; }

/* ── CARDS mode clair ── */
[data-theme="light"] .card { background: #ffffff; border-color: #c8d0e0; }
[data-theme="light"] .card:hover { border-color: #007a55; }
[data-theme="light"] .card-title  { color: #111827; }
[data-theme="light"] .card-excerpt { color: #4b5675; }
[data-theme="light"] .card-arrow  { color: #007a55; }

/* ── PRODUCT CARDS mode clair ── */
[data-theme="light"] .product-card { background: #ffffff; border-color: #c8d0e0; }
[data-theme="light"] .product-card:hover { border-color: #007a55; }
[data-theme="light"] .pc-title    { color: #111827; }
[data-theme="light"] .pc-ref      { color: #007a55; }
[data-theme="light"] .pc-compat,
[data-theme="light"] .pc-alim     { color: #4b5675; }
[data-theme="light"] .pc-icon     { background: #e8ecf4; border-color: #c8d0e0; }
[data-theme="light"] .pc-arrow    { color: #c8d0e0; }
[data-theme="light"] .product-card:hover .pc-arrow { color: #007a55; }

/* ── PRODUCT GRID (matériel) mode clair ── */
[data-theme="light"] .product-label { color: #4b5675; }
[data-theme="light"] .product-value { color: #111827; }
[data-theme="light"] .product-ref   { color: #007a55; }

/* ── ÉTAPES mode clair ── */
[data-theme="light"] .step-num  { background: #007a55; color: #ffffff; }
[data-theme="light"] .step-text { color: #111827; }
[data-theme="light"] .step-text code {
  background: #e8ecf4;
  border-color: #c8d0e0;
  color: #0055aa;
}

/* ── ALERTES mode clair — textes foncés pour lisibilité ── */
[data-theme="light"] .alert-warn {
  background: #fef9ed;
  border-color: #f5c842;
  color: #78420a;
}
[data-theme="light"] .alert-error {
  background: #fff1f1;
  border-color: #fca5a5;
  color: #991b1b;
}
[data-theme="light"] .alert-info {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}

/* ── SCHÉMA zone mode clair ── */
[data-theme="light"] .schema-zone {
  background: #f0f2f7;
  border-color: #c8d0e0;
  color: #4b5675;
}
[data-theme="light"] .schema-caption { color: #4b5675; }

/* ── CODE mode clair ── */
[data-theme="light"] .entry-content pre,
[data-theme="light"] .code-block pre {
  background: #f0f2f7;
  border-color: #c8d0e0;
  color: #111827;
}
[data-theme="light"] .entry-content code {
  background: #e8ecf4;
  border-color: #c8d0e0;
  color: #0055aa;
}
[data-theme="light"] .copy-btn {
  background: #e8ecf4;
  border-color: #c8d0e0;
  color: #4b5675;
}
[data-theme="light"] .copy-btn:hover,
[data-theme="light"] .copy-btn.copied {
  color: #007a55;
  border-color: #007a55;
}

/* ── BREADCRUMB mode clair ── */
[data-theme="light"] .breadcrumb a   { color: #4b5675; }
[data-theme="light"] .breadcrumb .sep { color: #c8d0e0; }
[data-theme="light"] .breadcrumb .current { color: #111827; }

/* ── HERO mode clair ── */
[data-theme="light"] .hero-eyebrow { color: #007a55; }
[data-theme="light"] .hero-title   { color: #111827; }
[data-theme="light"] .hero-title span { color: #007a55; }
[data-theme="light"] .hero-sub     { color: #4b5675; }
[data-theme="light"] .hero-search input {
  background: #ffffff;
  border-color: #c8d0e0;
  color: #111827;
}
[data-theme="light"] .hero-search input:focus { border-color: #007a55; }
[data-theme="light"] .hero-search button { background: #007a55; color: #ffffff; }

/* ── BRAND CARDS mode clair ── */
[data-theme="light"] .brand-card {
  background: #ffffff;
  border-color: #c8d0e0;
}
[data-theme="light"] .brand-card:hover { border-color: #007a55; }
[data-theme="light"] .brand-name   { color: #007a55; }
[data-theme="light"] .brand-card--general .brand-name { color: #7c3aed; }
[data-theme="light"] .brand-card--general:hover { border-color: #7c3aed; }
[data-theme="light"] .brand-desc   { color: #4b5675; }
[data-theme="light"] .brand-link {
  background: #e8ecf4;
  border-color: #c8d0e0;
  color: #4b5675;
}
[data-theme="light"] .brand-link:hover { color: #007a55; border-color: #007a55; }

/* ── FILTRES mode clair ── */
[data-theme="light"] .filter-bar   { background: #ffffff; border-color: #c8d0e0; }
[data-theme="light"] .filter-label { color: #4b5675; }
[data-theme="light"] .filter-btn {
  background: #e8ecf4;
  border-color: #c8d0e0;
  color: #4b5675;
}
[data-theme="light"] .filter-btn:hover { color: #111827; border-color: #4b5675; }
[data-theme="light"] .filter-btn.active {
  color: #007a55;
  border-color: #007a55;
  background: #e6f5f0;
}
[data-theme="light"] .filter-search input {
  background: #f0f2f7;
  border-color: #c8d0e0;
  color: #111827;
}
[data-theme="light"] .filter-search input::placeholder { color: #4b5675; }
[data-theme="light"] .filter-search input:focus { border-color: #007a55; }
[data-theme="light"] .filter-count { color: #4b5675; }
[data-theme="light"] .filter-count span { color: #007a55; }

/* ── TAGS mode clair ── */
[data-theme="light"] .tag-honeywell { background:#e0f5ed; color:#065f46; border-color:#6ee7b7; }
[data-theme="light"] .tag-til       { background:#dbeafe; color:#1e3a8a; border-color:#93c5fd; }
[data-theme="light"] .tag-general   { background:#ede9fe; color:#5b21b6; border-color:#c4b5fd; }
[data-theme="light"] .tag-alarme    { background:#fef3c7; color:#78350f; border-color:#fcd34d; }
[data-theme="light"] .tag-ca        { background:#fee2e2; color:#991b1b; border-color:#fca5a5; }
[data-theme="light"] .tag-cablage   { background:#dcfce7; color:#14532d; border-color:#86efac; }
[data-theme="light"] .tag-prog      { background:#f3e8ff; color:#581c87; border-color:#d8b4fe; }
[data-theme="light"] .tag-depann    { background:#ffedd5; color:#7c2d12; border-color:#fdba74; }
[data-theme="light"] .tag-tech      { background:#f1f5f9; color:#334155; border-color:#cbd5e1; }

/* ── DOCS mode clair ── */
[data-theme="light"] .doc-link {
  background: #f0f2f7;
  border-color: #c8d0e0;
  color: #111827;
}
[data-theme="light"] .doc-link:hover { border-color: #007a55; background: #e6f5f0; }
[data-theme="light"] .doc-ext { color: #4b5675; }

/* ── FOOTER mode clair ── */
[data-theme="light"] .site-footer {
  background: #ffffff;
  border-top-color: #c8d0e0;
  color: #4b5675;
}
[data-theme="light"] .footer-links a { color: #4b5675; }
[data-theme="light"] .footer-links a:hover { color: #007a55; }

/* ── BARRE LECTURE mode clair ── */
[data-theme="light"] .reading-bar { background: #007a55; }

/* ── TOGGLE mode clair ── */
[data-theme="light"] .theme-toggle-btn { background: #d1fae5; border-color: #007a55; }
[data-theme="light"] .theme-toggle-btn::after { transform: translateX(18px); background: #007a55; }

/* ── PAGINATION mode clair ── */
[data-theme="light"] .page-numbers {
  background: #e8ecf4;
  border-color: #c8d0e0;
  color: #111827;
}
[data-theme="light"] .page-numbers.current,
[data-theme="light"] .page-numbers:hover {
  background: #007a55;
  color: #ffffff;
  border-color: #007a55;
}

/* ── SECTION PAGE TITLE mode clair ── */
[data-theme="light"] .section-page-title { color: #4b5675; border-bottom-color: #c8d0e0; }

/* ── TOGGLE THEME ── */
.theme-toggle { display:flex; align-items:center; gap:6px; margin-left:12px; flex-shrink:0; }
.theme-toggle-btn {
  position:relative; width:40px; height:22px;
  background:var(--surface2); border:1px solid var(--border); border-radius:11px;
  cursor:pointer; transition:background .3s, border-color .3s; flex-shrink:0;
}
.theme-toggle-btn::after {
  content:''; position:absolute; top:3px; left:3px; width:14px; height:14px;
  border-radius:50%; background:var(--muted); transition:transform .25s, background .25s;
}
[data-theme="light"] .theme-toggle-btn { background:#d4f5e9; border-color:var(--accent); }
[data-theme="light"] .theme-toggle-btn::after { transform:translateX(18px); background:var(--accent); }
.theme-toggle-icon { font-size:13px; user-select:none; }

/* ── BARRE DE PROGRESSION LECTURE ── */
.reading-bar {
  position:fixed; top:52px; left:0; width:0%; height:2px;
  background:var(--accent); z-index:99; transition:width .1s linear;
}

/* ── BLOCS CODE AVEC BOUTON COPIER ── */
.code-block { position:relative; margin-bottom:16px; }
.code-block pre {
  background:var(--bg); border:1px solid var(--border); border-radius:6px;
  padding:16px; padding-right:72px; overflow-x:auto;
  font-family:var(--mono); font-size:13px; line-height:1.6; margin:0;
}
.copy-btn {
  position:absolute; top:8px; right:8px;
  background:var(--surface2); border:1px solid var(--border); border-radius:4px;
  color:var(--muted); font-family:var(--mono); font-size:10px; font-weight:600;
  letter-spacing:.05em; padding:3px 9px; cursor:pointer;
  transition:color .15s, border-color .15s, background .15s; user-select:none;
}
.copy-btn:hover { color:var(--accent); border-color:var(--accent); }
.copy-btn.copied { color:var(--accent); border-color:var(--accent); }
.entry-content pre { position:relative; padding-right:72px; }

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  height: -webkit-fill-available;
  min-height: 100dvh;
}

/* ── BODY + STICKY FOOTER ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── TOPBAR ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 0;
  flex-shrink: 0;
}
.topbar-logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-decoration: none;
  margin-right: 24px;
  flex-shrink: 0;
}
.topbar-logo:hover { text-decoration: none; }

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex: 1;
}
.topbar-nav li a {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.topbar-nav li a:hover,
.topbar-nav li.current-menu-item a {
  color: var(--text);
  background: var(--surface2);
  text-decoration: none;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-search input[type="search"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 5px 12px;
  width: 180px;
  outline: none;
  transition: border-color 0.2s, width 0.3s;
}
.topbar-search input[type="search"]:focus {
  border-color: var(--accent);
  width: 240px;
}
.topbar-search input::placeholder { color: var(--muted); }

/* Burger mobile */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  margin-left: 16px;
  background: transparent;
  border: none;
  padding: 4px;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: 0.3s;
}
.topbar-actions { display:flex; align-items:center; gap:8px; margin-left:auto; flex-shrink:0; }


.site-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 80px;
  flex: 1 0 auto;
  width: 100%;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text); }

/* ── FICHE HEADER ── */
.fiche-header {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin-bottom: 36px;
  animation: fadeUp 0.4s ease both;
}
.fiche-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 3px;
  text-transform: uppercase;
}
.tag-honeywell { background: #002a1a; color: var(--accent);  border: 1px solid #005535; }
.tag-til       { background: #001428; color: var(--accent2); border: 1px solid #003566; }
.tag-general   { background: #1a1428; color: #c084fc;        border: 1px solid #3d1a5c; }
.tag-alarme    { background: #1a1200; color: var(--warn);    border: 1px solid #4a3500; }
.tag-ca        { background: #1a0000; color: var(--danger);  border: 1px solid #4a0000; }
.tag-cablage   { background: #0d1a0d; color: #7dff7d;        border: 1px solid #1a3d1a; }
.tag-prog      { background: #1a001a; color: #e07dff;        border: 1px solid #3d003d; }
.tag-depann    { background: #1a0a00; color: #ff9d4d;        border: 1px solid #4a2500; }
.tag-tech      { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); font-size: 10px; }

.fiche-title {
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.3;
}
.fiche-subtitle {
  color: var(--muted);
  font-size: 14px;
}

/* ── SECTIONS ── */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  animation: fadeUp 0.4s ease both;
}
.section:nth-child(2) { animation-delay: 0.05s; }
.section:nth-child(3) { animation-delay: 0.10s; }
.section:nth-child(4) { animation-delay: 0.15s; }
.section:nth-child(5) { animation-delay: 0.20s; }
.section:nth-child(6) { animation-delay: 0.25s; }
.section:nth-child(7) { animation-delay: 0.30s; }

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-body { padding: 20px; }

/* ── PRODUCT GRID ── */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.product-row { display: flex; flex-direction: column; gap: 3px; }
.product-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.product-value { font-size: 14px; font-weight: 500; }
.product-ref { font-family: var(--mono); color: var(--accent); font-size: 13px; }

/* ── SCHÉMA ── */
.schema-zone {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 6px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.schema-zone img { width: 100%; height: auto; }
.schema-caption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* ── ÉTAPES ── */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
}
.step-text { font-size: 14px; padding-top: 4px; }
.step-text code {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent2);
}

/* ── ALERTES ── */
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.5;
}
.alert-warn  { background: #1a1200; border: 1px solid #4a3500; }
.alert-error { background: #1a0000; border: 1px solid #4a0000; }
.alert-info  { background: #001428; border: 1px solid #003566; }
.alert-icon  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── VIDÉO ── */
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 6px; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* ── DOCS ── */
.docs-list { display: flex; flex-direction: column; gap: 8px; }
.doc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.doc-link:hover { border-color: var(--accent); background: #001a0f; text-decoration: none; }
.doc-ext { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ── CONTENU WYSIWYG ── */
.entry-content h2, .entry-content h3 { color: #fff; margin: 24px 0 12px; }
.entry-content p { margin-bottom: 14px; }
.entry-content ul, .entry-content ol { padding-left: 20px; margin-bottom: 14px; }
.entry-content li { margin-bottom: 6px; }
.entry-content code {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent2);
}
.entry-content pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── CARD ARCHIVE ── */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, transform 0.2s;
  animation: fadeUp 0.4s ease both;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.4; }
.card-excerpt { font-size: 13px; color: var(--muted); line-height: 1.6; }
.card-arrow { margin-top: auto; color: var(--accent); font-family: var(--mono); font-size: 12px; }

/* ── PAGE ACCUEIL ── */
.hero {
  padding: 64px 0 48px;
  text-align: center;
  animation: fadeUp 0.5s ease both;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero-title span { color: var(--accent); }
.hero-sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 32px;
}
.hero-search {
  display: flex;
  max-width: 460px;
  margin: 0 auto;
  gap: 0;
}
.hero-search input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 16px;
  outline: none;
  transition: border-color 0.2s;
}
.hero-search input:focus { border-color: var(--accent); }
.hero-search button {
  background: var(--accent);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #000;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.hero-search button:hover { opacity: 0.85; }

.brands-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
}
.brand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-decoration: none;
  transition: border-color 0.2s;
  animation: fadeUp 0.4s ease both;
}
.brand-card:hover { border-color: var(--accent); text-decoration: none; }
.brand-card--general:hover { border-color: #c084fc; }
.brands-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .brands-grid--3 { grid-template-columns: 1fr; } }
.brand-card:nth-child(2) { animation-delay: 0.1s; }
.brand-name {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}
.brand-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.brand-links { display: flex; gap: 8px; flex-wrap: wrap; }
.brand-link {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.brand-link:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ── SEARCH PAGE ── */
.search-header { margin-bottom: 32px; }
.search-header h1 { font-size: 22px; color: #fff; }
.search-header h1 span { color: var(--accent); font-family: var(--mono); }
.no-results { color: var(--muted); font-size: 15px; margin-top: 24px; }

/* ══════════════════════════════════════
   MENU USER (connecté) — avatar + déconnexion + connexion
══════════════════════════════════════ */
#bl-user-slot { display: contents; }

/* Masquer les items menu-auth ajoutés dans .topbar-nav en desktop
   (ils ne servent que dans le menu burger mobile ouvert) */
.topbar-nav .menu-auth { display: none; }
.topbar-nav.open .menu-auth { display: block; }
.bl-menu-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.bl-menu-user:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.bl-menu-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 229, 160, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bl-menu-username {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.bl-menu-logout,
.bl-menu-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.bl-menu-logout:hover,
.bl-menu-login:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.bl-menu-logout svg,
.bl-menu-login svg { flex-shrink: 0; }

/* Mode clair */
[data-theme="light"] .bl-menu-user {
  background: #e8ecf4;
  border-color: #c8d0e0;
  color: #111827;
}
[data-theme="light"] .bl-menu-user:hover { border-color: #007a55; }
[data-theme="light"] .bl-menu-avatar {
  background: #d1fae5;
  border-color: #007a55;
  color: #007a55;
}
[data-theme="light"] .bl-menu-logout,
[data-theme="light"] .bl-menu-login {
  color: #4b5675;
  border-color: #c8d0e0;
}
[data-theme="light"] .bl-menu-logout:hover,
[data-theme="light"] .bl-menu-login:hover {
  color: #007a55;
  border-color: #007a55;
}

/* Nom long raccourci sur écrans moyens */
@media (max-width: 1100px) {
  .bl-menu-username { max-width: 80px; }
}

/* ══════════════════════════════════════
   RESPONSIVE — TABLET (max 860px)
══════════════════════════════════════ */
@media (max-width: 860px) {
  .brands-grid { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .filter-group { flex-wrap: wrap; }

  /* Topbar en mode mobile dès 860px (pas 640px)
     pour que le burger apparaisse AVANT que le layout casse */
  .topbar-nav { display: none; }
  .topbar-nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: fixed;
    top: 52px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    max-height: calc(100vh - 52px);
    overflow-y: auto;
  }
  .topbar-nav.open li { list-style: none; }
  .topbar-nav.open li a {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
  }
  .topbar-search { display: none; }
  .burger { display: flex; }

  /* Masquer avatar + déconnexion + connexion de la topbar (ils iront dans le menu) */
  .topbar-actions .bl-menu-user,
  .topbar-actions .bl-menu-logout,
  .topbar-actions .bl-menu-login {
    display: none;
  }

  /* Le toggle thème RESTE visible dans la topbar */
  .topbar-actions .theme-toggle {
    margin-left: 0;
  }

  /* Mais les afficher DANS le menu burger ouvert */
  .topbar-nav.open .bl-menu-user,
  .topbar-nav.open .bl-menu-logout,
  .topbar-nav.open .bl-menu-login {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    margin: 0;
  }
  .topbar-nav.open .bl-menu-user {
    margin-top: 8px;
    padding: 10px 12px;
    padding-top: 14px;
    border-radius: 0;
    background: transparent;
    border: none;
    border-top: 1px solid var(--border);
  }
  .topbar-nav.open .bl-menu-username {
    max-width: none;
  }
  .topbar-nav.open .bl-menu-logout,
  .topbar-nav.open .bl-menu-login {
    border: none;
    padding: 10px 12px;
  }
}

/* ══════════════════════════════════════
   RESPONSIVE — MOBILE (max 640px)
══════════════════════════════════════ */
@media (max-width: 640px) {

  /* Topbar */
  .topbar { padding: 0 16px; gap: 0; }
  .topbar-logo { font-size: 13px; margin-right: 12px; }

  /* Wrapper */
  .site-wrapper { padding: 24px 16px 56px; }

  /* Breadcrumb */
  .breadcrumb { font-size: 11px; gap: 6px; margin-bottom: 20px; }
  .breadcrumb .current {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
  }

  /* Fiche header */
  .fiche-header { padding-left: 14px; margin-bottom: 24px; }
  .fiche-title { font-size: 20px; }
  .fiche-subtitle { font-size: 13px; }

  /* Section */
  .section-header { padding: 11px 16px; font-size: 10px; }
  .section-body { padding: 16px; }

  /* Matériel — 1 colonne sur mobile */
  .product-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Étapes */
  .step-num { width: 24px; height: 24px; font-size: 11px; }
  .step-text { font-size: 13px; }

  /* Hero */
  .hero { padding: 36px 0 28px; }
  .hero-title { font-size: 24px; }
  .hero-sub { font-size: 14px; }
  .hero-search { flex-direction: column; gap: 8px; }
  .hero-search input {
    border-right: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
  }
  .hero-search button {
    border-radius: var(--radius);
    width: 100%;
    padding: 10px;
  }

  /* Brands */
  .brands-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 28px; }
  .brand-card { padding: 20px 16px; }
  .brand-name { font-size: 16px; }

  /* Archive / Cards */
  .archive-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
  .card { padding: 16px; gap: 8px; }
  .card-title { font-size: 14px; }
  .card-excerpt { font-size: 12px; }

  /* Filtres */
  .filter-bar { padding: 14px; gap: 12px; }
  .filter-group { flex-direction: column; align-items: flex-start; gap: 8px; }
  .filter-label { min-width: auto; }
  .filter-buttons { gap: 5px; }
  .filter-btn { font-size: 10px; padding: 4px 10px; }
  .filter-search input { font-size: 13px; padding: 8px 12px; }

  /* Products grid */
  .products-grid { grid-template-columns: 1fr; gap: 10px; }
  .product-card { padding: 14px; gap: 12px; }
  .pc-icon { width: 36px; height: 36px; font-size: 18px; }
  .pc-title { font-size: 13px; }
  .pc-ref { font-size: 11px; }
  .pc-compat, .pc-alim { font-size: 11px; }

  /* Footer */
  .site-footer {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 10px;
  }
  .footer-links { gap: 12px; }

  /* Alertes */
  .alert { padding: 10px 12px; font-size: 13px; }

  /* Tags */
  .tag { font-size: 10px; padding: 2px 8px; }
}

/* ── FORMULAIRE DE RECHERCHE ── */
.bl-search-form {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  gap: 0;
}
.bl-search-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 16px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.bl-search-input:focus { border-color: var(--accent); }
.bl-search-input::placeholder { color: var(--muted); }
.bl-search-btn {
  background: var(--accent);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #000;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.bl-search-btn:hover { opacity: 0.85; }

/* Mode clair */
[data-theme="light"] .bl-search-input {
  background: #ffffff;
  border-color: #c8d0e0;
  color: #111827;
}
[data-theme="light"] .bl-search-input:focus { border-color: #007a55; }
[data-theme="light"] .bl-search-btn { background: #007a55; color: #ffffff; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Icones */
.section-header .icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 6px;
}

/* ========== Lightbox images articles ========== */
.bl-image-caption-mobile {
  display: none;
}

@media (max-width: 580px) {
  .bl-image-caption-mobile {
    display: block;
    font-size: 0.75rem;
    color: #5a7a94;
    font-style: italic;
    text-align: center;
    margin-top: 6px;
  }
}

.bl-lightbox {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.bl-lightbox.active {
  display: flex;
}

.bl-lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  object-fit: contain;
  cursor: default;
}

.bl-lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100000;
}

.bl-lightbox-close:hover {
  color: #5bc0f8;
}