/* AGMA Night: the icon list with the delivered-files illustration on service pages („Какво получавате при
   предаването“, „Какво получавате накрая“…), proposal of 26.11.2026.
   Adds to the theme's rules (night.css), never replaces them. Everything below applies only once handover.js has
   enhanced a block (.is-live), so without JavaScript the section stays exactly as it is now.
   - A blue light field behind the section, as elsewhere on the site, drifting gently with the pointer.
   - The illustration becomes the list's own stack of cards: one per item, with its icon, title and line. The card
     of the item under the pointer comes to the front; on screen and untouched, the stack deals itself through the
     items one by one.
   - The icons light up and draw themselves when their item is active; the row under the pointer gets a soft panel
     with light that follows the pointer, like the site's cells.
   - The two notes under the list („Какво не е включено“, „Кой изпълнява“) become a tidy pair of ruled rows. */

/* ---------- the light field ---------- */
/* blue by default; --agma-night-orb: var(--wp--preset--color--purple-50) on the band (or :root) makes it purple */
.is-style-agma-night-band.has-orb { position: relative; isolation: isolate; overflow: clip; }
.agma-night-orb {
	position: absolute;
	z-index: -1;
	left: var(--ox, 72%);
	top: var(--oy, 50%);
	width: min(1000px, 150vw);
	aspect-ratio: 1;
	/* the homepage glows' recipe: the blue preset at half strength, fading out to nothing */
	background: radial-gradient(closest-side, var(--agma-night-orb, var(--wp--preset--color--blue-50, #016AD480)), color-mix(in srgb, var(--agma-night-orb, var(--wp--preset--color--blue-50, #016AD480)) 40%, transparent) 45%, transparent);
	translate: calc(-50% + var(--dx, 0px)) calc(-50% + var(--dy, 0px));
	opacity: 0;
	transition: opacity 1.6s ease;
	pointer-events: none;
}
.has-orb:has(.is-live.is-in) > .agma-night-orb { opacity: 1; animation: agma-night-orb-breathe 9s ease-in-out infinite alternate; }
@keyframes agma-night-orb-breathe { from { scale: .92; } to { scale: 1.04; } }

/* ---------- the list ---------- */
.is-live .agma-night-feature-list { gap: 2px; }
.is-live .is-style-agma-night-feature {
	position: relative;
	isolation: isolate;
	margin-inline: -16px;
	padding: 11px 16px;
	border-radius: 24px;
}
/* the panel under the pointer, with light that follows it (as on the site's cells) */
.is-live .is-style-agma-night-feature::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border: 1px solid var(--wp--preset--color--night-line);
	border-radius: inherit;
	background:
		radial-gradient(260px circle at var(--mx, 30%) var(--my, 50%), var(--wp--preset--color--night-signal-wash), transparent 70%),
		color-mix(in srgb, var(--wp--preset--color--night-panel) 78%, transparent);
	opacity: 0;
	transition: opacity .45s var(--agma-night-ease, ease);
}
.is-live .is-style-agma-night-feature.is-held::before { opacity: 1; }
.is-live .is-style-agma-night-feature p { transition: color .45s ease; }
.is-live .is-style-agma-night-feature.is-active p { color: color-mix(in srgb, var(--wp--preset--color--night-muted) 55%, var(--wp--preset--color--night-text)); }

/* the icon of the active item lights up and draws itself */
.is-live .agma-night-feature-icon {
	transition: border-color .45s ease, background-color .45s ease, color .45s ease, box-shadow .6s ease, translate .6s var(--agma-night-ease, ease);
}
.is-live .agma-night-feature-icon svg { transition: scale .6s var(--agma-night-ease, ease); }
.is-live .agma-night-feature-icon svg * { stroke-dasharray: 1; }
.is-live .is-style-agma-night-feature.is-active .agma-night-feature-icon {
	border-color: var(--wp--preset--color--night-signal-edge);
	background:
		radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--wp--preset--color--night-signal) 24%, transparent), transparent 72%),
		var(--wp--preset--color--night-panel-2);
	color: var(--wp--preset--color--night-signal-hi);
	box-shadow: 0 14px 28px -16px color-mix(in srgb, var(--wp--preset--color--night-signal) 70%, transparent);
	translate: 0 -2px;
}
.is-live .is-style-agma-night-feature.is-active .agma-night-feature-icon svg * { animation: agma-night-draw .9s var(--agma-night-ease, ease) both; }
.is-live .is-style-agma-night-feature.is-held .agma-night-feature-icon svg { scale: 1.08; }

