/* =====================================================================
   LA LISTE D'OBJETS — /wiki/objet/<nom>, /wiki/objets/liste/<jeton>
   =====================================================================
   Les images sont détourées : elles reposent sur un DAMIER, le signe
   universel de la transparence. Gris neutre à demi-opacité, il se lit sur
   le thème nuit comme sur le thème jour sans jeton propre à chacun.
   ===================================================================== */

:root {
	--obj-damier-a: rgba(127, 127, 127, .09);
	--obj-damier-b: rgba(127, 127, 127, .19);
}

.obj-app {
	display: grid;
	gap: var(--space-4);
}

.obj-damier {
	background: repeating-conic-gradient(var(--obj-damier-a) 0 25%, var(--obj-damier-b) 0 50%) 0 0 / 16px 16px;
}

html:not(.js) .obj-js { display: none !important; }

/* (La recherche, les filtres, la barre et la grille des objets sont
   devenus ceux du wiki le 17/10/2026 — assets/css/wiki.css.) */

/* (Le nom du modèle à copier, titre de la fiche — .obj-copiable : seule
   son icône se clique, theme.css ; main.js montre la bulle « Copié ».) */

/* --- La fiche --------------------------------------------------------- */
.obj-fiche { display: grid; gap: var(--space-5); }

.obj-fiche-tete {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	align-items: flex-end;
	justify-content: space-between;
}

.obj-fiche-tete h1 {
	margin: 0;
	font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
	font-size: var(--fs-2xl);
	font-weight: 500;
	overflow-wrap: anywhere;
}

.obj-fiche-sous { color: var(--pf-muted); }
.obj-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.obj-fiche-corps {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: var(--space-5);
	align-items: start;
}

.obj-hero {
	margin: 0;
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-5);
	border: 1px solid var(--pf-line-soft);
	border-radius: var(--radius);
	max-width: 100%;
}

.obj-hero img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

.obj-specs {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	margin: 0;
	border: 1px solid var(--pf-line-soft);
	border-radius: var(--radius);
	overflow: hidden;
}

.obj-specs dt, .obj-specs dd { margin: 0; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--pf-line-soft); }
.obj-specs dt { color: var(--pf-muted); background: var(--pf-surface); font-size: var(--fs-sm); }
.obj-specs dd { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; min-width: 0; overflow-wrap: anywhere; }
.obj-specs dt:last-of-type, .obj-specs dd:last-of-type { border-bottom: 0; }
.obj-specs .text-mono { font-variant-numeric: tabular-nums; }
.obj-pastille-mini { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--pf-line); vertical-align: middle; }

/* Le bouton « Copier » : l'icône seule (theme.css), 16 px ; le mot reste
   pour les lecteurs d'écran, à taille nulle. */
.obj-copier {
	--copie-taille: 16px;
	--copie-ecart: 0;

	display: inline-grid;
	place-items: center;
	padding: 2px;
	font: inherit;
	font-size: 0;
	color: var(--link-color);
	background: transparent;
	border: 0;
}

/* La colonne de droite : les infos, puis les boutons (vue de face, code,
   éditeurs). */
.obj-fiche-infos { display: grid; gap: var(--space-3); min-width: 0; align-content: start; }

/* Leurs fenêtres : celle des listes (.obj-dialogue), plus large, en popover
   — dans la COUCHE DU DESSUS du navigateur : au-dessus de tout, barre du
   site comprise, sans z-index à régler ; hors du flux : la page ne bouge
   pas d'un pixel. Un clic à côté ou Échap la ferme. */
/* UNE taille, la même pour les trois et quel que soit le contenu, et JAMAIS
   de défilement dedans : le contenu s'adapte à la fenêtre (le dessin se
   met à l'échelle, les lignes de code trop longues passent à la ligne). Le
   `display` ne se pose qu'OUVERT (:popover-open) : posé sur l'élément, il
   le montrerait fermé. */
.obj-grand {
	box-sizing: border-box;
	width: min(960px, calc(100vw - 32px));
	height: min(680px, calc(100dvh - 32px));
	overflow: hidden;
}

.obj-grand:popover-open { display: flex; flex-direction: column; }
.obj-grand::backdrop { background: rgba(0, 0, 0, .55); }
.obj-grand .obj-dialogue-tete h2 { display: inline-flex; align-items: center; gap: var(--space-2); }

.obj-integration-bouton { justify-self: start; }

