/*
 * Scroll hint (rehber "Kaydırma ipucu", 30 Sep 2026). Markup:
 * functions.php jj_scroll_hint(). A finger pushing the screen up on touch
 * screens, a mouse wheel on computers, the line next to it. The story's
 * copy sits inside the stage (bean-story style.scss places it); the other
 * pages' copy is fixed at the bottom centre. `.is-off` hides it (the visitor
 * started scrolling, or the page has nothing further down).
 */
.jj-hint {
	display: flex;
	align-items: center;
	gap: 10px;
	font: 500 13px/1.2 var( --jj-text, "Barlow", system-ui, sans-serif );
	letter-spacing: 0.02em;
	white-space: nowrap;
	transition: opacity 0.45s ease, visibility 0.45s, bottom 0.3s ease;
}
.jj-hint.is-off {
	opacity: 0 !important;
	visibility: hidden;
	pointer-events: none;
}
.jj-hint-ico {
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	overflow: visible;
}
.jj-hint-finger { width: 22px; height: 31px; }
.jj-hint-mouse { display: none; width: 18px; height: 27px; }
/* a mouse or trackpad: the wheel instead of the finger */
@media ( hover: hover ) and ( pointer: fine ) {
	.jj-hint-finger { display: none; }
	.jj-hint-mouse { display: block; }
}

/* the finger pushes the screen up, the arrow above it shows the way */
.jj-hint-hand { animation: jj-hint-push 1.9s cubic-bezier( 0.45, 0, 0.2, 1 ) infinite; }
.jj-hint-trail { animation: jj-hint-trail 1.9s ease-out infinite; }
/* the wheel rolls down */
.jj-hint-wheel { animation: jj-hint-wheel 1.6s ease-in-out infinite; }
/* the hand never fades out completely, so the icon is always there */
@keyframes jj-hint-push {
	0% { transform: translateY( 6px ); opacity: 0.35; }
	20% { opacity: 1; }
	70% { transform: translateY( -3px ); opacity: 1; }
	100% { transform: translateY( -5px ); opacity: 0.35; }
}
@keyframes jj-hint-trail {
	0%, 35% { opacity: 0; }
	65% { opacity: 0.9; }
	100% { opacity: 0; }
}
@keyframes jj-hint-wheel {
	0% { transform: translateY( 0 ); opacity: 1; }
	70% { transform: translateY( 5px ); opacity: 0; }
	100% { transform: translateY( 0 ); opacity: 0; }
}
/* reduced motion: the icon stands still (finger with its arrow, mouse with its wheel) */
@media ( prefers-reduced-motion: reduce ) {
	.jj-hint-ico * { animation: none !important; }
	.jj-hint-trail { opacity: 0.9; }
	.jj-hint { transition: none; }
}

/* every page but the front page, and the story's still layout (reduced
   motion, where the stops stack up under it): bottom centre of the screen,
   on a paper pill so it reads over any section */
.jj-hint--page,
html.static .jj-bean-story .jj-hint {
	position: fixed;
	z-index: 12; /* under the header (20), the cookie band (28) and the menu (30) */
	left: 50%;
	bottom: calc( env( safe-area-inset-bottom, 0px ) + 18px );
	transform: translateX( -50% );
	padding: 8px 16px 8px 12px;
	border-radius: 999px;
	background: rgba( 243, 234, 216, 0.95 );
	color: var( --jj-ink, #2a1a12 ) !important; /* story.js colours the story's hint for the live stage only */
	opacity: 1;
	box-shadow: 0 6px 20px rgba( 28, 17, 11, 0.18 );
}

/* iPhone Safari (client, real iPhone 5 Oct 2026): the other pages' hint sits
   above Safari's floating bottom toolbar (scroll-hint.js adds the class; the
   toolbar's height is not given to the page, ~70px over the home bar area) */
html.jj-ios-safari .jj-hint--page {
	bottom: calc( env( safe-area-inset-bottom, 0px ) + 70px );
}

/* while the cookie band is open (jj-core consent.js publishes its height) the hint sits above it */
html.jj-band-open .jj-bean-story .jj-hint,
html.jj-band-open .jj-hint--page,
html.jj-band-open.static .jj-bean-story .jj-hint {
	bottom: calc( var( --jj-band-h, 0px ) + 12px + 16px + env( safe-area-inset-bottom, 0px ) );
}
