/* =====================================================================
   inner-motion.css — lively look for the "side menu + content" inner pages
   (school clubs, about, programmes & services). Loaded only on those pages
   (see $inner_motion_pages in _head.php / template.php).

   Accessibility rules (same as motion.css, do not break them):
   - Only transform / opacity move; no text, ARIA or reading-order change.
   - Movement only under html.motion-on (off for "reduce motion" and after
     "stop automatic motion"); everything ends in under 5 seconds.
   - Anything waiting to appear (.im-wait) shows at once on keyboard focus.
   - Decoration is CSS or aria-hidden; contrast modes and print get the
     plain page. Brand colours only: green #2a6806, gold #f0c300.
   ===================================================================== */

/* ---------- static look (everyone) ---------- */

/* gold bar under the page title and section titles */
#faqs-1 .tab-content > h1.h3-sm::after,
#faqs-1 .tab-content > h2.h3-sm::after {
	content: "";
	display: block;
	width: 70px;
	height: 4px;
	margin-top: 10px;
	border-radius: 4px;
	background: linear-gradient(90deg, #f0c300, #fff2a8, #f0c300);
	transform-origin: 100% 50%;
}
[dir="ltr"] #faqs-1 .tab-content > h1.h3-sm::after,
[dir="ltr"] #faqs-1 .tab-content > h2.h3-sm::after { transform-origin: 0 50%; }

/* the current item of the side menu gets a gold edge on the reading-start side */
#faqs-1 .tabs-1 li.tab-link.current { box-shadow: inset -5px 0 0 #f0c300; }
[dir="ltr"] #faqs-1 .tabs-1 li.tab-link.current { box-shadow: inset 5px 0 0 #f0c300; }

/* photos: gold frame + soft shadow (organisation chart excluded: it must stay full width) */
#faqs-1 .tabs-content img.image-aboutus:not(.haykaltanzimi) {
	padding: 5px;
	border-radius: 12px;
	background: linear-gradient(135deg, #f0c300, #fff2a8 45%, #f0c300);
	box-shadow: 0 8px 14px -6px rgba(0, 0, 0, .35);   /* compact: the text box clips anything wider */
}
/* phones: full-width photo instead of text squeezed into a thin column */
@media (max-width: 575px) {
	#faqs-1 .tabs-content img.image-aboutus:not(.haykaltanzimi) {
		float: none !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 0 16px !important;
	}
}

/* photo wrapper added by inner-motion.js (only when animations are on): it takes the photo's
   place in the text flow so a light can sweep across the photo and the photo can zoom inside */
.im-frame {
	display: block;
	position: relative;
	overflow: hidden;
	float: left;
	margin: 2px 15px 20px 10px;   /* room for the compact shadow inside the clipped text box */
	border-radius: 12px;
	box-shadow: 0 8px 14px -6px rgba(0, 0, 0, .35);
	transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), box-shadow .5s ease;
}
[dir="ltr"] .im-frame { float: right; margin: 2px 10px 20px 15px; }
.im-frame > img.image-aboutus {
	float: none !important;
	display: block;
	margin: 0 !important;
	box-shadow: none !important;
	transition: transform .6s cubic-bezier(.34, 1.56, .64, 1);
}
@media (max-width: 575px) {
	.im-frame { float: none; margin: 0 0 16px; }
}
.im-frame::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -60%;
	width: 40%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
	transform: skewX(-18deg);
	opacity: 0;
	pointer-events: none;
}

