:root {
	--jbann-modal-bg: #FAF6EF;
	--jbann-color-title: var(--color-fern);
	--jbann-color-content: #4A5A3C;
	--jbann-color-subtitle: #4A5A3C;
	--jbann-color-button-bg: #f8b90e;
	--jbann-color-focus: color-mix(in srgb, var(--jbann-color-button-bg) 85%, black);
	--jbann-color-banner-bg: color-mix(in srgb, var(--jbann-color-button-bg) 85%, black);
	--jbann-radius-modal: 1.125rem;
	--jbann-radius-button: 2em;

	--jbann-font-title: Georgia,serif;
	--jbann-font-content: inherit;
	--jbann-font-button: inherit;
	--jbann-size-title: 1.5rem;
	--jbann-size-content: 1rem;
	--jbann-size-button: 1rem;
	--jbann-size-subtitle: 0.9375rem;

	--jbann-logo-max-width: 150px;
	--jbann-logo-max-height: 48px;

	--jbann-dialog-max-width: 22.5rem;
	--jbann-shadow-rgb: 40, 35, 25;
}

html:has(#jb-ann-dialog:not([open])) .grecaptcha-badge {
	bottom: 80px !important;
}

#jb-ann-dialog {
	position: fixed;
	inset: auto;
	left: 0;
	right: 0;
	bottom: 0.75rem;
	margin: 0 auto;
	padding: 0;
	border: none;
	z-index: 99999;
	background: var(--jbann-modal-bg);
	border-radius: var(--jbann-radius-modal);
	box-shadow:
		0 1px 2px rgba(var(--jbann-shadow-rgb), 0.12),
		0 4px 8px rgba(var(--jbann-shadow-rgb), 0.14),
		0 12px 24px rgba(var(--jbann-shadow-rgb), 0.18);
	width: calc(100% - 1.5rem);
	max-width: var(--jbann-dialog-max-width);
	max-height: 90svh;
}

#jb-ann-dialog[open] {
	display: flex;
	flex-direction: column;
}

#jb-ann-dialog::backdrop {
	background: rgba(var(--jbann-shadow-rgb), 0.15);
}

#jb-ann-dialog .jb-ann-dialog__body {
	flex: 1 1 auto;
	min-height: 0;
	border-radius: var(--jbann-radius-modal);
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: thin;
}

#jb-ann-dialog .jb-ann-dialog__body::-webkit-scrollbar {
	width: 6px;
}

#jb-ann-dialog.jb-ann-dialog--has-media .jb-ann-dialog__body {
	display: flex;
	flex-direction: column;
}

#jb-ann-dialog .jb-ann-dialog__media {
	position: relative;
	flex: 0 0 9rem;
	height: 9rem;
	min-height: 9rem;
	min-width: 0;
	overflow: hidden;
}

#jb-ann-dialog .jb-ann-dialog__media img,
#jb-ann-dialog .jb-ann-dialog__media picture {
	position: absolute;
	inset: 0;
	display: block;
}

#jb-ann-dialog .jb-ann-dialog__media img,
#jb-ann-dialog .jb-ann-dialog__media picture img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

#jb-ann-dialog .jb-ann-dialog__content {
	flex: 0 0 auto;
	min-height: 0;
	align-self: stretch;
	overflow-y: visible;
	overflow-x: hidden;
	scrollbar-width: thin;
	padding: clamp(1rem, 4vw, 1.5rem) 1.25rem clamp(0.875rem, 3vw, 1.25rem);
	text-align: center;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: center;
}

#jb-ann-dialog .jb-ann-dialog__content::-webkit-scrollbar {
	width: 6px;
}

#jb-ann-dialog:not(.jb-ann-dialog--has-media) .jb-ann-dialog__content {
	text-align: center;
	align-items: center;
}

#jb-ann-dialog .jb-ann-dialog__close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: var(--jbann-modal-bg);
	color: var(--jbann-color-title);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
	z-index: 100000;
}

#jb-ann-dialog .jb-ann-dialog__close svg {
	width: 24px;
	height: 24px;
}

#jb-ann-dialog .jb-ann-dialog__close:focus-visible {
	outline: 2px solid var(--jbann-color-focus);
	outline-offset: 2px;
}

#jb-ann-dialog .jb-ann-dialog__logo-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--jbann-logo-max-width);
	height: var(--jbann-logo-max-height);
	max-width: var(--jbann-logo-max-width);
	max-height: var(--jbann-logo-max-height);
	overflow: hidden;
	margin-bottom: 12px;
	flex: 0 0 auto;
}

#jb-ann-dialog:not(.jb-ann-dialog--has-media) .jb-ann-dialog__logo-wrap {
	justify-content: center;
	margin-left: auto;
	margin-right: auto;
}

