/* Seasonal fall foliage, driven by js/fall.js. Loaded only while app/seasonal.py says so.
   Everything here is decoration: fixed or absolutely positioned, click-through, and never
   part of the page flow, so no existing layout moves. */

.gg-fall {
	--gg-leaf-rust: #b5471b;
	--gg-leaf-amber: #d9822b;
	--gg-leaf-gold: #e5aa2e;
	--gg-leaf-wine: #7a2318;
	--gg-leaf-bark: #8a5a1f;
	position: fixed;
	inset: 0;
	z-index: 45; /* above the page, below the sticky header (50), drawers and dialogs */
	overflow: hidden;
	pointer-events: none;
	contain: strict;
}

.gg-fall__p {
	position: absolute;
	top: 0;
	left: 0;
	pointer-events: none;
	will-change: transform;
}

.gg-leaf { display: block; width: 100%; height: 100%; overflow: visible; }
.gg-leaf__body { fill: currentColor; }
.gg-leaf__vein { fill: none; stroke: rgba(55, 22, 4, .38); stroke-width: 1.1; stroke-linecap: round; }
.gg-leaf--rust { color: var(--gg-leaf-rust, #b5471b); }
.gg-leaf--amber { color: var(--gg-leaf-amber, #d9822b); }
.gg-leaf--gold { color: var(--gg-leaf-gold, #e5aa2e); }
.gg-leaf--wine { color: var(--gg-leaf-wine, #7a2318); }
.gg-leaf--bark { color: var(--gg-leaf-bark, #8a5a1f); }

/* Dark mode: embers rising from below. */
.gg-fall__ember {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: radial-gradient(circle, #fff1c4 0%, #ffb347 45%, rgba(255, 110, 30, 0) 72%);
	box-shadow: 0 0 7px 2px rgba(255, 140, 40, .5);
}
.gg-fall__ember > i {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	animation: gg-ember-flicker 1.4s ease-in-out infinite alternate;
}
@keyframes gg-ember-flicker { from { opacity: .3; } to { opacity: 1; } }

/* Leaves resting on the top edge of the footer. The footer becomes the positioning box;
   position: relative alone never moves anything. */
.gg-footer { position: relative; }
.gg-fall-pile {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 1;
	height: 0;
	pointer-events: none;
}

/* Visitors can stop the motion (WCAG 2.2.2). Sits in the footer's top padding. */
.gg-fall-toggle {
	position: absolute;
	top: .4rem;
	right: var(--gg-gutter, 1rem);
	display: inline-grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	color: var(--gg-leaf-rust, #b5471b);
	background: transparent;
	cursor: pointer;
	pointer-events: auto;
	opacity: .75;
}
.gg-fall-toggle:hover { opacity: 1; }
.gg-fall-toggle:focus-visible { outline: 2px solid var(--gg-focus); outline-offset: 2px; opacity: 1; }
.gg-fall-toggle[aria-pressed="false"] { color: var(--gg-muted); opacity: .55; }
.gg-fall-toggle svg { width: 1.1rem; height: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
	.gg-fall, .gg-fall-pile, .gg-fall-toggle { display: none; }
	.gg-fall__ember > i { animation: none; }
}
