/* The tree of the texts (D-077). One root, worship; its branches are the parts of the
   law it touches; each branch carries the texts of the corpus, each text its articles.
   The links are drawn by the highlighter: thin where the tree rests, a full stroke on
   the path the reader has opened. Colours and faces are the application's (index.html). */
.colonne.large { max-width: none; }
.arbre { padding: 6px 0 40px; container: arbre / inline-size; }
.arbre-plan { position: relative; display: grid; grid-template-columns: 172px 268px minmax(250px, 300px) minmax(0, 1fr);
              column-gap: 56px; align-items: start; }
/* a text is open: the root and the branches step back, the page of the text takes the room */
.arbre[data-niveau="2"] .arbre-plan { grid-template-columns: 64px 226px 262px minmax(0, 1fr); column-gap: 42px; }
.arbre[data-niveau="2"] .arbre-racine .nom { font-size: 15px; line-height: 1.2; letter-spacing: 0; }
.arbre[data-niveau="2"] .arbre-racine dl, .arbre[data-niveau="2"] .arbre-racine .au,
.arbre[data-niveau="2"] .arbre-branches .poids, .arbre[data-niveau="2"] .arbre-branches .phrase { display: none; }
.arbre-liens { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.arbre-liens path { fill: none; stroke: var(--filet-fort); stroke-width: 1.2; stroke-linecap: round; }
.arbre-liens path.trait { stroke: var(--menthe); stroke-width: 9; opacity: .5; }
.arbre-liens.pousse path { stroke-dasharray: var(--l); stroke-dashoffset: var(--l);
                           animation: lien-pousse .75s var(--sortie) forwards; animation-delay: calc(var(--i, 0) * 26ms); }
@keyframes lien-pousse { to { stroke-dashoffset: 0; } }
.arbre-col { position: relative; z-index: 1; min-width: 0; margin: 0; padding: 0; list-style: none; }

/* the root */
.arbre-racine { align-self: start; position: sticky; top: max(20px, calc(50vh - 230px)); padding: 6px 0; }
.arbre-racine .nom { margin: 12px 0 2px; font: 600 38px/1.02 var(--titre); letter-spacing: -.02em; color: var(--encre); }
.arbre-racine .nom span { padding: 0 6px 2px; margin-left: -6px; border-radius: 3px;
                          background: linear-gradient(var(--menthe), var(--menthe)) no-repeat left / 100% 100%;
                          color: #12202B; animation: lu-trait .8s var(--sortie) .15s both; }
.arbre-racine dl { margin: 16px 0 0; display: grid; gap: 5px; font: 400 14px/1.35 var(--sans); color: var(--encre-2);
                   font-variant-numeric: tabular-nums lining-nums; }
.arbre-racine dl div { display: flex; gap: 6px; align-items: baseline; }
.arbre-racine dt { order: 2; }
.arbre-racine dd { order: 1; margin: 0; font-weight: 600; color: var(--encre); }
.arbre-racine .au { margin: 14px 0 0; font-size: 13px; color: var(--encre-2); }

/* a branch, a text: a word one can open; what is open is under the stroke */
.arbre-noeud { display: block; width: 100%; padding: 6px 10px 7px; border: 0; border-radius: 3px; background: none;
               color: var(--encre); text-align: left; cursor: pointer; font: inherit; }
.arbre-noeud:hover { background: var(--sable-2); }
.arbre-noeud[aria-expanded="true"] { background: var(--surligne); box-shadow: inset 3px 0 0 var(--emeraude); }
.arbre-noeud .titre { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.arbre-branches .titre b { font: 600 15.5px/1.3 var(--sans); }
.arbre-noeud .n { flex: none; font: 400 13px/1 var(--sans); color: var(--encre-2); font-variant-numeric: tabular-nums; }
.arbre-noeud .poids { display: block; height: 3px; margin-top: 6px; border-radius: 2px; background: var(--filet);
                      width: calc(var(--p) * 100%); min-width: 6px; }
.arbre-noeud[aria-expanded="true"] .poids { background: var(--emeraude); }
.arbre-noeud .phrase { display: none; margin-top: 6px; font: 400 13.5px/1.4 var(--sans); color: var(--encre-2); }
.arbre-noeud[aria-expanded="true"] .phrase { display: block; }
.arbre-textes .titre b { font: 400 16.5px/1.3 var(--serif); }
.arbre-textes .meta { display: block; margin-top: 3px; font: 400 13px/1.4 var(--sans); color: var(--encre-2);
                      font-variant-numeric: tabular-nums; }
.arbre-textes .local { color: var(--ambre); font-weight: 600; }
.arbre-col.nait > li { animation: arbre-ecrit .5s var(--sortie) backwards; animation-delay: calc(80ms + var(--i, 0) * 24ms); }
@keyframes arbre-ecrit { from { clip-path: inset(0 100% 0 0); } }

/* the articles of a text, then one article as the corpus holds it */
.arbre-feuille { align-self: start; min-height: 120px; }
.arbre-feuille .invite { margin: 10px 0 0; max-width: 34ch; font: italic 400 15.5px/1.5 var(--serif); color: var(--encre-2); }
.arbre-feuille h4 { margin: 4px 0 2px; font: 600 21px/1.25 var(--serif); text-wrap: balance; }
.arbre-feuille .compte-art { margin: 0 0 12px; font-size: 13.5px; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.arbre-feuille input.aller { width: 100%; max-width: 15rem; height: 34px; margin: 0 0 12px; padding: 0 10px; font: inherit; font-size: 14.5px;
                             color: var(--encre); background: var(--page); border: 1px solid var(--filet-fort); border-radius: 3px; }
.arbre-feuille input.aller:focus { outline: none; border-color: var(--emeraude); }
.arbre-articles { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.arbre-articles button { min-width: 36px; height: 28px; padding: 0 8px; border: 1px solid var(--filet); border-radius: 3px;
                         background: var(--page); color: var(--encre); cursor: pointer; font: 600 13px/1 var(--sans);
                         font-variant-numeric: tabular-nums; white-space: nowrap; }
.arbre-articles button:hover { border-color: var(--emeraude); color: var(--emeraude); }
.arbre-articles button.fini { color: var(--encre-2); border-style: dotted; font-weight: 400; text-decoration: line-through; }
.arbre-articles button[aria-current="true"] { background: var(--emeraude); border-color: var(--emeraude); color: var(--sur-accent, #fff); }
.arbre-article { margin: 16px 0 0; padding: 16px 0 0; border-top: 3px double var(--filet-fort); animation: arbre-ecrit .45s var(--sortie) backwards; }
.arbre-boite { scroll-margin: 20px; }
.arbre-boite:focus { outline: none; }
.arbre-article .ref { margin: 0; font: 600 12.5px/1.4 var(--sans); color: var(--encre-2); }
.arbre-article .num { margin: 2px 0 6px; font: 600 30px/1.1 var(--serif); color: var(--emeraude); font-variant-numeric: lining-nums; }
.arbre-article .vigueur { margin: 0 0 12px; font: 600 14px/1.4 var(--sans); font-variant-numeric: tabular-nums; }
.arbre-article .vigueur.finie { color: var(--ambre); }
.arbre-article .contenu p { margin: 0 0 10px; font: 400 17px/1.6 var(--serif); overflow-wrap: anywhere; }
.arbre-article .suite { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; font-size: 14.5px; }
.arbre-article .suite button { padding: 0; text-align: left; border: 0; background: none; cursor: pointer; font: inherit; color: var(--emeraude);
                               text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.arbre-article .mention { margin: 14px 0 0; padding: 0; border: 0; font: italic 400 14.5px/1.5 var(--serif); color: var(--encre-2); }
.arbre-fil { display: none; }

/* the doctrine of a branch (D-096) */
.vers-branches .branches-liees { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 8px 0 0; padding: 0; list-style: none; }
.vers-branches .branches-liees li { display: flex; flex-direction: column; gap: 2px; }
.vers-branches .branches-liees button { padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
                                         font: 600 15px/1.35 var(--sans); color: var(--emeraude); text-decoration: underline;
                                         text-underline-offset: 3px; text-decoration-thickness: 1px; }
.vers-branches .branches-liees span { font: 400 12.5px/1.4 var(--sans); color: var(--encre-2); }
.vers-branches .branches-liees li { padding: 8px 12px; border: 1px solid var(--filet); border-radius: 3px; }
.arbre-textes li.doctrine { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--filet); }
.arbre-textes .arbre-noeud.doctrine .titre b { font: 600 15.5px/1.3 var(--sans); color: var(--emeraude); }
.arbre-noeud.seule-doctrine .titre b { font-style: italic; }
.doc-outils { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.doc-outils select, .doc-outils input { height: 34px; padding: 0 10px; font: inherit; font-size: 14.5px; color: var(--encre);
                                         background: var(--page); border: 1px solid var(--filet-fort); border-radius: 3px; }
.doc-outils input { flex: 1; min-width: 12rem; }
.doc-outils select:focus, .doc-outils input:focus { outline: 2px solid transparent; border-color: var(--emeraude); }
.doc-sujet { margin: 0 0 6px; border-top: 1px solid var(--filet); }
.doc-sujet > summary { display: flex; align-items: baseline; gap: 8px; padding: 12px 2px 10px;
                       cursor: pointer; list-style: none; font: 600 16.5px/1.3 var(--sans); color: var(--encre); }
.doc-sujet > summary::-webkit-details-marker { display: none; }
.doc-sujet > summary::before { content: "›"; display: inline-block; width: 1em; color: var(--encre-2); transition: transform .2s var(--sortie); }
.doc-sujet[open] > summary::before { transform: rotate(90deg); }
.doc-sujet > summary b { flex: 1; font-weight: 600; }
.doc-sujet > summary .n { font: 400 13px/1 var(--sans); color: var(--encre-2); font-variant-numeric: tabular-nums; }
.doc-phrase { margin: 0 0 10px; max-width: 62ch; font: italic 400 15px/1.5 var(--serif); color: var(--encre-2); }
.doc-type { margin: 0 0 12px; }
.doc-type h6 { margin: 8px 0 2px; font: 600 12.5px/1.4 var(--sans); letter-spacing: .02em; color: var(--encre-2); }
.doc-portee { margin: 0 0 6px; max-width: 62ch; font: 400 13px/1.45 var(--sans); color: var(--encre-2); }
.doc-liste { margin: 0; padding: 0; list-style: none; }
.doc-carte { padding: 8px 0 9px; border-bottom: 1px solid var(--filet); }
.doc-titre { display: block; width: 100%; padding: 0; text-align: left; border: 0; background: none; cursor: pointer;
             font: 400 16px/1.4 var(--serif); color: var(--encre); text-wrap: pretty; overflow-wrap: anywhere; }
.doc-titre:hover { color: var(--emeraude); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 4px 0 0; font: 400 13px/1.4 var(--sans); color: var(--encre-2);
            font-variant-numeric: tabular-nums; }
.doc-meta .etat, .doc-ref .etat { padding: 0 6px; border-radius: 3px; font: 600 12px/1.6 var(--sans); }
.doc-meta .etat.verifier, .doc-ref .etat.verifier { color: var(--ambre); background: var(--ambre-fond); }
.doc-meta .etat.depasse, .doc-ref .etat.depasse { color: var(--rouge); background: var(--rouge-fond); }
.doc-meta .etat.scan { color: var(--encre-2); border: 1px dotted var(--filet-fort); }
.doc-pourquoi { margin: 3px 0 0; font: 400 12.5px/1.4 var(--sans); color: var(--encre-2); }
.doc-lecture { padding-top: 4px; }
.doc-lecture:focus { outline: none; }
.doc-lecture .ref { margin: 0; font: 600 12.5px/1.4 var(--sans); color: var(--encre-2); }
.doc-retour, .doc-source { display: inline-block; margin: 0 0 12px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit;
                           font-size: 14.5px; color: var(--emeraude); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.doc-cites { margin: 6px 0 14px; }
.doc-cites .arbre-articles button { width: auto; max-width: 100%; height: auto; min-height: 28px; padding: 5px 8px;
                                   font-weight: 400; line-height: 1.35; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.doc-etat { margin: -6px 0 10px; font: 400 13px/1.4 var(--sans); color: var(--encre-2); }
.doc-etat:empty { display: none; }
.doc-passage { padding: 12px 0 4px; border-top: 1px solid var(--filet); }
.doc-ref { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 6px; font: 600 12.5px/1.4 var(--sans); color: var(--encre-2); }
.doc-raison { margin: 0 0 8px; font: italic 400 13.5px/1.45 var(--sans); color: var(--ambre); }
.doc-passage p:not(.doc-ref):not(.doc-raison) { margin: 0 0 10px; font: 400 16.5px/1.6 var(--serif); overflow-wrap: anywhere; }
.doc-lecture .mention, .arbre-feuille > .mention { margin: 14px 0 0; font: italic 400 14.5px/1.5 var(--serif); color: var(--encre-2); }

/* in the rail */
.vers-arbre { margin: -8px 14px 18px; height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 0;
              border-radius: 999px; background: none; color: var(--sur-marine); cursor: pointer; font: 600 15px/1 var(--sans); }
.vers-arbre:hover { background: var(--marine-2); }
.vers-arbre[aria-current="true"] { background: var(--marine-2); color: #fff; box-shadow: inset 3px 0 0 var(--menthe); }

/* narrow: one level at a time, and the way back above it */
@container arbre (max-width: 1040px) {
  .arbre-plan { display: block; }
  .arbre-liens { display: none; }
  .arbre-fil { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 14px; padding: 0; list-style: none; font-size: 14.5px; }
  .arbre-fil li + li::before { content: "›"; margin-right: 8px; color: var(--encre-2); }
  .arbre-fil button { padding: 0; border: 0; background: none; font: inherit; color: var(--emeraude); cursor: pointer;
                      text-decoration: underline; text-underline-offset: 3px; }
  .arbre-fil button, .arbre-fil .ici { display: inline-block; padding: 10px 0; text-align: left; }
  .arbre-fil .ici { color: var(--encre); font-weight: 600; }
  .arbre-fil li { display: flex; align-items: baseline; }
  .arbre-racine { position: static; }
  .arbre[data-niveau="0"] .arbre-fil { display: none; }
  .arbre-feuille input.aller { font-size: 16px; height: 44px; }
  .arbre-racine .nom { font-size: 30px; }
  .arbre-racine dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arbre[data-niveau="2"] .arbre-plan { display: block; }
  .arbre[data-niveau="1"] .arbre-racine, .arbre[data-niveau="1"] .arbre-branches,
  .arbre[data-niveau="2"] .arbre-racine, .arbre[data-niveau="2"] .arbre-branches, .arbre[data-niveau="2"] .arbre-textes { display: none; }
  .arbre[data-niveau="0"] .arbre-textes, .arbre[data-niveau="0"] .arbre-feuille, .arbre[data-niveau="1"] .arbre-feuille { display: none; }
  .arbre-branches { margin-top: 18px; }
  .arbre-textes { margin-top: 0 !important; }
  .arbre-noeud { padding: 11px 10px 12px; }
  .arbre-articles button { height: 36px; min-width: 44px; }
  .doc-outils select, .doc-outils input { font-size: 16px; height: 44px; }
  .doc-titre { min-height: 44px; padding: 6px 0; }
  .doc-retour, .doc-source { min-height: 44px; padding: 10px 0; }
  .doc-cites .arbre-articles button { min-height: 44px; }
}
@media (max-width: 640px) {
  .vers-branches .branches-liees li { padding: 0; }
  .vers-branches .branches-liees button { display: block; width: 100%; min-height: 44px; padding: 10px 12px 2px; }
  .vers-branches .branches-liees span { padding: 0 12px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .arbre-liens.pousse path { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
  .arbre-col.nait > li, .arbre-article, .arbre-racine .nom span { animation: none; }
  .doc-sujet > summary::before { transition: none; }
}
