/* ════════════════════════════════════════════════════════
   degradation.css — styles spécifiques à la page « Fiches de Dégradation — Huile, Roulements &amp; Paliers hydrodynamiques »
   (extraits de l'ancien <style> en ligne de degradation.html)
════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════
   STYLES PAGE FICHES DÉGRADATION
════════════════════════════════════════════════════════ */

/* ── Mise en page deux colonnes (sommaire + contenu) ── */
.deg-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 40px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

@media (max-width: 900px) {
  .deg-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
}

/* ── Sommaire latéral fixe ── */
.toc {
  position: sticky;
  top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 0.72rem;
}

.toc-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.toc a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0 4px 8px;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  line-height: 1.5;
}

.toc a:hover,
.toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc a.sub {
  padding-left: 18px;
  font-size: 0.68rem;
}

/* ── En-tête de page ── */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 6px;
}

.page-header .subtitle {
  color: var(--muted);
  font-size: 0.85rem;
}

.page-header .badge-norme {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  background: rgba(240,192,64,0.12);
  border: 1px solid rgba(240,192,64,0.3);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.05em;
}

/* ── Séparateur de fonction (groupe de fiches) ── */
.fonction-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.fonction-header:first-of-type {
  margin-top: 0;
}

.fonction-numero {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  background: rgba(240,192,64,0.1);
  border: 1px solid rgba(240,192,64,0.25);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}

.fonction-titre {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.fonction-type {
  margin-left: auto;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Fiche individuelle de mode de dégradation ── */
.fiche {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.fiche:hover {
  border-color: rgba(240,192,64,0.35);
}

/* ── En-tête de fiche (cliquable pour déplier) ── */
.fiche-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}

.fiche-id {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}

.fiche-titre {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  line-height: 1.4;
}

/* Badge de risque (code couleur selon score) */
.risque-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.risque-eleve   { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.risque-modere  { background: rgba(251,146,60,0.15);  color: #fb923c; border: 1px solid rgba(251,146,60,0.3); }
.risque-faible  { background: rgba(74,222,128,0.15);  color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }

/* Chevron d'ouverture/fermeture */
.fiche-chevron {
  color: var(--muted);
  font-size: 0.7rem;
  transition: transform 0.25s;
}

.fiche.open .fiche-chevron {
  transform: rotate(180deg);
}

/* ── Corps de la fiche (contenu dépliable) ── */
.fiche-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}

.fiche.open .fiche-body {
  display: block;
}

/* ── Grille de sections dans la fiche ── */
.fiche-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 700px) {
  .fiche-grid { grid-template-columns: 1fr; }
}

/* Section pleine largeur dans la grille */
.fiche-grid .full {
  grid-column: 1 / -1;
}

/* ── Bloc de section (Cause, Effets, etc.) ── */
.section-bloc {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
}

.section-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

.section-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.6;
}

/* ── Liste de points dans une section ── */
.section-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-list li {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.6;
  padding: 3px 0 3px 14px;
  position: relative;
}

.section-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
}

/* ── Bloc tâche de maintenance (accent visuel fort) ── */
.tache-bloc {
  background: rgba(240,192,64,0.06);
  border: 1px solid rgba(240,192,64,0.25);
  border-radius: 6px;
  padding: 14px 16px;
}

.tache-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tache-type-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: #0e0f13;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 700;
}

.tache-frequence {
  font-size: 0.75rem;
  color: var(--muted);
}

.tache-responsable {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}

.tache-description {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.6;
}

/* ── Indicateurs de criticité (P, C, Risque) ── */
.criticite-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.criticite-item {
  flex: 1;
  min-width: 80px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}

.criticite-val {
  font-family: 'DM Mono', monospace;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.criticite-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ── Méthodes ASTM (liste de tags) ── */
.astm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.astm-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  background: rgba(240,192,64,0.08);
  border: 1px solid rgba(240,192,64,0.2);
  border-radius: 4px;
  padding: 3px 8px;
}

/* ── Pattern de défaillance ── */
.pattern-badge {
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: 'DM Mono', monospace;
}

.pattern-usure    { background: rgba(251,146,60,0.12); color: #fb923c; border: 1px solid rgba(251,146,60,0.25); }
.pattern-aleatoire{ background: rgba(148,163,184,0.12); color: #94a3b8; border: 1px solid rgba(148,163,184,0.25); }

/* ── Alertes sécurité ── */
.securite-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: #f87171;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 4px;
  padding: 3px 8px;
  margin-top: 6px;
}

/* ── Sélecteur d'onglets (Huile / Roulements) ── */
.tab-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: 0.02em;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }
.toc-section { display: none; }
.toc-section.active { display: block; }

/* ── Tags de détection (roulements) ── */
.detection-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.detection-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  background: rgba(240,192,64,0.08);
  border: 1px solid rgba(240,192,64,0.2);
  border-radius: 4px;
  padding: 3px 8px;
}

/* ── Patterns roulements ── */
.pattern-fatigue { background: rgba(167,139,250,0.12); color: #a78bfa; border: 1px solid rgba(167,139,250,0.25); }
