/*
 * Save button (B1-11; one look everywhere). SAVE-UNIFY 19/11 (Sherif: «نوحده زي القالب… الزرار الخفيف… اللي يدوس
 * عليه يتملي وخلاص، زي الكروت بتاعة المقالات»): the look of the theme's own article-card bookmark (Foxiz
 * .meta-bookmark .rb-bookmark, main.css): a bare icon, no circle, no tint. Colour = the theme's main text colour (--tq-text:
 * black in light, white in dark; Sherif 19/11 «اسود مش رمادي زي الاخبار»: the grey meta colour was taken out).
 * - Not saved: the outline icon in the text colour; hover / focus = the icon in the theme's bookmark colour
 *   (--bookmark-color = Theme Options «bookmark_color», the site blue; its dark value in dark), as the theme does.
 * - Saved: the filled icon, same colour (the theme only swaps the icon); a short «pop» when it turns saved.
 * The box stays a 32px tap target (transparent; the theme's own ring of .rb-follow is taken off: border 0). After a mouse
 * click the icon does not stay blue (colour on hover and keyboard focus only). The theme's trigger (.rb-bookmark, or .rb-follow for a company /
 * section) covers it and takes the click; its script marks the state by the class «bookmarked» / «followed» on that
 * trigger. Its font icons are kept invisible; our inline SVGs (in the first HTML, never late) show the state.
 */
.tq-save {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: transparent;
	color: var(--tq-text);
	font-size: calc(var(--meta-fsize, 13px) * 1.15);
	line-height: 1;
	transition: var(--effect, color 0.2s ease);
}

.tq-save__icon {
	grid-area: 1 / 1;
	pointer-events: none;
}

.tq-save__icon--on,
.tq-save:has(.rb-bookmark.bookmarked) .tq-save__icon--off,
.tq-save:has(.rb-follow.followed) .tq-save__icon--off {
	display: none;
}

.tq-save:has(.rb-bookmark.bookmarked) .tq-save__icon--on,
.tq-save:has(.rb-follow.followed) .tq-save__icon--on {
	display: inline-block;
	animation: tq-save-pop 0.36s ease-out;
}

.tq-save:not(:has(.rb-bookmark.bookmarked), :has(.rb-follow.followed)) .tq-save__icon--off {
	animation: tq-save-back 0.24s ease-out;
}

.tq-save:hover,
.tq-save:has(:focus-visible) {
	color: var(--bookmark-color, var(--tq-accent));
}

.tq-save:has(:focus-visible) {
	outline: 2px solid var(--bookmark-color, var(--tq-accent));
	outline-offset: -2px;
}

.tq-save .rb-bookmark,
.tq-save .rb-follow {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: auto;
	height: auto;
	margin: 0;
	border: 0;
	border-radius: inherit;
	cursor: pointer;
}

.tq-save .rb-bookmark > *,
.tq-save .rb-follow > * {
	visibility: hidden;
}

/* The old Foxiz game cards (Legacy_Save): the row = the company line + the save button at its end. The company stays centred
   (centred in the room the button leaves); nothing shows in the hero (its own action row). */
.tq-lg-row {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 32px;
}

.tq-lg-row .p-meta {
	display: flex;
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
}

.tq-lg-row .p-meta .meta-inner {
	flex: 1 1 100%;
	min-width: 0;
	justify-content: center;
}

.tq-lg-row .meta-tax-company {
	min-width: 0;
	max-width: 100%;
}

.tq-lg-save {
	display: inline-flex;
	flex: none;
}

/* Box cards (the upcoming page): the button replaces the theme's bookmark at the end of the date line; the date stays centred. */
.p-meta.has-bookmark:has(.tq-lg-save) {
	display: flex;
	align-items: center;
	min-height: 32px;
}

.p-meta.has-bookmark:has(.tq-lg-save) .meta-inner {
	flex: 1 1 auto;
	justify-content: center;
}

.p-meta .tq-lg-save .tq-save .rb-bookmark {
	display: block;
}

.tq-hero .tq-lg-row,
.tq-hero-cover .tq-lg-row {
	display: none;
}

@keyframes tq-save-pop {
	0% {
		transform: scale(0.6);
	}

	55% {
		transform: scale(1.25);
	}

	100% {
		transform: scale(1);
	}
}

@keyframes tq-save-back {
	0% {
		transform: scale(0.85);
	}

	100% {
		transform: scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tq-save {
		transition: none;
	}

	.tq-save .tq-save__icon {
		animation: none;
	}
}
