@import url('base.css');

.page-sub { margin-bottom: 1.2rem; }

.doc-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  max-width: 1240px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  gap: 2rem;
  align-items: start;
}

.sidebar,
.doc-section,
.table-wrap,
.doc-figure,
.metrics-grid,
.specs-grid,
.stack-grid,
.timeline,
.tutorial-list,
.download-grid,
.gallery-grid,
.video-grid,
.callout,
.mini-grid {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.sidebar {
  position: sticky;
  top: 88px;
  overflow: hidden;
}

.sidebar-title,
.sidebar-dl {
  padding: 1rem 1.1rem;
}

.sidebar-title {
  color: var(--white);
  font-family: var(--font-title);
  border-bottom: 1px solid var(--border-light);
}

.toc {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}

.toc-link {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.58rem 1.1rem;
  color: var(--text-mid);
  font-size: 0.83rem;
  border-left: 2px solid transparent;
}

.toc-link:hover,
.toc-link.active {
  color: var(--white);
  background: rgba(29, 53, 87, 0.05);
  border-left-color: var(--tech-green);
}

.toc-num {
  min-width: 22px;
  font-family: var(--font-mono);
  color: var(--text-light);
  font-size: 0.7rem;
}

.sidebar-dl {
  border-top: 1px solid var(--border-light);
  display: grid;
  gap: 0.5rem;
}

.sidebar-dl-title {
  color: var(--text-light);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-dl-btn {
  padding: 0.68rem 0.8rem;
  text-align: center;
  border-radius: 999px;
  border: 1px solid rgba(29, 53, 87, 0.18);
  background: rgba(29, 53, 87, 0.07);
  color: var(--white);
  font-size: 0.82rem;
}

.doc-content {
  min-width: 0;
  display: grid;
  gap: 1.25rem;
}

.doc-section {
  padding: 1.7rem;
}

.section-badge {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(29, 53, 87, 0.12);
  color: var(--tech-green);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin-bottom: 0.9rem;
}

.doc-section-title {
  color: var(--white);
  font-family: var(--font-title);
  font-size: 1.85rem;
  margin-bottom: 1rem;
}

.doc-lead {
  color: #dcf9e5;
  font-family: var(--font-title);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.doc-section p,
.doc-section li {
  color: var(--text-mid);
  line-height: 1.8;
  font-size: 0.94rem;
}

.sub-title {
  color: var(--white);
  font-family: var(--font-title);
  font-size: 1.1rem;
  margin: 1.7rem 0 0.8rem;
}

.callout {
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}

.callout strong { color: var(--white); }

.metrics-grid,
.specs-grid,
.stack-grid,
.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.metric-card,
.spec-tile,
.stack-card,
.mini-card {
  padding: 1rem 1.1rem;
  background: rgba(29, 53, 87, 0.04);
}

.metric-card strong,
.spec-tile-val,
.stack-card strong,
.mini-card strong {
  display: block;
  color: var(--white);
  font-family: var(--font-title);
  margin-bottom: 0.25rem;
}

.metric-card span,
.spec-tile-label,
.stack-card span,
.mini-card span {
  display: block;
  color: var(--text-light);
  font-size: 0.78rem;
  line-height: 1.6;
}

.doc-figure { overflow: hidden; }

.fig-img-wrap { padding: 1rem; }

.fig-img-wrap img {
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
}

.doc-figure figcaption {
  padding: 0.8rem 1rem;
  color: var(--text-light);
  font-size: 0.78rem;
  border-top: 1px solid var(--border-light);
}

.table-wrap { overflow-x: auto; }

.bom-table {
  width: 100%;
  border-collapse: collapse;
}

.bom-table th {
  background: rgba(29, 53, 87, 0.08);
  color: var(--white);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.85rem 1rem;
}

.bom-table td {
  padding: 0.85rem 1rem;
  color: var(--text-mid);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.bom-table tbody tr:last-child td { border-bottom: none; }
.bom-table tbody tr:nth-child(even) td { background: rgba(29, 53, 87, 0.04); }
.bom-table td.qty { color: var(--white); text-align: center; }

.timeline { overflow: hidden; }

.timeline-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
}

.timeline-row:last-child { border-bottom: none; }

.timeline-num {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(29, 53, 87, 0.12);
  color: var(--tech-green);
  font-family: var(--font-mono);
}

.timeline-body h4 {
  color: var(--white);
  font-family: var(--font-title);
  margin-bottom: 0.4rem;
}

.timeline-body ul {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.timeline-body li {
  position: relative;
  padding-left: 1rem;
}

.timeline-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tech-green);
}

.tutorial-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
}

.tutorial-step {
  display: grid;
  grid-template-columns: 64px 1fr 220px;
  gap: 1rem;
  padding: 1rem;
  background: rgba(29, 53, 87, 0.04);
  border-bottom: 1px solid var(--border-light);
}

.tutorial-step:last-child { border-bottom: none; }

.tutorial-num {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(29, 53, 87, 0.12);
  color: var(--tech-green);
  font-family: var(--font-mono);
}

.tutorial-body h4 {
  color: var(--white);
  font-family: var(--font-title);
  margin-bottom: 0.5rem;
}

.tutorial-body p { margin-bottom: 0.6rem; }

.tutorial-aside {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.9rem;
  background: rgba(29, 53, 87, 0.04);
}

.tutorial-aside strong {
  display: block;
  color: var(--white);
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
}

.tutorial-aside span {
  display: block;
  color: var(--text-light);
  font-size: 0.8rem;
  line-height: 1.7;
  margin-bottom: 0.35rem;
}

.download-grid,
.gallery-grid,
.video-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.download-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.download-card,
.gallery-card,
.video-card {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: rgba(29, 53, 87, 0.04);
}

.download-card {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.download-card h4,
.gallery-card h4,
.video-card h4 {
  color: var(--white);
  font-family: var(--font-title);
  margin-bottom: 0.3rem;
}

.download-card p,
.gallery-card p,
.video-card p {
  color: var(--text-mid);
  font-size: 0.88rem;
  line-height: 1.7;
}

.download-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.download-meta span {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--tech-green);
  border: 1px solid rgba(29, 53, 87, 0.18);
  background: rgba(29, 53, 87, 0.06);
}

.download-card .btn-secondary {
  width: fit-content;
}

.gallery-card img,
.video-card video {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.gallery-card-body,
.video-card-body {
  padding: 1rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
  background: rgba(29, 53, 87, 0.08);
  color: var(--blue-mid);
}

@media (max-width: 980px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .tutorial-step,
  .download-grid,
  .gallery-grid,
  .video-grid,
  .metrics-grid,
  .specs-grid,
  .stack-grid,
  .mini-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tutorial-step {
    grid-template-columns: 64px 1fr;
  }

  .tutorial-aside {
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  .doc-layout {
    padding: 2rem 1.15rem 3rem;
  }

  .tutorial-step,
  .download-grid,
  .gallery-grid,
  .video-grid,
  .metrics-grid,
  .specs-grid,
  .stack-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-aside {
    grid-column: auto;
  }

  .timeline-row {
    grid-template-columns: 1fr;
  }
}
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.improv-col {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.5rem;
}

.improv-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.improv-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  list-style: none;
}

.improv-list li {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.55;
  padding-left: 1rem;
  position: relative;
}

.improv-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--blue-mid);
  font-size: 0.7rem;
}

