/* ===== THEORIE.CSS — Fiches théoriques Mon Déclic ===== */
/* Réutilise les variables de theme.css. Feuille commune à toutes les pages theorie/*.html */

.theo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 980px;
  margin: 0 auto 28px;
  padding: 18px 4px 22px;
  border-bottom: 1px solid var(--border);
}

.theo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theo-brand img { width: 40px; height: 40px; border-radius: 10px; }

.theo-brand-text { display: flex; flex-direction: column; }
.theo-brand-text strong { font-size: 15px; color: var(--text); }
.theo-brand-text span { font-size: 12px; color: var(--text3); }

.theo-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.theo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .2s, transform .15s;
}
.theo-btn:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--text); }
.theo-btn--accent { background: var(--gradient); border-color: transparent; color: #08111c; }

.theo-hero {
  max-width: 980px;
  margin: 0 auto 32px;
  padding: 0 4px;
}
.theo-hero .theo-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.10);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 14px;
}
.theo-hero h1 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 10px; }
.theo-hero p { color: var(--text2); font-size: 16px; max-width: 70ch; }

/* Sommaire (table des matières) */
.theo-toc {
  max-width: 980px;
  margin: 0 auto 40px;
  padding: 20px 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.theo-toc h2 { font-size: 15px; margin-bottom: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.theo-toc ol {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 20px;
}
.theo-toc li a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--text2);
  font-weight: 600;
  font-size: 14.5px;
}
.theo-toc li a:hover { background: var(--surface3); color: var(--accent); }
.theo-toc li .num { color: var(--accent); font-weight: 800; min-width: 20px; }

/* Une fiche = une <article> par exercice */
.theo-fiche {
  max-width: 980px;
  margin: 0 auto 56px;
  padding: 28px clamp(18px, 4vw, 34px);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  scroll-margin-top: 24px;
}

.theo-fiche-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.theo-fiche-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; text-align: center; line-height: 1.1;
  background: var(--gradient);
  color: #08111c;
  flex-shrink: 0;
}
.theo-fiche-head h2 { font-size: 22px; margin-bottom: 4px; }
.theo-fiche-head .theo-related { font-size: 13px; color: var(--text3); }
.theo-fiche-head .theo-related a { color: var(--accent); font-weight: 700; }