.obj-grand > .obj-bloc { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

/* Le menu : un trait fin entre les groupes (vue de face │ code │ éditeurs). */
.obj-onglets-sep { align-self: stretch; width: 1px; margin: 6px var(--space-1); background: var(--pf-line-soft); }
.obj-grand .obj-panneau { flex: 1 1 auto; min-height: 0; }

.obj-grand .obj-panneau pre {
	box-sizing: border-box;
	height: 100%;
	max-height: none;
	overflow: hidden;
	line-height: 1.45;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.obj-cotes { color: var(--pf-ink-soft); }
.obj-grand .obj-cotes svg { display: block; width: 100%; height: 100%; margin: 0 auto; }

.obj-blocs { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* `align-content: start` : les deux blocs sont étirés à la hauteur du plus
   long (la grille), et sans lui les lignes du plus court se répartissaient
   ce surplus — un grand vide sous le titre. */
.obj-bloc { display: grid; gap: var(--space-2); min-width: 0; align-content: start; }
.obj-bloc h2 { margin: 0; font-size: var(--fs-lg); }
.obj-onglets { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--pf-line-soft); }

.obj-onglet {
	border: 0;
	border-bottom: 2px solid transparent;
	background: transparent;
	color: var(--pf-muted);
	font: inherit;
	font-size: var(--fs-sm);
	padding: 6px var(--space-3);
	cursor: pointer;
}

.obj-onglet[aria-selected="true"] { color: var(--pf-ink); border-bottom-color: var(--pf-gold); }
.obj-panneau { position: relative; }
.js .obj-panneau[hidden] { display: none; }
html:not(.js) .obj-panneau + .obj-panneau { margin-top: var(--space-2); }

.obj-panneau pre {
	margin: 0;
	max-height: 340px;
	overflow: auto;
	padding: var(--space-3);
	padding-right: 72px;
	background: var(--pf-panel-deep);
	border: 1px solid var(--pf-line-soft);
	border-radius: var(--radius);
	font-size: var(--fs-xs);
	line-height: 1.55;
	white-space: pre;
}

.obj-panneau .obj-copier { position: absolute; top: var(--space-2); right: var(--space-2); background: var(--pf-panel); }
.obj-mention { color: var(--pf-muted); font-size: var(--fs-xs); border-top: 1px solid var(--pf-line-soft); padding-top: var(--space-3); }

/* --- La fenêtre « Ajouter à une liste » -------------------------------- */
.obj-dialogue {
	width: min(420px, calc(100vw - 32px));
	background: var(--pf-panel);
	color: var(--pf-ink);
	border: 1px solid var(--pf-gold-line);
	border-radius: var(--radius);
	padding: var(--space-4);
	box-shadow: var(--shadow-lg);
}

.obj-dialogue::backdrop { background: rgba(0, 0, 0, .55); }
.obj-dialogue-tete { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.obj-dialogue-tete h2 { margin: 0; font-size: var(--fs-lg); }
.obj-dialogue-fermer { background: none; border: 0; color: var(--pf-muted); cursor: pointer; font-size: var(--fs-lg); line-height: 1; }
.obj-dialogue-fermer:hover { color: var(--pf-ink); }
.obj-dialogue ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); max-height: 50vh; overflow: auto; }
.obj-dialogue label { display: flex; gap: var(--space-2); align-items: center; padding: var(--space-1) 0; cursor: pointer; }
.obj-dialogue form { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.obj-dialogue form input { flex: 1; min-width: 0; }

/* --- Les listes -------------------------------------------------------- */
.obj-listes { display: grid; gap: var(--space-3); }

.obj-liste-ligne {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-3);
	align-items: center;
	justify-content: space-between;
	padding: var(--space-3);
	background: var(--pf-panel);
	border: 1px solid var(--pf-line-soft);
	border-radius: var(--radius);
}

.obj-liste-ligne h2 { margin: 0; font-size: var(--fs-lg); }
.obj-liste-ligne form { display: inline-flex; gap: var(--space-2); align-items: center; }
.obj-liste-ligne input[type="text"] { width: 180px; max-width: 100%; }
.obj-export { display: grid; gap: var(--space-2); }

.obj-export textarea {
	width: 100%;
	min-height: 140px;
	font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
	font-size: var(--fs-xs);
	white-space: pre;
}

/* --- Petits écrans ----------------------------------------------------- */
@media (max-width: 900px) {
	.obj-fiche-corps, .obj-blocs { grid-template-columns: minmax(0, 1fr); }
}
