/* Wiegert Généalogie – styles publics */
:root {
	--wg-nav: #1f2433;
	--wg-accent: #ad7324;
	--wg-link: #2b6a94;
	--wg-text: #1f2433;
	--wg-muted: #6b7080;
	--wg-line: #e2e4ea;
	--wg-soft: #fdf4e1;
	--wg-radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.wg {
	margin: 0;
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 17px;
	line-height: 1.55;
	color: var(--wg-text);
	background: #fff;
}
.wg a { color: var(--wg-link); text-decoration: none; }
.wg a:hover { text-decoration: underline; }

/* En-tête */
.wg-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--wg-nav);
	color: #fff;
	text-align: center;
	padding: 14px 10px 12px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.wg-brand { font-size: 1.35rem; font-weight: 700; }
.wg-brand a { color: #fff; }
.wg-brand a:hover { text-decoration: none; }
.wg-sub { font-size: .95rem; font-weight: 400; opacity: .8; margin-left: 8px; }
.wg-nav {
	display: flex; justify-content: center; gap: 4px;
	margin-top: 10px;
	overflow-x: auto; -webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.wg-nav::-webkit-scrollbar { display: none; }
.wg-nav a {
	display: inline-flex; align-items: center; gap: 7px;
	color: #fff; font-weight: 600; white-space: nowrap;
	padding: 9px 14px; border-radius: 999px;
	transition: background .2s, transform .2s;
}
.wg-nav a:hover { background: rgba(255, 255, 255, .12); text-decoration: none; transform: translateY(-1px); }
.wg-nav a.is-active { background: var(--wg-accent); }
.wg-ico { flex: none; }

/* Contenu */
.wg-main { max-width: 980px; margin: 0 auto; padding: 28px 18px 60px; }
.wg-h1 {
	text-align: center; font-size: 2rem; line-height: 1.2; margin: 18px 0 32px; font-weight: 800;
}
.wg-h1::after {
	content: ""; display: block; width: 96px; height: 6px; border-radius: 6px;
	background: var(--wg-accent); margin: 14px auto 0;
}
.wg-h2 { font-size: 1.3rem; margin: 34px 0 12px; }
.wg-center { text-align: center; }
.wg-muted { color: var(--wg-muted); font-size: .92em; }
.wg-intro { max-width: 640px; margin: 0 auto 8px; }
.wg-counts { margin-bottom: 26px; }

/* Boutons */
.wg-btn {
	display: inline-block; background: var(--wg-accent); color: #fff !important; font-weight: 700;
	padding: 13px 30px; border-radius: 999px; border: 0;
	box-shadow: 0 4px 0 rgba(0, 0, 0, .28);
	cursor: pointer; font-size: 1rem; font-family: inherit;
	transition: transform .15s, box-shadow .15s, filter .15s;
}
.wg-btn:hover { text-decoration: none !important; transform: translateY(-2px); filter: brightness(1.07); box-shadow: 0 6px 0 rgba(0, 0, 0, .28); }
.wg-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .28); }
.wg-btn-sm { padding: 8px 18px; font-size: .92rem; }

.wg-menu { text-align: center; }
.wg-menu-item { margin: 0 0 26px; }
.wg-menu-item p { margin: 12px auto 0; max-width: 560px; }

