/* AventOps — calendrier de l'Avent animé pour Joomla
 * (C) 2026 PharWeb — GPL v2 or later
 * Polices : Mountains of Christmas (Apache 2.0), Playfair Display (OFL) — embarquées localement.
 */
@font-face { font-family: "AO Festive"; src: url("../fonts/mountains-of-christmas-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "AO Serif"; src: url("../fonts/playfair-display-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "AO Serif"; src: url("../fonts/playfair-display-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Thèmes ---------- */
.aventops, .ao-layer, body:has(.ao-skin-page) {
	--ao-bg: #6d0f1d; --ao-bg2: #a3172c; --ao-door: #b3132b; --ao-door2: #1f6b3a; --ao-door3: #8e0f22;
	--ao-accent: #f2c14e; --ao-text: #fff; --ao-door-text: #fff; --ao-inside: #2a0a10; --ao-glow: #ffd97a;
	--ao-hill: #f4f1ec; --ao-hill2: #ffffff; --ao-pine: #0f4a2a; --ao-pine2: #17663b; --ao-window: #ffcf5a;
	--ao-bulbs: #ff4d4d, #ffd24d, #4dd2ff, #7dff7a;
	--ao-modal-bg: #fffaf2; --ao-modal-text: #2b1a14; --ao-flake: #fff;
	--ao-gap: 12px; --ao-radius: 14px; --ao-max: 1100px; --ao-cols: 6;
	--ao-font-title: "AO Festive", "Georgia", serif;
}
.ao-theme-nuit, body:has(.ao-skin-page.ao-theme-nuit) {
	--ao-bg: #070f26; --ao-bg2: #1b2f63; --ao-door: #1d3c78; --ao-door2: #2b2466; --ao-door3: #12306a;
	--ao-accent: #dfe8ff; --ao-text: #eef3ff; --ao-door-text: #f4f7ff; --ao-inside: #050a1a; --ao-glow: #9fc2ff;
	--ao-hill: #c9d6f2; --ao-hill2: #e9efff; --ao-pine: #0b1f3f; --ao-pine2: #13305c; --ao-window: #ffd36b;
	--ao-modal-bg: #f3f6ff; --ao-modal-text: #101a36;
}
.ao-theme-pain-epices, body:has(.ao-skin-page.ao-theme-pain-epices) {
	--ao-bg: #4a2a12; --ao-bg2: #7d4a22; --ao-door: #a8642c; --ao-door2: #8a4f22; --ao-door3: #b97638;
	--ao-accent: #fff6e6; --ao-text: #fff6e6; --ao-door-text: #fffaf0; --ao-inside: #2e1808; --ao-glow: #ffe2a8;
	--ao-hill: #fff6e6; --ao-hill2: #ffffff; --ao-pine: #6b3a14; --ao-pine2: #8a5020; --ao-window: #ffb84d;
	--ao-modal-bg: #fff8ec; --ao-modal-text: #3a2210;
}
.ao-theme-nordique, body:has(.ao-skin-page.ao-theme-nordique) {
	--ao-bg: #efe8dc; --ao-bg2: #fbf8f2; --ao-door: #ffffff; --ao-door2: #c8102e; --ao-door3: #1f5135;
	--ao-accent: #c8102e; --ao-text: #24302a; --ao-door-text: #24302a; --ao-inside: #e6ddd0; --ao-glow: #ffcf7a;
	--ao-hill: #ffffff; --ao-hill2: #f7f3ec; --ao-pine: #1f5135; --ao-pine2: #2d6b49; --ao-window: #ffc04d;
	--ao-modal-bg: #ffffff; --ao-modal-text: #24302a; --ao-flake: #ffffff;
}
.ao-theme-sucre-orge, body:has(.ao-skin-page.ao-theme-sucre-orge) {
	--ao-bg: #ffd3e1; --ao-bg2: #fff0f5; --ao-door: #e8456b; --ao-door2: #3fbf9f; --ao-door3: #ffffff;
	--ao-accent: #ffffff; --ao-text: #7a1d3a; --ao-door-text: #ffffff; --ao-inside: #fff6f9; --ao-glow: #ff8fb0;
	--ao-hill: #ffffff; --ao-hill2: #fff7fa; --ao-pine: #2fa486; --ao-pine2: #45c4a3; --ao-window: #ffd84d;
	--ao-modal-bg: #fffafc; --ao-modal-text: #5c1730; --ao-flake: #ffffff;
}

/* ---------- Conteneur ---------- */
.aventops {
	position: relative; isolation: isolate; overflow: hidden;
	border-radius: calc(var(--ao-radius) + 8px);
	padding: clamp(56px, 7vw, 84px) clamp(12px, 3vw, 36px) clamp(120px, 16vw, 200px);
	color: var(--ao-text);
	background: radial-gradient(120% 80% at 50% 0%, var(--ao-bg2) 0%, var(--ao-bg) 70%);
	font-family: inherit;
}
.aventops.ao-has-bg { background: linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,.35)), var(--ao-bg-image) center / cover no-repeat, var(--ao-bg); }
.aventops.ao-theme-nordique { background-image: radial-gradient(circle at 10px 10px, rgba(200,16,46,.07) 2px, transparent 2.5px), radial-gradient(120% 80% at 50% 0%, var(--ao-bg2), var(--ao-bg) 70%); background-size: 22px 22px, auto; }
.aventops.ao-theme-sucre-orge { background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.35) 0 14px, transparent 14px 28px), radial-gradient(120% 80% at 50% 0%, var(--ao-bg2), var(--ao-bg) 70%); }
.ao-inner { position: relative; z-index: 3; max-width: var(--ao-max); margin: 0 auto; }

