/* YB Typography Styles - base look of the word styles.
 * Animation rules are NOT here: they are written from presets.php and attached to this stylesheet (wp_add_inline_style).
 * Colours and sizes arrive as CSS variables written by Elementor's own selectors.
 *
 * A word is three nested layers (see widget.php):
 *   .ybck-seg        motion layer (an animation of the word moves this one)
 *   .ybck-seg__pose  pose layer   (rotation, pill / highlight block, effect pseudo-elements)
 *   .ybck-seg__text  paint layer  (gradient / knockout / stroke on the letters)
 * Words only become inline-blocks (ybck-seg--block) when they need to be: a pill, a rotation, an icon or an animation.
 * Plain words stay inline so long text still wraps normally. */

.ybck-ts { position: relative; }
.ybck-ts__text { margin: 0; overflow-wrap: anywhere; }
.ybck-ts__link { color: inherit; text-decoration: none; }
.ybck-ts:focus-visible { outline: 2px solid #4f46e5; outline-offset: 4px; }
.ybck-grp { display: inline; }
.ybck-seg__pose, .ybck-seg__text { display: inline; }
.ybck-seg--block, .ybck-seg--block > .ybck-seg__pose { display: inline-block; }
.ybck-seg--block > .ybck-seg__pose { position: relative; rotate: var(--ybck-rot, 0deg); transform-origin: 50% 50%; }
.ybck-error-note { padding: 8px 12px; border: 1px dashed #b42318; color: #b42318; font: 13px/1.4 sans-serif; }

/* ---- icon (decoration, same colour/paint as the word) */
/* A word with an icon lays the icon and the word side by side; the icon's vertical position is a setting (top / centre / bottom). */
/* The word's own baseline stays the baseline of the whole word (so words with and without icons sit on the same line);
 * only the icon moves, and it can sit at the top, centre or bottom of the word. "wrap" + "align-content: center" keeps the word
 * centred in a pill that has a minimum height. */
.ybck-seg--icon > .ybck-seg__pose { display: inline-flex; flex-wrap: wrap; align-content: center; align-items: baseline; }
.ybck-seg--icon .ybck-seg__text { align-self: baseline; }
.ybck-seg__icon { display: inline-block; font-size: var(--ybck-icon-size, .9em); line-height: 1; align-self: var(--ybck-icon-self, center); }
.ybck-seg__icon svg { width: 1em; height: 1em; fill: currentColor; display: block; }
.ybck-seg__icon + .ybck-seg__text { margin-inline-start: var(--ybck-icon-gap, .35em); }
.ybck-seg__text + .ybck-seg__icon { margin-inline-start: var(--ybck-icon-gap, .35em); }

/* ---- Stroke & Fill: outline with its own fill colour (empty fill = outline only) */
.ybck-seg--stroke .ybck-seg__text,
.ybck-seg--stroke .ybck-seg__icon {
	-webkit-text-stroke-width: var(--ybck-sw, 1.5px);
	-webkit-text-stroke-color: var(--ybck-sc, currentColor);
	-webkit-text-fill-color: var(--ybck-fill, transparent);
}
.ybck-seg--stroke .ybck-seg__icon svg { fill: var(--ybck-sc, currentColor); }

/* ---- Gradient text, knockout text, and a gradient on the marker pill's text: paint clipped to the letters */
.ybck-seg--gradient .ybck-seg__text,
.ybck-seg--gradient .ybck-seg__icon,
.ybck-seg--flow .ybck-seg__text,
.ybck-seg--flow .ybck-seg__icon,
.ybck-seg--knockout .ybck-seg__text,
.ybck-seg--knockout .ybck-seg__icon,
.ybck-seg--marker.ybck-mkt-gradient .ybck-seg__text,
.ybck-seg--marker.ybck-mkt-gradient .ybck-seg__icon {
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	/* Room for descenders and accents (ç ş ğ İ) so the clip never cuts them off. */
	padding-block: .14em;
	margin-block: -.14em;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}
.ybck-seg--gradient .ybck-seg__text,
.ybck-seg--gradient .ybck-seg__icon,
.ybck-seg--marker.ybck-mkt-gradient .ybck-seg__text,
.ybck-seg--marker.ybck-mkt-gradient .ybck-seg__icon {
	background-image: var(--ybck-t-grad);
}
/* ---- Animated gradient: a stretched copy of the gradient that slides sideways, so the colours travel (left to right by default).
 * The picture ends where it starts (see Gradient::flow_value), so the loop has no seam. Static when reduced motion is requested. */
.ybck-seg--flow .ybck-seg__text,
.ybck-seg--flow .ybck-seg__icon {
	background-image: var(--ybck-t-flow);
	background-size: 200% 100%;
	background-repeat: repeat-x;
	background-position: 200% 50%;
}
@keyframes ybck-flow { from { background-position: 200% 50%; } to { background-position: 0% 50%; } }
@media (prefers-reduced-motion: no-preference) {
	.ybck-seg--flow.is-visible .ybck-seg__text,
	.ybck-seg--flow.is-visible .ybck-seg__icon,
	.ybck-seg--flow.ybck-flow-always .ybck-seg__text,
	.ybck-seg--flow.ybck-flow-always .ybck-seg__icon {
		animation: ybck-flow var(--ybck-fl-dur, 4s) linear infinite var(--ybck-fl-dir, normal);
	}
}

/* An svg icon cannot be clipped to a gradient: it takes the first gradient colour instead. */
.ybck-seg--gradient .ybck-seg__icon svg,
.ybck-seg--flow .ybck-seg__icon svg,
.ybck-seg--marker.ybck-mkt-gradient .ybck-seg__icon svg { fill: var(--ybck-t-g1, #4f46e5); }

/* ---- Knockout: the text is a window onto an image or a colour. The real text stays in the page for screen readers. */
.ybck-seg--knockout .ybck-seg__text,
.ybck-seg--knockout .ybck-seg__icon {
	background-color: var(--ybck-ko-color, #111827);
	background-image: var(--ybck-ko-img, none);
	background-size: var(--ybck-ko-size, cover);
	background-position: var(--ybck-ko-pos, center center);
	background-repeat: no-repeat;
}
.ybck-seg--knockout .ybck-seg__icon svg { fill: var(--ybck-ko-color, #111827); }

/* ---- Highlighter with hover underline: a highlight block and an underline, both at once */
.ybck-seg--overlay > .ybck-seg__pose { isolation: isolate; }
.ybck-seg--overlay > .ybck-seg__pose::before,
.ybck-seg--overlay > .ybck-seg__pose::after {
	content: "";
	position: absolute;
	pointer-events: none;
}
.ybck-seg--overlay > .ybck-seg__pose::before {
	left: calc(-1 * var(--ybck-hl-px, .12em));
	right: calc(-1 * var(--ybck-hl-px, .12em));
	bottom: .04em;
	height: var(--ybck-hl-h, 45%);
	background: var(--ybck-hl, #fde68a);
	border-radius: var(--ybck-hl-radius, 0);
	z-index: -1;
}
.ybck-seg--overlay > .ybck-seg__pose::after {
	left: 0;
	right: 0;
	bottom: var(--ybck-ul-off, 0px);
	height: var(--ybck-ul-h, 3px);
	background: var(--ybck-ul, currentColor);
	border-radius: var(--ybck-ul-radius, 0);
	transform: scaleX(0);
	transform-origin: left center;
}
/* The underline is decorative. Mouse hover, keyboard focus of a link around it, and a focused word all open it. */
.ybck-seg--overlay:hover > .ybck-seg__pose::after,
.ybck-seg--overlay:focus-visible > .ybck-seg__pose::after,
.ybck-ts__link:focus-visible .ybck-seg--overlay > .ybck-seg__pose::after,
.ybck-ts__link:hover .ybck-seg--overlay > .ybck-seg__pose::after {
	transform: scaleX(1);
}
/* Underline set to 'always visible', or to none (settings of the word). */
.ybck-seg--overlay.ybck-ul-always > .ybck-seg__pose::after { transform: scaleX(1); transition: none; }
.ybck-seg--overlay.ybck-ul-off > .ybck-seg__pose::after { display: none; }
@media (hover: none) {
	.ybck-seg--overlay > .ybck-seg__pose::after { transform: scaleX(1); }
}
@media (prefers-reduced-motion: no-preference) {
	.ybck-seg--overlay > .ybck-seg__pose::after { transition: transform var(--ybck-ov-dur, 350ms) cubic-bezier(.22, 1, .36, 1); }
}

/* ---- Marker Highlight: an always-visible pill. The word is centred in it and the pill is always taller than the word. */
.ybck-seg--marker > .ybck-seg__pose {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	text-align: center;
	padding: var(--ybck-pb-py, .2em) var(--ybck-pb-px, .5em);
	min-height: var(--ybck-pb-minh, 0);
	border-radius: var(--ybck-pb-radius, 999px);
	background: var(--ybck-pb-bg, var(--ybck-pb-color, #fde68a));
	background-size: var(--ybck-pb-size, cover);
	background-position: center;
	background-repeat: no-repeat;
}
/* a pill with an icon keeps the same rule: content centred as a whole, text on the baseline */
.ybck-seg--marker.ybck-seg--icon > .ybck-seg__pose { align-items: baseline; align-content: center; justify-content: center; }
.ybck-seg--marker.ybck-mkt-solid .ybck-seg__text,
.ybck-seg--marker.ybck-mkt-solid .ybck-seg__icon { color: var(--ybck-mk-tc, currentColor); }
.ybck-seg--marker.ybck-mkt-solid .ybck-seg__icon svg { fill: var(--ybck-mk-tc, currentColor); }

/* ---- See-through text in a pill. The pill is white (or black) and blends with what is behind it: the letters become
 * holes onto the page. Needs a page behind it that is not cut off by a faded, filtered or moving parent. */
.ybck-seg--through,
.ybck-seg--through-dark { mix-blend-mode: screen; }
.ybck-seg--through-dark { mix-blend-mode: multiply; }
.ybck-seg--through > .ybck-seg__pose { background: #fff; }
.ybck-seg--through .ybck-seg__text,
.ybck-seg--through .ybck-seg__icon { color: #000; }
.ybck-seg--through .ybck-seg__icon svg { fill: #000; }
.ybck-seg--through-dark > .ybck-seg__pose { background: #000; }
.ybck-seg--through-dark .ybck-seg__text,
.ybck-seg--through-dark .ybck-seg__icon { color: #fff; }
.ybck-seg--through-dark .ybck-seg__icon svg { fill: #fff; }

/* ---- Used by the editor's Play button to jump to the starting look without animating there */
.ybck-no-transition,
.ybck-no-transition::before,
.ybck-no-transition::after,
.ybck-no-transition > .ybck-seg__pose::before,
.ybck-no-transition > .ybck-seg__pose::after { transition: none !important; }


/* ---- Kinetic rotator. The words take turns in ONE box that is as wide and tall as the biggest word (they share one grid cell),
 * so the words around it never move. Words slide in and out inside the box (clipped, so nothing trails outside), one after the
 * other: the old word is gone before the next one starts. Only transform moves. The padding is a safe zone for dots and tails;
 * negative margins cancel its effect on the layout. "overflow: clip" (not hidden) keeps the box on the text baseline. */
.ybck-rot {
	display: inline-grid;
	overflow: hidden;
	overflow: clip;
	white-space: nowrap;
	padding: var(--ybck-rot-py, .15em) var(--ybck-rot-px, .08em);
	margin: calc(-1 * var(--ybck-rot-py, .15em)) var(--ybck-rot-ga, 0px) calc(-1 * var(--ybck-rot-py, .15em)) var(--ybck-rot-gb, 0px);
	text-align: var(--ybck-rot-ta, left);
	vertical-align: baseline;
}
.ybck-rot__w {
	grid-area: 1 / 1;
	visibility: hidden;
	color: var(--ybck-rot-color, inherit);
	transform: translate(var(--ybck-rot-in-x, 0px), var(--ybck-rot-in-y, calc(110% + .15em)));
}
.ybck-rot__w.is-active { visibility: visible; transform: none; }
.ybck-rot__w.is-leaving { visibility: visible; transform: translate(var(--ybck-rot-out-x, 0px), var(--ybck-rot-out-y, calc(-110% - .15em))); }
@media (prefers-reduced-motion: no-preference) {
	.ybck-rot__w.is-active,
	.ybck-rot__w.is-leaving { transition: transform var(--ybck-rot-dur, 600ms) var(--ybck-rot-ease, cubic-bezier(.22, 1, .36, 1)); }
}
/* Reduced motion: the first word stays, nothing slides. */
@media (prefers-reduced-motion: reduce) {
	.ybck-rot__w:not(:first-child) { display: none; }
}
/* All the words as plain text for screen readers (the sliding copy is hidden from them). */
.ybck-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* ---- Safety nets: never lose the text */
@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
	.ybck-seg--gradient .ybck-seg__text,
	.ybck-seg--knockout .ybck-seg__text,
	.ybck-seg--marker.ybck-mkt-gradient .ybck-seg__text { color: var(--ybck-t-g1, var(--ybck-ko-color, currentColor)); -webkit-text-fill-color: currentColor; }
}
@media (forced-colors: active) {
	.ybck-seg--gradient .ybck-seg__text, .ybck-seg--flow .ybck-seg__text, .ybck-seg--knockout .ybck-seg__text, .ybck-seg--stroke .ybck-seg__text,
	.ybck-seg--marker.ybck-mkt-gradient .ybck-seg__text,
	.ybck-seg--gradient .ybck-seg__icon, .ybck-seg--knockout .ybck-seg__icon, .ybck-seg--stroke .ybck-seg__icon {
		-webkit-text-fill-color: currentColor;
		-webkit-text-stroke: 0;
		background: none;
		color: CanvasText;
	}
	.ybck-seg--overlay > .ybck-seg__pose::before { background: Mark; }
	.ybck-seg--overlay > .ybck-seg__pose::after { background: LinkText; }
	.ybck-seg--marker > .ybck-seg__pose { background: Canvas; border: 1px solid CanvasText; }
	.ybck-seg--through, .ybck-seg--through-dark { mix-blend-mode: normal; }
	.ybck-seg--through > .ybck-seg__pose, .ybck-seg--through-dark > .ybck-seg__pose { background: Canvas; }
	.ybck-seg--through .ybck-seg__text, .ybck-seg--through-dark .ybck-seg__text,
	.ybck-seg--marker .ybck-seg__text { color: CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
	.ybck-clone { display: none; }
}
