/* ==========================================================================
   Эффекты при наведении на фото разделов (главная): Кино, Театр, Эстрада,
   Телевидение, Цирк, Выставки, Друг детей. См. js/nav-effects.js
   Выключить: в functions.php OLESHKO_NAV_EFFECTS = false
   ========================================================================== */
.nfx { position: relative; overflow: hidden; isolation: isolate; }
.nfx img { display: block; transition: filter .6s ease, transform .8s ease; }
.nfx__layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
canvas.nfx__layer { width: 100%; height: 100%; z-index: 5; }

/* 1. Кино — луч прожектора */
.nfx--kino .nfx__spot {
	opacity: 0;
	transition: opacity .45s ease;
	background: radial-gradient(circle var(--nfx-r, 150px) at var(--nfx-x, 50%) var(--nfx-y, 45%),
		rgba(255, 243, 214, .16) 0%, rgba(255, 243, 214, .05) 40%, rgba(0, 0, 0, .74) 100%);
}
.nfx--kino.is-on .nfx__spot { opacity: 1; }
.nfx--kino .nfx__grain {
	opacity: 0; transition: opacity .45s ease; mix-blend-mode: overlay;
	background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px);
}
.nfx--kino.is-on .nfx__grain { opacity: 1; animation: nfx-flicker .18s steps(2) infinite; }
@keyframes nfx-flicker { 50% { opacity: .55; } }

/* 2. Театр — занавес */
.nfx__cur {
	position: absolute; top: 0; bottom: 0; width: 51%; z-index: 3; pointer-events: none;
	background-color: #7a140e;
	background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.32) 0 6px, rgba(255,255,255,.05) 6px 10px, transparent 10px 20px);
	transition: transform 1.1s cubic-bezier(.7, 0, .25, 1);
}
.nfx__cur--l { left: 0; transform: translateX(-86%); box-shadow: inset -10px 0 14px -8px rgba(0,0,0,.6); }
.nfx__cur--r { right: 0; transform: translateX(86%); box-shadow: inset 10px 0 14px -8px rgba(0,0,0,.6); }
.nfx__val {
	position: absolute; left: 0; right: 0; top: 0; height: 8%; z-index: 4; pointer-events: none;
	background: #5f0f0a; border-bottom: 2px solid #c9a227;
	transition: transform 1.1s cubic-bezier(.7, 0, .25, 1);
}
.nfx--teatr img { filter: brightness(.82); }
.nfx--teatr.is-on img { filter: brightness(1.05); }
.nfx--teatr.is-on .nfx__cur--l { transform: translateX(-101%); }
.nfx--teatr.is-on .nfx__cur--r { transform: translateX(101%); }
.nfx--teatr.is-on .nfx__val { transform: translateY(-105%); }
/* на телефонах: занавес сначала закрыт и открывается, когда блок появляется на экране */
.nfx--touch.nfx--teatr:not(.is-on) .nfx__cur--l, .nfx--touch.nfx--teatr:not(.is-on) .nfx__cur--r { transform: translateX(0); }

/* 3. Эстрада — огни гримёрного зеркала */
.nfx__bulb {
	position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; z-index: 3; pointer-events: none;
	background: #3d3122; transition: background .25s ease, box-shadow .25s ease;
}
.nfx--ehstrada.is-on .nfx__bulb { background: #ffe2a0; box-shadow: 0 0 6px 2px rgba(255, 196, 90, .85), 0 0 14px 4px rgba(255, 170, 60, .35); }
.nfx--ehstrada img { filter: brightness(.85); }
.nfx--ehstrada.is-on img { filter: brightness(1.08) saturate(1.1); }

/* 4. Телевидение — включение старого телевизора */
.nfx--televidenie .nfx__scan {
	opacity: 0; transition: opacity .4s ease;
	background: repeating-linear-gradient(0deg, rgba(0,0,0,.3) 0 1px, transparent 1px 3px);
}
.nfx--televidenie.is-on .nfx__scan { opacity: .6; }
.nfx--televidenie .nfx__beam { background: #fff; opacity: 0; transform: scale(0, .006); z-index: 4; }
.nfx--televidenie.is-play .nfx__beam { animation: nfx-tv-on .75s ease-out forwards; }
.nfx--televidenie.is-play img { animation: nfx-tv-jitter .45s steps(3) 1; }
@keyframes nfx-tv-on {
	0% { opacity: 1; transform: scale(0, .006); }
	35% { opacity: 1; transform: scale(1, .006); }
	65% { opacity: .7; transform: scale(1, 1); }
	100% { opacity: 0; transform: scale(1, 1); }
}
@keyframes nfx-tv-jitter {
	0% { transform: translateX(-3px); filter: hue-rotate(25deg) contrast(1.3); }
	50% { transform: translateX(3px); }
	100% { transform: none; filter: none; }
}

/* 5. Цирк — конфетти (canvas) */
.nfx--cirk.is-on img { transform: scale(1.03); }

/* 6. Выставки — вспышка фотоаппарата и музейная рама */
.nfx--vystavki .nfx__flash { background: #fff; opacity: 0; z-index: 4; }
.nfx--vystavki.is-play .nfx__flash { animation: nfx-flash .8s ease-out forwards; }
@keyframes nfx-flash { 0% { opacity: 0; } 8% { opacity: .9; } 100% { opacity: 0; } }
.nfx--vystavki .nfx__frame { z-index: 3; box-shadow: inset 0 0 0 0 #e9e3d6; transition: box-shadow .6s ease; }
.nfx--vystavki.is-on .nfx__frame { box-shadow: inset 0 0 0 10px #ece6d8, inset 0 0 0 12px #b69a55, inset 0 0 22px 12px rgba(0,0,0,.35); }

/* 7. Друг детей — мыльные пузыри (canvas) */
.nfx--drug-detej.is-on img { filter: saturate(1.15) brightness(1.04); }

@media (prefers-reduced-motion: reduce) {
	.nfx__layer, .nfx__cur, .nfx__val, .nfx__bulb, .nfx img { transition: none !important; animation: none !important; }
}