/* Mobile : place limitée, on priorise le media (photo) sur le logo pour éviter une modale surchargée/à rallonge. */
#jb-ann-dialog.jb-ann-dialog--has-media .jb-ann-dialog__logo-wrap {
	display: none;
}

#jb-ann-dialog .jb-ann-dialog__logo-wrap picture,
#jb-ann-dialog .jb-ann-dialog__logo-wrap .jb-ann-dialog__logo {
	display: block;
	max-width: 100%;
	max-height: 100%;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}

#jb-ann-dialog .jb-ann-dialog__logo-wrap img {
	display: block;
	max-width: var(--jbann-logo-max-width) !important;
	max-height: var(--jbann-logo-max-height) !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain;
}

#jb-ann-dialog .jb-ann-dialog__title {
	margin: 0 0 clamp(0.3em, 1.5vw, 0.5em);
	font-family: var(--jbann-font-title, sans-serif);
	font-size: var(--jbann-size-title);
	color: var(--jbann-color-title);
}

#jb-ann-dialog .jb-ann-dialog__text-wrap p {
	margin: 0 0 0.75em;
	color: var(--jbann-color-content);
	font-family: var(--jbann-font-content, sans-serif);
	font-size: var(--jbann-size-content);
	line-height: 1.4;
}

#jb-ann-dialog .jb-ann-dialog__text-wrap p:last-child {
	margin-bottom: 0;
}

#jb-ann-dialog .jb-ann-dialog__cta-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	align-self: stretch;
	margin-top: clamp(0.875rem, 3vw, 1.25rem);
}

#jb-ann-dialog:not(.jb-ann-dialog--has-media) .jb-ann-dialog__cta-wrap,
#jb-ann-dialog:has(.jb-ann-dialog__subtitle) .jb-ann-dialog__cta-wrap {
	align-items: center;
}

#jb-ann-dialog .jb-ann-dialog__cta {
	background: var(--jbann-color-button-bg);
	color: #fff;
	border: none;
	padding: 0.7em 1.6em;
	border-radius: var(--jbann-radius-button);
	font-family: var(--jbann-font-button, sans-serif);
	font-size: var(--jbann-size-button);
	font-weight: 600;
	cursor: pointer;
	transition: background-color 200ms ease;
}

#jb-ann-dialog .jb-ann-dialog__cta:has(~ .jb-ann-dialog__subtitle) {
	align-self: stretch;
	text-align: center;
}

@media (hover: hover) {
	#jb-ann-dialog .jb-ann-dialog__cta:hover {
		background: color-mix(in srgb, var(--jbann-color-button-bg) 95%, black);
	}
}

#jb-ann-dialog .jb-ann-dialog__cta:active {
	background: color-mix(in srgb, var(--jbann-color-button-bg) 85%, black);
}

#jb-ann-dialog .jb-ann-dialog__cta:focus-visible {
	outline: 2px solid var(--jbann-color-focus);
	outline-offset: 2px;
}

#jb-ann-dialog .jb-ann-dialog__subtitle {
	margin-top: 0.667em;
	font-size: var(--jbann-size-subtitle);
	color: var(--jbann-color-subtitle);
	font-weight: 600;
	text-align: center;
}

#jb-ann-dialog .jb-ann-dialog__subtitle--link {
	text-decoration: underline !important;
}

@media (min-width: 40em) {
	#jb-ann-dialog .jb-ann-dialog__body {
		overflow: hidden;
	}

	#jb-ann-dialog .jb-ann-dialog__content {
		flex: 1 1 auto;
		overflow-y: auto;
		padding: 1.5rem;
	}

	#jb-ann-dialog .jb-ann-dialog__close {
		top: 16px;
		right: 16px;
	}

	#jb-ann-dialog {
		left: auto;
		right: 20px;
		bottom: 20px;
		width: var(--jbann-dialog-max-width);
		max-width: calc(100% - 40px);
		max-height: 80vh;
	}
}

.jbann-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99998;
	display: none;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	background: var(--jbann-color-banner-bg);
	color: #fff;
}

.jbann-banner__text {
	flex: 1 1 auto;
	font-size: 0.9375rem;
	font-weight: 600;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.jbann-banner__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 0 0 auto;
}

.jbann-banner__open {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	border: none;
	border-radius: var(--jbann-radius-button);
	padding: 0.5em 1em;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.jbann-banner__close {
	background: transparent;
	border: none;
	color: #fff;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	flex: 0 0 auto;
}

.jbann-banner__close svg {
	width: 20px;
	height: 20px;
}

.jbann-reminder {
	display: none;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99997;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: var(--jbann-color-button-bg);
	color: #fff;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}