/* Calendrier AIBL — chargé par le thème enfant (functions.php). Ne pas dupliquer dans le Customizer. */

/* Calendrier / archives : pleine largeur contenu (1200px) — ne pas cibler #page-container (footer Divi) */
body.et_full_width_page #main-content .container,
body.aibl-page-calendrier #main-content .container {
	max-width: 1200px;
	width: 100%;
	padding-left: 24px;
	padding-right: 24px;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}
body.et_full_width_page #main-content #left-area,
body.aibl-page-calendrier #main-content #left-area {
	width: 100%;
	max-width: 100%;
	float: none;
	padding-right: 0;
}
body.aibl-page-calendrier #main-content .entry-content {
	width: 100%;
	max-width: 100%;
	float: none;
	clear: both;
}

#main-content .aibl-page-title {
	font-size: 32px;
	font-weight: 700;
	color: #333;
	margin: 0 0 32px;
	padding: 0;
	line-height: 1.2;
}

/* Hero — même grille flex que .aibl-card-upcoming (date | contenu) */
.aibl-hero {
	background: #fef2f2;
	border-radius: 10px;
	padding: 22px 26px;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 22px;
	margin-bottom: 40px;
}
.aibl-hero .aibl-date-block {
	text-align: center;
	min-width: 56px;
	flex-shrink: 0;
	align-self: flex-start;
	margin-top: 0;
}
.aibl-date-block {
	text-align: center;
	min-width: 56px;
	flex-shrink: 0;
}
.aibl-date-day {
	display: block;
	font-size: 36px;
	font-weight: 600;
	color: #C8102E;
	line-height: 1;
}
.aibl-date-month {
	display: block;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #C8102E;
	margin-top: 4px;
	font-weight: 500;
}
.aibl-hero-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #C8102E;
	font-weight: 500;
	margin-bottom: 4px;
}
.aibl-hero-title {
	font-size: 18px;
	font-weight: 600;
	color: #333;
	line-height: 1.4;
	margin: 0 0 6px;
}
.aibl-hero-meta {
	font-size: 14px;
	font-weight: 600;
	color: #333;
	margin-top: 4px;
}
.aibl-hero-link {
	font-size: 13px;
	color: #C8102E;
	text-decoration: none;
	font-weight: 500;
}
.aibl-hero-full {
	align-items: flex-start;
}
.aibl-hero-full .aibl-hero-body {
	flex: 1;
	min-width: 0;
	width: 100%;
}
.aibl-hero-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 6px;
}
.aibl-hero-top .aibl-hero-label {
	margin-bottom: 0;
}
.aibl-hero-top .aibl-badge {
	margin-left: auto;
}
.aibl-hero-full .aibl-body {
	margin-top: 12px;
}

/* Sections — sans ligne grise */
.aibl-section-label {
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #C8102E;
	font-weight: 600;
	margin: 40px 0 20px;
	padding: 0;
}
.aibl-section-past {
	margin-top: 56px;
}

#left-area .entry-content .aibl-list-avenir {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 48px;
}

#left-area .entry-content .aibl-grid-past {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-bottom: 24px;
	align-items: stretch;
}

