/* Fiche événement publique : valeurs issues des tokens `--fl-*`. */

.fl-event {
	background: var(--fl-color-surface-sunken);
	color: var(--fl-text-primary);
	font-size: var(--fl-font-size-base);
	line-height: var(--fl-line-height-base);
}

.fl-event__container {
	box-sizing: border-box;
	max-width: 1240px;
	margin-inline: auto;
	padding-inline: var(--fl-space-2xl);
}

.fl-event__muted {
	color: var(--fl-text-secondary);
	font-size: var(--fl-font-size-md);
}

.fl-event__muted p {
	margin: 0;
}

.fl-event__grow {
	flex: 1;
	min-width: 0;
}

/* Header */

.fl-event-hero {
	position: relative;
	/* Environ la moitié de l'écran : 400 px sur un portable de 768 px, 520 px au plus. */
	height: clamp(380px, 52vh, 520px);
	overflow: hidden;
	background: var(--fl-color-ink);
}

/* L'affiche se lit en entier : elle garde de la hauteur. */
.fl-event-hero--poster {
	height: clamp(500px, 58vh, 600px);
}

/* Sans image : juste de quoi poser la navigation. */
.fl-event-hero--empty {
	height: 120px;
}

.fl-event-hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.fl-event-hero__blur {
	position: absolute;
	inset: -16px;
	display: none;
	background-position: center;
	background-size: cover;
	filter: blur(8px);
}

/* Image entière, centrée sur sa propre version floutée. */
@media (min-width: 768px) {
	.fl-event-hero--contain-desktop .fl-event-hero__blur {
		display: block;
	}

	.fl-event-hero--contain-desktop .fl-event-hero__image {
		object-fit: contain;
	}
}

@media (max-width: 767px) {
	.fl-event-hero--contain-mobile .fl-event-hero__blur {
		display: block;
	}

	.fl-event-hero--contain-mobile .fl-event-hero__image {
		object-fit: contain;
	}
}

.fl-event-hero__open {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.fl-event-hero__open:focus-visible {
	outline: 2px solid var(--fl-color-accent);
	outline-offset: -4px;
}

.fl-event-hero__scrim {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0) 30%);
}

.fl-event-intro {
	padding-block: var(--fl-space-2xl);
	background: var(--fl-color-surface);
}

.fl-event-intro__crumbs {
	margin: 0 0 var(--fl-space-lg);
}

.fl-event-intro__head {
	display: flex;
	align-items: center;
	gap: var(--fl-space-lg);
}

/* Carré de date devant le titre, comme sur l'ancienne fiche. */
.fl-event-date-tile {
	flex: none;
	display: flex;
	flex-direction: column;
	width: 60px;
	overflow: hidden;
	border: 1px solid var(--fl-color-border);
	border-radius: var(--fl-radius-md);
	background: var(--fl-color-surface);
	text-align: center;
}

.fl-event-date-tile__month {
	padding-block: var(--fl-space-3xs);
	background: var(--fl-color-accent);
	font-size: var(--fl-font-size-xs);
	font-weight: var(--fl-font-weight-semibold);
	text-transform: uppercase;
}

.fl-event-date-tile.is-past .fl-event-date-tile__month {
	background: var(--fl-color-surface-sunken);
	color: var(--fl-text-secondary);
}

.fl-event-date-tile__day {
	padding-top: var(--fl-space-3xs);
	font-size: var(--fl-font-size-2xl);
	font-weight: var(--fl-font-weight-bold);
	line-height: var(--fl-line-height-tight);
}

.fl-event-date-tile__weekday {
	padding-bottom: var(--fl-space-2xs);
	color: var(--fl-text-secondary);
	font-size: var(--fl-font-size-xs);
}

.fl-event .fl-event-intro__title {
	max-width: 800px;
	margin: 0 0 var(--fl-space-sm);
	color: inherit;
	font-family: inherit;
	font-size: var(--fl-font-size-3xl);
	font-weight: var(--fl-font-weight-bold);
	line-height: var(--fl-line-height-tight);
}

