/* Figures, diagrams and compact tables for the glossary entries
   (glossary/*.html and the French pages built from them in fr/glossaire/).
   Colours come from the theme tokens, so every diagram follows the light
   and dark schemes. Text lives in HTML wherever it can, so it reflows on a
   phone and is translated by tools/build-french-pages.mjs. */

.gl-figure {
  margin: 24px 0 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-2);
}
.gl-figure > img,
.gl-figure__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.gl-figure figcaption {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.55;
}
.gl-figure figcaption strong { color: var(--ink); }
.gl-figure__label {
  margin: 0 0 10px;
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gl-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.gl-split--narrow-media { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.gl-phone { max-width: 260px; margin: 0 auto; background: transparent; }

/* Two drawings side by side, labelled in HTML (they stay side by side on a phone) */
.gl-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gl-pair > li { margin: 0; list-style: none; }
.gl-pair__head { margin: 0 0 8px; line-height: 1.35; }
.gl-pair__head strong { display: block; font-size: 1.05rem; }
.gl-pair__head span { color: var(--ink-2); font-size: 0.85rem; }
.gl-pair__note { margin: 8px 0 0; color: var(--ink-2); font-size: 0.82rem; line-height: 1.4; }

/* Inline SVG drawings */
.gl-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: inherit;
}
.gl-svg--wide { max-width: 680px; margin: 0 auto; }
.gl-svg text { fill: var(--ink); font-weight: 650; }
.gl-svg .t-muted { fill: var(--ink-2); font-weight: 600; }
.gl-svg .t-accent { fill: var(--accent); }
.gl-svg .t-on-accent { fill: var(--on-fill); }
.gl-svg .ln { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.gl-svg .ln-thin { fill: none; stroke: var(--ink-2); stroke-width: 1.2; stroke-linecap: round; }
.gl-svg .ln-accent { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gl-svg .ln-dash { fill: none; stroke: var(--ink-3); stroke-width: 1.4; stroke-dasharray: 5 5; }
.gl-svg .f-paper { fill: var(--paper); }
.gl-svg .f-paper2 { fill: var(--paper-2); }
.gl-svg .f-line { fill: var(--line); }
.gl-svg .f-strong { fill: var(--line-strong); }
.gl-svg .f-ink { fill: var(--ink); }
.gl-svg .f-ink3 { fill: var(--ink-3); }
.gl-svg .f-soft { fill: var(--accent-soft); }
.gl-svg .f-accent { fill: var(--accent); }
.gl-svg .f-danger { fill: var(--danger); }
.gl-svg .s-line { stroke: var(--line-strong); }
.gl-svg .s-ink { stroke: var(--ink); }
.gl-svg .s-accent { stroke: var(--accent); }
.gl-svg .sw1 { stroke-width: 1.2; }
.gl-svg .sw2 { stroke-width: 2; }

/* Compact tables that fit a phone without sideways scrolling */
.gl-table {
  width: 100%;
  margin: 14px 0 0;
  border-collapse: collapse;
  background: var(--paper);
  font-size: 0.82rem;
  line-height: 1.45;
}
.gl-table caption {
  padding: 0 0 8px;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}
.gl-table th,
.gl-table td {
  padding: 7px 9px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.gl-table th { background: var(--paper-2); font-weight: 650; }
.gl-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gl-table .mono { white-space: nowrap; }
.gl-table .mono,
.gl-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem; }
.gl-table .lvl1 { padding-left: 22px; }
.gl-table .lvl2 { padding-left: 38px; }
.gl-table tr.is-head td { font-weight: 700; }

/* Key figures above a drawing */
.gl-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.gl-facts > div {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.gl-facts dt { color: var(--ink-3); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.gl-facts dd { margin: 2px 0 0; font-weight: 700; line-height: 1.3; }

/* Legends under drawings */
.gl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 12px 0 0;
  padding: 0;
  font-size: 0.85rem;
}
.gl-legend li { display: flex; align-items: center; gap: 8px; list-style: none; }
.gl-legend--stack { flex-direction: column; gap: 12px; margin: 0; font-size: 0.9rem; line-height: 1.45; }
.gl-legend--stack li { align-items: flex-start; }
.gl-legend svg { flex: none; width: 22px; height: 22px; }
.gl-key {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

/* Timeline (dates) */
.gl-timeline {
  position: relative;
  margin: 4px 0 0;
  padding: 0 0 0 26px;
  list-style: none;
}
.gl-timeline::before {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 7px;
  width: 2px;
  background: var(--line-strong);
  content: "";
}
.gl-timeline li {
  position: relative;
  margin: 0 0 14px;
  list-style: none;
  line-height: 1.5;
}
.gl-timeline li:last-child { margin-bottom: 0; }
.gl-timeline li::before {
  position: absolute;
  top: 6px;
  left: -25px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink-3);
  border-radius: 50%;
  background: var(--paper);
  content: "";
}
.gl-timeline li.is-key::before { border-color: var(--accent); background: var(--accent); }
.gl-timeline time,
.gl-timeline .gl-when { display: block; color: var(--ink-2); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; }
.gl-timeline li.is-key time { color: var(--accent); }
.gl-timeline strong { display: block; }

/* Pyramid of documents (process, procedure, instruction, record) */
.gl-pyramid { margin: 0; padding: 0; list-style: none; }
.gl-pyramid li {
  margin: 0 auto 6px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  list-style: none;
  text-align: center;
  line-height: 1.4;
}
.gl-pyramid li:nth-child(1) { width: 52%; }
.gl-pyramid li:nth-child(2) { width: 68%; }
.gl-pyramid li:nth-child(3) { width: 84%; }
.gl-pyramid li.is-focus { border-color: var(--accent); background: var(--accent-soft); }
.gl-pyramid li:nth-child(4) { width: 100%; }
.gl-pyramid strong { display: block; }
.gl-pyramid span { color: var(--ink-2); font-size: 0.85rem; }

/* A short document shown as a page */
.gl-doc {
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 0.88rem;
  line-height: 1.55;
}
.gl-doc__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  color: var(--ink-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.gl-doc h3 { margin: 0 0 10px; font-size: 1.05rem; line-height: 1.3; }
.gl-doc dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 14px;
  margin: 0 0 10px;
}
.gl-doc dt { font-weight: 700; }
.gl-doc dd { margin: 0; }
.gl-doc ol { margin: 4px 0 10px; padding-left: 22px; }
.gl-doc ol li { margin: 0 0 3px; }
.gl-doc p { margin: 0; font-size: inherit; }
.gl-doc__sub { margin: 10px 0 2px; color: var(--ink); font-weight: 700; }

/* Cards with a small drawing on top */
.gl-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gl-cards > li {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  list-style: none;
  line-height: 1.5;
}
.gl-cards .gl-svg { max-width: 150px; margin: 0 auto 10px; }
.gl-cards h3 { margin: 0 0 4px; font-size: 1rem; }
.gl-cards p { margin: 0; color: var(--ink-2); font-size: 0.86rem; }

/* Map of document types by stage of the product's life */
.gl-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gl-map > li {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--paper);
  list-style: none;
}
.gl-map h3 { margin: 0 0 8px; font-size: 0.9rem; line-height: 1.3; }
.gl-map ul { margin: 0; padding: 0; }
.gl-map ul li {
  margin: 0 0 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--paper-2);
  list-style: none;
  font-size: 0.8rem;
  line-height: 1.35;
}
.gl-map ul li a { color: inherit; }

/* Product structure tree */
.gl-tree,
.gl-tree ul { margin: 0; padding: 0; list-style: none; }
.gl-tree ul { margin-left: 14px; padding-left: 14px; border-left: 2px solid var(--line-strong); }
.gl-tree li { position: relative; margin: 6px 0; list-style: none; }
.gl-tree ul > li::before {
  position: absolute;
  top: 17px;
  left: -14px;
  width: 12px;
  height: 2px;
  background: var(--line-strong);
  content: "";
}
.gl-node {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 0.88rem;
  line-height: 1.4;
}
.gl-node--sub { border-color: var(--accent); background: var(--accent-soft); }
.gl-lvl {
  flex: none;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 700;
}
.gl-qty { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 650; }

/* Standard work combination table */
.gl-gantt .gl-track-cell { width: 44%; min-width: 120px; }
.gl-track {
  position: relative;
  display: block;
  height: 18px;
  border-radius: 4px;
  background: var(--paper-2);
}
.gl-track::after {
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: var(--takt, 90.9%);
  width: 2px;
  background: var(--danger);
  content: "";
}
.gl-bar { position: absolute; top: 3px; display: block; height: 12px; border-radius: 3px; }
.gl-bar--manual { background: var(--ink); }
.gl-bar--auto { top: 6px; height: 6px; border: 1.5px dashed var(--accent); background: transparent; }
.gl-bar--walk { background: repeating-linear-gradient(90deg, var(--ink-3) 0 3px, transparent 3px 6px); }
.gl-swatch { display: inline-block; flex: none; width: 22px; height: 10px; border-radius: 3px; }

/* An annotated file excerpt */
.gl-code {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.6;
  white-space: pre;
}
.gl-code .c-key { color: var(--accent); font-weight: 700; }
.gl-code .c-note { color: var(--ink-3); }

@media (max-width: 720px) {
  .gl-figure { padding: 12px; }
  .gl-split,
  .gl-split--narrow-media { grid-template-columns: 1fr; }
  .gl-cards { grid-template-columns: 1fr; }
  .gl-doc dl { grid-template-columns: 1fr; gap: 0; }
  .gl-doc dd { margin-bottom: 6px; }
  .gl-cards .gl-svg { max-width: 120px; }
  .gl-map { grid-template-columns: 1fr 1fr; }
  .gl-pyramid li:nth-child(1) { width: 76%; }
  .gl-pyramid li:nth-child(2) { width: 84%; }
  .gl-pyramid li:nth-child(3) { width: 92%; }
  .gl-table { font-size: 0.78rem; }
  .gl-table th, .gl-table td { padding: 6px; }
  .gl-table .lvl1 { padding-left: 14px; }
  .gl-table .lvl2 { padding-left: 24px; }
  /* The combination table: number, element and times on one line, the time line under them */
  .gl-gantt tr { display: grid; grid-template-columns: 38px minmax(0, 1fr) 56px 40px 42px; }
  .gl-gantt th, .gl-gantt td { border-width: 0 0 1px; }
  .gl-gantt .gl-track-cell, .gl-gantt tr > :last-child { grid-column: 1 / -1; width: auto; min-width: 0; }
  .gl-gantt tr > :last-child { border-bottom: 2px solid var(--line-strong); }
}
@media (max-width: 420px) {
  .gl-map { grid-template-columns: 1fr; }
}
