/* Brandsmen Post Toolkit — TOC & Social Share
   Theme-agnostic defaults driven by CSS variables. Override any --bsp-* token
   in your theme to restyle without editing the plugin.
   All sizing is expressed in rem (1rem = root font-size). */

:root {
	--bsp-accent:        #0b5cff;
	--bsp-accent-ink:    #ffffff;
	--bsp-ink:           #000d26;
	--bsp-muted:         rgba( 0, 13, 38, 0.62 );
	--bsp-line:          rgba( 0, 13, 38, 0.12 );
	--bsp-surface:       #ffffff;
	--bsp-surface-2:     #f5f7fb;
	--bsp-radius:        0.875rem;   /* 14px */
	--bsp-rail-width:    16.25rem;   /* 260px */
	--bsp-rail-top:      7.5rem;     /* 120px */
	--bsp-font:          inherit;
}

/* Anchor offset so a jumped-to heading lands clear of the top, not flush against it. */
.single-post__content h2[id],
.entry-content h2[id],
article h2[id] {
	scroll-margin-top: 9rem;
}

/* ───────────────── Table of Contents ───────────────── */
.bsp-toc {
	font-family: var( --bsp-font );
	background: var( --bsp-surface-2 );
	border: 0.0625rem solid var( --bsp-line );
	border-radius: var( --bsp-radius );
	padding: 1.15rem 0.85rem;
	margin: 0 0 2rem;
	box-sizing: border-box;
}

.bsp-toc__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.bsp-toc__title {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var( --bsp-muted );
}

.bsp-toc__toggle {
	display: none;          /* shown only in inline/mobile mode */
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	margin: -0.4rem -0.4rem -0.4rem 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var( --bsp-ink );
	cursor: pointer;
	border-radius: 0.5rem;
	transition: background 0.15s, transform 0.2s;
}
.bsp-toc__toggle:hover { background: rgba( 0, 13, 38, 0.06 ); }
.bsp-toc[aria-collapsed="true"] .bsp-toc__toggle svg { transform: rotate( -90deg ); }

.bsp-toc__list,
.bsp-toc .bsp-toc__list {
	list-style: none;
	margin: 0.9rem 0 0;
	padding: 0;          /* override theme's .single-post__content ul indent */
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
}
.bsp-toc[aria-collapsed="true"] .bsp-toc__list {
	max-height: 0 !important;
	opacity: 0;
	margin-top: 0;
}