.fl-event .fl-event-intro__title--long {
	font-size: var(--fl-font-size-2xl);
}

.fl-event-intro__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fl-space-xs) var(--fl-space-xl);
	color: var(--fl-text-secondary);
	font-size: var(--fl-font-size-base);
	font-weight: var(--fl-font-weight-medium);
}

.fl-event-intro__meta-item {
	display: inline-flex;
	align-items: center;
	gap: var(--fl-space-sm);
}

.fl-event-intro__meta-item svg {
	flex: none;
	color: var(--fl-text-secondary);
}

/* Ancres */

.fl-event__anchors {
	position: sticky;
	/* Sous la barre d'admin WordPress quand elle est là. */
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 20;
	border-bottom: 1px solid var(--fl-color-border);
	background: var(--fl-color-surface);
}

/* Une section atteinte par une ancre ne passe pas sous la barre. */
.fl-event [id] {
	scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 72px);
}

.fl-event__anchors-list {
	display: flex;
	gap: 28px;
	overflow-x: auto;
	scrollbar-width: none;
}

.fl-event__anchor {
	flex: none;
	padding-block: var(--fl-space-lg);
	border-bottom: 2px solid transparent;
	color: var(--fl-text-secondary);
	font-weight: var(--fl-font-weight-medium);
}

.fl-event__anchor:hover {
	color: var(--fl-text-primary);
}

.fl-event__anchor.is-active {
	border-bottom-color: var(--fl-color-ink);
	color: var(--fl-text-primary);
	font-weight: var(--fl-font-weight-semibold);
}

/* Colonnes : la réservation vient d'abord dans le DOM pour le téléphone. */

.fl-event__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	align-items: start;
	gap: var(--fl-space-3xl);
	padding-block: var(--fl-space-3xl) var(--fl-space-4xl);
}

.fl-event__side {
	position: sticky;
	top: 88px;
	display: flex;
	flex-direction: column;
	gap: var(--fl-space-lg);
	grid-column: 2;
	grid-row: 1;
}

.fl-event__main {
	display: flex;
	flex-direction: column;
	gap: var(--fl-space-2xl);
	min-width: 0;
	grid-column: 1;
	grid-row: 1;
}

[id="presentation"],
[id="galerie"],
[id="acces"],
[id="organisateur"],
[id="avis"],
[id="fl-event-booking"] {
	scroll-margin-top: 88px;
}

.fl-event__card,
.fl-event-booking {
	box-sizing: border-box;
	border: 1px solid var(--fl-color-border);
	border-radius: var(--fl-radius-lg);
	background: var(--fl-color-surface);
	padding: var(--fl-space-2xl);
}

.fl-event .fl-event__title {
	margin: 0 0 var(--fl-space-lg);
	color: inherit;
	font-family: inherit;
	font-size: var(--fl-font-size-lg);
	font-weight: var(--fl-font-weight-semibold);
	line-height: var(--fl-line-height-snug);
}

.fl-event__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--fl-space-md);
	margin-bottom: var(--fl-space-lg);
}

.fl-event__head .fl-event__title {
	margin: 0;
}

.fl-event__tags {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fl-space-sm);
}

/* Présentation */

.fl-event__description.is-collapsed .fl-event__description-text {
	position: relative;
	max-height: 420px;
	overflow: hidden;
}

.fl-event__description.is-collapsed .fl-event__description-text::after {
	position: absolute;
	inset: auto 0 0;
	height: 90px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--fl-color-surface));
	content: "";
}

.fl-event__description-toggle {
	margin-top: var(--fl-space-md);
}

.fl-event .fl-event__description-text :is(h2, h3, h4) {
	color: inherit;
	font-family: inherit;
	font-size: var(--fl-font-size-base);
	font-weight: var(--fl-font-weight-semibold);
	line-height: var(--fl-line-height-snug);
}

.fl-event__description-text img {
	max-width: 100%;
	height: auto;
}

