/*
 * FDA Footnotes — styles publics.
 * Léger, sans dépendance. Info-bulles en CSS pur (survol + focus clavier).
 * Les classes d'origine (footnote_referrer, footnote_tooltip, etc.) sont
 * conservées pour rester compatible avec d'éventuels styles du thème.
 */

:root {
	/* Décalage de défilement pour compenser l'en-tête fixe Enfold. */
	--fda-fn-scroll-offset: 160px;
}

/* --- Référent : le [n] en exposant --- */
.fda-footnote-referrer {
	position: relative;
	white-space: nowrap;
}

.fda-footnote-referrer .footnote_plugin_tooltip_text {
	font-size: smaller;
	vertical-align: super;
	line-height: 0;
}

a.fda-fn-referrer {
	text-decoration: none;
	cursor: pointer;
}

a.fda-fn-referrer:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

/* Cible de défilement décalée sous un en-tête fixe. */
a.fda-fn-referrer,
.footnotes_plugin_reference_row th {
	scroll-margin-top: var(--fda-fn-scroll-offset);
}

/* --- Info-bulle (CSS pur) --- */
.fda-footnote-tooltip {
	position: absolute;
	left: 50%;
	bottom: 100%;
	transform: translateX(-50%);
	z-index: 9999;
	box-sizing: border-box;
	width: max-content;
	max-width: min(450px, 90vw);
	margin-bottom: 7px;
	padding: 0.6em 0.9em;
	background: #fff;
	color: #000;
	border: 1px solid #cccc99;
	border-radius: 0;
	box-shadow: 0 2px 6px rgba(102, 102, 102, 0.6);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	text-align: left;
	white-space: normal;
	/* Masquée par défaut, sans gêner la mise en page ni les clics. */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 200ms ease, visibility 200ms ease;
}

.fda-footnote-referrer:hover .fda-footnote-tooltip,
.fda-footnote-referrer:focus-within .fda-footnote-tooltip {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.fda-footnote-tooltip .footnote_tooltip_continue {
	display: inline-block;
	margin-top: 0.2em;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

/* --- Conteneur de références --- */
.fda-footnotes-reference-container {
	margin-top: 24px;
	margin-bottom: 0;
}

.fda-footnotes-reference-container .footnote_container_prepare {
	margin: 0 0 0.5em;
}

.fda-footnotes-reference-container .footnote_container_prepare.fda-fn-has-border {
	border-bottom: 1px solid #aaa;
	padding-bottom: 0.3em;
}

.fda-footnotes-reference-container .footnote_reference_container_label {
	font-weight: 700;
}

.fda-footnotes-reference-container table.footnotes_table {
	width: 100%;
	margin: 0;
	border: none;
	border-collapse: collapse;
	background: none;
}

.fda-footnotes-reference-container .footnotes_table th,
.fda-footnotes-reference-container .footnotes_table td {
	border: none;
	background: none;
	padding: 0.25em 0;
	vertical-align: top;
	text-align: left;
}

.fda-footnotes-reference-container .footnote_plugin_index_combi {
	width: 1%;
	min-width: 2.2em;
	white-space: nowrap;
	padding-right: 0.6em;
}

.fda-footnotes-reference-container a.footnote_backlink {
	text-decoration: none;
	cursor: pointer;
}

.fda-footnotes-reference-container a.footnote_backlink:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

.fda-footnotes-reference-container .footnote_index_arrow {
	margin-right: 0.15em;
}

.fda-footnotes-reference-container .footnote_plugin_text {
	width: auto;
	word-break: break-word;
}

/* Légende lue par les lecteurs d'écran, masquée visuellement. */
.fda-footnotes-reference-container caption.accessibility {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Surbrillance brève de la cible après un clic (progressivement amélioré). */
.fda-fn-flash {
	animation: fda-fn-flash 1.5s ease-out;
	border-radius: 3px;
}

@keyframes fda-fn-flash {
	0%   { background-color: rgba(74, 117, 189, 0.3); } /* Couleur d'accentuation Enfold (bleu) */
	100% { background-color: transparent; }
}

/* À l'impression : pas d'info-bulle, flèches de retour inutiles. */
@media print {
	.fda-footnote-tooltip { display: none !important; }
	.fda-footnotes-reference-container .footnote_index_arrow { display: none; }
}