.ao-title {
	font-family: var(--ao-font-title); font-weight: 700; text-align: center; color: inherit;
	font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1.1; margin: 0 0 .4em; letter-spacing: .01em;
	text-shadow: 0 2px 0 rgba(0,0,0,.15), 0 0 24px color-mix(in srgb, var(--ao-glow) 45%, transparent);
	animation: ao-title-in 1s cubic-bezier(.2,.8,.2,1) both;
}
.ao-font-serif { --ao-font-title: "AO Serif", Georgia, serif; }
.ao-font-sans { --ao-font-title: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.ao-font-template { --ao-font-title: inherit; }
.ao-intro { text-align: center; max-width: 720px; margin: 0 auto 1.2em; font-size: 1.05rem; opacity: .95; }
.ao-intro a { color: inherit; text-decoration: underline; }
.ao-countdown { text-align: center; margin: 0 auto 1.2em; font-weight: 600; display: table; padding: .35em 1em; border-radius: 99px; background: color-mix(in srgb, var(--ao-text) 14%, transparent); backdrop-filter: blur(4px); }
.ao-preview-badge { text-align: center; margin: 0 auto 1em; display: table; padding: .3em .9em; border-radius: 99px; background: #ffd24d; color: #3a2a00; font-weight: 700; font-size: .85rem; }
.ao-noscript { text-align: center; }

/* ---------- Grilles ---------- */
.ao-grid { --ao-row: clamp(78px, calc(min(100vw, var(--ao-max)) / var(--ao-cols) - var(--ao-gap)), 160px); }
.ao-layout-grid .ao-grid, .ao-layout-mosaic .ao-grid {
	display: grid; gap: var(--ao-gap);
	grid-template-columns: repeat(var(--ao-cols), minmax(0, 1fr));
	grid-auto-rows: var(--ao-row); grid-auto-flow: dense;
}
.ao-layout-tree .ao-grid { display: flex; flex-direction: column; align-items: center; gap: var(--ao-gap); }
.ao-row { display: flex; justify-content: center; gap: var(--ao-gap); }
.ao-layout-tree .ao-cell { width: clamp(52px, 10vw, 108px); aspect-ratio: 1; }
.ao-tree-star { width: clamp(48px, 8vw, 84px); height: auto; filter: drop-shadow(0 0 12px var(--ao-glow)); animation: ao-pulse 2.4s ease-in-out infinite; }
@media (max-width: 680px) {
	.ao-grid { --ao-cols: 4 !important; }
	.aventops { --ao-cols: 4; }
}
@media (max-width: 420px) {
	.ao-grid { --ao-cols: 3 !important; }
}

/* ---------- Cases ---------- */
.ao-cell { position: relative; min-width: 0; animation: ao-cell-in .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 28ms); }
.ao-door {
	all: unset; box-sizing: border-box; position: absolute; inset: 0; display: block; cursor: pointer;
	perspective: 900px; border-radius: var(--ao-radius); -webkit-tap-highlight-color: transparent;
}
.ao-door:focus-visible { outline: 3px solid var(--ao-accent); outline-offset: 3px; }
.ao-door-inside, .ao-door-front { position: absolute; inset: 0; border-radius: var(--ao-radius); }
.ao-door-inside {
	display: grid; place-items: center; overflow: hidden;
	background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--ao-glow) 70%, transparent) 0%, var(--ao-inside) 72%);
	box-shadow: inset 0 4px 18px rgba(0,0,0,.45);
}
.ao-door-inside svg { width: 46%; max-width: 72px; height: auto; color: var(--ao-accent); filter: drop-shadow(0 0 10px var(--ao-glow)); }
.ao-inside-title { position: absolute; left: 6px; right: 6px; bottom: 6px; font-size: .72rem; line-height: 1.15; text-align: center; color: #fff; text-shadow: 0 1px 3px #000; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ao-door-front {
	--c: var(--ao-door);
	display: grid; place-items: center; overflow: hidden; transform-origin: left center;
	background: linear-gradient(150deg, color-mix(in srgb, var(--c) 82%, #fff) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 80%, #000) 100%);
	color: var(--ao-door-text);
	box-shadow: 0 6px 16px rgba(0,0,0,.28), inset 0 0 0 2px color-mix(in srgb, var(--ao-accent) 55%, transparent);
	transition: transform .95s cubic-bezier(.25,.9,.25,1.05), opacity .6s ease, filter .6s ease, box-shadow .3s;
	will-change: transform; backface-visibility: hidden;
}
.ao-cell:nth-child(3n+2) .ao-door-front { --c: var(--ao-door2); }
.ao-cell:nth-child(5n+4) .ao-door-front { --c: var(--ao-door3); }
.ao-theme-nordique .ao-cell:nth-child(3n+1) .ao-door-front, .ao-theme-sucre-orge .ao-cell:nth-child(5n+4) .ao-door-front { color: var(--ao-text); }
.ao-row .ao-cell:nth-child(n) .ao-door-front { --c: var(--ao-door); color: var(--ao-door-text); }
.ao-row .ao-cell:nth-child(even) .ao-door-front { --c: var(--ao-door2); }
.ao-row.ao-trunk .ao-door-front { --c: #6b3a1a; }

.ao-num {
	position: relative; z-index: 2; font-family: var(--ao-font-title); font-weight: 700;
	font-size: clamp(1.5rem, 4.2vw, 2.6rem); line-height: 1; text-shadow: 0 2px 4px rgba(0,0,0,.35);
}
.ao-big .ao-num { font-size: clamp(2.6rem, 8vw, 5rem); }
.ao-deco { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ao-deco-icon { position: absolute; top: 9%; left: 50%; width: 30%; max-width: 44px; transform: translateX(-50%); opacity: .9; color: var(--ao-accent); }
.ao-big .ao-deco-icon { max-width: 70px; }
.ao-frame { fill: none; stroke: color-mix(in srgb, var(--ao-accent) 70%, transparent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ao-knob { position: absolute; right: 9%; top: 52%; width: 7px; height: 7px; border-radius: 50%; background: var(--ao-accent); box-shadow: 0 1px 2px rgba(0,0,0,.5); }

/* Pain d'épices : glaçage en pointillés */
.ao-theme-pain-epices .ao-door-front { box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.ao-theme-pain-epices .ao-frame { stroke: #fffaf0; stroke-width: 3; stroke-dasharray: 2 6; stroke-linecap: round; }
/* Sucre d'orge : cadre rayé */
.ao-theme-sucre-orge .ao-door-front { box-shadow: 0 6px 16px rgba(160,30,70,.25), inset 0 0 0 5px transparent; border: 5px solid transparent; background-origin: border-box; background-clip: padding-box, border-box; background-image: linear-gradient(150deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c) 45%, color-mix(in srgb, var(--c) 85%, #000)), repeating-linear-gradient(45deg, #fff 0 6px, #e8456b 6px 12px); }
/* Nuit : givre */
.ao-theme-nuit .ao-door-front::before { content: ""; position: absolute; inset: 0; background: radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent), radial-gradient(1px 1px at 70% 20%, #fff 50%, transparent), radial-gradient(1.5px 1.5px at 80% 75%, #fff 50%, transparent), radial-gradient(1px 1px at 35% 80%, #fff 50%, transparent); opacity: .7; }
/* Nordique : point de croix */
.ao-theme-nordique .ao-door-front { box-shadow: 0 4px 12px rgba(60,40,20,.15), inset 0 0 0 2px rgba(36,48,42,.12); }
.ao-theme-nordique .ao-frame { stroke: currentColor; stroke-opacity: .35; stroke-dasharray: 4 4; }

/* ---------- Formes ---------- */
/* Cadeau : rubans en dégradés */
.ao-shape-gift .ao-door-front {
	background:
		linear-gradient(90deg, transparent calc(50% - 9px), var(--ao-accent) calc(50% - 9px) calc(50% + 9px), transparent calc(50% + 9px)),
		linear-gradient(0deg, transparent calc(50% - 9px), var(--ao-accent) calc(50% - 9px) calc(50% + 9px), transparent calc(50% + 9px)),
		linear-gradient(150deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c) 45%, color-mix(in srgb, var(--c) 80%, #000));
}
.ao-shape-gift .ao-num { background: var(--ao-accent); color: var(--c); border-radius: 50%; width: 1.7em; height: 1.7em; display: grid; place-items: center; font-size: clamp(1rem, 3vw, 1.7rem); text-shadow: none; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.ao-shape-gift .ao-big .ao-num { font-size: clamp(1.8rem, 5vw, 3rem); }
.ao-shape-gift .ao-deco-icon, .ao-shape-gift .ao-frame, .ao-shape-gift .ao-knob { display: none; }
.ao-bow { position: absolute; top: -2px; left: 50%; width: 42%; max-width: 70px; transform: translateX(-50%); color: color-mix(in srgb, var(--ao-accent) 78%, var(--c)); filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
/* Boule */
.ao-shape-bauble .ao-door, .ao-shape-bauble .ao-door-front, .ao-shape-bauble .ao-door-inside { inset: 8% 50% auto 50%; width: min(84%, calc(var(--ao-row) * .84)); aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; }
.ao-shape-bauble .ao-big .ao-door { width: min(84%, calc(var(--ao-row) * 1.8)); }
.ao-shape-bauble .ao-door-front, .ao-shape-bauble .ao-door-inside { inset: 0; width: 100%; transform: none; }
.ao-shape-bauble .ao-door-front { background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c) 30%, #fff) 0%, var(--c) 38%, color-mix(in srgb, var(--c) 65%, #000) 100%); transform-origin: center; }
.ao-shape-bauble .ao-door::before { content: ""; position: absolute; left: 50%; top: -9%; width: 22%; height: 11%; transform: translateX(-50%); border-radius: 3px 3px 1px 1px; background: linear-gradient(90deg, #a07b2c, #f6dd8c, #a07b2c); z-index: 2; }
.ao-shape-bauble .ao-deco-icon, .ao-shape-bauble .ao-frame, .ao-shape-bauble .ao-knob { display: none; }
.ao-shape-bauble .ao-cell:not(.ao-row .ao-cell)::before { content: ""; position: absolute; left: 50%; top: -6px; height: 14%; border-left: 1px solid color-mix(in srgb, var(--ao-accent) 60%, transparent); }
/* Enveloppe */
.ao-shape-envelope .ao-door-front { background: linear-gradient(160deg, #fffdf7, #efe6d4); color: #5a3a2a; transform-origin: center top; }
.ao-shape-envelope .ao-door-front::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 58%; background: linear-gradient(170deg, #f6eedc, #e2d5bb); clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.ao-door-front { --seal: var(--c); }
.ao-theme-nordique .ao-door-front { --seal: var(--ao-door2); }
.ao-theme-nordique .ao-cell:nth-child(even) .ao-door-front { --seal: var(--ao-door3); }
.ao-theme-sucre-orge .ao-cell:nth-child(5n+4) .ao-door-front { --seal: var(--ao-door); }
.ao-shape-envelope .ao-num { width: 1.8em; height: 1.8em; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--seal) 70%, #fff), var(--seal)); color: #fff; margin-top: 12%; font-size: clamp(1rem, 3vw, 1.6rem); box-shadow: 0 2px 5px rgba(0,0,0,.35); z-index: 3; }
.ao-shape-envelope .ao-frame, .ao-shape-envelope .ao-knob { display: none; }
.ao-shape-envelope .ao-deco-icon { top: auto; bottom: 8%; color: var(--seal); width: 22%; }
.ao-shape-envelope .ao-lock { color: #8a7a66; }

/* ---------- États ---------- */
.ao-door.is-locked .ao-door-front { filter: saturate(.85); }
.ao-lock { position: absolute; right: 7px; bottom: 7px; width: 16px; height: 16px; opacity: .65; z-index: 3; color: currentColor; }
.ao-door.is-locked:hover .ao-lock { opacity: 1; }
.ao-door.is-missed .ao-door-front, .ao-door.is-closed .ao-door-front { filter: grayscale(.7) brightness(.85); }
.ao-door.is-today .ao-door-front { animation: ao-today 2.2s ease-in-out infinite; }
.ao-door.is-shake { animation: ao-shake .5s ease; }

/* Survol */
.ao-hover-on .ao-door.is-open:not(.is-opened):hover .ao-door-front { transform: rotateY(-16deg); box-shadow: 10px 10px 22px rgba(0,0,0,.35); }
.ao-hover-on.ao-effect-flip .ao-door.is-open:not(.is-opened):hover .ao-door-front,
.ao-hover-on.ao-effect-burst .ao-door.is-open:not(.is-opened):hover .ao-door-front { transform: translateY(-4px) scale(1.04); }
.ao-hover-on.ao-effect-unwrap .ao-door.is-open:not(.is-opened):hover .ao-door-front { transform: rotateX(14deg); }
.ao-hover-on .ao-door.is-locked:hover .ao-door-front { transform: translateY(-2px); }

/* Effets d'ouverture */
.ao-door.is-opened .ao-door-front { transform: rotateY(-112deg); box-shadow: 4px 6px 14px rgba(0,0,0,.25); }
.ao-door.is-opened { z-index: 2; }
.ao-effect-flip .ao-door { transform-style: preserve-3d; }
.ao-effect-flip .ao-door-front { transform-origin: center; }
.ao-effect-flip .ao-door-inside { transform: rotateY(180deg); backface-visibility: hidden; transition: transform .95s cubic-bezier(.25,.9,.25,1.05); }
.ao-effect-flip .ao-door.is-opened .ao-door-front { transform: rotateY(-180deg); }
.ao-effect-flip .ao-door.is-opened .ao-door-inside { transform: rotateY(0); }
.ao-effect-burst .ao-door.is-opened .ao-door-front { transform: scale(1.5); opacity: 0; filter: blur(6px); }
.ao-effect-unwrap .ao-door-front { transform-origin: center top; }
.ao-effect-unwrap .ao-door.is-opened .ao-door-front { transform: rotateX(-118deg); }
.ao-shape-bauble .ao-door.is-opened .ao-door-front { transform: scale(1.4); opacity: 0; filter: blur(5px); }
.ao-shape-envelope.ao-effect-door3d .ao-door.is-opened .ao-door-front { transform: rotateX(-118deg); }

/* Porte déjà ouverte : le battant s'efface, plus rien ne déborde sur les cases voisines */
.ao-inside-num { position: absolute; top: 6px; left: 8px; font: 700 .8rem/1 var(--ao-font, inherit); color: #fff; opacity: .9; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.ao-door.is-settled { z-index: auto; }
.ao-door.is-settled .ao-door-front { opacity: 0 !important; visibility: hidden; pointer-events: none; transition: opacity .45s ease, visibility 0s linear .45s; }
.ao-door.is-settled .ao-door-inside { box-shadow: inset 0 3px 12px rgba(0,0,0,.4), inset 0 0 0 2px color-mix(in srgb, var(--ao-accent) 45%, transparent); }
.ao-door.is-settled .ao-door-inside::after { content: "✓"; position: absolute; top: 5px; right: 6px; width: 1.25em; height: 1.25em; display: grid; place-items: center; border-radius: 50%; font-size: .7rem; font-weight: 700; color: var(--ao-inside); background: var(--ao-accent); opacity: .9; }
.ao-door.is-settled:hover .ao-door-inside svg { transform: scale(1.08); }
.ao-door-inside svg { transition: transform .3s ease; }
.ao-effect-flip .ao-door.is-settled .ao-door-inside { transform: none; }
.ao-shape-bauble .ao-inside-num { top: 50%; left: 50%; transform: translate(-50%, -150%); }
.ao-shape-bauble .ao-door.is-settled .ao-door-inside::after { top: 10%; right: 10%; }
.ao-layout-tree .ao-inside-title, .ao-mode-today .ao-inside-num { display: none; }

/* ---------- Ambiance : neige, guirlande, décor ---------- */
.ao-sky, .ao-snowfall { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.ao-snowfall { z-index: 4; }
.ao-star { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; animation: ao-twinkle 3s ease-in-out infinite; }
.ao-flake { position: absolute; top: -12px; border-radius: 50%; background: var(--ao-flake); opacity: .85; animation: ao-fall linear infinite; filter: blur(.3px); }
.ao-theme-nordique .ao-flake, .ao-theme-sucre-orge .ao-flake { box-shadow: 0 0 2px rgba(0,0,0,.18); }
.ao-garland { position: absolute; top: 0; left: 0; right: 0; height: 60px; z-index: 5; pointer-events: none; }
.ao-garland svg { width: 100%; height: 100%; }
.ao-garland .ao-wire { fill: none; stroke: #1d3b22; stroke-width: 2; }
.ao-theme-nordique .ao-garland .ao-wire, .ao-theme-sucre-orge .ao-garland .ao-wire { stroke: #5b5b5b; }
.ao-bulb { animation: ao-bulb 1.6s ease-in-out infinite alternate; }
.ao-scene { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(110px, 15vw, 190px); z-index: 2; pointer-events: none; }
.ao-scene svg { width: 100%; height: 100%; display: block; }
.ao-window { fill: var(--ao-window); animation: ao-flicker 4s ease-in-out infinite; }
.ao-particle { position: absolute; z-index: 30; pointer-events: none; width: 18px; height: 18px; will-change: transform, opacity; }

/* ---------- Toast ---------- */
.ao-toast { position: fixed; left: 50%; bottom: 22px; z-index: 40; transform: translateX(-50%); max-width: 92%; padding: .7em 1.2em; border-radius: 12px; background: rgba(20,12,10,.88); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: ao-toast-in .35s cubic-bezier(.2,.8,.2,1); text-align: center; }

/* ---------- Fenêtre de contenu ---------- */
.ao-modal {
	width: min(760px, 94vw); max-height: 90vh; padding: 0; border: 0; border-radius: 22px; overflow: hidden;
	background: var(--ao-modal-bg); color: var(--ao-modal-text); box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.ao-modal[open] { animation: ao-pop .55s cubic-bezier(.2,1.25,.3,1) both; display: flex; flex-direction: column; }
/* Centred whatever the template does to <dialog> (CSS resets that set margin: 0, or another position) */
dialog.ao-modal[open] { position: fixed; inset: 0; margin: auto; height: fit-content; max-width: 94vw; }
.ao-modal::backdrop { background: rgba(10,6,4,.6); backdrop-filter: blur(4px); animation: ao-fade .3s ease both; }
.ao-modal-head { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 56px 18px 20px; color: var(--ao-door-text);
	background: linear-gradient(135deg, var(--ao-door), color-mix(in srgb, var(--ao-door) 60%, #000)); }
.ao-theme-nordique .ao-modal-head { color: #fff; background: linear-gradient(135deg, var(--ao-door2), color-mix(in srgb, var(--ao-door2) 60%, #000)); }
.ao-modal-head svg.ao-head-deco { position: absolute; right: 52px; top: 50%; width: 90px; transform: translateY(-50%); opacity: .18; color: #fff; }
.ao-badge { flex: 0 0 auto; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--ao-accent); color: var(--ao-door); font-family: var(--ao-font-title); font-weight: 700; font-size: 1.9rem; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.ao-theme-nordique .ao-badge { color: #fff; background: var(--ao-door2); box-shadow: 0 0 0 3px #fff; }
.ao-modal-title { margin: 0; font-family: var(--ao-font-title); font-size: clamp(1.4rem, 3.5vw, 2rem); line-height: 1.15; color: inherit; }
.ao-modal-teaser { margin: .2em 0 0; opacity: .9; }
.ao-close { all: unset; position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: rgba(255,255,255,.2); color: #fff; transition: transform .2s, background .2s; }
.ao-close:hover { transform: rotate(90deg); background: rgba(255,255,255,.35); }
.ao-close:focus-visible { outline: 2px solid #fff; }
.ao-modal-body { padding: 22px; overflow: auto; }
/* The body scrolls inside the window: head and buttons always stay visible */
.ao-modal .ao-content { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.ao-modal-head, .ao-modal-foot { flex: none; }
.ao-modal .ao-modal-body { flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
/* Pictures and videos shown whole, enlarged on click */
.ao-modal .ao-block-image img, .ao-modal .ao-block-text img, .ao-modal .ao-block video { width: auto; max-width: 100%; max-height: min(62vh, 620px); object-fit: contain; }
.ao-modal .ao-block-video video { width: 100%; background: #000; }
.ao-modal .ao-ratio { max-width: min(100%, calc(min(62vh, 620px) * 16 / 9)); margin: 0 auto; }
.ao-zoomable { cursor: zoom-in; }
.ao-block-video { position: relative; }
.ao-zoom-btn { position: absolute; top: 8px; right: 8px; z-index: 2; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; opacity: .85; transition: opacity .2s, transform .2s; }
.ao-zoom-btn:hover, .ao-zoom-btn:focus-visible { opacity: 1; transform: scale(1.06); }
.ao-zoom-btn svg { width: 20px; height: 20px; }
dialog.ao-zoom[open] { position: fixed; inset: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; padding: 0; border: 0; background: transparent; display: grid; place-items: center; cursor: zoom-out; }
.ao-zoom::backdrop { background: rgba(5,3,2,.88); }
.ao-zoom img { max-width: 96vw; max-height: 92vh; width: auto; height: auto; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: ao-fade .25s ease both; }
.ao-zoom .ao-zoom-close { position: fixed; top: 14px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.ao-zoom figcaption { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); max-width: 90vw; color: #fff; text-align: center; font-size: .95rem; }
.ao-modal-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid rgba(0,0,0,.08); }
.ao-modal-foot .ao-btn[disabled] { opacity: .35; pointer-events: none; }
.ao-block { margin: 0 0 1.1em; animation: ao-block-in .5s cubic-bezier(.2,.8,.2,1) both; }
.ao-block:nth-child(2) { animation-delay: .08s; } .ao-block:nth-child(3) { animation-delay: .16s; } .ao-block:nth-child(n+4) { animation-delay: .24s; }
.ao-block img, .ao-block video { max-width: 100%; height: auto; border-radius: 12px; display: block; margin: 0 auto; }
.ao-block figcaption, .ao-caption { text-align: center; font-size: .9rem; opacity: .8; margin-top: .4em; }
.ao-block audio { width: 100%; }
.ao-ratio { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #000; }
.ao-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ao-pdf { width: 100%; height: min(60vh, 520px); border-radius: 10px; border: 1px solid rgba(0,0,0,.1); margin-bottom: .6em; }
.ao-btn { display: inline-flex; align-items: center; gap: .45em; padding: .65em 1.15em; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 600; text-decoration: none !important;
	background: var(--ao-door); color: var(--ao-door-text) !important; box-shadow: 0 3px 10px rgba(0,0,0,.18); transition: transform .15s, box-shadow .15s; }
.ao-theme-nordique .ao-btn { background: var(--ao-door2); color: #fff !important; }
.ao-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.ao-btn-ghost { background: transparent; color: var(--ao-modal-text) !important; box-shadow: inset 0 0 0 1.5px currentColor; }
.ao-theme-nordique .ao-btn-ghost { background: transparent; color: var(--ao-modal-text) !important; }
.ao-ico { width: 1.1em; height: 1.1em; }
.ao-block-link, .ao-block-file, .ao-block-pdf p { text-align: center; }
.ao-coupon { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 16px; border: 2px dashed var(--ao-door); border-radius: 14px; background: color-mix(in srgb, var(--ao-door) 6%, transparent); }
.ao-coupon-code { font-size: 1.5rem; font-weight: 800; letter-spacing: .12em; padding: .2em .6em; border-radius: 8px; background: #fff; color: var(--ao-door); }
.ao-empty { text-align: center; opacity: .7; }
.ao-loading { display: grid; place-items: center; min-height: 160px; }
.ao-loading svg { width: 54px; animation: ao-spin 1.2s linear infinite; color: var(--ao-door); }

/* Mode panneau (sous le calendrier) */
.ao-panel { margin-top: 28px; border-radius: 22px; overflow: hidden; background: var(--ao-modal-bg); color: var(--ao-modal-text); box-shadow: 0 20px 50px rgba(0,0,0,.3); animation: ao-pop .55s cubic-bezier(.2,1.25,.3,1) both; }

/* ---------- Animations ---------- */
@keyframes ao-title-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes ao-cell-in { from { opacity: 0; transform: translateY(18px) scale(.9); } }
@keyframes ao-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px) rotate(-2deg); } 40% { transform: translateX(6px) rotate(2deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes ao-today { 0%,100% { box-shadow: 0 6px 16px rgba(0,0,0,.28), 0 0 0 0 color-mix(in srgb, var(--ao-glow) 80%, transparent); } 50% { box-shadow: 0 6px 16px rgba(0,0,0,.28), 0 0 0 8px transparent, 0 0 28px color-mix(in srgb, var(--ao-glow) 90%, transparent); } }
@keyframes ao-twinkle { 0%,100% { opacity: .2; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.3); } }
@keyframes ao-fall { from { transform: translate3d(0, -20px, 0); } to { transform: translate3d(var(--sway, 30px), var(--fall, 900px), 0); } }
@keyframes ao-bulb { from { opacity: .45; filter: none; } to { opacity: 1; filter: drop-shadow(0 0 6px currentColor); } }
@keyframes ao-flicker { 0%,100% { opacity: 1; } 45% { opacity: .82; } 50% { opacity: .95; } 70% { opacity: .86; } }
@keyframes ao-pulse { 0%,100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.08) rotate(6deg); } }
@keyframes ao-pop { from { opacity: 0; transform: translateY(24px) scale(.88); } }
@keyframes ao-fade { from { opacity: 0; } }
@keyframes ao-block-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes ao-toast-in { from { opacity: 0; transform: translate(-50%, 14px); } }
@keyframes ao-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.aventops *, .aventops *::before, .aventops *::after, .ao-modal, .ao-modal * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
	.ao-snowfall { display: none; }
}

/* Revers visible pour les effets « porte » et « couvercle » */
.ao-effect-door3d .ao-door-front, .ao-effect-unwrap .ao-door-front { backface-visibility: visible; }
.ao-effect-door3d .ao-door.is-opened .ao-door-front > *, .ao-effect-unwrap .ao-door.is-opened .ao-door-front > * { opacity: 0; transition: opacity .2s .25s; }
.ao-effect-door3d .ao-door.is-opened .ao-door-front, .ao-effect-unwrap .ao-door.is-opened .ao-door-front { filter: brightness(.8); }

/* ---------- Image sur la face d'une case ---------- */
.ao-door-front.has-face { background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.45)), var(--ao-face) center / cover no-repeat !important; border-color: transparent; }
.ao-door-front.has-face .ao-deco-icon, .ao-door-front.has-face .ao-frame, .ao-door-front.has-face .ao-knob, .ao-door-front.has-face .ao-bow, .ao-door-front.has-face::after { display: none; }
.ao-door-front.has-face .ao-num { color: #fff; background: none; box-shadow: none; text-shadow: 0 2px 8px rgba(0,0,0,.6); margin: 0; width: auto; height: auto; }

/* ---------- Image révélée au fil des jours ---------- */
.ao-has-reveal .ao-door.is-opened .ao-door-inside { background: var(--ao-reveal) var(--ao-rv-pos, 0 0) / var(--ao-rv-size, cover) no-repeat; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.ao-has-reveal .ao-door.is-opened .ao-door-inside > svg, .ao-has-reveal .ao-door.is-opened .ao-inside-title { display: none; }
.ao-has-reveal .ao-door.is-opened .ao-door-front { opacity: 0; pointer-events: none; }

/* ---------- Module : case du jour ---------- */
.aventops.ao-mode-today { padding: 22px 18px 20px; }
.ao-mode-today .ao-grid { --ao-cols: 1 !important; grid-template-columns: 1fr !important; max-width: 220px; margin: 0 auto; --ao-row: 200px; }
.ao-mode-today .ao-num { font-size: 3.4rem; }
.ao-module-foot { text-align: center; margin: 16px 0 0; }
.ao-module-label { text-align: center; font-family: var(--ao-font-title); font-weight: 700; font-size: 1.5rem; margin: 0 0 12px; text-shadow: 0 2px 6px rgba(0,0,0,.25); }
.ao-module-foot .ao-btn { background: var(--ao-accent); color: var(--ao-door) !important; }
.ao-theme-nordique .ao-module-foot .ao-btn { color: #fff !important; background: var(--ao-door2); }

/* Éléments masqués : l'attribut hidden l'emporte sur l'affichage des pastilles */
.aventops [hidden] { display: none !important; }

/* ---------- Boutons en haut à droite (moins d'animations, son) ---------- */
.ao-tools { position: absolute; top: 14px; right: 14px; z-index: 6; display: flex; gap: 8px; }
.aventops:has(.ao-garland svg) > .ao-tools { top: 52px; }
.ao-tool { all: unset; box-sizing: border-box; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
	background: color-mix(in srgb, var(--ao-text) 18%, transparent); color: var(--ao-text); backdrop-filter: blur(4px); transition: transform .2s; }
.ao-tool:hover { transform: scale(1.08); }
.ao-tool:focus-visible { outline: 2px solid var(--ao-accent); outline-offset: 2px; }
.ao-tool svg { width: 18px; height: 18px; }
/* Moins d'animations : neige, guirlande, scintillements, pulsations et particules à l'arrêt */
.ao-calm .ao-snowfall, html.ao-calm-page .ao-layer-snow { display: none; }
.ao-calm *, .ao-calm *::before, .ao-calm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; }
.ao-calm .ao-door.is-today .ao-door-front { animation: none; box-shadow: 0 0 0 3px var(--ao-accent), 0 6px 16px rgba(0,0,0,.28); }

/* ---------- Progression ---------- */
.ao-progress { display: flex; align-items: center; justify-content: center; gap: .7em; margin: -.4em auto 1.2em; font-weight: 600; font-size: .92rem; }
.ao-progress-bar { width: min(220px, 40vw); height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ao-text) 18%, transparent); overflow: hidden; }
.ao-progress-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ao-accent), color-mix(in srgb, var(--ao-accent) 60%, #fff)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.ao-progress.is-complete .ao-progress-text::before { content: "★ "; color: var(--ao-accent); }

/* ---------- Avant la première case ---------- */
.ao-waiting { text-align: center; margin: 0 auto 1.6em; animation: ao-block-in .8s cubic-bezier(.2,.8,.2,1) both; }
.ao-waiting-text { font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: 600; margin: 0 0 .8em; }
.ao-clock { display: flex; justify-content: center; gap: clamp(8px, 2vw, 18px); }
.ao-clock-unit { display: grid; gap: .25em; min-width: clamp(64px, 14vw, 110px); padding: .7em .4em .6em; border-radius: calc(var(--ao-radius) + 2px);
	background: color-mix(in srgb, var(--ao-door) 85%, transparent); color: var(--ao-door-text); box-shadow: 0 8px 22px rgba(0,0,0,.25), inset 0 0 0 2px color-mix(in srgb, var(--ao-accent) 55%, transparent); }
.ao-clock-unit b { font: 700 clamp(1.8rem, 6vw, 3.4rem)/1 var(--ao-font-title); font-variant-numeric: tabular-nums; }
.ao-clock-unit small { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.ao-is-waiting.ao-mode-full .ao-grid:not([hidden]) { opacity: .55; filter: saturate(.8); }

/* ---------- Menu de partage ---------- */
.ao-modal-foot { position: relative; }
.ao-share-menu { position: absolute; bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%); z-index: 5; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
	min-width: 280px; max-width: calc(100vw - 30px); padding: 8px; border-radius: 16px; background: var(--ao-modal-bg, #fff); color: var(--ao-modal-text, #222);
	box-shadow: 0 16px 40px rgba(0,0,0,.3), 0 0 0 1px rgba(0,0,0,.06); animation: ao-fade .2s ease; }
.ao-share-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: .55em; padding: .55em .7em; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.ao-share-item:hover, .ao-share-item:focus-visible { background: color-mix(in srgb, currentColor 9%, transparent); }
.ao-share-item .ao-ico { width: 1.1em; height: 1.1em; }
.ao-net-dot { width: .9em; height: .9em; border-radius: 50%; background: var(--net, #888); flex: none; }
.ao-net-facebook { --net: #1877f2; } .ao-net-whatsapp { --net: #25d366; } .ao-net-threads { --net: #111; } .ao-net-bluesky { --net: #1185fe; }
.ao-net-x { --net: #111; } .ao-net-linkedin { --net: #0a66c2; }
.ao-share-item.ao-net-story { grid-column: 1 / -1; justify-content: center; background: linear-gradient(90deg, #f58529, #dd2a7b, #8134af); color: #fff; }

/* ---------- Toutes les cases ouvertes ---------- */
.ao-finale .ao-badge svg { width: 60%; height: 60%; }
.ao-finale .ao-modal-body { text-align: center; }

@media (max-width: 560px) {
	.ao-share-menu { position: fixed; left: 10px; right: 10px; bottom: 10px; transform: none; min-width: 0; }
}

/* ---------- Particules : paillettes, étoiles filantes, bulles ---------- */
.ao-particle-gold { border-radius: 50%; }
.ao-particle-bubbles { border-radius: 50%; border: 2px solid; background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.85) 0 18%, rgba(255,255,255,.08) 22%); }
.ao-particle-shooting { width: 16px; height: 16px; filter: drop-shadow(0 0 6px currentColor); }
.ao-particle-shooting::after { content: ""; position: absolute; left: 50%; top: 50%; width: 46px; height: 2px; transform-origin: 0 50%; transform: rotate(var(--tail, 180deg)); background: linear-gradient(90deg, currentColor, transparent); opacity: .8; }

/* ---------- Articles Joomla dans une case ---------- */
.ao-article-title { font-family: var(--ao-font-title); font-size: 1.35rem; margin: 0 0 .5em; }
.ao-article-title a { color: inherit; text-decoration: none; }
.ao-article-text img { max-width: 100%; height: auto; border-radius: 10px; }
.ao-articles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ao-articles a { display: grid; gap: 6px; color: inherit; text-decoration: none; font-weight: 600; line-height: 1.25; padding: 8px; border-radius: 12px; background: color-mix(in srgb, currentColor 5%, transparent); transition: transform .2s, background .2s; }
.ao-articles a:hover { transform: translateY(-2px); background: color-mix(in srgb, currentColor 10%, transparent); }
.ao-articles img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; }

/* Window of a door in the live preview of the administration (theme only, no box) */
.aventops.ao-preview-host { position: fixed !important; inset: 0 auto auto 0 !important; width: 0 !important; height: 0 !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important;
	overflow: visible !important; background: none !important; border: 0 !important; box-shadow: none !important; }
.aventops.ao-preview-host::before, .aventops.ao-preview-host::after { display: none !important; }