.fl-event__video iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	border: 0;
	border-radius: var(--fl-radius-md);
}

/* Réservation */

.fl-event-booking {
	font-size: var(--fl-font-size-md);
}

.fl-event-booking .fl-event__muted {
	font-size: var(--fl-font-size-sm);
}

.fl-event .fl-event-booking__title {
	margin-bottom: var(--fl-space-md);
}

/* Statut des ventes et compte à rebours sur une ligne. */
.fl-event-booking__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--fl-space-sm) var(--fl-space-md);
	margin-bottom: var(--fl-space-lg);
}

.fl-event-booking__countdown {
	display: inline-flex;
	align-items: center;
	gap: var(--fl-space-xs);
	color: var(--fl-text-secondary);
	font-size: var(--fl-font-size-sm);
	font-weight: var(--fl-font-weight-medium);
}

.fl-event-booking__countdown svg {
	flex: none;
	color: var(--fl-text-secondary);
}

.fl-event-booking__ticket {
	margin-bottom: var(--fl-space-sm);
	padding: var(--fl-space-sm) var(--fl-space-md);
	border: 1px solid var(--fl-color-border);
	font-size: var(--fl-font-size-sm);
	border-radius: var(--fl-radius-md);
}

.fl-event-booking__ticket-head {
	display: flex;
	justify-content: space-between;
	gap: var(--fl-space-sm);
}

.fl-event-booking__price {
	color: var(--fl-color-accent-ink);
	font-weight: var(--fl-font-weight-semibold);
	white-space: nowrap;
}

.fl-event-booking__from {
	margin: 0 0 var(--fl-space-md);
}

.fl-event-booking__cta,
.fl-event-booking__dates {
	margin-top: var(--fl-space-sm);
}

.fl-event-booking__dates {
	display: block;
	width: 100%;
}

.fl-event-booking__dates .fl-ui-dropdown__menu {
	right: 0;
	left: 0;
	max-height: 320px;
	overflow-y: auto;
}

.fl-event-booking__tools {
	display: flex;
	justify-content: space-between;
	gap: var(--fl-space-xs);
	margin-top: var(--fl-space-lg);
	padding-top: var(--fl-space-md);
	border-top: 1px solid var(--fl-color-border);
}

.fl-event-booking__tools .fl-favorite.active svg {
	fill: currentColor;
}

/* Galerie */

.fl-event-gallery {
	position: relative;
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	grid-template-rows: 170px 170px;
	gap: var(--fl-space-sm);
	overflow: hidden;
	border-radius: var(--fl-radius-md);
}

.fl-event-gallery__tile {
	padding: 0;
	border: 0;
	background: var(--fl-color-surface-sunken);
	cursor: zoom-in;
}

.fl-event-gallery__tile img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.fl-event-gallery__tile:first-child {
	grid-row: span 2;
}

.fl-event-gallery--1 {
	grid-template-columns: 1fr;
	grid-template-rows: 340px;
}

.fl-event-gallery--2 {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 280px;
}

.fl-event-gallery--2 .fl-event-gallery__tile:first-child,
.fl-event-gallery--1 .fl-event-gallery__tile:first-child {
	grid-row: auto;
}

.fl-event-gallery--3 {
	grid-template-columns: 2fr 1fr;
}

.fl-event-gallery--4 .fl-event-gallery__tile:nth-child(4) {
	grid-column: span 2;
}

.fl-event-gallery__all {
	position: absolute;
	right: var(--fl-space-md);
	bottom: var(--fl-space-md);
}

/* Accès */

.fl-event-access__address {
	margin: var(--fl-space-lg) 0 0;
	font-weight: var(--fl-font-weight-semibold);
}

.fl-event-weather {
	display: flex;
	align-items: center;
	gap: var(--fl-space-md);
	margin-top: var(--fl-space-lg);
	padding: var(--fl-space-md) var(--fl-space-lg);
	border-radius: var(--fl-radius-md);
	background: var(--fl-color-surface-sunken);
}