/* Carte à venir — bloc distinct (fond charte §2.2) */
.aibl-card-upcoming {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 22px;
	background: #F7F7F7;
	border-radius: 8px;
	padding: 20px 24px;
	border-left: 4px solid #C8102E;
}
.aibl-card-main {
	flex: 1;
	min-width: 0;
	line-height: 1.4;
}
.aibl-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 6px;
}
.aibl-type {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #C8102E;
	font-weight: 600;
}
.aibl-title {
	font-size: 18px;
	font-weight: 600;
	color: #333;
	margin: 0 0 6px;
	line-height: 1.4;
	word-wrap: break-word;
	overflow-wrap: break-word;
}
.aibl-event-details {
	font-size: 14px;
	color: #333;
	line-height: 1.4;
	margin: 0 0 12px;
}
.aibl-event-details .aibl-detail-line {
	margin: 0;
}
.aibl-event-details .aibl-detail-heure + .aibl-detail-lieu {
	margin-top: 2px;
}
.aibl-detail-lieu .aibl-map-link {
	display: inline;
	margin: 0;
	padding: 0;
	line-height: inherit;
}
.aibl-detail-lieu br {
	line-height: 1.2;
}
.aibl-detail-label {
	font-weight: 600;
	color: #333;
}
.aibl-detail-map {
	margin: 0;
	padding: 0;
}
.aibl-detail-map .aibl-map-link {
	display: inline-block;
	color: #d61810;
	text-decoration: underline;
	font-weight: 400;
	font-size: 14px;
}
.aibl-detail-map .aibl-map-link:hover {
	text-decoration: none;
}
.aibl-hero .aibl-event-details {
	margin-top: 0;
}
.aibl-hero-body .aibl-hero-title,
.aibl-card-main .aibl-title {
	margin: 0;
}
.aibl-speaker-block {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	margin: 14px 0 10px;
}
.aibl-hero-body .aibl-speaker-block,
.aibl-card-main .aibl-speaker-block {
	margin-top: 14px;
	margin-bottom: 10px;
}
.aibl-speaker-name {
	font-size: 15px;
	font-weight: 600;
	color: #d61810;
	line-height: 1.25;
	margin: 0;
	padding: 0;
}
.aibl-speaker-org {
	font-size: 14px;
	font-style: italic;
	color: #333;
	line-height: 1.25;
	margin: 2px 0 0;
	padding: 0;
}
.aibl-speaker {
	font-size: 14px;
	color: #555;
	margin-bottom: 12px;
}
.aibl-body {
	font-size: 14px;
	color: #333;
	line-height: 1.4;
}
.aibl-body p {
	margin: 0 0 10px;
	line-height: 1.4;
}
.aibl-body p:last-child {
	margin-bottom: 0;
}
.aibl-body ul,
.aibl-body ol {
	margin: 6px 0 10px;
	padding-left: 18px;
}

/* Typographie : 1.4 = ratio (pas 1.4px) */
body.aibl-page-calendrier .aibl-body .aibl-body-inner,
body.aibl-page-calendrier .aibl-body .aibl-body-inner p,
body.aibl-page-calendrier .aibl-body .aibl-body-inner em,
body.aibl-page-calendrier .aibl-body .aibl-body-inner strong,
body.aibl-page-calendrier .aibl-body .aibl-body-inner i,
body.aibl-page-calendrier .aibl-body .aibl-body-inner li {
	line-height: 1.4;
	font-size: 14px;
}
body.aibl-page-calendrier .aibl-event-details,
body.aibl-page-calendrier .aibl-card-main {
	line-height: 1.4;
}
.aibl-badge {
	font-size: 11px;
	padding: 4px 10px;
	border-radius: 4px;
	font-weight: 500;
	margin-left: auto;
	text-decoration: none;
	flex-shrink: 0;
	background: #fef2f2;
	color: #C8102E;
}
.aibl-badge-soon {
	background: #f0f0f0;
	color: #666;
	cursor: default;
}
.aibl-hero-link.aibl-register-soon {
	color: #666;
	cursor: default;
	pointer-events: none;
}