/* Listes */
.wg-list { list-style: none; padding: 0; margin: 14px 0; }
.wg-list li { padding: 7px 4px; border-bottom: 1px solid var(--wg-line); }
.wg-cols { list-style: none; padding: 0; columns: 3 200px; column-gap: 24px; }
.wg-cols li { padding: 4px 0; break-inside: avoid; }
.wg-sn { font-weight: 700; }
.wg-name:hover .wg-sn { text-decoration: underline; }
.wg-gn { color: var(--wg-text); }
.wg-sex { display: inline-block; width: 1.1em; text-align: center; font-weight: 700; }
.wg-m { color: #2b5aa8; }
.wg-f { color: #a3305a; }
.wg-u { color: #999; }

/* Recherche, lettres, pagination */
.wg-search { display: flex; gap: 8px; justify-content: center; margin: 0 0 18px; flex-wrap: wrap; }
.wg-search input[type=search] {
	flex: 1 1 240px; max-width: 420px; padding: 11px 16px; font-size: 1rem; font-family: inherit;
	border: 2px solid var(--wg-line); border-radius: 999px; outline: none;
}
.wg-search input[type=search]:focus { border-color: var(--wg-accent); }
.wg-letters { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 18px; }
.wg-letters a {
	min-width: 36px; text-align: center; padding: 5px 9px; border-radius: 8px;
	background: #f2f3f6; color: var(--wg-text); font-weight: 600; font-size: .92rem;
	transition: background .15s;
}
.wg-letters a:hover { background: #e4e6ed; text-decoration: none; }
.wg-letters a.is-active { background: var(--wg-accent); color: #fff; }
.wg-pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 28px 0 0; flex-wrap: wrap; }
.wg-pager a { font-weight: 700; padding: 8px 14px; border-radius: 999px; background: #f2f3f6; }

/* Fiches */
.wg-fiche { margin: 0 0 36px; border-left: 4px solid var(--wg-line); padding-left: 12px; }
.wg-fiche-head {
	background: var(--wg-soft); border-left: 6px solid var(--wg-accent);
	border-radius: 0 var(--wg-radius) var(--wg-radius) 0;
	padding: 14px 20px; font-size: 1.35rem; margin-bottom: 12px;
}
.wg-fiche-head .wg-name { color: inherit; }
.wg-fiche-head .wg-sn { color: var(--wg-link); }
.wg-fiche-body { padding: 4px 4px 0 14px; border-left: 4px solid var(--wg-line); }
.wg-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 8px 0; }
.wg-dl dt { font-weight: 700; color: #4b5060; }
.wg-dl dd { margin: 0; }
.wg-union { margin-top: 14px; padding-left: 14px; border-left: 4px solid var(--wg-line); }
.wg-union-in { padding-left: 14px; border-left: 4px solid var(--wg-line); margin-top: 6px; }
.wg-kids { list-style: none; padding: 0; margin: 0; }
.wg-note { background: #f7f8fa; border-radius: 10px; padding: 10px 16px; margin: 16px 0; }
.wg-note p { margin: 6px 0 0; }
.wg-portrait { float: right; margin: 0 0 12px 16px; }
.wg-portrait img { width: 140px; height: auto; border-radius: 10px; display: block; box-shadow: 0 3px 10px rgba(0, 0, 0, .18); }
.wg-gallery { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; clear: both; }
.wg-gallery figure { margin: 0; width: 110px; text-align: center; font-size: .8rem; }
.wg-gallery img { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; transition: transform .2s; }
.wg-gallery a:hover img { transform: scale(1.05); }
.wg-fiche-links { clear: both; margin: 12px 0 0; font-size: .92rem; }

/* Tableau éclair */
.wg-table-wrap { overflow-x: auto; }
.wg-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.wg-table th { text-align: left; background: var(--wg-nav); color: #fff; padding: 9px 10px; position: sticky; top: 0; }
.wg-table td { padding: 8px 10px; border-bottom: 1px solid var(--wg-line); vertical-align: top; }
.wg-table tr:hover td { background: #fbf6ea; }

/* Lieux */
.wg-seg { display: inline-flex; align-items: center; gap: 4px; background: #f2f3f6; padding: 4px; border-radius: 999px; flex-wrap: wrap; }
.wg-seg a, .wg-seg button, .wg-seg > span { padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .92rem; color: var(--wg-text); background: none; border: 0; font-family: inherit; cursor: pointer; }
.wg-seg > span { cursor: default; color: var(--wg-muted); padding-right: 6px; }
.wg-seg a:hover, .wg-seg button:hover { background: #e4e6ed; text-decoration: none; }
.wg-seg a.is-active { background: var(--wg-accent); color: #fff; }
.wg-center-seg { display: flex; justify-content: center; width: fit-content; margin: 0 auto 22px; }
.wg-psn p { margin: 0 0 14px; line-height: 1.5; }
.wg-place-name { color: var(--wg-text) !important; font-weight: 600; }

/* États */
.wg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.wg-stat { background: var(--wg-soft); border-radius: var(--wg-radius); padding: 18px 12px; text-align: center; border-bottom: 4px solid var(--wg-accent); }
.wg-stat strong { display: block; font-size: 1.8rem; line-height: 1.1; }
.wg-stat span { color: var(--wg-muted); font-size: .92rem; }
.wg-bars { display: grid; gap: 7px; }
.wg-bar { display: grid; grid-template-columns: 62px 1fr 48px; gap: 10px; align-items: center; font-size: .92rem; }
.wg-bar-t { background: #f2f3f6; border-radius: 999px; height: 14px; overflow: hidden; }
.wg-bar-t i { display: block; height: 100%; background: var(--wg-accent); border-radius: 999px; }
.wg-bar-n { text-align: right; color: var(--wg-muted); }

/* Arbre */
.wg-tree-page .wg-main { max-width: none; }
.wg-toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 0 0 18px; }
.wg-tree-scroll {
	overflow: auto; border: 1px solid var(--wg-line); border-radius: var(--wg-radius);
	padding: 22px 16px; background: #fbfbfd; cursor: grab; -webkit-overflow-scrolling: touch;
	max-height: calc(100vh - 230px); min-height: 340px;
}
.wg-tree-scroll.is-drag { cursor: grabbing; user-select: none; }
.wg-tree { display: inline-block; min-width: min-content; }
.wg-p { display: flex; align-items: center; }
.wg-ups { display: flex; flex-direction: column; position: relative; margin-left: 24px; }
.wg-ups::before { content: ""; position: absolute; left: -24px; top: 50%; width: 24px; border-top: 2px solid #c9ccd6; }
.wg-ups > .wg-p { position: relative; padding: 5px 0 5px 24px; }
.wg-ups > .wg-p::before { content: ""; position: absolute; left: 0; top: 50%; width: 24px; border-top: 2px solid #c9ccd6; }
.wg-ups > .wg-p::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid #c9ccd6; }
.wg-ups > .wg-p:first-child::after { top: 50%; }
.wg-ups > .wg-p:last-child::after { bottom: 50%; }
.wg-ups > .wg-p:only-child::after { display: none; }
.wg-pc {
	position: relative; width: 210px; flex: none; background: #fff;
	border: 2px solid #d5d8e0; border-radius: 12px; padding: 8px 34px 8px 12px;
	box-shadow: 0 2px 6px rgba(20, 25, 50, .07);
	transition: transform .15s, box-shadow .15s, border-color .15s;
}
.wg-pc:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(20, 25, 50, .14); border-color: var(--wg-accent); }
.wg-pc.is-m { border-left: 6px solid #2b5aa8; }
.wg-pc.is-f { border-left: 6px solid #a3305a; }
.wg-pc-name { display: block; line-height: 1.25; font-size: .95rem; }
.wg-pc-name .wg-name { color: var(--wg-text); }
.wg-pc-years { display: block; color: var(--wg-muted); font-size: .8rem; margin-top: 2px; }
.wg-sosa {
	position: absolute; top: -9px; left: -9px; min-width: 22px; height: 22px; padding: 0 5px;
	background: var(--wg-nav); color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
}
.wg-pc-center { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--wg-muted); opacity: .55; padding: 4px; border-radius: 8px; display: flex; }
.wg-pc-center:hover { opacity: 1; background: #f2f3f6; }
.wg-pc-center .wg-ico { width: 18px; height: 18px; }
.wg-hint { font-size: .85rem; }

.wg-desc { list-style: none; margin: 4px 0 4px 0; padding-left: 20px; border-left: 2px solid var(--wg-line); }
.wg-desc-root { border-left: 0; padding-left: 0; }
.wg-desc li { margin: 6px 0; }
.wg-desc summary { cursor: pointer; }
.wg-dn { padding: 2px 0; }
.wg-un { margin: 6px 0 4px 6px; color: #4b5060; }
.wg-mini { display: inline-flex; vertical-align: middle; margin-left: 6px; opacity: .55; }
.wg-mini:hover { opacity: 1; }
.wg-mini .wg-ico { width: 16px; height: 16px; }

/* Bas de page */
.wg-footer { text-align: center; padding: 22px 12px 90px; color: var(--wg-muted); font-size: .9rem; border-top: 1px solid var(--wg-line); }
.wg-top {
	position: fixed; right: 16px; bottom: 18px; width: 52px; height: 52px; border-radius: 50%;
	background: var(--wg-nav); color: #fff; border: 0; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
	opacity: 0; pointer-events: none; transform: translateY(10px);
	transition: opacity .25s, transform .25s, background .2s;
}
.wg-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.wg-top:hover { background: var(--wg-accent); }

/* Mobile */
@media (max-width: 640px) {
	body.wg { font-size: 16px; }
	.wg-h1 { font-size: 1.6rem; margin-bottom: 24px; }
	.wg-main { padding: 18px 12px 50px; }
	.wg-nav { justify-content: flex-start; padding: 0 4px; }
	.wg-nav a { padding: 8px 11px; gap: 6px; }
	.wg-nav .wg-ico { width: 20px; height: 20px; }
	.wg-dl { grid-template-columns: 1fr; gap: 0; }
	.wg-dl dd { margin-bottom: 8px; }
	.wg-hide-s { display: none; }
	.wg-portrait { float: none; display: block; margin: 0 0 12px; }
	.wg-pc { width: 180px; }
}
@media print {
	.wg-header, .wg-top, .wg-footer, .wg-toolbar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}