.fl-event-weather__temp {
	font-size: var(--fl-font-size-2xl);
	font-weight: var(--fl-font-weight-bold);
	line-height: var(--fl-line-height-tight);
}

.fl-event-weather--days {
	display: block;
}

.fl-event-weather__title {
	display: block;
	margin-bottom: var(--fl-space-md);
}

.fl-event-weather__days {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: var(--fl-space-sm);
}

.fl-event-weather__day {
	display: flex;
	align-items: center;
	gap: var(--fl-space-md);
	padding: var(--fl-space-md);
	border-radius: var(--fl-radius-md);
	background: var(--fl-color-surface);
}

.fl-event-weather__day .fl-event-weather__temp {
	font-size: var(--fl-font-size-xl);
}

/* Organisateur */

.fl-event-contact {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--fl-space-md);
}

.fl-event-contact__wide {
	grid-column: 1 / -1;
}

.fl-event-contact__trap {
	position: absolute;
	left: -9999px;
}

.fl-event-organizer__managed {
	display: inline-flex;
	align-items: center;
	gap: var(--fl-space-3xs);
	color: var(--fl-text-secondary);
	font-size: var(--fl-font-size-sm);
}

.fl-event-organizer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--fl-space-lg);
}

.fl-event-organizer__avatar {
	flex: none;
	width: 56px;
	height: 56px;
	border-radius: var(--fl-radius-pill);
	object-fit: cover;
}

.fl-event-organizer__avatar--initials {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--fl-color-surface-sunken);
	font-weight: var(--fl-font-weight-bold);
}

.fl-event-organizer__name {
	color: var(--fl-text-primary);
	font-weight: var(--fl-font-weight-semibold);
}

.fl-event-organizer__stats {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fl-space-xs) var(--fl-space-md);
}

.fl-event-organizer__stat {
	display: inline-flex;
	align-items: center;
	gap: var(--fl-space-2xs);
}

.fl-event-organizer__actions {
	display: flex;
	gap: var(--fl-space-sm);
}

/* Mode convoi */

.fl-event-convoy {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--fl-space-lg);
	box-sizing: border-box;
	padding: var(--fl-space-2xl);
	border-radius: var(--fl-radius-lg);
	background: var(--fl-color-ink);
	color: var(--fl-text-inverse);
}

.fl-event-convoy__text {
	flex: 1 1 320px;
	min-width: 0;
}

.fl-event-convoy__eyebrow {
	margin: 0 0 var(--fl-space-xs);
	color: var(--fl-color-accent);
	font-size: var(--fl-font-size-sm);
	font-weight: var(--fl-font-weight-semibold);
}

.fl-event .fl-event-convoy__title {
	margin: 0 0 var(--fl-space-xs);
	color: inherit;
	font-family: inherit;
	font-size: var(--fl-font-size-lg);
	font-weight: var(--fl-font-weight-semibold);
	line-height: var(--fl-line-height-snug);
}

.fl-event-convoy__lead {
	margin: 0;
	color: var(--fl-text-inverse-muted);
}

/* Avis */

.fl-event-reviews__thread {
	display: flex;
	flex-direction: column;
	gap: var(--fl-space-xl);
	margin-bottom: var(--fl-space-2xl);
}

.fl-event-reviews__reply {
	margin-top: var(--fl-space-md);
}

.fl-event-reviews__empty {
	margin: 0 0 var(--fl-space-lg);
}

.fl-event-reviews__form {
	display: flex;
	flex-direction: column;
	gap: var(--fl-space-lg);
}

.fl-event-reviews__identity {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--fl-space-md);
}

/* Événements similaires */

.fl-event__related {
	padding-block: var(--fl-space-4xl);
	border-top: 1px solid var(--fl-color-border);
	background: var(--fl-color-surface);
}

/* L'encart du pied de page déborde sur son enveloppe : même fond que la fin de la
 * fiche, grise, ou blanche quand elle se termine par les événements similaires. */