/* ---------- keyframes (prefix im- : keep names unique across all CSS files) ---------- */
@keyframes im-rise  { from { opacity: 0; transform: translate3d(0, 30px, 0); } to { opacity: 1; transform: none; } }
@keyframes im-slide { from { opacity: 0; transform: translate3d(40px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes im-slide-ltr { from { opacity: 0; transform: translate3d(-40px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes im-bar   { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes im-pop   { 0% { opacity: 0; transform: scale(.8) rotate(-3deg); } 65% { opacity: 1; transform: scale(1.03) rotate(.5deg); } 100% { opacity: 1; transform: none; } }
@keyframes im-sweep { 0% { opacity: 1; transform: translateX(0) skewX(-18deg); } 100% { opacity: 1; transform: translateX(450%) skewX(-18deg); } }
@keyframes im-sweep-again { 0% { opacity: 1; transform: translateX(0) skewX(-18deg); } 100% { opacity: 1; transform: translateX(450%) skewX(-18deg); } }
@keyframes im-float-in { 0% { opacity: 0; transform: translateY(50px) scale(.4) rotate(var(--r, 0deg)); } 70% { opacity: var(--o, .2); transform: translateY(-6px) scale(1.08) rotate(var(--r, 0deg)); } 100% { opacity: var(--o, .2); transform: rotate(var(--r, 0deg)); } }
@keyframes im-bob { 0%, 100% { transform: rotate(var(--r, 0deg)); } 50% { transform: translateY(-8px) rotate(calc(var(--r, 0deg) * -1)); } }

/* ---------- 1. top of the page: plays from the first paint (pure CSS, no flash) ---------- */
html.motion-on .inner-page-wrapper #breadcrumb .breadcrumb-item { animation: im-rise .6s cubic-bezier(.22, .61, .36, 1) both; }
html.motion-on .inner-page-wrapper #breadcrumb .breadcrumb-item:nth-child(2) { animation-delay: .1s; }
html.motion-on .inner-page-wrapper #breadcrumb .breadcrumb-item:nth-child(3) { animation-delay: .2s; }
html.motion-on .inner-page-wrapper #breadcrumb .breadcrumb-item:nth-child(n+4) { animation-delay: .3s; }

html.motion-on #faqs-1 .tabs-1 > li { animation: im-slide .6s cubic-bezier(.22, .61, .36, 1) both; }
html.motion-on[dir="ltr"] #faqs-1 .tabs-1 > li { animation-name: im-slide-ltr; }
html.motion-on #faqs-1 .tabs-1 > li:nth-child(1) { animation-delay: .2s; }
html.motion-on #faqs-1 .tabs-1 > li:nth-child(2) { animation-delay: .3s; }
html.motion-on #faqs-1 .tabs-1 > li:nth-child(3) { animation-delay: .4s; }
html.motion-on #faqs-1 .tabs-1 > li:nth-child(4) { animation-delay: .5s; }
html.motion-on #faqs-1 .tabs-1 > li:nth-child(5) { animation-delay: .6s; }
html.motion-on #faqs-1 .tabs-1 > li:nth-child(n+6) { animation-delay: .7s; }

html.motion-on #faqs-1 .tab-content:first-child > h1 { animation: im-rise .8s cubic-bezier(.22, .61, .36, 1) .25s both; }
html.motion-on #faqs-1 .tab-content:first-child > h1.h3-sm::after { animation: im-bar .8s cubic-bezier(.34, 1.56, .64, 1) .8s both; }
html.motion-on #faqs-1 .tab-content:first-child .small_description > * { animation: im-rise .7s cubic-bezier(.22, .61, .36, 1) .45s both; }
html.motion-on #faqs-1 .tab-content:first-child .small_description > :nth-child(2) { animation-delay: .6s; }
html.motion-on #faqs-1 .tab-content:first-child .small_description > :nth-child(3) { animation-delay: .75s; }
html.motion-on #faqs-1 .tab-content:first-child .small_description > :nth-child(n+4) { animation-delay: .9s; }
html.motion-on #faqs-1 .tab-content:first-child .im-frame::after { animation: im-sweep 1.1s ease-in-out 1.3s; }

/* ---------- 2. lower blocks: appear when scrolled to (inner-motion.js: .im-wait -> .im-in) ---------- */
html.motion-on #faqs-1 .tab-content.im-wait > h2,
html.motion-on #faqs-1 .tab-content.im-wait .small_description > * { opacity: 0; }
html.motion-on #faqs-1 .tab-content.im-in > h2 { animation: im-rise .7s cubic-bezier(.22, .61, .36, 1) both; }
html.motion-on #faqs-1 .tab-content.im-in > h2.h3-sm::after { animation: im-bar .8s cubic-bezier(.34, 1.56, .64, 1) .4s both; }
html.motion-on #faqs-1 .tab-content.im-in .small_description > * { animation: im-rise .7s cubic-bezier(.22, .61, .36, 1) .15s both; }
html.motion-on #faqs-1 .tab-content.im-in .small_description > :nth-child(2) { animation-delay: .3s; }
html.motion-on #faqs-1 .tab-content.im-in .small_description > :nth-child(3) { animation-delay: .45s; }
html.motion-on #faqs-1 .tab-content.im-in .small_description > :nth-child(n+4) { animation-delay: .6s; }
html.motion-on #faqs-1 .tab-content.im-in .small_description > .im-frame { animation: im-pop .8s cubic-bezier(.34, 1.56, .64, 1) .1s both; }
html.motion-on #faqs-1 .tab-content.im-in .im-frame::after { animation: im-sweep 1.1s ease-in-out .9s; }
/* reached with the keyboard before being scrolled to: no fade at all */
html.motion-on #faqs-1 .tab-content.im-instant *,
html.motion-on #faqs-1 .tab-content.im-instant *::after { animation: none !important; opacity: 1 !important; }

/* ---------- 3. hover + keyboard focus ---------- */
html.motion-on #faqs-1 .tabs-1 > li > a img { transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
html.motion-on #faqs-1 .tabs-1 > li > a:hover img,
html.motion-on #faqs-1 .tabs-1 > li > a:focus-visible img { transform: scale(1.15) rotate(-8deg); }
@media (hover: hover) {
	html.motion-on .im-frame:hover { transform: translateY(-6px) rotate(-1.2deg); box-shadow: 0 14px 16px -8px rgba(0, 0, 0, .45); }
	html.motion-on[dir="ltr"] .im-frame:hover { transform: translateY(-6px) rotate(1.2deg); }
	html.motion-on .im-frame:hover > img { transform: scale(1.06); }
	html.motion-on .im-frame:hover::after { animation: im-sweep-again 1s ease-in-out; }
}

/* ---------- 4. school clubs: club icons under the side menu (inner-motion.js, aria-hidden) ---------- */
.clubs-deco { display: none; }
@media (min-width: 992px) {
	.clubs-deco {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 22px 10px;
		position: sticky;
		top: 140px;
		margin: 40px 10px 0;
		pointer-events: none;
		color: #2a6806;
	}
	.clubs-deco i {
		justify-self: center;
		font-size: var(--s, 34px);
		--o: .2;
		opacity: var(--o);
		transform: rotate(var(--r, 0deg));
	}
	.clubs-deco i.gold { color: #f0c300; --o: .5; }
	html.motion-on .clubs-deco i { animation: im-float-in .9s cubic-bezier(.34, 1.56, .64, 1) var(--d, 0s) both, im-bob 1.8s ease-in-out calc(var(--d, 0s) + 1s) 1; }
}

/* ---------- 5. stopped motion / contrast modes / print ---------- */
html.motion-paused #faqs-1 *,
html.motion-paused #faqs-1 *::after,
html.motion-paused .inner-page-wrapper #breadcrumb * { animation: none !important; transition: none !important; }
html.motion-paused #faqs-1 .tab-content * { opacity: 1 !important; }
html.motion-paused .clubs-deco i { opacity: .2 !important; }
html.motion-paused .clubs-deco i.gold { opacity: .5 !important; }

html.high-contrast #faqs-1 .tab-content > h1.h3-sm::after,
html.high-contrast #faqs-1 .tab-content > h2.h3-sm::after,
html.high-contrast .im-frame::after,
html.high-contrast .clubs-deco { display: none !important; }
html.high-contrast #faqs-1 .tabs-content img.image-aboutus { background: none; box-shadow: none; border: 2px solid currentColor; }
html.high-contrast #faqs-1 .tabs-1 li.tab-link.current { box-shadow: none; }
@media (forced-colors: active), print {
	#faqs-1 .tab-content > h1.h3-sm::after, #faqs-1 .tab-content > h2.h3-sm::after,
	.im-frame::after, .clubs-deco { display: none !important; }
	#faqs-1 .tabs-content img.image-aboutus { background: none; box-shadow: none; border: 2px solid CanvasText; }
	#faqs-1 .tab-content * { opacity: 1 !important; animation: none !important; }
}
