/* Tutorials (includes/tutorials.php): the cards on the tutorials page and a tutorial's own page.
   Selectors start with "body" so the theme's link colours never win. */

body .rac-tut {
	--tut-ease: cubic-bezier(0.23, 1, 0.32, 1);
	--tut-line: rgba(194, 205, 232, .12);
	font-family: var(--ra-font, "Assistant", system-ui, sans-serif);
}

/* ---------------------------------------------------------------- the tutorials page's opening (as on the catalog page) */
body .ra-tutorials-page .ra-page-title .elementor-heading-title { font-size: clamp(2.4rem, 1.2rem + 3.6vw, 3.8rem); letter-spacing: -.035em; color: #f2f6ff; }
body .ra-tutorials-page .elementor-widget-text-editor p { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.6; color: #c2cde8; max-width: 58ch; margin: 0; }

/* ---------------------------------------------------------------- the grid and its cards */
body .rac-tut .rac-tut-grid {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px;
}
body .rac-tut .rac-tut-card {
	position: relative; display: flex; flex-direction: column; min-width: 0; margin: 0; overflow: hidden;
	border: 1px solid var(--tut-line); border-radius: var(--ra-r-lg, 24px);
	background: linear-gradient(180deg, rgba(19, 27, 58, .92), rgba(12, 18, 38, .96));
	box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset;
	transition: transform 260ms var(--tut-ease), border-color 200ms ease, box-shadow 260ms var(--tut-ease);
}
body .rac-tut .rac-tut-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ra-navy-900, #090e21); }
body .rac-tut .rac-tut-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--tut-ease); }
body .rac-tut .rac-tut-play {
	position: absolute; inset-block-end: 14px; inset-inline-start: 14px; display: grid; place-items: center;
	width: 46px; height: 46px; border-radius: 50%; background: rgba(7, 11, 26, .72); color: var(--ra-cyan-300, #7df0f4);
	border: 1px solid rgba(47, 224, 230, .4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	transition: background-color 200ms ease, color 200ms ease, transform 260ms var(--tut-ease);
}
/* A play sign points right in every language (media controls are not mirrored). */
body .rac-tut .rac-tut-play svg { margin-left: 3px; }
body .rac-tut .rac-tut-badge {
	position: absolute; inset-block-start: 12px; inset-inline-start: 12px; padding: 5px 12px; border-radius: 999px;
	background: rgba(255, 196, 87, .92); color: #1a1200; font-size: 13px; font-weight: 800;
}
body .rac-tut .rac-tut-body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; flex: 1 1 auto; }
body .rac-tut .rac-tut-topics { margin: 0; color: var(--ra-cyan-300, #7df0f4); font-size: 14px; font-weight: 700; letter-spacing: .02em; }
body .rac-tut .rac-tut-title { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.35; }
body .rac-tut .rac-tut-title a { color: var(--ra-text, #f2f6ff); text-decoration: none; }
/* The whole card opens the tutorial, through its title. */
body .rac-tut .rac-tut-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
body .rac-tut .rac-tut-title a:focus-visible { outline: none; }
body .rac-tut .rac-tut-card:has(.rac-tut-title a:focus-visible) { outline: 2px solid var(--ra-cyan-300, #7df0f4); outline-offset: 3px; }
body .rac-tut .rac-tut-excerpt { margin: 0; color: var(--ra-text-2, #c2cde8); font-size: 16px; line-height: 1.6; }
body .rac-tut .rac-tut-go { margin-top: auto; padding-top: 6px; color: var(--ra-cyan-300, #7df0f4); font-size: 15px; font-weight: 700; }
body .rac-tut .rac-tut-go::after { content: " ←"; }
@media (hover: hover) and (pointer: fine) {
	body .rac-tut .rac-tut-card:hover { transform: translateY(-4px); border-color: rgba(47, 224, 230, .35); box-shadow: 0 24px 50px -28px rgba(47, 224, 230, .35); }
	body .rac-tut .rac-tut-card:hover .rac-tut-media img { transform: scale(1.04); }
	body .rac-tut .rac-tut-card:hover .rac-tut-play { background: var(--ra-cyan-400, #2fe0e6); color: #041018; transform: scale(1.06); }
}

/* No tutorials yet. */
body .rac-tut.rac-tut-empty {
	display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 32px;
	border: 1px dashed rgba(125, 240, 244, .28); border-radius: 22px; background: rgba(255, 255, 255, .02);
}
body .rac-tut.rac-tut-empty p { margin: 0; max-width: 52ch; color: var(--ra-text-2, #c2cde8); font-size: 17px; line-height: 1.6; }
body .rac-tut.rac-tut-empty .rac-tut-empty-h { color: var(--ra-text, #f2f6ff); font-size: 22px; font-weight: 800; }

body .rac-tut-btn, body .rac-tut .rac-tut-btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 50px; margin-top: 8px; padding: 12px 24px;
	border-radius: 14px; background: var(--ra-cyan-400, #2fe0e6); color: #041018; font-size: 17px; font-weight: 800; text-decoration: none;
	box-shadow: 0 12px 30px -14px rgba(47, 224, 230, .75);
	transition: background-color 200ms ease, box-shadow 200ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
body .rac-tut-btn:hover { background: var(--ra-cyan-300, #7df0f4); color: #041018; }
body .rac-tut-btn:active { transform: scale(.97); }
body .rac-tut-btn:focus-visible { outline: 2px solid var(--ra-cyan-300, #7df0f4); outline-offset: 3px; }

/* ---------------------------------------------------------------- a tutorial's own page */
body.rac-tut-single .rac-tut-page {
	width: min(100% - 32px, 920px); margin-inline: auto; padding: clamp(120px, 12vw, 160px) 0 clamp(64px, 8vw, 110px);
	font-family: var(--ra-font, "Assistant", system-ui, sans-serif); color: var(--ra-text, #f2f6ff);
}
body.rac-tut-single .rac-tut-head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 32px; }
body.rac-tut-single .rac-tut-back { display: inline-flex; gap: 8px; min-height: 44px; align-items: center; color: var(--ra-text-3, #8b99bc); font-size: 16px; font-weight: 700; text-decoration: none; }
body.rac-tut-single .rac-tut-back:hover { color: var(--ra-cyan-300, #7df0f4); }
body.rac-tut-single .rac-tut-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
body.rac-tut-single .rac-tut-tags a {
	display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border: 1px solid rgba(47, 224, 230, .3); border-radius: 999px;
	color: var(--ra-cyan-300, #7df0f4); font-size: 14px; font-weight: 700; text-decoration: none;
}
body.rac-tut-single .rac-tut-tags a:hover { background: rgba(47, 224, 230, .12); }
body.rac-tut-single .rac-tut-h1 { margin: 0; font-size: clamp(32px, 4.6vw, 54px); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: var(--ra-text, #f2f6ff); }
body.rac-tut-single .rac-tut-lead { margin: 0; max-width: 60ch; color: var(--ra-text-2, #c2cde8); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.65; }
body.rac-tut-single .rac-tut-content { color: var(--ra-text-2, #c2cde8); font-size: 18px; line-height: 1.75; }
body.rac-tut-single .rac-tut-content > * + * { margin-top: 1.1em; }
body.rac-tut-single .rac-tut-content h2, body.rac-tut-single .rac-tut-content h3 { color: var(--ra-text, #f2f6ff); line-height: 1.3; margin-top: 1.8em; }
body.rac-tut-single .rac-tut-content a { color: var(--ra-cyan-300, #7df0f4); text-decoration: underline; text-underline-offset: 3px; }
body.rac-tut-single .rac-tut-content img { max-width: 100%; height: auto; border-radius: 16px; }
body.rac-tut-single .rac-tut-content code { padding: 2px 6px; border-radius: 6px; background: rgba(194, 205, 232, .1); direction: ltr; unicode-bidi: isolate; }
body.rac-tut-single .rac-tut-content pre { padding: 18px 20px; border-radius: 14px; background: #0b1230; overflow-x: auto; direction: ltr; text-align: left; font-size: 15px; }
/* The video: wide, rounded, with a soft frame. */
body.rac-tut-single .rac-tut-content .wp-block-embed,
body.rac-tut-single .rac-tut-content .elementor-widget-video { margin-block: 8px 28px; }
body.rac-tut-single .rac-tut-content .wp-block-embed__wrapper,
body.rac-tut-single .rac-tut-content > p > iframe,
body.rac-tut-single .rac-tut-content > iframe {
	overflow: hidden; border-radius: 18px; border: 1px solid rgba(47, 224, 230, .2); background: #050816;
	box-shadow: 0 30px 70px -36px rgba(0, 0, 0, .8), 0 0 40px -18px rgba(47, 224, 230, .35);
}
body.rac-tut-single .rac-tut-content > p > iframe, body.rac-tut-single .rac-tut-content > iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }

body.rac-tut-single .rac-tut-cta {
	display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 56px; padding: 28px 30px;
	border: 1px solid rgba(47, 224, 230, .22); border-radius: 22px;
	background: radial-gradient(120% 140% at 100% 0%, rgba(47, 224, 230, .12), transparent 60%), #0d1430;
}
body.rac-tut-single .rac-tut-cta p { margin: 0; color: var(--ra-text-2, #c2cde8); font-size: 17px; line-height: 1.6; }
body.rac-tut-single .rac-tut-cta .rac-tut-cta-h { color: var(--ra-text, #f2f6ff); font-size: 24px; font-weight: 800; }
body.rac-tut-single .rac-tut-more { margin-top: 64px; }
body.rac-tut-single .rac-tut-more-h { margin: 0 0 22px; color: var(--ra-text, #f2f6ff); font-size: 28px; font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
	body .rac-tut .rac-tut-card, body .rac-tut .rac-tut-media img, body .rac-tut .rac-tut-play, body .rac-tut-btn { transition: none; }
	body .rac-tut .rac-tut-card:hover, body .rac-tut .rac-tut-card:hover .rac-tut-media img, body .rac-tut .rac-tut-card:hover .rac-tut-play { transform: none; }
}

/* ---------------------------------------------------------------- a tutorial's cover (rac_tut_cover())
   The night grid of the site, "הדרכה חינמית" with a play sign, the topic, the title in big letters, and a
   video timeline along the bottom: a free video, never a course (the course covers are photographs of Roei
   with the course name). The accent follows the first topic. Sizes follow the card's width (cqi). */
body .rac-tut .rac-tut-media,
.rac-tvideo-btn { container-type: inline-size; }
.rac-tcover {
	--ac: #2fe0e6;
	--ac-soft: rgba(47, 224, 230, .22);
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 3cqi;
	padding: 6.5cqi 6.5cqi 6cqi;
	overflow: hidden;
	color: #f2f6ff;
	font-family: var(--ra-font, Assistant, sans-serif);
	text-align: start;
	background:
		radial-gradient(110% 90% at 100% 0%, var(--ac-soft), transparent 55%),
		radial-gradient(80% 80% at 0% 100%, rgba(32, 44, 89, .85), transparent 70%),
		linear-gradient(160deg, #101a3c 0%, #070b1a 100%);
}
.rac-tcover::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(125, 240, 244, .07) 1px, transparent 1px),
		linear-gradient(90deg, rgba(125, 240, 244, .07) 1px, transparent 1px);
	background-size: 7cqi 7cqi;
	-webkit-mask-image: radial-gradient(90% 80% at 85% 10%, #000, transparent 75%);
	mask-image: radial-gradient(90% 80% at 85% 10%, #000, transparent 75%);
	pointer-events: none;
}
.rac-tcover > * { position: relative; }
.rac-tcover--a1 { --ac: #b6a3ff; --ac-soft: rgba(167, 139, 250, .24); }
.rac-tcover--a2 { --ac: #5eead4; --ac-soft: rgba(94, 234, 212, .2); }
.rac-tcover--a3 { --ac: #ffd27a; --ac-soft: rgba(251, 191, 36, .18); }
.rac-tcover-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 3cqi;
}
.rac-tcover-kind {
	display: inline-flex;
	align-items: center;
	gap: 1.6cqi;
	padding: 1.3cqi 2.8cqi;
	border: 1px solid color-mix(in srgb, var(--ac) 55%, transparent);
	border-radius: 999px;
	background: rgba(7, 11, 26, .62);
	color: var(--ac);
	font-size: max(11px, 3.5cqi);
	font-weight: 800;
	line-height: 1.2;
	white-space: nowrap;
}
.rac-tcover-kind svg { width: 1em; height: 1em; }
.rac-tcover-topic {
	color: rgba(194, 205, 232, .85);
	font-size: max(11px, 3.4cqi);
	font-weight: 700;
	white-space: nowrap;
}
.rac-tcover-title {
	display: -webkit-box;
	max-width: 94%;
	overflow: hidden;
	font-size: 7.6cqi;
	font-weight: 800;
	line-height: 1.16;
	letter-spacing: -.01em;
	text-wrap: balance;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}
.rac-tcover.is-mid .rac-tcover-title { font-size: 6.6cqi; }
.rac-tcover.is-long .rac-tcover-title { font-size: 5.8cqi; }
.rac-tcover-bar {
	height: max(3px, .9cqi);
	margin-inline-start: max(56px, 15cqi);
	border-radius: 999px;
	background: rgba(194, 205, 232, .18);
}
.rac-tcover-bar i {
	position: relative;
	display: block;
	width: 34%;
	height: 100%;
	border-radius: inherit;
	background: var(--ac);
	box-shadow: 0 0 12px color-mix(in srgb, var(--ac) 60%, transparent);
}
.rac-tcover-bar i::after {
	content: "";
	position: absolute;
	inset-inline-end: -1.2cqi;
	top: 50%;
	width: max(9px, 2.6cqi);
	height: max(9px, 2.6cqi);
	border-radius: 50%;
	background: #f2f6ff;
	transform: translate(0, -50%);
}
/* the card's play button keeps its place at the start of the timeline */
body .rac-tut .rac-tut-card:hover .rac-tcover-bar i { width: 42%; transition: width 600ms var(--tut-ease, ease); }

/* ---------------------------------------------------------------- the video on a tutorial's page */
body.rac-tut-single .rac-tut-content .wp-block-embed__wrapper:has(.rac-tvideo)::before { content: none; display: none; }
.rac-tvideo {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 18px;
	border: 1px solid rgba(47, 224, 230, .2);
	background: #050816;
	box-shadow: 0 30px 70px -36px rgba(0, 0, 0, .8), 0 0 40px -18px rgba(47, 224, 230, .35);
}
.rac-tvideo iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rac-tvideo-btn {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.rac-tcover--big { padding: 5.5cqi; }
.rac-tcover--big .rac-tcover-title { font-size: 6cqi; max-width: 80%; }
.rac-tcover--big.is-mid .rac-tcover-title { font-size: 5.4cqi; }
.rac-tcover--big.is-long .rac-tcover-title { font-size: 4.8cqi; }
.rac-tcover--big .rac-tcover-bar { margin-inline-start: 0; }
.rac-tvideo-play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background: var(--ra-cyan-400, #2fe0e6);
	color: #041018;
	box-shadow: 0 0 0 10px rgba(47, 224, 230, .16), 0 20px 50px -14px rgba(47, 224, 230, .7);
	transform: translate(-50%, -50%);
	transition: transform 220ms cubic-bezier(.22, 1, .36, 1), box-shadow 220ms ease;
}
.rac-tvideo-play svg { margin-left: 4px; }
.rac-tvideo-btn:hover .rac-tvideo-play { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 0 14px rgba(47, 224, 230, .2), 0 20px 50px -14px rgba(47, 224, 230, .8); }
.rac-tvideo-btn:active .rac-tvideo-play { transform: translate(-50%, -50%) scale(.96); }
.rac-tvideo-btn:focus-visible { outline: 3px solid var(--ra-cyan-300, #7df0f4); outline-offset: -3px; }
@media (max-width: 600px) {
	.rac-tvideo-play { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
	.rac-tvideo-play, body .rac-tut .rac-tut-card:hover .rac-tcover-bar i { transition: none; }
}
/* On the page the title sits low, under the play button, and keeps to two lines. */
.rac-tcover--big { justify-content: flex-start; }
.rac-tcover--big .rac-tcover-title { margin-top: auto; -webkit-line-clamp: 2; }
