/**
 * Sk Share Counter — Front-end Layout & Positioning
 * Supports dedicated outer gutter column for desktop & collision avoidance for footer/content.
 */

.skshco-share-bar {
	--skshco-button-size: 48px;
	--skshco-radius: 8px;
	--skshco-gap: 0.5rem;
	--skshco-custom-color: #1877f2;
	box-sizing: border-box;
}

.skshco-share-bar *,
.skshco-share-bar *::before,
.skshco-share-bar *::after {
	box-sizing: border-box;
}

.skshco-share-bar.skshco-device--mobile {
	display: none;
}

/* ==========================================================================
   Desktop Vertical Sidebar (Dedicated Outer Gutter Column)
   ========================================================================== */
.skshco-share-bar--vertical.skshco-is-vertical {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 99990;
	max-height: 90vh;
	overflow: visible;
	padding: 0.5rem;
	transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
	            transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0.28s;
}

.skshco-share-bar--vertical.skshco-is-fixed-left {
	left: 0.75rem;
}

.skshco-share-bar--vertical.skshco-is-fixed-right {
	right: 0.75rem;
}

/* Outer gutter positioning: Keeps sidebar in its own column beside 1140px/1200px containers */
@media (min-width: 1200px) {
	.skshco-share-bar--vertical.skshco-is-fixed-left {
		left: max(0.75rem, calc((100vw - 1180px) / 2 - 76px));
	}
	.skshco-share-bar--vertical.skshco-is-fixed-right {
		right: max(0.75rem, calc((100vw - 1180px) / 2 - 76px));
	}
}

@media (min-width: 1400px) {
	.skshco-share-bar--vertical.skshco-is-fixed-left {
		left: max(1.5rem, calc((100vw - 1240px) / 2 - 84px));
	}
	.skshco-share-bar--vertical.skshco-is-fixed-right {
		right: max(1.5rem, calc((100vw - 1240px) / 2 - 84px));
	}
}

/* On screens < 1200px, hide vertical bar to prevent overlapping content text */
@media (max-width: 1199px) {
	.skshco-share-bar--vertical.skshco-is-vertical {
		display: none !important;
	}
}

/* ==========================================================================
   Collision Avoidance (Dock away when reaching footer / content end)
   ========================================================================== */
.skshco-share-bar--vertical.skshco-docked-hidden {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	transform: translateY(-50%) translateX(-28px) !important;
}

.skshco-share-bar--vertical.skshco-is-fixed-right.skshco-docked-hidden {
	transform: translateY(-50%) translateX(28px) !important;
}

.skshco-share-bar--horizontal.skshco-docked-hidden {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	transform: translateY(calc(100% + var(--skshco-bottom-offset, 0px))) !important;
}

/* ==========================================================================
   Horizontal Floating Bottom Bar
   Supports bottom offset for sticky mobile navigation bars / footers
   ========================================================================== */
.skshco-share-bar--horizontal.skshco-is-horizontal.skshco-is-floating-bottom {
	position: fixed;
	left: 0;
	right: 0;
	bottom: var(--skshco-bottom-offset, 0px);
	z-index: 99990;
	margin: 0;
	padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.08);
	transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
	            transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0.28s;
}

.skshco-share-bar--horizontal.skshco-sticky-mobile {
	bottom: var(--skshco-mobile-bottom-offset, var(--skshco-bottom-offset, 0px));
	padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
}

/* Keep horizontal bottom bar in a sleek single line */
.skshco-share-bar--horizontal.skshco-is-floating-bottom .skshco-share-bar__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: nowrap;
	gap: var(--skshco-gap);
	max-width: 540px;
	margin: 0 auto;
}

.skshco-share-bar--horizontal.skshco-is-floating-bottom .skshco-share-buttons {
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
}

/* Inline / shortcode embed */
.skshco-share-bar--inline.skshco-share-bar--horizontal {
	position: relative;
	left: auto;
	right: auto;
	bottom: auto;
	width: 100%;
	clear: both;
	margin-top: 1.5rem;
	padding: 0.75rem 0;
	background: transparent;
	border: none;
	box-shadow: none;
}

.skshco-share-bar__inner {
	display: flex;
	align-items: center;
	gap: var(--skshco-gap);
}

.skshco-share-bar--vertical .skshco-share-bar__inner {
	flex-direction: column;
}

.skshco-share-bar--horizontal .skshco-share-bar__inner {
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: center;
}

.skshco-share-count {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 3.25rem;
	font-size: 0.72rem;
	line-height: 1.15;
	color: #1d2327;
	user-select: none;
}

.skshco-share-count__value {
	font-size: 1.25rem;
	font-weight: 700;
	color: #0f172a;
}

.skshco-share-buttons {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: var(--skshco-gap);
	flex-direction: inherit;
	align-items: center;
	justify-content: inherit;
}

.skshco-share-bar--vertical .skshco-share-buttons {
	flex-direction: column;
}

.skshco-share-buttons__item {
	margin: 0;
	padding: 0;
	display: flex;
}

.skshco-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--skshco-button-size);
	height: var(--skshco-button-size);
	color: #fff;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
	cursor: pointer;
}

.skshco-shape--rectangle .skshco-share-btn {
	width: calc(var(--skshco-button-size) * 1.85);
	min-width: calc(var(--skshco-button-size) * 1.6);
	padding: 0 0.65rem;
}

.skshco-share-btn:hover,
.skshco-share-btn:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.skshco-theme--official .skshco-share-btn {
	background-color: var(--skshco-btn-official, #555);
}

.skshco-theme--custom .skshco-share-btn {
	background-color: var(--skshco-custom-color);
}

.skshco-size--small {
	--skshco-button-size: 32px;
}

.skshco-size--medium {
	--skshco-button-size: 46px;
}

.skshco-size--large {
	--skshco-button-size: 56px;
}

.skshco-shape--square .skshco-share-btn {
	border-radius: 0;
}

.skshco-shape--rounded .skshco-share-btn {
	border-radius: var(--skshco-radius);
}

.skshco-shape--circle .skshco-share-btn {
	border-radius: 50%;
}

.skshco-shape--rectangle .skshco-share-btn {
	border-radius: var(--skshco-radius);
}

.skshco-share-btn__icon svg {
	display: block;
	width: 55%;
	height: 55%;
}

body.skshco-share-float-bottom-desktop {
	padding-bottom: 5rem;
}

/* ==========================================================================
   Mobile Responsive Rules
   ========================================================================== */
@media (max-width: 767px) {
	.skshco-share-bar {
		--skshco-button-size: 38px;
		--skshco-gap: 0.4rem;
	}

	body.skshco-share-float-bottom-desktop {
		padding-bottom: 0;
	}

	body.skshco-share-float-bottom-mobile {
		padding-bottom: calc(4.5rem + var(--skshco-mobile-bottom-offset, var(--skshco-bottom-offset, 0px)));
	}

	/* Prevent bottom bar from overlapping content end / comments */
	body.skshco-share-float-bottom-mobile .td-main-content-wrap,
	body.skshco-share-float-bottom-mobile .entry-content,
	body.skshco-share-float-bottom-mobile .site-content,
	body.skshco-share-float-bottom-mobile article {
		padding-bottom: 2rem;
	}

	.skshco-share-count {
		min-width: 2.75rem;
		font-size: 0.65rem;
	}

	.skshco-share-count__value {
		font-size: 1.05rem;
	}

	.skshco-share-bar.skshco-device--desktop {
		display: none !important;
	}

	.skshco-share-bar.skshco-device--mobile {
		display: block !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.skshco-share-btn,
	.skshco-share-bar {
		transition: none !important;
	}
}
