/**
 * Fesheni Africa child theme: social pills and strips, the second advert and
 * small layout additions. Loaded on every front-end page.
 *
 * The top-bar "Follow us" button and the cover's "Share" button each open a
 * strip of icon pills the same height as the button: the top one slides in
 * from the right (opening to the left of its button), the share one from the
 * left (opening to its right). Without JavaScript the pills show in a row.
 */

/* ---- Pills (icon only) ---- */
body.fesheni-pills .fsp-wrap a.fsp {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 30px;
	height: 30px;
	margin: 0;
	padding: 0;
	border-radius: 999px;
	background: var(--fsp-bg, #111);
	color: var(--fsp-fg, #fff) !important;
	font-size: 14px;
	line-height: 1;
	text-decoration: none !important;
	transition: transform 0.15s ease, filter 0.15s ease;
}
body.fesheni-pills .fsp-wrap a.fsp:hover,
body.fesheni-pills .fsp-wrap a.fsp:focus-visible {
	transform: translateY(-1px);
	filter: brightness(1.12);
}
body.fesheni-pills .fsp-wrap a.fsp:focus-visible {
	outline: 2px solid var(--fsp-bg, #111);
	outline-offset: 2px;
}
body.fesheni-pills .fsp-wrap a.fsp i {
	margin: 0;
	color: inherit !important;
	font-size: 14px;
}

/* Pills that follow light and dark mode (dark mode swaps them in dark.css),
   or one colour for all. */
body.fesheni-pills-theme .fsp-wrap a.fsp,
body.fesheni-pills-single .fsp-wrap a.fsp {
	--fsp-bg: var(--fsp-single-bg, #111);
	--fsp-fg: var(--fsp-single-fg, #fff);
}

/* Each network's own colour. */
body.fesheni-pills-brand .fsp-facebook { --fsp-bg: #1877f2; }
body.fesheni-pills-brand .fsp-twitter { --fsp-bg: #000; }
body.fesheni-pills-brand .fsp-instagram { --fsp-bg: #d62976; }
body.fesheni-pills-brand .fsp-youtube { --fsp-bg: #e00; }
body.fesheni-pills-brand .fsp-vimeo { --fsp-bg: #1ab7ea; }
body.fesheni-pills-brand .fsp-linkedin { --fsp-bg: #0a66c2; }
body.fesheni-pills-brand .fsp-tiktok { --fsp-bg: #010101; }
body.fesheni-pills-brand .fsp-pinterest { --fsp-bg: #e60023; }
body.fesheni-pills-brand .fsp-dribbble { --fsp-bg: #ea4c89; }
body.fesheni-pills-brand .fsp-flickr { --fsp-bg: #0063dc; }
body.fesheni-pills-brand .fsp-tumblr { --fsp-bg: #36465d; }
body.fesheni-pills-brand .fsp-snapchat { --fsp-bg: #fffc00; --fsp-fg: #111; }
body.fesheni-pills-brand .fsp-soundcloud { --fsp-bg: #ff5500; }
body.fesheni-pills-brand .fsp-spotify { --fsp-bg: #1db954; --fsp-fg: #111; }
body.fesheni-pills-brand .fsp-telegram { --fsp-bg: #229ed9; }
body.fesheni-pills-brand .fsp-whatsapp { --fsp-bg: #25d366; --fsp-fg: #0b3d1f; }
body.fesheni-pills-brand .fsp-vk { --fsp-bg: #0077ff; }
body.fesheni-pills-brand .fsp-skype { --fsp-bg: #00aff0; }
body.fesheni-pills-brand .fsp-odnoklassniki { --fsp-bg: #ee8208; }
body.fesheni-pills-brand .fsp-rss { --fsp-bg: #f26522; }
body.fesheni-pills-brand .fsp-issuu { --fsp-bg: #f36d5d; }

/* ---- The buttons: see-through, outlined, in both modes ---- */
.fsp-wrap .fsp-toggle { display: none; }
body.fesheni-pills .fsp-wrap.fsp-ready .fsp-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	height: 38px;
	padding: 0 16px 0 14px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--fsp-toggle-fg, #6a6b6c);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: inset 0 0 0 1px currentColor;
}
body.fesheni-pills .fsp-wrap.fsp-ready .fsp-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
/* The share button sits on the cover photo. */
body.fesheni-pills .fsp-share-cover.fsp-ready .fsp-toggle {
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85), 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* The theme's white pill behind search and "+" is see-through too. */
html body #top-bar-right { background: transparent !important; }

/* ---- The strips ---- */
.fsp-wrap .fsp-drawer-title,
.fsp-wrap .fsp-close { display: none !important; }
body.fesheni-pills .fsp-wrap.fsp-ready {
	display: inline-flex !important;
	align-items: center;
}
body.fesheni-pills .header-social-links.fsp-ready { position: relative; }
body.fesheni-pills .fsp-wrap.fsp-ready .fsp-drawer {
	position: absolute;
	top: 50%;
	z-index: 1000;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 6px;
	box-sizing: border-box;
	height: 38px;
	max-width: calc(100vw - 90px);
	padding: 0 4px;
	overflow-x: auto;
	overflow-y: hidden;
	border-radius: 999px;
	background: var(--fsp-strip-bg, rgba(255, 255, 255, 0.94));
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	scrollbar-width: none;
	transition: transform 0.25s ease, opacity 0.25s ease, visibility 0s linear 0.25s;
}
body.fesheni-pills .fsp-wrap.fsp-ready .fsp-drawer::-webkit-scrollbar { display: none; }
/* Top bar: opens to the left of its button, sliding in from the right. */
body.fesheni-pills .header-social-links.fsp-ready .fsp-drawer {
	right: calc(100% + 8px);
	transform: translate(28px, -50%);
}
/* Cover share: opens to the right of its button, sliding in from the left. */
body.fesheni-pills .fsp-share-cover.fsp-ready .fsp-drawer {
	left: calc(100% + 8px);
	transform: translate(-28px, -50%);
}
body.fesheni-pills .fsp-wrap.fsp-ready.is-open .fsp-drawer {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate(0, -50%);
	transition: transform 0.25s ease, opacity 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
	body.fesheni-pills .fsp-wrap.fsp-ready .fsp-drawer { transition: none; }
}

/* Phones: the top button is a round icon. */
@media (max-width: 768px) {
	body.fesheni-pills .header-social-links.fsp-ready .fsp-toggle {
		width: 38px;
		padding: 0;
	}
	body.fesheni-pills .header-social-links.fsp-ready .fsp-toggle-text {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
}

/* Computers, when the top pills are set to show in a row instead. */
@media (min-width: 769px) {
	body.fesheni-pills:not(.fesheni-drawer-desktop) .header-social-links.fsp-ready .fsp-toggle { display: none; }
	body.fesheni-pills:not(.fesheni-drawer-desktop) .header-social-links.fsp-ready .fsp-drawer {
		position: static;
		height: auto;
		padding: 0;
		background: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none;
	}
}

/* Without JavaScript: the pills in a row. */
body.fesheni-pills .fsp-wrap:not(.fsp-ready) .fsp-drawer {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* ---- Where the top bar sits on the cover photo (960px and narrower),
   its icons and outline are white like the logo. ---- */
@media (max-width: 960px) {
	html body #top-bar-right a,
	html body #top-bar-right i,
	html body #top-search a.search,
	html body .hidden-sidebar-button a.open-hidden-sidebar,
	html body .hidden-sidebar-button a.open-hidden-sidebar span {
		color: #fff !important;
		border-color: currentColor !important;
	}
	body.fesheni-pills .header-social-links.fsp-ready .fsp-toggle {
		color: #fff;
		box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85), 0 1px 3px rgba(0, 0, 0, 0.2);
	}
}

/* ---- Share on the cover: the "Share" button sits where the share bar was ---- */
.fsp-share-cover {
	position: absolute;
	z-index: 12;
	bottom: 30px;
	left: 5%;
}

/* ---- Home cover: a column can use up to 65% of the cover when the other
   side has no widgets ---- */
body.fesheni-cover-left-wide .magcover .cover-sidebar-left,
body.fesheni-cover-right-wide .magcover .cover-sidebar-right {
	width: 65% !important;
	max-width: 65% !important;
}

/* ---- About widget: room above the image, like the other widgets ---- */
.widget_aboutme .about-img { padding-top: 12px; }
.widget_aboutme .about-img a { display: inline-block; }

/* ---- Bottom advert above the footer: as wide as the content area ---- */
.anymag-ad-bottom-wrap { clear: both; padding-top: 10px; padding-bottom: 10px; }
.anymag-ad-bottom-wrap:empty { display: none; }
.related-posts .anymag-ad-slot--bottom { clear: both; width: 100%; margin-top: 30px; }

/* ---- Post covers: the description line runs to 80% of the cover's width
   (the home cover is unchanged). ---- */
body.single .magcover .cover-descr { width: 80%; }

/* An About widget with no header, text or signature shows no empty space. */
.widget_aboutme .about-content:not(:has(*)) { display: none; }

/* ---- Light/Dark pill (before the search button) ----
   It reads the mode it switches to: "Light" while the site is dark, "Dark"
   while it is light. See-through and outlined, like the Follow us pill. */
.fesheni-scheme { display: flex; align-items: center; }
.fesheni-scheme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	box-sizing: border-box;
	height: 38px;
	padding: 0 14px 0 12px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--fsp-toggle-fg, #6a6b6c);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: inset 0 0 0 1px currentColor;
}
.fesheni-scheme-toggle[hidden] { display: none; }
.fesheni-scheme-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.fesheni-scheme-toggle i { font-size: 14px; }
.fesheni-scheme-toggle .fss-to-light { display: none; }
html.fesheni-is-dark .fesheni-scheme-toggle .fss-to-light { display: inline; }
html.fesheni-is-dark .fesheni-scheme-toggle .fss-to-dark { display: none; }
html.fesheni-is-dark .fesheni-scheme-toggle { color: var(--fd-menu-link, #fff); }
@media (max-width: 960px) {
	.fesheni-scheme-toggle,
	html.fesheni-is-dark .fesheni-scheme-toggle {
		color: #fff;
		box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85), 0 1px 3px rgba(0, 0, 0, 0.2);
	}
}
/* Narrow phones: just the sun or moon. */
@media (max-width: 480px) {
	.fesheni-scheme-toggle { width: 38px; padding: 0; }
	.fesheni-scheme-toggle .fss-label { display: none !important; }
}

/* Narrow phones: tighter gaps between the top-bar buttons, so the extra
   Light/Dark pill doesn't push them into the logo. */
@media (max-width: 400px) {
	html body #top-bar-right .header-icon { padding: 0 4px; }
	html body #top-bar-right .right-search { margin: 0 4px; }
	html body .header-social-links.fsp-ready { margin-right: 2px; }
}
