/* AFA Généalogie — couleurs officielles AFA */
.afa-gen {
	--afa-bleu: #2E3F8F;
	--afa-marine: #142A40;
	--afa-or: #C9A646;
	--afa-or-pale: #E0BE85;
	--afa-fond: #faf8f3;
	--afa-ligne: #e4dccb;
	--afa-texte: #1f2933;
	color: var(--afa-texte);
	line-height: 1.55;
	max-width: 1100px;
	margin: 0 auto;
}
.afa-gen h2, .afa-gen h3 { font-family: 'Lora', Georgia, serif; color: var(--afa-marine); }
.afa-gen-titre { margin: .4em 0 .2em; font-size: 1.9em; }
.afa-gen h3 { border-bottom: 2px solid var(--afa-or); padding-bottom: .2em; margin-top: 1.6em; font-size: 1.25em; }
.afa-gen a { color: var(--afa-bleu); text-decoration: none; }
.afa-gen a:hover { text-decoration: underline; }

/* navigation */
.afa-gen-nav { display: flex; gap: 1.2em; border-bottom: 1px solid var(--afa-ligne); padding-bottom: .5em; margin-bottom: .8em; font-size: .95em; }
.afa-gen-nav a { color: var(--afa-marine); font-weight: 600; }

/* recherche */
.afa-gen-recherche { display: flex; flex-wrap: wrap; gap: .8em 1em; align-items: flex-end; background: var(--afa-fond); border: 1px solid var(--afa-ligne); border-radius: 8px; padding: 1em; }
.afa-gen-recherche label { display: flex; flex-direction: column; font-size: .85em; font-weight: 600; color: var(--afa-marine); gap: .25em; }
.afa-gen-recherche input[type=text] { padding: .5em .7em; border: 1px solid #cfc6b3; border-radius: 5px; min-width: 200px; font-size: 1rem; }
.afa-gen-recherche .afa-gen-cocher { flex-direction: row; align-items: center; font-weight: 400; padding-bottom: .55em; }
.afa-gen-recherche button, .afa-gen-bouton {
	background: var(--afa-bleu); color: #fff !important; border: 0; border-radius: 5px; padding: .6em 1.2em; font-weight: 600; cursor: pointer; display: inline-block;
}
.afa-gen-recherche button:hover, .afa-gen-bouton:hover { background: var(--afa-marine); text-decoration: none !important; }
.afa-gen-mini .afa-gen-recherche input[type=text] { min-width: 140px; }

/* tableaux */
.afa-gen-table { width: 100%; border-collapse: collapse; margin: .6em 0; }
.afa-gen-table th, .afa-gen-table td { text-align: left; padding: .45em .6em; border-bottom: 1px solid var(--afa-ligne); vertical-align: top; }
.afa-gen-table thead th { background: var(--afa-marine); color: #fff; font-weight: 600; }
.afa-gen-table tbody tr:nth-child(even) { background: var(--afa-fond); }
.afa-gen-evenements th { width: 9em; color: var(--afa-marine); }
.afa-gen-evenements td:nth-child(2) { width: 12em; white-space: nowrap; }
.afa-gen-compte { color: #555; margin: .8em 0 .2em; }

/* fiche */
.afa-gen-sous-titre { color: #555; margin-top: 0; }
.afa-gen-id { font-family: monospace; color: #888; }
.afa-gen-actions { display: flex; gap: .6em; flex-wrap: wrap; margin: .6em 0 1em; }
.afa-gen-role { font-weight: 600; color: var(--afa-marine); margin-right: .4em; }
.afa-gen-liste { list-style: none; padding: 0; margin: .4em 0 1em; }
.afa-gen-liste li { margin: .2em 0; }
.afa-gen-union { border-left: 3px solid var(--afa-or-pale); padding: .2em 0 .2em 1em; margin: .8em 0; }
.afa-gen-union p { margin: .25em 0; }
.afa-gen-enfants { margin: .2em 0 .4em 1.2em; }
.afa-gen-lien-famille { font-size: .9em; }
.afa-gen-annees, .afa-gen-info { color: #666; font-size: .92em; }
.afa-gen-vivant, .afa-gen-inconnu { color: #888; font-style: italic; }
.afa-gen-note { background: var(--afa-fond); padding: .6em 1em; border-radius: 6px; }

/* famille */
.afa-gen-couple { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; margin-top: .5em; }
.afa-gen-carte { background: var(--afa-fond); border: 1px solid var(--afa-ligne); border-top: 4px solid var(--afa-bleu); border-radius: 8px; padding: .8em 1em; }
.afa-gen-carte p { margin: .2em 0; }
.afa-gen-carte-nom { font-size: 1.15em; font-family: 'Lora', Georgia, serif; }
.afa-gen-mariage { text-align: center; margin: 1em 0; }

/* ascendance */
.afa-gen-choix-gen { margin: .4em 0 1em; font-size: .95em; }
.afa-gen-choix-gen .courante, .afa-gen-pages .courante, .afa-gen-alpha .courante { font-weight: 700; color: var(--afa-marine); }
.afa-gen-pedigree {
	display: grid;
	grid-template-columns: repeat(var(--afa-gen-cols), minmax(150px, 1fr));
	grid-template-rows: repeat(var(--afa-gen-rows), minmax(2.6em, auto));
	gap: 4px 18px;
	overflow-x: auto;
	padding-bottom: .5em;
}
.afa-gen-case { display: flex; align-items: center; position: relative; }
.afa-gen-case::before { content: ''; position: absolute; left: -18px; top: 50%; width: 18px; border-top: 1px solid var(--afa-or); }
.afa-gen-pedigree > .afa-gen-case:first-child::before { display: none; }
.afa-gen-case-int {
	width: 100%; background: #fff; border: 1px solid var(--afa-ligne); border-left: 4px solid var(--afa-or);
	border-radius: 5px; padding: .3em .5em; font-size: .88em; line-height: 1.3; position: relative;
}
.afa-gen-case.afa-gen-sexe-m .afa-gen-case-int { border-left-color: var(--afa-bleu); }
.afa-gen-case.afa-gen-sexe-f .afa-gen-case-int { border-left-color: var(--afa-or); }
.afa-gen-case-int .afa-gen-annees { display: block; font-size: .9em; }
.afa-gen-sosa { float: right; font-size: .75em; color: #aaa; margin-left: .4em; }
.afa-gen-suite { position: absolute; right: .4em; bottom: .2em; font-weight: 700; }

/* descendance */
.afa-gen-descendance, .afa-gen-descendance ul { list-style: none; padding-left: 1.4em; border-left: 1px dotted var(--afa-or); }
.afa-gen-descendance { padding-left: 0; border-left: 0; }
.afa-gen-descendance li { margin: .35em 0; }
.afa-gen-niveau { display: inline-block; min-width: 1.6em; text-align: center; background: var(--afa-marine); color: #fff; border-radius: 3px; font-size: .75em; margin-right: .3em; }
.afa-gen-desc-union { margin-left: 2em; font-size: .95em; color: #444; }

/* patronymes et pagination */
.afa-gen-alpha, .afa-gen-pages { display: flex; flex-wrap: wrap; gap: .3em .7em; margin: .8em 0; font-size: 1.05em; }
.afa-gen-patronymes { columns: 4 180px; list-style: none; padding: 0; }
.afa-gen-patronymes li { break-inside: avoid; padding: .15em 0; }
.afa-gen-n { color: #999; font-size: .85em; }

/* avis */
.afa-gen-avis { background: var(--afa-fond); border-left: 4px solid var(--afa-or); padding: .8em 1em; border-radius: 4px; }
.afa-gen-avis-erreur { border-left-color: #b42318; }

@media (max-width: 700px) {
	.afa-gen-couple { grid-template-columns: 1fr; }
	.afa-gen-evenements td:nth-child(2) { white-space: normal; width: auto; }
	.afa-gen-recherche input[type=text] { min-width: 0; width: 100%; }
	.afa-gen-recherche label { flex: 1 1 100%; }
}

/* ------------------------------------------------------------------
   v0.6.1 — harmonisation avec les pages du site (Lora, bleu / marine / or)
   ------------------------------------------------------------------ */
.afa-gen { font-family: 'Lora', Georgia, serif; font-size: 16px; color: #2b2b2b; max-width: none; }
.afa-gen h2, .afa-gen h3, .afa-gen-titre { font-family: 'Lora', Georgia, serif; font-weight: 600; letter-spacing: 0; }
.afa-gen-titre { color: #1F3B57; font-size: 30px; line-height: 1.2; margin: 6px 0 14px; }
.afa-gen h3 { color: #1F3B57; font-size: 21px; border-bottom: 3px solid var(--afa-or); }
.afa-gen a { color: var(--afa-bleu); }

/* onglets */
.afa-gen-nav { gap: 6px; border-bottom: 1px solid #e8e1d0; padding-bottom: 10px; margin-bottom: 14px; }
.afa-gen-nav a { font-family: 'Lora', serif; font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--afa-bleu);
	padding: 6px 12px; border-radius: 20px; border: 1px solid transparent; }
.afa-gen-nav a:hover { border-color: var(--afa-or); text-decoration: none; background: #fbf6ea; }

/* recherche */
.afa-gen-recherche { background: var(--afa-marine); border: 0; border-top: 4px solid var(--afa-or); border-radius: 0 0 12px 12px; padding: 22px 24px; gap: 12px 14px; }
.afa-gen-recherche label { color: var(--afa-or-pale); font-family: 'Lora', serif; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }
.afa-gen-recherche input[type=text] { border: 1px solid var(--afa-or); border-radius: 8px; padding: 12px 15px; font: 16px 'Lora', serif; color: #1F3B57; background: #fff; min-width: 220px; }
.afa-gen-recherche input[type=text]:focus { outline: 2px solid var(--afa-or-pale); outline-offset: 1px; }
.afa-gen-recherche .afa-gen-cocher { color: #dfe5ee; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; }
.afa-gen-recherche button, .afa-gen-bouton {
	background: var(--afa-or-pale); color: var(--afa-marine) !important; border-radius: 8px; padding: 12px 24px;
	font: 700 15px 'Lora', serif; border: 0; transition: background .15s;
}
.afa-gen-recherche button:hover, .afa-gen-bouton:hover { background: var(--afa-or); }
.afa-gen-bouton { padding: 10px 18px; }
.afa-gen-mini .afa-gen-recherche { border-radius: 12px; }

/* listes et tableaux */
.afa-gen-table thead th { background: var(--afa-marine); font-family: 'Lora', serif; font-weight: 600; }
.afa-gen-table td, .afa-gen-table th { border-bottom-color: #eee6d4; }
.afa-gen-table tbody tr:nth-child(even) { background: #faf7f0; }
.afa-gen-compte { font-style: italic; color: #6b6b6b; }

/* fiche */
.afa-gen-sous-titre { font-style: italic; color: #6b6b6b; }
.afa-gen-union { border-left-color: var(--afa-or); background: #fdfbf6; border-radius: 0 8px 8px 0; padding: 10px 16px; }
.afa-gen-role { color: #1F3B57; }
.afa-gen-carte { background: #fff; border: 1px solid #ece4d2; border-top: 4px solid var(--afa-bleu); border-radius: 0 0 12px 12px; padding: 16px 20px; }
.afa-gen-carte + .afa-gen-carte { border-top-color: var(--afa-or); }
.afa-gen-carte-nom { font-weight: 600; font-size: 1.2em; }
.afa-gen-case-int { border-radius: 8px; border-color: #ece4d2; box-shadow: 0 1px 2px rgba(20,42,64,.05); }

/* patronymes */
.afa-gen-alpha a, .afa-gen-alpha span { display: inline-block; min-width: 30px; text-align: center; padding: 4px 6px; border-radius: 6px; }
.afa-gen-alpha .courante { background: var(--afa-marine); color: #fff; }
.afa-gen-alpha a:hover { background: #fbf6ea; text-decoration: none; }

/* invitation à se connecter */
.afa-gen-acces { background: var(--afa-marine); border-top: 4px solid var(--afa-or); border-radius: 0 0 14px 14px; padding: 34px 30px; text-align: center; color: #e8edf4; }
.afa-gen-acces .afa-gen-acces-kicker { color: var(--afa-or-pale); font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; margin: 0 0 6px; }
.afa-gen-acces h2 { color: #fff; font-size: 28px; margin: 0 0 10px; }
.afa-gen-acces p { max-width: 640px; margin: 0 auto 18px; }
.afa-gen-acces .afa-gen-boutons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.afa-gen-acces .afa-gen-bouton-contour { border: 1px solid var(--afa-or-pale); color: var(--afa-or-pale) !important; background: transparent; border-radius: 8px; padding: 10px 18px; font: 600 15px 'Lora', serif; }
.afa-gen-acces .afa-gen-bouton-contour:hover { background: rgba(224,190,133,.12); text-decoration: none; }

/* ------------------------------------------------------------------
   v0.7.0 — arbre de descendance graphique (de haut en bas)
   ------------------------------------------------------------------ */
#afa-gen { scroll-margin-top: 110px; }
.afa-gen-bouton-clair { background: #fff !important; border: 1px solid var(--afa-or) !important; }
.afa-gen-bouton-clair:hover { background: #fbf6ea !important; }
.afa-gen-sep { color: #bbb; margin: 0 .2em; }

.afa-gen-arbre-defil { overflow-x: auto; padding: 8px 0 18px; -webkit-overflow-scrolling: touch; }
.afa-gen-arbre { display: inline-block; min-width: 100%; text-align: center; --afa-trait: #9aa3b5; }
.afa-gen-arbre ul, .afa-gen-arbre li { list-style: none; margin: 0; }
.afa-gen-arbre li::marker { content: none; }
.afa-gen-arbre ul { display: flex; flex-wrap: nowrap; justify-content: center; padding: 22px 0 0; position: relative; }
.afa-gen-arbre > ul { padding-top: 0; }
.afa-gen-arbre li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 4px 0; }
.afa-gen-arbre > ul > li { padding-top: 0; }

/* traits : demi-barres horizontales + descente vers chaque enfant */
.afa-gen-arbre li::before, .afa-gen-arbre li::after {
	content: ''; position: absolute; top: 0; width: 50%; height: 22px; border-top: 1px solid var(--afa-trait);
}
.afa-gen-arbre li::before { right: 50%; }
.afa-gen-arbre li::after { left: 50%; border-left: 1px solid var(--afa-trait); }
.afa-gen-arbre li:first-child::before, .afa-gen-arbre li:last-child::after { border-top: 0; }
.afa-gen-arbre > ul > li::before, .afa-gen-arbre > ul > li::after { display: none; }
/* descente du parent vers la barre des enfants */
.afa-gen-arbre ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 1px solid var(--afa-trait); }

/* boîtes */
.afa-gen-noeud {
	position: relative; background: #fff; border: 1px solid #e3dccb; border-top: 3px solid var(--afa-bleu);
	border-radius: 8px; padding: 7px 10px 8px; min-width: 92px; max-width: 190px;
	font-size: 14px; line-height: 1.3; box-shadow: 0 1px 2px rgba(20,42,64,.06);
}
.afa-gen-noeud.afa-gen-sexe-f { border-top-color: var(--afa-or); }
.afa-gen-noeud-nom { display: block; font-weight: 600; }
.afa-gen-noeud-nom a { color: var(--afa-marine); }
.afa-gen-noeud-annees { display: block; color: #666; font-size: 13px; margin-top: 2px; }
.afa-gen-noeud-conjoint { display: block; color: #555; font-size: 12.5px; margin-top: 3px; font-style: italic; }
.afa-gen-noeud-conjoint a { color: #555; }
.afa-gen-noeud-conjoint b { font-style: normal; color: var(--afa-or); }
.afa-gen-noeud-racine { background: #f4f6fb; border-color: #c9d0e3; }
.afa-gen-noeud-ligne { background: #fbf1dc; border-color: var(--afa-or); border-top-color: #a8822a; }
.afa-gen-noeud-union {
	position: absolute; top: -9px; left: -7px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px;
	background: var(--afa-or-pale); color: var(--afa-marine); font-size: 11px; font-weight: 700;
}
.afa-gen-noeud-suite { position: absolute; right: 5px; bottom: 2px; font-size: 13px; color: var(--afa-or) !important; }
.afa-gen-noeud-suite:hover { text-decoration: none !important; color: var(--afa-bleu) !important; }
.afa-gen-arbre-aide { font-size: 13px; font-style: italic; color: #777; }

@media print {
	.afa-gen-nav, .afa-gen-choix-gen, .afa-gen-arbre-aide, .afa-gen-noeud-suite { display: none !important; }
	.afa-gen-arbre-defil { overflow: visible; }
	.afa-gen-noeud { box-shadow: none; break-inside: avoid; }
}

/* v0.8.0 — photos et documents sur les fiches */
.afa-gen-medias { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 4px; }
.afa-gen-media { margin: 0; width: 170px; }
.afa-gen-media img { width: 170px; height: 130px; object-fit: cover; border-radius: 8px; border: 1px solid #ece4d2; display: block; }
.afa-gen-media-doc { display: flex; align-items: center; justify-content: center; width: 170px; height: 130px; border-radius: 8px; border: 1px solid #ece4d2; background: #faf7f0; color: var(--afa-bleu); font-weight: 700; }
.afa-gen-media figcaption { font-size: 13px; line-height: 1.35; margin-top: 5px; color: #444; }

/* v0.10.0 — cimetières et pierres tombales */
.afa-gen-sous-nav { margin: 0 0 14px; font-size: 15px; }
.afa-gen-pierres { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0 6px; }
.afa-gen-pierre { margin: 0; width: 190px; }
.afa-gen-pierre img { width: 190px; height: 240px; object-fit: cover; border-radius: 8px; border: 1px solid #ece4d2; display: block; background: #f4f1ea; }
.afa-gen-pierre-grande { width: 260px; }
.afa-gen-pierre-grande img { width: 260px; height: 330px; }
.afa-gen-pierre figcaption { font-size: 13.5px; line-height: 1.4; margin-top: 6px; color: #444; }
.afa-gen-pierre-noms { display: block; font-weight: 600; }
.afa-gen-pierre .afa-gen-info { display: block; margin-top: 2px; }
.afa-gen-sepulture { background: #faf8f3; border: 1px solid #ece4d2; border-radius: 10px; padding: 12px 16px 6px; margin: 6px 0 10px; }
.afa-gen-sepulture p { margin: 4px 0 8px; }
.afa-gen-chercher-sep a { white-space: nowrap; }
.afa-gen-cimetieres td.afa-gen-n, .afa-gen-cimetieres th.afa-gen-n { text-align: right; width: 90px; }
.afa-gen-cimetiere-tete { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; justify-content: space-between; }
.afa-gen-cimetiere-tete > div { flex: 1 1 280px; }
.afa-gen-carte { flex: 0 1 420px; width: 420px; max-width: 100%; height: 260px; border: 1px solid #ece4d2; border-radius: 10px; }
@media (max-width: 600px) { .afa-gen-pierre, .afa-gen-pierre-grande { width: 100%; } .afa-gen-pierre img, .afa-gen-pierre-grande img { width: 100%; height: auto; max-height: 420px; } }

/* v0.11.0 — carte « Ce jour-là chez les Fortin » [afa_gen_ce_jour] */
.afa-cj { display: flex; gap: 20px; align-items: center; background: #fff; border: 1px solid #e8dfc9; border-radius: 14px; padding: 22px; font-family: 'Lora', Georgia, serif; box-sizing: border-box; }
.afa-cj p { margin: 0; }
.afa-cj-date { flex: 0 0 auto; width: 92px; height: 104px; border-radius: 10px; background: #142A40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.afa-cj-jour { font-size: 40px; font-weight: 700; line-height: 1; color: #E0BE85; }
.afa-cj-mois { font-size: 13px; letter-spacing: 2px; color: #fff; }
.afa-cj-trait { width: 28px; height: 2px; background: #C9A646; margin-top: 6px; }
.afa-cj-corps { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.afa-cj-kicker { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #2E3F8F; font-weight: 600; }
.afa-cj-titre { font-size: 19px; line-height: 1.3; color: #142A40; font-weight: 600; }
.afa-cj-sous { font-size: 14px; color: #4a5568; font-style: italic; }
.afa-cj-liens { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px !important; font-size: 14px; font-weight: 600; }
.afa-cj-liens a { color: #2E3F8F; text-decoration: none; }
.afa-cj-liens a.afa-cj-lien2 { color: #6b5a2e; }
.afa-cj-liens a:hover { color: #142A40; text-decoration: underline; }
@media (max-width: 480px) { .afa-cj { gap: 14px; padding: 16px; } .afa-cj-date { width: 72px; height: 84px; } .afa-cj-jour { font-size: 32px; } .afa-cj-titre { font-size: 17px; } }