/* ---------- the notes under the list ---------- */
.is-live .agma-night-features-text > .agma-night-service-note {
	max-width: 62ch;
	margin: 0;
	padding-top: 16px;
	border-top: 1px solid var(--wp--preset--color--night-line);
	font-size: 15px;
	line-height: 1.6;
	color: var(--wp--preset--color--night-muted);
}
.is-live .agma-night-features-text > .agma-night-service-note + .agma-night-service-note { margin-top: 16px; }
.is-live .agma-night-features-text > .agma-night-service-note strong {
	display: block;
	margin-bottom: 2px;
	color: var(--wp--preset--color--night-text);
	font-weight: 700;
}

/* ---------- the stack ---------- */
.is-live .is-style-agma-night-files > svg { display: none; }
.is-style-agma-night-features:not(.is-live) .agma-stack, .is-style-agma-night-features:not(.is-live) .agma-stack__chips { display: none; }
.agma-stack { position: relative; container-type: inline-size; aspect-ratio: 1 / .78; }
.agma-stack__card {
	--x: 0%;
	--y: 0%;
	--r: 0deg;
	--s: 1;
	position: absolute;
	left: 50%;
	top: 50%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 58%;
	height: 80%;
	padding: 6cqw 5.6cqw 5.4cqw;
	border: 1px solid var(--wp--preset--color--night-line-2);
	border-radius: 5cqw;
	background: var(--wp--preset--color--night-panel-2);
	box-shadow: 0 26px 44px -30px rgba(0, 0, 0, .85);
	translate: calc(-50% + var(--x)) calc(-50% + var(--y));
	rotate: var(--r);
	scale: var(--s);
	transition:
		translate .85s var(--agma-night-ease, ease), rotate .85s var(--agma-night-ease, ease), scale .85s var(--agma-night-ease, ease),
		opacity .5s ease, background-color .5s ease, border-color .5s ease, box-shadow .7s ease;
}
.agma-stack__card[data-slot="0"] {
	z-index: 6;
	border-color: var(--wp--preset--color--night-signal-edge);
	background: var(--wp--preset--color--night-panel);
	box-shadow: 0 44px 70px -34px rgba(0, 0, 0, .9), 0 18px 50px -30px color-mix(in srgb, var(--wp--preset--color--night-signal) 45%, transparent);
}
.agma-stack__card[data-slot="1"] { z-index: 5; --x: 31%; --y: -7%; --r: 7deg; --s: .9; }
.agma-stack__card[data-slot="2"] { z-index: 4; --x: -31%; --y: -4%; --r: -9deg; --s: .9; }
.agma-stack__card[data-slot="3"] { z-index: 3; --y: -13%; --r: 2deg; --s: .8; opacity: .75; }
.agma-stack__card[data-slot="4"], .agma-stack__card[data-slot="5"] { z-index: 2; --y: -16%; --s: .72; opacity: 0; }

.agma-stack__icon { display: block; width: 19cqw; height: 19cqw; transform-origin: 0 0; scale: .62; transition: scale .7s var(--agma-night-ease, ease); }
.agma-stack .agma-stack__icon svg { display: block; width: 100%; height: 100%; fill: none; stroke: var(--wp--preset--color--night-muted); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; transition: stroke .5s ease; }
.agma-stack__card[data-slot="0"] .agma-stack__icon { scale: 1; }
.agma-stack .agma-stack__card[data-slot="0"] .agma-stack__icon svg { stroke: var(--wp--preset--color--night-signal); }
.agma-stack .agma-stack__card[data-slot="0"] .agma-stack__icon svg * { stroke-dasharray: 1; animation: agma-night-draw 1.1s var(--agma-night-ease, ease) .15s both; }

