/* ============================================================
   Page « Mes outils » et fiches d'outil
   ------------------------------------------------------------
   Chargée par outils.html, outils-en.html et outils/*.html,
   après css/styles.css dont elle reprend les variables.
   ============================================================ */

/* ── Tags (mêmes couleurs que la page projets) ── */
.tool-tag {
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid var(--border-color);
  color: var(--muted);
  background: transparent;
  display: inline-block;
}
.tool-tag.tag-cyber { border-color: #FE6E00; color: #FE6E00; }
.tool-tag.tag-dev   { border-color: #6366f1; color: #6366f1; }
.tool-tag.tag-sys   { border-color: #0ea5e9; color: #0ea5e9; }

/* ── Badge de version ── */
.version-badge {
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  color: #00C758;
  border: 1px solid #00C758;
}
.version-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: #00C758;
}

/* ── Boutons-liens dans une carte ──
   styles.css souligne et recolore tous les liens de .card, boutons compris :
   au survol, le texte d'un bouton plein prendrait la couleur de son fond. */
.card a.btn { text-decoration: none; }
.card a.btn-primary,
.card a.btn-primary:hover { color: #FAF9F6; }
.card a.btn-outline-secondary:hover { color: var(--bg); }

/* ── Libellé technique (fil d'Ariane, méta) ── */
.mono-label {
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mono-label a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.mono-label a:hover { color: var(--primary); }

/* ============================================================
   Liste des outils
   ============================================================ */
.tool-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.tool-card:focus-within { border-color: var(--primary) !important; }

.tool-cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg);
}
/* Zoom sur le coin supérieur gauche : une fenêtre entière réduite à la
   largeur d'une carte devient illisible */
.tool-cover img {
  width: 150%;
  max-width: none;
  height: auto;
  display: block;
  transform-origin: top left;
  transition: transform 300ms ease;
}
.tool-card:hover .tool-cover img { transform: scale(1.03); }

.tool-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.tool-card .card-text { flex: 1; }

.tool-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

/* Lien d'appel : toute la carte est cliquable (stretched-link) */
.card a.tool-cta {
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary);
  text-decoration: none;
}
.card a.tool-cta i { transition: transform 150ms ease; display: inline-block; }
.tool-card:hover a.tool-cta i { transform: translateX(3px); }

/* Emplacement « d'autres outils arrivent » */
.tool-placeholder {
  height: 100%;
  min-height: 220px;
  border: 1px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.8rem;
}
.tool-placeholder i { font-size: 1.6rem; margin-bottom: 0.6rem; }

/* ============================================================
   Fiche d'un outil
   ============================================================ */
.tool-header-icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.tool-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}
.tool-lead { color: var(--muted); font-size: 1.02rem; }

/* Titres de section (même trait orange que les cartes du portfolio) */
.tool-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
  display: inline-block;
}

/* ── Bloc de téléchargement ── */
.download-box {
  border: 1px solid var(--primary);
  background: rgba(254, 110, 0, 0.04);
  padding: 1.25rem;
  scroll-margin-top: 90px; /* la navbar est fixe (72 px) */
}
@media (max-width: 575.98px) {
  .download-box { padding: 1rem; }
}
.download-box .btn-download {
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
}
.btn-download .btn-sub {
  display: block;
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.8;
}
.download-meta {
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.9rem 0 0;
}
.download-note {
  font-size: 0.85rem;
  color: var(--muted);
  border-left: 3px solid var(--primary);
  padding-left: 0.75rem;
  margin: 1rem 0 0;
}

.hash-details { margin-top: 0.9rem; }
.hash-details summary {
  cursor: pointer;
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.hash-details summary:hover { color: var(--primary); }
.hash-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
}
.hash-list li { margin-bottom: 0.5rem; font-size: 0.78rem; }
.hash-list code {
  display: block;
  word-break: break-all;
  font-size: 0.72rem;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  background: var(--bg);
  color: var(--text);
}

/* ── Galerie de captures ── */
.shot-main {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border-color);
  background: var(--bg);
  cursor: zoom-in;
  position: relative;
}
.shot-main:hover,
.shot-main:focus-visible { border-color: var(--primary); }
.shot-main img {
  width: 100%;
  height: auto;
  display: block;
}
.shot-main .shot-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text);
  opacity: 0;
  transition: opacity 150ms ease;
}
.shot-main:hover .shot-zoom,
.shot-main:focus-visible .shot-zoom { opacity: 1; }

.shot-caption {
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.6rem 0 1rem;
}

.shot-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.5rem;
}
.shot-thumb {
  padding: 0;
  border: 1px solid var(--border-color);
  background: var(--bg);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 150ms ease, border-color 150ms ease;
}
.shot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
}
.shot-thumb:hover,
.shot-thumb:focus-visible { opacity: 1; }
.shot-thumb.active {
  opacity: 1;
  border-color: var(--primary);
  outline: 1px solid var(--primary);
}

/* Visionneuse agrandie (modale Bootstrap) — Bootstrap la limite à 500 px
   sous 992 px de large, plus petit que l'image dans la page */
.shot-modal .modal-dialog { max-width: min(1080px, calc(100vw - 1rem)); }
.shot-modal .modal-content {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border-color);
  border-radius: 0;
}
.shot-modal .modal-header,
.shot-modal .modal-footer { border-color: var(--border-color); }
.shot-modal .modal-body { padding: 0.75rem; }
.shot-modal .modal-body img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
}
.shot-counter {
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}
html.dark .shot-modal .btn-close { filter: invert(1) grayscale(1) brightness(2); }

/* ── Fonctionnalités ── */
.feature {
  display: flex;
  gap: 0.9rem;
  height: 100%;
}
.feature > i {
  color: var(--primary);
  font-size: 1.35rem;
  line-height: 1.2;
  flex-shrink: 0;
}
.feature h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.feature p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}
html.dark .feature p { color: var(--muted); }

/* ── Étapes numérotées ── */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
}
/* Colonnes qui divisent les six étapes : pas de case vide en fin de grille */
@media (min-width: 576px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .steps { grid-template-columns: repeat(6, 1fr); } }
.steps li {
  counter-increment: step;
  background: var(--card-bg);
  padding: 1rem;
  font-size: 0.88rem;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.3rem;
}
.steps li strong { display: block; margin-bottom: 0.2rem; }
.steps li span { color: var(--muted); }
.steps li code { color: var(--text); font-size: 0.85em; }

/* ── Garde-fous ── */
.guard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.guard-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.6rem;
}
.guard-list li::before {
  content: '\F270'; /* bi-check2-circle */
  font-family: 'bootstrap-icons';
  position: absolute;
  left: 0;
  top: 0;
  color: #00C758;
}

/* ── Distributions ── */
.distro-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.distro-chip {
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.75rem;
  padding: 3px 10px;
  border: 1px solid var(--border-color);
  color: var(--text);
}
.distro-chip .bi { color: #FE6E00; margin-left: 4px; }

/* ── Pile technique ── */
.stack-table {
  width: 100%;
  font-size: 0.9rem;
  border-collapse: collapse;
}
.stack-table th,
.stack-table td {
  border-top: 1px solid var(--border-color);
  padding: 0.55rem 0.75rem 0.55rem 0;
  vertical-align: top;
}
.stack-table th {
  font-family: 'Fragment Mono', 'Consolas', monospace;
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
  width: 1%;
  padding-right: 1.5rem;
}