.bsp-toc__link {
	display: block;
	position: relative;
	padding: 0.4rem 0.4rem 0.4rem 0.6rem;
	font-size: 0.95rem;
	line-height: 1.35;
	color: var( --bsp-muted );
	text-decoration: none;
	border-radius: 0.5rem;
	border-left: 0.125rem solid transparent;
	transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.bsp-toc__link:hover {
	color: var( --bsp-ink );
	background: rgba( 11, 92, 255, 0.06 );
}
.bsp-toc__link.is-active {
	color: var( --bsp-accent );
	font-weight: 600;
	border-left-color: var( --bsp-accent );
	background: rgba( 11, 92, 255, 0.07 );
}

/* Side-rail mode (positioned by JS when there's room to the right). */
.bsp-toc--rail {
	position: fixed;
	top: var( --bsp-rail-top );
	max-height: calc( 100vh - var( --bsp-rail-top ) - 2.5rem );
	overflow-y: auto;
	margin: 0;
	background: transparent;
	border: 0;
	padding: 0 0 0 1.1rem;
	border-left: 0.0625rem solid var( --bsp-line );
	z-index: 20;
	scrollbar-width: thin;
}
.bsp-toc--rail .bsp-toc__list { margin-top: 0.75rem; max-height: none !important; opacity: 1; }
.bsp-toc--rail .bsp-toc__toggle { display: none; }

/* Docked mode — the theme lays the TOC out in a real grid sidebar column.
   Keep the boxed panel look; just add sticky-friendly scrolling. */
.bsp-toc--docked {
	max-height: calc( 100vh - 8rem );
	overflow-y: auto;
	scrollbar-width: thin;
}
.bsp-toc--docked .bsp-toc__toggle { display: none; }
.bsp-toc--docked .bsp-toc__list { max-height: none !important; opacity: 1; }

/* Share block beneath the TOC — the "line" divider then the buttons.
   Lives OUTSIDE the collapsible list so it stays visible when the TOC is
   collapsed on mobile (TOC collapsed at top, share right below it). */
.bsp-toc__share {
	margin-top: 1.1rem;
	padding-top: 1.1rem;
	border-top: 0.0625rem solid var( --bsp-line );
}
.bsp-toc__share-title {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var( --bsp-muted );
	margin-bottom: 0.7rem;
}

/* Compact (icon-only) share buttons used inside the rail/TOC widget. */
.bsp-share__btns--compact { gap: 0.45rem; }
.bsp-share__btns--compact .bsp-share__btn { padding: 0.6rem; }
.bsp-share__btns--compact .bsp-share__btn-label {
	position: absolute; width: 0.0625rem; height: 0.0625rem; padding: 0; margin: -0.0625rem;
	overflow: hidden; clip: rect( 0 0 0 0 ); white-space: nowrap; border: 0;
}

/* ───────────────── Share card ───────────────── */
.bsp-share {
	font-family: var( --bsp-font );
	margin: 3rem 0 0;
}
.bsp-share__card {
	display: flex;
	align-items: stretch;
	gap: 1.5rem;
	background: var( --bsp-surface );
	border: 0.0625rem solid var( --bsp-line );
	border-radius: var( --bsp-radius );
	padding: 1.25rem;
	box-shadow: 0 0.625rem 1.875rem -1.375rem rgba( 0, 13, 38, 0.5 );
}
.bsp-share__thumb {
	flex: 0 0 8.25rem;
	width: 8.25rem;
	border-radius: 0.625rem;
	overflow: hidden;
	background: var( --bsp-surface-2 );
}
.bsp-share__thumb-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.bsp-share__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.35rem;
}
.bsp-share__eyebrow {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var( --bsp-muted );
}
.bsp-share__post-title {
	margin: 0 0 0.6rem;
	font-size: 1.15rem;
	font-weight: 600;
	line-height: 1.3;
	color: var( --bsp-ink );
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.bsp-share__btns {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
}
.bsp-share__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 0.85rem;
	border: 0.0625rem solid var( --bsp-line );
	border-radius: 0.625rem;
	background: var( --bsp-surface );
	color: var( --bsp-ink );
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.06s, border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.bsp-share__btn svg { flex: 0 0 auto; }
.bsp-share__btn:hover { transform: translateY( -0.0625rem ); box-shadow: 0 0.5rem 1.125rem -0.75rem rgba( 0, 13, 38, 0.55 ); }
.bsp-share__btn:active { transform: translateY( 0 ); }

/* Brand-tinted hovers */
.bsp-share__btn--facebook:hover  { background: #1877f2; border-color: #1877f2; color: #fff; }
.bsp-share__btn--x:hover         { background: #000;    border-color: #000;    color: #fff; }
.bsp-share__btn--linkedin:hover  { background: #0a66c2; border-color: #0a66c2; color: #fff; }
.bsp-share__btn--instagram:hover { background: #d6249f; border-color: #d6249f; color: #fff; }
.bsp-share__btn--email:hover     { background: var( --bsp-ink ); border-color: var( --bsp-ink ); color: #fff; }
.bsp-share__btn--copy:hover      { background: var( --bsp-accent ); border-color: var( --bsp-accent ); color: var( --bsp-accent-ink ); }
.bsp-share__btn.is-done          { background: var( --bsp-accent ); border-color: var( --bsp-accent ); color: var( --bsp-accent-ink ); }

.bsp-share__feedback {
	display: block;
	min-height: 1.1em;
	margin-top: 0.5rem;
	font-size: 0.85rem;
	line-height: 1.35;
	color: var( --bsp-accent );
	opacity: 0;
	transition: opacity 0.2s;
}
.bsp-share__feedback.is-visible { opacity: 1; }

/* ───────────────── References / Sources ───────────────── */
.bsp-refs { margin: 3rem 0 0; }
.bsp-refs__title { font-family: var( --bsp-font ); }
.bsp-refs__list {
	margin: 1rem 0 0;
	padding-left: 1.25rem;
}
.bsp-refs__item {
	margin-bottom: 0.5rem;
	line-height: 1.5;
}
.bsp-refs__link {
	color: var( --bsp-accent );
	word-break: break-word;
}

/* ───────────────── Responsive ───────────────── */
@media (max-width: 42.5rem) {
	.bsp-share__card { flex-direction: column; gap: 1.1rem; }
	.bsp-share__thumb { flex-basis: auto; width: 100%; height: 10rem; }
	.bsp-share__btn-label { position: absolute; width: 0.0625rem; height: 0.0625rem; padding: 0; overflow: hidden; clip: rect( 0 0 0 0 ); white-space: nowrap; } /* icon-only on small screens */
	.bsp-share__btn { padding: 0.7rem; }
}

/* Inline/mobile TOC shows the collapse control */
@media (max-width: 74.9375rem) {
	.bsp-toc__toggle { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
	.bsp-toc__list, .bsp-share__btn, .bsp-toc__link, .bsp-share__feedback { transition: none; }
}