/* Passés — cartes compactes ; pied de carte = Voir plus toujours en bas */
.aibl-card-past {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 100%;
	background: #fff;
	border: 1px solid #E5E5E5;
	border-radius: 8px;
	padding: 16px 18px;
	border-left: 3px solid #D3D1C7;
}
.aibl-card-past-main {
	flex: 1 1 auto;
	min-height: 0;
}
.aibl-card-past-foot {
	flex-shrink: 0;
	margin-top: auto;
	padding-top: 10px;
}
.aibl-card-past .aibl-modal-source {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.aibl-card-past .aibl-date-block {
	text-align: center;
	margin-bottom: 10px;
}
.aibl-card-past .aibl-date-day {
	font-size: 28px;
	font-weight: 600;
	color: #999;
	line-height: 1;
}
.aibl-card-past .aibl-date-month {
	color: #999;
}
.aibl-card-past .aibl-date-year {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #666;
	margin-top: 4px;
}
.aibl-card-past .aibl-type {
	font-size: 10px;
	color: #999;
}
.aibl-card-past .aibl-title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 4px;
	word-wrap: break-word;
	overflow-wrap: break-word;
	color: #333;
}
.aibl-card-past .aibl-speaker {
	font-size: 13px;
	color: #666;
	margin-bottom: 8px;
}
.aibl-desc {
	font-size: 13px;
	color: #666;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0 0 8px;
}
.aibl-more {
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 13px;
	font-weight: 400;
	color: #d61810;
	text-align: left;
	display: block;
	width: 100%;
}
.aibl-more:hover {
	text-decoration: underline;
}
.aibl-badge-past {
	background: #f5f4f0;
	color: #888;
}

.aibl-archives-cta {
	text-align: center;
	margin: 40px 0 64px;
}

/* Bouton site AIBL (réglages Divi) */
.aibl-archives-cta .aibl-btn,
.aibl-archives-cta a.aibl-btn,
a.aibl-btn {
	display: inline-block !important;
	font-family: Montserrat, "Helvetica Neue", Arial, sans-serif !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	text-transform: uppercase !important;
	background: #d61810 !important;
	color: #fff !important;
	border-radius: 3px !important;
	padding: 8px 20px !important;
	text-decoration: none !important;
	border: none !important;
	cursor: pointer;
	line-height: 1.3 !important;
	letter-spacing: 0.02em;
	box-shadow: none !important;
}
.aibl-archives-cta .aibl-btn:hover,
.aibl-archives-cta a.aibl-btn:hover,
a.aibl-btn:hover {
	opacity: 0.92;
	color: #fff !important;
	background: #d61810 !important;
}

.aibl-archive-past .aibl-archive-toolbar {
	position: sticky;
	top: 0;
	z-index: 20;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.aibl-archive-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin-bottom: 28px;
	padding: 14px 18px;
	background: #fff;
	border: 1px solid #E5E5E5;
	border-radius: 8px;
}
.aibl-period-label {
	font-size: 14px;
	font-weight: 600;
	color: #333;
}
.aibl-year-filter {
	font-size: 14px;
	padding: 8px 12px;
	border: 1px solid #D3D1C7;
	border-radius: 6px;
	background: #fff;
	color: #333;
	min-width: 200px;
}

.aibl-year-label {
	font-size: 20px;
	font-weight: 700;
	color: #333;
	margin: 32px 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid #F7F7F7;
}
.aibl-year-block:first-child .aibl-year-label {
	margin-top: 0;
}
.aibl-year-block {
	margin-bottom: 12px;
}

/* Popup événement */
.aibl-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999999;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.aibl-modal.is-open {
	display: flex;
}
body.aibl-modal-open {
	overflow: hidden;
}
.aibl-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(51, 51, 51, 0.5);
}
.aibl-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 720px;
	max-height: 88vh;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.aibl-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border: none;
	background: #F7F7F7;
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 0;
}
.aibl-modal-close:hover {
	background: #eee;
	color: #333;
}
.aibl-modal-scroll {
	overflow-y: auto;
	padding: 28px 36px 32px;
	-webkit-overflow-scrolling: touch;
}
.aibl-modal-event {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	align-items: flex-start;
}
.aibl-modal-event-main {
	flex: 1;
	min-width: 0;
}
.aibl-modal-event .aibl-date-day {
	font-size: 40px;
	color: #d61810;
}
.aibl-modal-event .aibl-date-month {
	color: #d61810;
}
.aibl-modal-event .aibl-title {
	font-size: 22px;
	margin-bottom: 8px;
}
.aibl-modal-meta {
	font-size: 14px;
	font-weight: 600;
	color: #333;
	margin-bottom: 12px;
	line-height: 1.4;
}
.aibl-modal-body {
	font-size: 15px;
	line-height: 1.6;
	color: #333;
}
.aibl-modal-body p {
	margin: 0 0 12px;
}
.aibl-modal-body p:last-child {
	margin-bottom: 0;
}
.aibl-back-link {
	margin: -16px 0 24px;
}
.aibl-back-link a {
	font-size: 14px;
	color: #C8102E;
	text-decoration: none;
	font-weight: 500;
}
.aibl-back-link a:hover {
	text-decoration: underline;
}

