/* ============================================================
   PWA Saint-Cyprien — Feuille de style
   v2.2 — Fix Font Awesome + Montserrat
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ============================================================
   Font Awesome — protection globale
   ============================================================ */
.fa, .fas, .far, .fal, .fat, .fad, .fab,
.fa-solid, .fa-regular, .fa-light, .fa-thin, .fa-duotone, .fa-brands,
[class*=" fa-"], [class^="fa-"] {
	font-family: "Font Awesome 7 Pro", "Font Awesome 7 Free",
	             "Font Awesome 7 Brands" !important;
}

:root {
	--c-bg:        #faf6f0;
	--c-surface:   #ffffff;
	--c-surface-2: #f3ede2;
	--c-ink:       #0f2942;
	--c-ink-soft:  #3a536a;
	--c-muted:     #8a7e6d;
	--c-line:      rgba(15, 41, 66, 0.08);

	--c-bleu:        #0a3a7c;
	--c-bleu-dark:   #062a5c;
	--c-jaune:       #ffdd00;
	--c-jaune-soft:  rgba(255, 221, 0, 0.18);

	--f-body: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

	--header-h:     64px;
	--bottom-bar-h: 76px;
	--gutter:       1.25rem;
	--radius-sm:    10px;
	--radius:       16px;
	--radius-lg:    24px;

	--ease: cubic-bezier(0.22, 1, 0.36, 1);

	--safe-top:    env(safe-area-inset-top, 0px);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }

body.pwa {
	font-family: var(--f-body);
	font-size: 16px;
	line-height: 1.55;
	color: var(--c-ink);
	background: var(--c-bg);
	min-height: 100vh;
	min-height: 100dvh;
	overscroll-behavior-y: none;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   Layout racine
   ============================================================ */
.pwa-root {
	max-width: 720px;
	margin: 0 auto;
	min-height: 100dvh;
	background: var(--c-bg);
	position: relative;
}
.pwa-root--home { background: var(--c-bleu); }

.pwa-main {
	padding: calc(var(--header-h) + var(--safe-top) + 1rem) var(--gutter) 2.5rem;
	display: flex;
	flex-direction: column;
	gap: 1.75rem;
}
.pwa-main--with-bottom-bar {
	padding-bottom: calc(var(--bottom-bar-h) + 1.5rem);
}

/* ============================================================
   HOME — Plein écran avec image en BG
   ============================================================ */
.pwa-home {
	position: relative;
	min-height: 100dvh;
	background-color: var(--c-bleu-dark);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: #fff;
	display: flex;
	flex-direction: column;
	padding: calc(var(--safe-top) + 1.5rem) var(--gutter)
	         calc(var(--bottom-bar-h) + 1.75rem);
	isolation: isolate;
	overflow: hidden;
}
.pwa-home__scrim {
	position: absolute; inset: 0; z-index: 0;
	background:
		linear-gradient(180deg,
			rgba(10, 58, 124, 0.05) 0%,
			rgba(10, 58, 124, 0.15) 40%,
			rgba(10, 58, 124, 0.55) 70%,
			rgba(10, 58, 124, 0.85) 100%);
	pointer-events: none;
}
.pwa-home > *:not(.pwa-home__scrim) {
	position: relative;
	z-index: 1;
}

.pwa-home__brand {
	display: flex; justify-content: center;
	padding-top: .5rem;
	margin-bottom: auto;
}
.pwa-home__logo {
	width: clamp(160px, 34vw, 220px);
	height: auto;
}

.pwa-home__center {
	text-align: center;
	max-width: 30rem;
	margin: 2rem auto 1.5rem;
}
.pwa-home__swoosh {
	width: 64px; height: auto;
	margin: 0 auto .85rem;
	display: block;
	filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.25));
}
.pwa-home__eyebrow {
	font-size: .82rem;
	font-weight: 600;
	text-transform: uppercase;
	margin: 0 0 .55rem;
	color: rgba(255, 255, 255, 0.95);
}
.pwa-home__title {
	font-size: clamp(1.8rem, 7vw, 2.4rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.015em;
	margin: 0;
	color: #fff;
	text-wrap: balance;
	text-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

.pwa-home__social {
	display: flex;
	flex-direction: row;
	justify-content: center;
	gap: .65rem;
	margin-top: 1rem;
}

.pwa-social-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	background: rgba(10, 26, 50, 0.55);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	color: #fff;
	font-size: 1.25rem;
	flex-shrink: 0;
}

.pwa-social-btn__icon {
	width: 28px; height: 28px;
	display: grid; place-items: center;
	font-size: 1.05rem;
	flex-shrink: 0;
}
.pwa-social-btn__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwa-social-btn .fa-facebook, .pwa-social-btn .fa-facebook-f  { color: #1877F2; }
.pwa-social-btn .fa-instagram   { color: #E4405F; }
.pwa-social-btn .fa-linkedin, .pwa-social-btn .fa-linkedin-in { color: #0A66C2; }
.pwa-social-btn .fa-youtube     { color: #FF0000; }

/* ============================================================
   HEADER PWA — Fixed
   ============================================================ */
.pwa-header {
	position: fixed;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 100%;
	max-width: 720px;
	z-index: 200;
	display: grid;
	grid-template-columns: 44px 1fr 44px;
	align-items: center;
	gap: .75rem;
	padding: calc(var(--safe-top) + .5rem) var(--gutter) .75rem;
	background: rgba(250, 246, 240, 0.92);
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid var(--c-line);
}
.pwa-header--transparent {
	background: transparent;
	border-bottom: 0;
	box-shadow: none;
}
.pwa-header--transparent .pwa-back,
.pwa-header--transparent .pwa-home-btn {
	background: rgba(255, 255, 255, 0.92);
	border-color: transparent;
	box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.25);
}
.pwa-header__titles { text-align: center; min-width: 0; }
.pwa-header__title {
	font-weight: 700;
	font-size: 1.05rem;
	margin: 0;
	color: var(--c-ink);
	line-height: 1.2;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pwa-header__subtitle {
	font-size: .72rem;
	color: var(--c-muted);
	margin: .1rem 0 0;
	letter-spacing: .02em;
}
.pwa-back, .pwa-home-btn {
	width: 44px; height: 44px;
	border-radius: 50%;
	border: 1px solid var(--c-line);
	background: var(--c-surface);
	color: var(--c-ink);
	display: grid; place-items: center;
	font-size: .95rem;
	text-decoration: none;
	cursor: pointer;
}
.pwa-back:active, .pwa-home-btn:active {
	transform: scale(0.92);
	background: var(--c-surface-2);
}

/* ============================================================
   SINGLE — Fiche agenda
   ============================================================ */
.pwa-single { gap: 1.25rem; padding-top: 0 !important; }
.pwa-single__media {
	margin: 0 calc(var(--gutter) * -1);
	overflow: hidden;
	aspect-ratio: 16 / 10;
}
.pwa-single__media img { width: 100%; height: 100%; object-fit: cover; }
.pwa-single__head { padding-top: .5rem; }
.pwa-single__date {
	display: inline-flex; align-items: center; gap: .5rem;
	font-size: .82rem;
	font-weight: 600;
	color: var(--c-bleu);
	text-transform: uppercase;
	margin: 0 0 .6rem;
	padding: .4rem .75rem;
	background: var(--c-jaune-soft);
	border-radius: 999px;
}
.pwa-single__title {
	font-size: clamp(1.4rem, 5.5vw, 1.85rem);
	font-weight: 700;
	line-height: 1.15;
	margin: 0;
	color: var(--c-ink);
}
.pwa-meta {
	display: flex; flex-direction: column;
	background: var(--c-surface);
	border-radius: var(--radius);
	border: 1px solid var(--c-line);
	overflow: hidden;
}
.pwa-meta__item {
	display: flex; align-items: flex-start; gap: .9rem;
	padding: .85rem 1rem;
	border-bottom: 1px solid var(--c-line);
}
.pwa-meta__item:last-child { border-bottom: 0; }
.pwa-meta__icon {
	width: 36px; height: 36px;
	border-radius: 10px;
	background: var(--c-jaune-soft);
	color: var(--c-bleu);
	display: grid; place-items: center;
	font-size: .9rem;
	flex-shrink: 0;
}
.pwa-meta__label {
	font-size: .7rem;
	font-weight: 600;
	color: var(--c-muted);
	text-transform: uppercase;
	letter-spacing: .04em;
	margin-bottom: .15rem;
}
.pwa-meta__value { font-size: .95rem; color: var(--c-ink); font-weight: 500; }
.pwa-single__content { font-size: 1rem; color: var(--c-ink-soft); }
.pwa-single__content p { margin: 0 0 .85em; }

/* ============================================================
   ITEM PWA — Actu / Agenda encapsulé
   ============================================================ */
.pwa-item-main { gap: 1rem; }
.pwa-item {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
}
.pwa-item__media {
	margin: 0 calc(var(--gutter) * -1);
	overflow: hidden;
	background: var(--c-surface-2);
	aspect-ratio: 16 / 10;
}
.pwa-item__media img { width: 100%; height: 100%; object-fit: cover; }
.pwa-item__head { display: flex; flex-direction: column; gap: .45rem; }
.pwa-item__kicker {
	margin: 0;
	font-size: .78rem;
	font-weight: 800;
	color: var(--c-bleu);
	text-transform: uppercase;
	letter-spacing: .04em;
}
.pwa-item__title {
	margin: 0;
	color: var(--c-ink);
	font-size: clamp(1.45rem, 5.2vw, 1.95rem);
	font-weight: 800;
	line-height: 1.12;
}
.pwa-item__content {
	background: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	padding: 1rem;
	color: var(--c-ink-soft);
	overflow: hidden;
}
.pwa-item__content > *:first-child { margin-top: 0 !important; }
.pwa-item__content > *:last-child { margin-bottom: 0 !important; }
.pwa-item__content .et_pb_section,
.pwa-item__content .et_pb_row,
.pwa-item__content .et_pb_column,
.pwa-item__content .et_pb_module {
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}
.pwa-item__content .et_pb_section,
.pwa-item__content .et_pb_row {
	padding-left: 0 !important;
	padding-right: 0 !important;
}
.pwa-item__content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.pwa-item__content iframe { max-width: 100%; }

/* ============================================================
   Contenu Gutenberg fallback
   ============================================================ */
.pwa-content h2 { font-weight: 700; font-size: 1.35rem; color: var(--c-ink); margin: 1.25rem 0 .75rem; }
.pwa-content h3 { font-weight: 700; font-size: 1.1rem; color: var(--c-ink); margin: 1.1rem 0 .5rem; }
.pwa-content p { margin: 0 0 .85em; color: var(--c-ink-soft); }
.pwa-content a:not(.btn) { color: var(--c-bleu); text-decoration: underline; }
.pwa-content img { border-radius: var(--radius); margin: .75rem 0; }

/* ============================================================
   BOTTOM BAR — Fixed, prioritaire sur tout autre CSS
   ============================================================ */
.pwa-bottom-bar {
	position: fixed !important;
	bottom: 0 !important;
	left: 50% !important;
	transform: translateX(-50%) !important;
	width: 100% !important;
	max-width: 720px !important;
	height: var(--bottom-bar-h) !important;
	min-height: var(--bottom-bar-h) !important;
	box-sizing: border-box !important;
	z-index: 99999 !important;
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
	background: #0a3a7c !important;
	padding: 0.55rem 0.25rem 0.45rem !important;
	box-shadow: 0 -8px 24px -8px rgba(0, 0, 0, 0.18) !important;
}
.pwa-bottom-bar__item {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 0.4rem !important;
	padding: 0.35rem 0.25rem !important;
	color: rgba(255, 255, 255, 0.95) !important;
	font-size: 0.72rem !important;
	font-weight: 700 !important;
	min-height: 0 !important;
	height: 100% !important;
	text-decoration: none !important;
	position: relative !important;
	border-radius: 12px !important;
}
.pwa-bottom-bar__icon {
	display: block !important;
	font-style: normal !important;
	font-size: 1.4rem !important;
	line-height: 1 !important;
	color: #ffdd00 !important;
}
.pwa-bottom-bar__icon--svg {
	width: 1.4rem !important;
	height: 1.4rem !important;
	font-size: unset !important;
	object-fit: contain !important;
	filter: brightness(0) saturate(100%) invert(90%) sepia(60%) saturate(600%) hue-rotate(5deg) brightness(105%) !important;
}
.pwa-bottom-bar__label {
	display: block !important;
	line-height: 1 !important;
	white-space: nowrap !important;
	font-weight: 700 !important;
}
.pwa-bottom-bar__item.is-active { color: #fff !important; }
.pwa-bottom-bar__item.is-active::before { content: none !important; display: none !important; }

/* ============================================================
   Animations
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}