/* ===== DOCUMENTATION PAGE ===== */

/* Barre de recherche */
.doc-search-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1.5rem 0;
}

.doc-search-form {
  display: flex;
  gap: 0;
  max-width: 680px;
  border: 2px solid var(--teal);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
}

.doc-search-form input {
  flex: 1;
  border: none;
  border-radius: 0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  outline: none;
  box-shadow: none;
}

.doc-search-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s;
}

.doc-search-btn:hover {
  background: var(--teal-light);
}

.doc-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.doc-tag-label {
  font-size: 0.82rem;
  color: var(--gray-600);
  font-weight: 600;
}

.doc-tag {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.18s;
}

.doc-tag:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.doc-tag.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

/* Navigation catégories */
.doc-cat-nav {
  background: var(--navy);
  position: sticky;
  top: 72px; /* hauteur du site-header */
  z-index: 90;
  overflow-x: auto;
}

.doc-cat-nav .wrapper {
  display: flex;
  gap: 0;
  min-width: max-content;
  padding-top: 0;
  padding-bottom: 0;
}

.doc-cat-nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  display: block;
}

.doc-cat-nav a:hover {
  color: #fff;
  border-bottom-color: var(--teal-light);
  background: rgba(255,255,255,0.06);
}

/* Catégories */
.doc-categories {
  background: var(--gray-50);
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.doc-category {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 2rem;
  scroll-margin-top: 120px;
}

.doc-cat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.5rem;
  background: var(--navy);
  color: #fff;
}

.doc-cat-icon {
  font-size: 1.4rem;
  width: 2.2rem;
  text-align: center;
}

.doc-cat-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  flex: 1;
}

.doc-cat-count {
  font-size: 0.78rem;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

/* Liste de documents */
.doc-list {
  display: flex;
  flex-direction: column;
}

.doc-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
}

.doc-item:last-child {
  border-bottom: none;
}

.doc-item:hover {
  background: var(--gray-50);
}

/* Icône type de fichier */
.doc-item-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  margin-top: 0.1rem;
}

.doc-item-icon.pdf { background: #e53e3e; }
.doc-item-icon.doc { background: #2b6cb0; }
.doc-item-icon.xls { background: #276749; }
.doc-item-icon.ppt { background: #c05621; }

.doc-item-body {
  flex: 1;
  min-width: 0;
}

.doc-item-body h3 {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
}

.doc-item-body h3 a {
  color: var(--navy);
  text-decoration: none;
  transition: color 0.15s;
}

.doc-item-body h3 a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.doc-item-body p {
  margin: 0 0 0.5rem;
  font-size: 0.825rem;
  color: var(--gray-600);
  line-height: 1.5;
}

.doc-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Badges de type */
.doc-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--teal-pale);
  color: var(--teal);
}

.doc-badge.text-off {
  background: #ebf4ff;
  color: #2b6cb0;
}

.doc-badge.rapport {
  background: #fff5e6;
  color: #c05621;
}

.doc-badge.fiche {
  background: #f0fff4;
  color: #276749;
}

.doc-badge.modele {
  background: #faf5ff;
  color: #6b21a8;
}

.doc-date {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 500;
}

/* Bouton téléchargement */
.doc-dl-btn {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--teal-pale);
  color: var(--teal);
  transition: background 0.18s, color 0.18s, transform 0.18s;
  text-decoration: none;
  margin-top: 0.1rem;
}

.doc-dl-btn:hover {
  background: var(--teal);
  color: #fff;
  transform: translateY(-1px);
}

/* Lien voir plus */
.doc-see-more {
  display: block;
  text-align: right;
  padding: 0.75rem 1.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  transition: color 0.15s;
}

.doc-see-more:hover {
  color: var(--teal-light);
}

/* Responsive */
@media (max-width: 600px) {
  .doc-item {
    gap: 0.75rem;
    padding: 1rem;
  }

  .doc-item-icon {
    width: 2rem;
    height: 2rem;
    font-size: 0.55rem;
  }

  .doc-cat-nav a {
    font-size: 0.76rem;
    padding: 0.65rem 0.75rem;
  }
}
