/* ==========================================================================
   SR Editer — Documentation (docs.html)
   Chargé après article.css : surcharge la mise en page article (sommaire
   à 300px, tiroir mobile) et ajoute les composants de doc (callouts,
   cartes, tableaux, étapes, FAQ, pagination).
   ========================================================================== */

/* Layout override for modern doc style */
.aww-docs {
  padding: 0 4rem 10rem;
  position: relative;
}
.aww-docs-container {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 4rem;
  align-items: start;
}

/* Sidebar navigation */
.aww-docs-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 120px);
}
.docs-sidebar-inner {
  height: 100%;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.docs-sidebar-inner::-webkit-scrollbar {
  width: 4px;
}
.docs-sidebar-inner::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

/* Search Box & Controls */
.doc-search-box {
  position: relative;
  margin-bottom: 1.25rem;
}
.doc-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.65rem 3.6rem 0.65rem 2.4rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.84rem;
  outline: none;
  transition: all 0.2s ease;
}
.doc-search-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.18);
}
.doc-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
.doc-search-kbd {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  padding: 0.15rem 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}
.doc-search-clear {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  cursor: pointer;
  display: block;
  padding: 0.2rem 0.4rem;
  line-height: 1;
  border-radius: 4px;
}
.doc-search-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.doc-search-status {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 1rem;
  padding: 0 0.5rem;
  display: block;
}

/* Navigation Groups */
.docs-nav-group {
  margin-bottom: 1.5rem;
}
.docs-nav-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  padding: 0 0.75rem;
  margin-bottom: 0.45rem;
}
.docs-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0;
  margin: 0;
}
.docs-nav-list li a.aww-toc-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.docs-nav-list li a.aww-toc-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(3px);
}
.docs-nav-list li a.aww-toc-link.active {
  color: #fff;
  background: rgba(255, 107, 53, 0.15);
  border-color: rgba(255, 107, 53, 0.35);
  font-weight: 600;
  transform: translateX(3px);
  box-shadow: 0 0 16px rgba(255, 107, 53, 0.12);
}

/* Mobile Sticky Nav Bar */
.doc-mobile-nav-bar {
  display: none;
  position: sticky;
  top: 72px;
  z-index: 40;
  background: rgba(10, 11, 16, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  margin: -1rem -1rem 2rem;
}
.doc-mobile-nav-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.doc-mobile-nav-toggle svg {
  flex-shrink: 0;
  color: var(--accent);
}
.doc-mobile-active-section {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

/* Content styling */
.aww-docs-section {
  scroll-margin-top: 130px;
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.aww-docs-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.doc-section-header {
  margin-bottom: 1.75rem;
}
.doc-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.doc-section-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}
.doc-section-lead {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  max-width: 840px;
}

/* Callout components */
.doc-callout {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  border-radius: 12px;
  margin: 1.75rem 0;
  border-left: 4px solid;
  font-size: 0.94rem;
  line-height: 1.65;
  backdrop-filter: blur(12px);
}
.doc-callout-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 3px;
}
.doc-callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
  color: #fde68a;
}
.doc-callout-warning strong { color: #fbbf24; }
.doc-callout-info {
  background: rgba(56, 189, 248, 0.08);
  border-color: #38bdf8;
  color: #bae6fd;
}
.doc-callout-info strong { color: #7dd3fc; }
.doc-callout-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
  color: #a7f3d0;
}
.doc-callout-success strong { color: #34d399; }

/* Comparison Tables */
.doc-table-wrapper {
  overflow-x: auto;
  margin: 1.75rem 0;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  scrollbar-width: thin;
}
.doc-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.doc-table th {
  padding: 0.95rem 1.15rem;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.doc-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  vertical-align: middle;
}
.doc-table tr:last-child td {
  border-bottom: none;
}
.doc-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.9);
}

/* Badges */
.doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.doc-badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.doc-badge-orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.doc-badge-red { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.doc-badge-blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.doc-badge-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.doc-badge-gray { background: rgba(156, 163, 175, 0.12); color: #9ca3af; border: 1px solid rgba(156, 163, 175, 0.25); }

/* Keycaps Keyboard Shortcuts */
kbd {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  font-size: 0.76rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom-width: 2px;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Cards Grid */
.doc-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.doc-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.doc-card-item {
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, background 0.2s;
}
.doc-card-item:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.035);
}
.doc-card-item h4 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.doc-card-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.28);
  color: var(--accent);
  flex-shrink: 0;
}
.doc-card-icon-wrap svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}
.doc-card-icon-wrap.success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.doc-card-icon-wrap.danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.doc-card-icon-wrap.warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.doc-card-icon-wrap.info {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}
.doc-card-icon-wrap.purple {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.3);
  color: #c084fc;
}
.doc-card-item p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Step flow diagram */
.doc-flow {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.75rem 0;
}
.doc-flow-step {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
}
.doc-flow-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 107, 53, 0.15);
  border: 1px solid rgba(255, 107, 53, 0.4);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-flow-content h5 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.doc-flow-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.55;
}

/* Carte de téléchargement */
.doc-download-card {
  margin: 2rem 0;
  border-color: rgba(255, 107, 53, 0.35);
  background: rgba(255, 107, 53, 0.03);
}
.doc-download-card h3 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.aww-docs-content .doc-download-card p {
  margin-bottom: 1.25rem;
}
.doc-download-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.doc-download-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Listes à puces dans les cartes */
.doc-list {
  margin: 0.75rem 0 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}
.doc-list strong {
  color: rgba(255, 255, 255, 0.85);
}

/* Cartes "pris en charge" / "pas encore possible" */
.doc-card-item--success { border-color: rgba(16, 185, 129, 0.3); }
.doc-card-item--danger { border-color: rgba(239, 68, 68, 0.3); }
.doc-card-title--success { color: #34d399 !important; }
.doc-card-title--danger { color: #f87171 !important; }

/* FAQ */
.doc-faq {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

/* Libellé du bouton de sommaire mobile */
.doc-mobile-nav-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Next / Previous Pagination Footer */
.doc-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.doc-pagination-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s ease;
}
.doc-pagination-card:hover {
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.04);
  transform: translateY(-2px);
}
.doc-pagination-card.next {
  text-align: right;
  align-items: flex-end;
}
.doc-pagination-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.doc-pagination-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

/* Floating Back to Top */
.doc-back-to-top {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(18, 19, 26, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.doc-back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.doc-back-to-top:hover {
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.15);
  color: var(--accent);
}

/* Responsive Mobile & Tablet */
@media (max-width: 992px) {
  .aww-docs {
    padding: 0 1.25rem 6rem;
  }
  .aww-docs-container {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .doc-mobile-nav-bar {
    display: block;
  }
  .aww-docs-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: rgba(10, 11, 16, 0.96);
    backdrop-filter: blur(20px);
    padding: 5rem 1.5rem 2rem;
    overflow-y: auto;
  }
  .aww-docs-sidebar.is-open {
    display: block;
  }
  .docs-sidebar-inner {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .doc-pagination {
    grid-template-columns: minmax(0, 1fr);
  }
  .doc-pagination-card.next {
    text-align: left;
    align-items: flex-start;
  }
  .doc-back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}
/* The modeling guide uses the same reading width as the other chapters. */
.doc-steps { padding-left: 1.5rem; display: grid; gap: 1rem; line-height: 1.7; }
.doc-steps li { padding-left: .35rem; }