.theo-block { margin-bottom: 24px; }
.theo-block:last-child { margin-bottom: 0; }
.theo-block h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.theo-block p { color: var(--text2); font-size: 15.5px; line-height: 1.7; margin-bottom: 10px; }
.theo-block p:last-child { margin-bottom: 0; }
.theo-block ul, .theo-block ol.theo-steps { margin: 0; padding: 0; list-style: none; }
.theo-block ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  color: var(--text2);
  font-size: 15px;
  line-height: 1.6;
}
.theo-block ul li::before {
  content: '';
  position: absolute;
  left: 4px; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Étapes numérotées */
.theo-steps { counter-reset: theo-step; }
.theo-steps li {
  counter-increment: theo-step;
  position: relative;
  padding: 10px 14px 10px 44px;
  margin-bottom: 8px;
  background: var(--surface2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  font-size: 15px;
  color: var(--text2);
  line-height: 1.55;
}
.theo-steps li::before {
  content: counter(theo-step);
  position: absolute;
  left: 12px; top: 10px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gradient);
  color: #08111c;
  font-weight: 800;
  font-size: 12.5px;
  display: flex; align-items: center; justify-content: center;
}

/* Exemple concret */
.theo-example {
  background: rgba(131, 189, 69, 0.07);
  border: 1px solid rgba(131, 189, 69, 0.28);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.theo-example h3 { color: var(--accent2); }

/* Astuce / piège à éviter */
.theo-tip {
  background: rgba(94, 196, 212, 0.07);
  border: 1px solid rgba(94, 196, 212, 0.28);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.theo-warning {
  background: rgba(255, 127, 157, 0.08);
  border: 1px solid rgba(255, 127, 157, 0.3);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.theo-warning h3 { color: var(--danger); }

/* Diagramme annoté (mockup d'écran + légende numérotée) */
.theo-diagram-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(200px, 0.9fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 720px) {
  .theo-diagram-wrap { grid-template-columns: 1fr; }
}
.theo-diagram {
  position: relative;
  background: #eef1f5;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  color: #1a1f2b;
  font-family: var(--font-body);
}
.theo-pin {
  position: absolute;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #ff7f9d;
  border: 2px solid #fff;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transform: translate(-50%, -50%);
  z-index: 5;
}
.theo-legend { list-style: none; padding: 0; margin: 0; }
.theo-legend li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text2);
  line-height: 1.5;
}
.theo-legend .theo-legend-num {
  position: absolute;
  left: 0; top: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #ff7f9d;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* Petits éléments réutilisables pour construire les diagrammes de mockup */
.mk-browserbar {
  display: flex; align-items: center; gap: 8px;
  background: #dfe3e8; padding: 8px 12px; border-bottom: 1px solid #c9ced6;
}
.mk-dot { width: 9px; height: 9px; border-radius: 50%; background: #c3c8d1; }
.mk-addr {
  flex: 1; background: #fff; border-radius: 6px; padding: 5px 10px;
  font-size: 12px; color: #333; display: flex; align-items: center; gap: 6px;
}
.mk-lock { color: #2f7d32; font-weight: 800; }
.mk-body { padding: 14px 16px; }
.mk-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #dde1e7; border-radius: 8px;
  padding: 9px 12px; margin-bottom: 8px; font-size: 12.5px; color: #222;
}
.mk-row strong { font-size: 13px; }
.mk-tag {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; letter-spacing: .03em;
}
.mk-tag--ad { background: #fdecea; color: #b3261e; }
.mk-tag--official { background: #e6f4ea; color: #1e7e34; }
.mk-url { color: #1a7d3c; font-size: 11.5px; }
.mk-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 800;
  background: #1a56c4; color: #fff;
}
.mk-btn--danger { background: #c0392b; }
.mk-btn--ghost { background: #fff; color: #333; border: 1px solid #c9ced6; }
.mk-muted { color: #6b7280; font-size: 11.5px; }
.mk-tile {
  background: #22283a; border-radius: 8px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #9aa4bd; font-size: 11px;
}
.mk-tab {
  display: flex; align-items: center; gap: 6px;
  background: #eef1f5; border-radius: 8px 8px 0 0; padding: 7px 12px 6px;
  font-size: 11.5px; color: #333;
}
.mk-tab--active { background: #fff; font-weight: 700; }
.mk-star { color: #d9a419; }

/* Bandeau "en construction" pour une catégorie pas encore terminée */
.theo-soon {
  max-width: 980px;
  margin: 0 auto 24px;
  padding: 16px 20px;
  background: rgba(243, 201, 105, 0.09);
  border: 1px solid rgba(243, 201, 105, 0.3);
  border-radius: var(--r-md);
  color: var(--text2);
  font-size: 14.5px;
}

.theo-footer-nav {
  max-width: 980px;
  margin: 40px auto 0;
  display: flex;
  justify-content: center;
}

/* ===== IMPRESSION / EXPORT PDF ===== */
@media print {
  body { background: #fff !important; color: #111 !important; }
  body::before, body::after, html::before { display: none !important; }
  .theo-actions, .no-print, .focus-mode-toggle, #header-slot, #sidebar-slot { display: none !important; }
  .theo-toc { border: 1px solid #ccc; background: #fafafa; break-inside: avoid; }
  .theo-toc li a { color: #111 !important; }
  .theo-fiche {
    background: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    color: #111 !important;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 26px;
  }
  .theo-fiche-head h2, .theo-hero h1 { color: #111 !important; }
  .theo-hero p, .theo-brand-text strong, .theo-brand-text span, .theo-fiche-head .theo-related { color: #333 !important; }
  .theo-header { border-color: #ddd !important; }
  .theo-block h3 { color: #1a4d8f !important; }
  .theo-block p, .theo-block ul li, .theo-legend li { color: #222 !important; }
  .theo-steps li { background: #f4f4f4 !important; border-color: #ddd !important; color: #222 !important; }
  .theo-example { background: #f2f8ea !important; border-color: #bcd99b !important; }
  .theo-tip { background: #eaf7f9 !important; border-color: #a9dbe2 !important; }
  .theo-warning { background: #fdeef2 !important; border-color: #f3b7c6 !important; }
  a { color: #1a4d8f !important; text-decoration: underline; }
  .theo-diagram { box-shadow: none !important; border: 1px solid #bbb !important; }
  .theo-hero, .theo-toc, .theo-fiche { max-width: 100% !important; }
}
