/* Pages des modèles de serveur : galerie de cartes (index) et fiche détaillée. */
/* Index : faits du hero, barre de recherche et de catégories, grille de cartes */
.mdl-facts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 22px; padding: 0; list-style: none; color: var(--text-2); }
.mdl-facts li { position: relative; padding-left: 14px; }
.mdl-facts li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.mdl-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 16px; margin: 0 0 8px; padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.mdl-search { max-width: 460px; }
.mdl-count { margin: 0; white-space: nowrap; }
.mdl-toc { grid-column: 1 / -1; min-width: 0; display: flex; flex-wrap: nowrap; gap: 6px; margin: 0; padding: 2px 0 4px; list-style: none; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); padding-right: 48px; }
.mdl-toc::-webkit-scrollbar { display: none; }
.mdl-toc li { flex: none; }
.mdl-toc .chip { min-height: 32px; padding: 4px 12px; white-space: nowrap; text-decoration: none; }
.mdl-toc .chip.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--link); }
.mdl-chip-n { color: var(--muted); font-weight: 500; }
.mdl-section { margin-top: clamp(36px, 5vw, 56px); }
.mdl-section[hidden], .mdl-card[hidden], .mdl-toc li[hidden] { display: none; }
.mdl-index h2.mdl-group { margin: 0 0 16px; font-size: 1.5rem; scroll-margin-top: 130px; }
.mdl-group-n { font-size: 1rem; font-weight: 500; }
.mdl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.mdl-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.mdl-card:hover, .mdl-card:focus-within { border-color: var(--border-strong); box-shadow: var(--shadow); }
.mdl-card-link { font-weight: 700; font-size: 1.05rem; color: var(--text); overflow-wrap: anywhere; }
.mdl-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.mdl-card-link:hover { text-decoration: none; }
.mdl-card-link:focus-visible { outline: none; }
.mdl-card:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.mdl-card-sum { display: -webkit-box; margin: 6px 0 12px; overflow: hidden; color: var(--text-2); font-size: .92rem; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; }
.mdl-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: auto 0 0; color: var(--muted); }
.mdl-empty { margin-top: 40px; text-align: center; }
@media (min-width: 640px) { .mdl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .mdl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 800px) { .mdl-bar { position: sticky; top: var(--header-h); z-index: 5; } }
@media (max-width: 799px) { .mdl-index h2.mdl-group { scroll-margin-top: 0; } }
@media (max-width: 520px) { .mdl-bar { grid-template-columns: minmax(0, 1fr); } .mdl-search { max-width: none; } }

/* Listes simples (modèles voisins sur la fiche) */
.mdl-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.mdl-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.mdl-list li > a { flex: 0 0 min(100%, 17rem); font-weight: 600; }
.mdl-list li > span { flex: 1 1 18rem; min-width: 0; }

/* Fiche d'un modèle */
.mdl-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.mdl-layout h2, .mdl-apply h2 { margin-top: 0; font-size: 1.5rem; }
.mdl-layout > div > h2:not(:first-child) { margin-top: 32px; }
.mdl-cat { margin: 26px 0 8px; font-size: 1.02rem; letter-spacing: .02em; text-transform: uppercase; color: var(--text-2); }
.mdl-channels, .mdl-roles, .mdl-mods, .mdl-tips { margin: 0; padding: 0; list-style: none; }
.mdl-channels li, .mdl-roles li, .mdl-mods li, .mdl-tips li { padding: 8px 0; overflow-wrap: anywhere; line-height: 1.45; border-bottom: 1px solid var(--border); }
.mdl-channels li:last-child, .mdl-roles li:last-child, .mdl-mods li:last-child, .mdl-tips li:last-child { border-bottom: 0; }
.mdl-ch { font-weight: 600; overflow-wrap: anywhere; }
.mdl-dot { display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border-strong); vertical-align: -1px; }
.mdl-apply { border-top: 1px solid var(--border); }
.mdl-layout > div { min-width: 0; }
.mdl-layout > div:last-child { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
@media (max-width: 960px) { .mdl-layout { grid-template-columns: minmax(0, 1fr); } }

/* Fil d'Ariane au-dessus de la plaque : assez d'air pour que la plaque penchée ne le touche pas */
.page-hero .cmp-crumbs { margin: 0 0 18px; color: var(--muted); }
.page-hero .cmp-crumbs a { color: var(--text-2); }