body.fl-event-page {
	--fl-footer-shell-bg: var(--fl-color-surface-sunken);
}

body.fl-event-page:has(.fl-event__related) {
	--fl-footer-shell-bg: var(--fl-color-surface);
}

/* Barre d'action : téléphone uniquement */

.fl-event-bar {
	display: none;
}

/* Encart « publier un événement » : colonne de droite en desktop, après les avis sinon. */
.fl-event__publish--main {
	display: none;
}

@media (max-width: 1023px) {
	.fl-event__publish--side {
		display: none;
	}

	.fl-event__publish--main {
		display: flex;
	}

	.fl-event__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--fl-space-md);
		padding-block: var(--fl-space-md) var(--fl-space-2xl);
	}

	.fl-event__side {
		position: static;
		grid-column: 1;
		grid-row: auto;
	}

	.fl-event__main {
		grid-column: 1;
		grid-row: auto;
		gap: var(--fl-space-md);
	}
}

@media (max-width: 767px) {
	.fl-event__container {
		padding-inline: var(--fl-space-lg);
	}

	.fl-event__layout {
		padding-inline: 0;
	}

	.fl-event__card,
	.fl-event-booking {
		border-inline: 0;
		border-radius: 0;
		padding: var(--fl-space-xl) var(--fl-space-lg);
	}

	/* Une seule ligne qui défile, comme sur l'app. */
	.fl-event__tags {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-inline: var(--fl-space-lg);
		scrollbar-width: none;
	}

	.fl-event__tags > * {
		flex: none;
	}

	.fl-event-hero {
		height: 240px;
	}

	/* Image entière : à 240 px, un flyer carré ou un bandeau très large serait minuscule. */
	.fl-event-hero--contain-mobile {
		height: 300px;
	}

	.fl-event-hero--poster {
		height: 380px;
	}

	.fl-event-hero--empty {
		height: 72px;
	}

	.fl-event-intro {
		padding-block: var(--fl-space-xl) var(--fl-space-lg);
	}

	.fl-event .fl-event-intro__title {
		font-size: var(--fl-font-size-2xl);
	}

	.fl-event-intro__head {
		gap: var(--fl-space-md);
	}

	.fl-event-date-tile {
		width: 52px;
	}

	.fl-event-date-tile__day {
		font-size: var(--fl-font-size-xl);
	}

	.fl-event .fl-event-intro__title--long {
		font-size: var(--fl-font-size-xl);
	}

	.fl-event-intro__meta {
		flex-direction: column;
		font-size: var(--fl-font-size-base);
	}

	.fl-event-gallery {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 200px 110px 110px;
	}

	.fl-event-gallery__tile:first-child {
		grid-column: span 2;
		grid-row: auto;
	}

	.fl-event-gallery--1,
	.fl-event-gallery--2 {
		grid-template-rows: 220px;
	}

	.fl-event-reviews__identity,
	.fl-event-contact {
		grid-template-columns: minmax(0, 1fr);
	}

	.fl-event-convoy {
		border-radius: 0;
		padding: var(--fl-space-xl) var(--fl-space-lg);
	}

	.fl-event-organizer__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		width: 100%;
	}

	.fl-event-bar {
		position: fixed;
		z-index: var(--fl-z-dropdown);
		inset: auto 0 0;
		display: flex;
		align-items: center;
		gap: var(--fl-space-md);
		padding: var(--fl-space-sm) var(--fl-space-lg) calc(var(--fl-space-sm) + env(safe-area-inset-bottom));
		border-top: 1px solid var(--fl-color-border);
		background: var(--fl-color-surface);
		box-shadow: 0 -4px 14px rgba(2, 3, 38, 0.08);
	}

	.fl-event-bar__text {
		flex: 1;
		min-width: 0;
	}

	/* Place de la barre fixe, sous le pied de page. */
	body.fl-event-page:has(.fl-event-bar) {
		padding-bottom: 72px;
	}
}
