/* Ajustements limites a l'article 4959, y compris son apercu WordPress. */
body.bfn-program-choice-post {
	--bfn-choice-sticky-top: 104px;
}

body.admin-bar.bfn-program-choice-post {
	--bfn-choice-sticky-top: 136px;
}

/* Meme depart sous le menu que les autres articles, sans marges Astra/Elementor. */
body.bfn-program-choice-post #content > .ast-container,
body.bfn-program-choice-post #primary,
body.bfn-program-choice-post #primary .ast-article-single,
body.bfn-program-choice-post #primary .entry-content,
body.bfn-program-choice-post #primary .elementor {
	box-sizing: border-box;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

body.bfn-program-choice-post #content > .ast-container,
body.bfn-program-choice-post #primary .elementor :is(.elementor-container, .elementor-row, .elementor-column, .elementor-column-wrap, .elementor-widget-wrap, .e-con, .e-con-inner) {
	display: block !important;
	box-sizing: border-box;
	width: 100% !important;
	max-width: none !important;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
}

body.bfn-program-choice-post #content,
body.bfn-program-choice-post #primary .elementor :is(.elementor-section, .elementor-widget-html, .elementor-widget-container) {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Un ancetre avec overflow masque empeche le sommaire de suivre le viewport. */
body.bfn-program-choice-post #page,
body.bfn-program-choice-post #content,
body.bfn-program-choice-post #primary,
body.bfn-program-choice-post #primary .entry-content,
body.bfn-program-choice-post #primary .elementor :is(.elementor-section, .elementor-container, .elementor-row, .elementor-column, .elementor-column-wrap, .elementor-widget-wrap, .elementor-widget, .elementor-widget-container, .e-con, .e-con-inner) {
	overflow: visible !important;
}

body.bfn-program-choice-post .bf-choice-shell {
	width: 100%;
	max-width: 100%;
	left: auto;
	transform: none;
	overflow: visible;
	padding-top: 24px;
}

body.bfn-program-choice-post .bf-choice-breadcrumb {
	display: none;
}

/* Position sous le header, hauteur bornee et acces a tous les liens sur petit ecran. */
body.bfn-program-choice-post .bf-choice-sidebar {
	position: sticky;
	top: var(--bfn-choice-sticky-top);
	align-self: start;
	padding-top: 0;
	max-height: calc(100vh - var(--bfn-choice-sticky-top) - 12px);
	max-height: calc(100dvh - var(--bfn-choice-sticky-top) - 12px);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

body.bfn-program-choice-post .bf-choice-sidebar-label,
body.bfn-program-choice-post .bf-choice-share-label {
	margin-bottom: 14px;
}

body.bfn-program-choice-post .bf-choice-toc a {
	margin-bottom: 12px;
}

body.bfn-program-choice-post .bf-choice-side-divider {
	margin: 18px 0;
}

body.bfn-program-choice-post .bf-choice-content > section {
	scroll-margin-top: var(--bfn-choice-sticky-top);
}

/* Boutons LLM identiques a ceux de l'article sur la progression. */
.bf-choice-shell .bf-choice-ai {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 38px;
	padding: 20px;
	border: 1px solid #ffd7c4;
	border-radius: 20px;
	background: linear-gradient(135deg, #fff8f4, #fffdfc);
}

.bf-choice-ai .bf-ai-label {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #111;
	font-size: 17px;
	font-weight: 700;
}

.bf-choice-ai .bf-ai-icon {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	border-radius: 50%;
	background: #ffe4d5;
}

.bf-choice-ai .bf-ai-buttons {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	min-width: 0;
}

.bf-choice-shell .bf-choice-ai .bf-ai-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 100%;
	padding: 9px 15px;
	border: 1px solid #ddd;
	border-radius: 999px;
	background: #fff;
	color: #111;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.bf-choice-shell .bf-choice-ai .bf-ai-button:is(:hover, :focus-visible) {
	border-color: var(--bf-orange);
}

.bf-choice-ai .bf-ai-button:focus-visible {
	outline: 2px solid #111;
	outline-offset: 3px;
}

@media (max-width: 820px) {
	body.bfn-program-choice-post .bf-choice-shell {
		padding-top: 16px;
	}

	.bf-choice-shell .bf-choice-ai {
		padding: 18px;
	}
}

/* Sur telephone, chaque ligne devient une fiche lisible au lieu d'une table tronquee. */
@media (max-width: 767px) {
	body.bfn-program-choice-post #bf-choice-article .bf-choice-table-wrap {
		box-sizing: border-box;
		width: 100% !important;
		max-width: 100% !important;
		margin: 20px 0;
		padding: 0;
		overflow: visible !important;
		border: 0 !important;
		border-radius: 0 !important;
		background: transparent !important;
		box-shadow: none !important;
	}

	body.bfn-program-choice-post #bf-choice-article .bf-choice-table {
		display: block !important;
		box-sizing: border-box;
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
		border: 0 !important;
		border-collapse: separate !important;
		border-spacing: 0;
		background: transparent;
		white-space: normal !important;
	}

	body.bfn-program-choice-post #bf-choice-article .bf-choice-table thead {
		display: block !important;
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		margin: -1px !important;
		padding: 0 !important;
		overflow: hidden !important;
		clip-path: inset(50%) !important;
		white-space: nowrap !important;
		border: 0 !important;
	}

	body.bfn-program-choice-post #bf-choice-article .bf-choice-table tbody {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
		width: 100% !important;
	}

	body.bfn-program-choice-post #bf-choice-article .bf-choice-table tbody tr {
		display: block !important;
		box-sizing: border-box;
		width: 100% !important;
		margin: 0 !important;
		overflow: hidden;
		border: 1px solid #e7e7e7 !important;
		border-radius: 16px;
		background: #fff !important;
		box-shadow: 0 6px 20px rgba(24, 24, 24, 0.06);
	}

	body.bfn-program-choice-post #bf-choice-article .bf-choice-table tbody td {
		display: block !important;
		box-sizing: border-box;
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
		height: auto !important;
		padding: 12px 15px;
		border: 0 !important;
		border-bottom: 1px solid #ededed !important;
		color: #555b63;
		font-size: 15px;
		line-height: 1.5;
		text-align: left;
		white-space: normal !important;
		overflow-wrap: anywhere;
		word-break: normal;
	}

	body.bfn-program-choice-post #bf-choice-article .bf-choice-table tbody td::before {
		display: block;
		margin-bottom: 4px;
		color: #70757d;
		font-size: 12px;
		font-weight: 700;
		line-height: 1.35;
		content: attr(data-label);
	}

	body.bfn-program-choice-post #bf-choice-article .bf-choice-table tbody td:first-child {
		padding: 14px 15px;
		background: #fff1e9 !important;
		color: #24272c;
		font-size: 16px;
		font-weight: 700;
	}

	body.bfn-program-choice-post #bf-choice-article .bf-choice-table tbody td:first-child::before {
		display: none;
		content: none;
	}

	body.bfn-program-choice-post #bf-choice-article .bf-choice-table tbody td:last-child {
		border-bottom: 0 !important;
	}
}