/* delivered: a check that draws itself on the front card */
/* the theme sizes every svg in the figure to its full width; these rules must outweigh it */
.agma-stack .agma-stack__check {
	position: absolute;
	top: 5.4cqw;
	right: 5.4cqw;
	width: 8cqw;
	height: 8cqw;
	fill: none;
	stroke: var(--wp--preset--color--night-line-2);
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: stroke .5s ease;
}
.agma-stack .agma-stack__check * { stroke-dasharray: 1; }
.agma-stack .agma-stack__card[data-slot="0"] .agma-stack__check { stroke: var(--wp--preset--color--night-signal); }
.agma-stack .agma-stack__card[data-slot="0"] .agma-stack__check path { animation: agma-night-draw .6s var(--agma-night-ease, ease) .75s both; }

.agma-stack__title, .agma-stack__text { opacity: 0; translate: 0 6px; transition: opacity .35s ease, translate .5s var(--agma-night-ease, ease); }
.agma-stack__title {
	margin-top: auto;
	font: 500 clamp(15px, 4.1cqw, 21px)/1.25 var(--wp--preset--font-family--unbounded, Unbounded, sans-serif);
	letter-spacing: -.03em;
	color: var(--wp--preset--color--night-text);
	text-wrap: balance;
}
.agma-stack__text {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	margin-top: 1.6cqw;
	font-size: clamp(13px, 3cqw, 15px);
	line-height: 1.5;
	color: var(--wp--preset--color--night-muted);
}
.agma-stack__card[data-slot="0"] .agma-stack__title, .agma-stack__card[data-slot="0"] .agma-stack__text { opacity: 1; translate: 0 0; transition-delay: .25s; }

/* one chip per item: the active one lit; pointing at a chip brings its card forward */
.agma-stack__chips { display: flex; justify-content: center; gap: 12px; margin-top: 6px; }
.agma-stack__chip {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	box-sizing: border-box;
	border: 1px solid var(--wp--preset--color--night-line-2);
	border-radius: 16px;
	background: var(--wp--preset--color--night-ground);
	color: var(--wp--preset--color--night-dim);
	cursor: pointer;
	transition: color .4s ease, border-color .4s ease, background-color .4s ease, box-shadow .5s ease, translate .5s var(--agma-night-ease, ease);
}
.agma-stack__chips .agma-stack__chip svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.agma-stack__chip:hover { color: var(--wp--preset--color--night-text); border-color: var(--wp--preset--color--night-dim); }
.agma-stack__chip.is-active {
	border-color: var(--wp--preset--color--night-signal-edge);
	background:
		radial-gradient(circle at 50% 25%, color-mix(in srgb, var(--wp--preset--color--night-signal) 22%, transparent), transparent 72%),
		var(--wp--preset--color--night-ground);
	color: var(--wp--preset--color--night-signal);
	box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--wp--preset--color--night-signal) 70%, transparent);
	translate: 0 -2px;
}

/* the entrance, once, when the section first comes on screen: the cards are dealt from below, one after another */
.agma-stack:not(.is-dealt) .agma-stack__card { opacity: 0; translate: -50% calc(-50% + 36px); rotate: 0deg; scale: .94; }
.agma-stack.is-dealing .agma-stack__card { transition-delay: calc((4 - var(--slot, 0)) * 90ms); }
.agma-stack:not(.is-dealt) + .agma-stack__chips .agma-stack__chip { opacity: 0; }
.agma-stack.is-dealing + .agma-stack__chips .agma-stack__chip { animation: agma-night-pop .5s var(--agma-night-ease, ease) both; animation-delay: calc(.5s + var(--i, 0) * 70ms); }

@media (max-width: 640px) {
	.agma-stack__chips { gap: 10px; }
	.agma-stack__chip { width: 46px; height: 46px; border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.agma-night-orb, .has-orb:has(.is-live.is-in) > .agma-night-orb { animation: none; transition: none; }
	.agma-stack__card { transition: opacity .2s ease; }
	.agma-stack:not(.is-dealt) .agma-stack__card { translate: calc(-50% + var(--x)) calc(-50% + var(--y)); rotate: var(--r); scale: var(--s); }
	.is-live .agma-night-feature-icon svg *, .agma-stack__icon svg *, .agma-stack__check path { animation: none !important; }
	.agma-stack__title, .agma-stack__text { translate: none; }
}