/* ===== TÉLÉCHARGEMENTS ===== */
.dl-categories {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dl-category {
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.dl-cat-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  background: var(--navy);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
}

.dl-items {
  display: flex;
  flex-direction: column;
}

.dl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  transition: background var(--tr);
  gap: 1rem;
}

.dl-row:last-child { border-bottom: none; }
.dl-row:hover { background: var(--bg); }

.dl-row-info { flex: 1; }

.dl-row-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.2rem;
}

.dl-row-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-light);
}

.dl-row-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  border: 1px solid #c8dcee;
  background: #eef4fa;
  padding: 0.35rem 0.9rem;
  border-radius: 3px;
  white-space: nowrap;
  transition: background var(--tr), border-color var(--tr);
  flex-shrink: 0;
}

.dl-row:hover .dl-row-btn {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .doc-layout {
    grid-template-columns: 220px 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    margin-bottom: 2rem;
  }

  .toc {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .toc-separator { display: none; }

  .specs-grid     { grid-template-columns: repeat(2, 1fr); }
  .calib-grid     { grid-template-columns: 1fr; }
  .improv-grid    { grid-template-columns: 1fr; }
  .system-diagram { flex-direction: column; }
  .sys-arrow      { transform: rotate(90deg); align-self: center; }
  .sys-block      { border-right: none; border-bottom: 1px solid var(--border); }
  .wiring-diagram { flex-direction: column; }
  .wiring-block   { border-right: none; border-bottom: 1px solid var(--border); }
  .wiring-arrows  { display: none; }
  .asm-step-body  { grid-template-columns: 1fr; }
  .asm-step-visual{ display: none; }
}

@media (max-width: 600px) {
  .specs-grid { grid-template-columns: repeat(2, 1fr); }
  .toc        { grid-template-columns: 1fr; }
  .doc-section-title { font-size: 1.35rem; }
}