@media (max-width: 980px) {
	#left-area .entry-content .aibl-grid-past {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	/* Prochain événement = même responsive que les cartes à venir (date en haut) */
	body.aibl-page-calendrier #left-area .entry-content .aibl-hero,
	body.aibl-page-calendrier #left-area .entry-content .aibl-hero-full,
	body.aibl-page-calendrier #left-area .entry-content .aibl-list-avenir .aibl-card-upcoming {
		display: flex !important;
		flex-direction: column !important;
		flex-wrap: nowrap !important;
		align-items: stretch !important;
		gap: 12px;
	}
	body.aibl-page-calendrier #left-area .entry-content .aibl-hero,
	body.aibl-page-calendrier #left-area .entry-content .aibl-hero-full {
		padding: 16px 18px;
	}
	body.aibl-page-calendrier #left-area .entry-content .aibl-list-avenir .aibl-card-upcoming {
		padding: 16px 18px;
	}
	body.aibl-page-calendrier #left-area .entry-content .aibl-hero .aibl-date-block,
	body.aibl-page-calendrier #left-area .entry-content .aibl-hero-full .aibl-date-block,
	body.aibl-page-calendrier #left-area .entry-content .aibl-card-upcoming .aibl-date-block {
		order: 0;
		width: auto;
		max-width: none;
		flex: 0 0 auto;
		align-self: flex-start;
		margin: 0;
	}
	body.aibl-page-calendrier #left-area .entry-content .aibl-hero-full .aibl-hero-body,
	body.aibl-page-calendrier #left-area .entry-content .aibl-card-upcoming .aibl-card-main {
		order: 1;
		width: 100%;
		max-width: 100%;
		flex: 1 1 auto;
		min-width: 0;
	}
	body.aibl-page-calendrier #left-area .entry-content .aibl-hero-top {
		width: 100%;
	}
	body.aibl-page-calendrier #left-area .entry-content .aibl-hero-top .aibl-badge {
		margin-left: auto;
	}
	#left-area .entry-content .aibl-grid-past {
		grid-template-columns: 1fr;
	}
	.aibl-modal-scroll {
		padding: 24px 20px 28px;
	}
}

/* Contenu Divi dans les articles : ne doit pas rétrécir la page */
body.aibl-page-calendrier #main-content .container {
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

/* Footer Divi : pleine largeur, hors contrainte du calendrier */
body.aibl-page-calendrier .et-l--footer,
body.aibl-page-calendrier #main-footer,
body.aibl-page-calendrier footer.et-l--footer {
	width: 100% !important;
	max-width: none !important;
	clear: both;
}
body.aibl-page-calendrier #main-content #left-area,
body.aibl-page-calendrier #main-content .entry-content {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
}
body.aibl-page-calendrier .aibl-archives-cta {
	clear: both;
	width: 100%;
}
body.aibl-page-calendrier .aibl-body .et-l--post,
body.aibl-page-calendrier .aibl-body .et_pb_section,
body.aibl-page-calendrier .aibl-body .et_pb_row,
body.aibl-page-calendrier .aibl-body .et_pb_column {
	width: 100% !important;
	max-width: none !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}
