/* ==========================================================================
   Neostella Story Tools
   Share buttons, "In this story", pull quote, pill tags, eyebrow, sticky aside.
   Colors follow the theme's text color; override the variables below in
   the child theme (or Site Editor > Styles > Additional CSS) if needed.
   ========================================================================== */

:root {
	--ns-accent: #403eff;          /* Neostella electric blue */
	--ns-mint: #a2ffd8;            /* aurora green */
	--ns-story-offset: 96px;       /* sticky header height + breathing room */
	--ns-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ── Shared eyebrow label ─────────────────────────────────────────────── */
.ns-share__label,
.ns-toc__label {
	margin: 0 0 .85rem;
	padding-top: .9rem;
	border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent);
	font-size: .6875rem;
	font-weight: 500;
	letter-spacing: .18em;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--ns-accent);
}

.ns-toc__label {
	border-top-color: currentColor;
}

/* ── In this story ────────────────────────────────────────────────────── */
.ns-toc__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: .55rem;
}

.ns-toc__item.is-level-3 { padding-left: .9rem; }
.ns-toc__item.is-level-4 { padding-left: 1.8rem; }

.ns-toc__link {
	position: relative;
	display: inline-block;
	font-size: .8125rem;
	line-height: 1.35;
	color: inherit;
	text-decoration: none;
	transition: color .2s var(--ns-ease), transform .2s var(--ns-ease);
}

.ns-toc__link::before {
	content: "";
	position: absolute;
	left: -.75rem;
	top: .55em;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--ns-accent);
	opacity: 0;
	transform: scale(.4);
	transition: opacity .2s var(--ns-ease), transform .2s var(--ns-ease);
}

.ns-toc__link:hover,
.ns-toc__link.is-active {
	color: var(--ns-accent);
}

.ns-toc__link.is-active {
	transform: translateX(.35rem);
}

.ns-toc__link.is-active::before {
	opacity: 1;
	transform: scale(1);
}

.ns-toc__link:focus-visible,
.ns-share__btn:focus-visible {
	outline: 2px solid var(--ns-accent);
	outline-offset: 3px;
	border-radius: 4px;
}

/* Headings jumped to from the list clear the sticky header. */
.wp-block-post-content :is(h2, h3, h4)[id] {
	scroll-margin-top: var(--ns-story-offset);
}

.wp-block-post-content :is(h2, h3, h4)[tabindex="-1"]:focus {
	outline: none;
}

/* ── Share buttons ────────────────────────────────────────────────────── */
.ns-share {
	position: relative;
}

.ns-share__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.ns-share.is-layout-vertical .ns-share__list {
	flex-direction: column;
	align-items: flex-start;
}

.ns-share__list > li {
	margin: 0;
}

.ns-share__btn {
	--ns-h: 2rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	min-height: var(--ns-h);
	padding: 0 .85rem;
	border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: .75rem;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition:
		color .2s var(--ns-ease),
		background-color .2s var(--ns-ease),
		border-color .2s var(--ns-ease),
		transform .2s var(--ns-ease),
		box-shadow .2s var(--ns-ease);
}

.ns-share.is-size-medium .ns-share__btn {
	--ns-h: 2.5rem;
	padding: 0 1.1rem;
	font-size: .875rem;
}

.ns-share__icon {
	display: inline-flex;
	line-height: 0;
}

.ns-share__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
	transform: scale(1.15);
}

.ns-share.is-size-medium .ns-share__icon svg {
	transform: scale(1.25);
}

/* Icon only: round buttons */
.ns-share.is-display-icon .ns-share__btn {
	width: var(--ns-h);
	padding: 0;
}

/* Hover / pressed */
.ns-share__btn:hover {
	transform: translateY(-1px);
	color: var(--ns-accent);
	border-color: color-mix(in srgb, var(--ns-accent) 55%, transparent);
	background: color-mix(in srgb, var(--ns-accent) 6%, transparent);
}

.ns-share__btn:active {
	transform: translateY(0);
}

/* Solid */
.ns-share.is-variant-solid .ns-share__btn {
	border-color: transparent;
	background: var(--wp--preset--color--contrast, #0b1640);
	color: var(--wp--preset--color--base, #fff);
}

.ns-share.is-variant-solid .ns-share__btn:hover {
	background: var(--ns-accent);
	color: #fff;
}

/* Network colors */
.ns-share.is-variant-brand .ns-share__btn {
	--ns-bg: var(--wp--preset--color--contrast, #0b1640);
	border-color: transparent;
	background: var(--ns-bg);
	color: #fff;
}

.ns-share.is-variant-brand .ns-share__btn--linkedin { --ns-bg: #0a66c2; }
.ns-share.is-variant-brand .ns-share__btn--facebook { --ns-bg: #0866ff; }
.ns-share.is-variant-brand .ns-share__btn--x { --ns-bg: #000; }
.ns-share.is-variant-brand .ns-share__btn--instagram {
	background: linear-gradient(45deg, #f58529, #dd2a7b 50%, #8134af);
}

.ns-share.is-variant-brand .ns-share__btn:hover {
	color: #fff;
	box-shadow: 0 6px 16px -6px var(--ns-bg);
}

/* Copied / shared confirmation */
.ns-share .ns-share__btn.is-done,
.ns-share .ns-share__btn.is-done:hover {
	color: #0b1640;
	border-color: transparent;
	background: var(--ns-mint);
}

.ns-share__status {
	position: absolute;
	left: 0;
	top: calc(100% + .4rem);
	font-size: .6875rem;
	line-height: 1.3;
	color: inherit;
	opacity: 0;
	transform: translateY(-2px);
	transition: opacity .2s var(--ns-ease), transform .2s var(--ns-ease);
	pointer-events: none;
}

.ns-share__status.is-visible {
	opacity: .8;
	transform: none;
}

/* Visually hidden text for screen readers */
.ns-share__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ── Sticky sidebar (class on the Group inside the left Column) ───────── */
.ns-story-aside > * + * {
	margin-top: 2.25rem;
}

@media (min-width: 782px) {
	.ns-story-aside {
		position: sticky;
		top: var(--ns-story-offset);
	}
}

@media (max-width: 781px) {
	.ns-toc.is-hidden-mobile {
		display: none;
	}
}

/* ── Block style: Quote › Pull quote ──────────────────────────────────── */
.wp-block-quote.is-style-ns-pull-quote {
	margin-block: 3rem;
	padding: 1.75rem 0 1.5rem;
	border: 0;
	border-top: 1px solid currentColor;
	border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	background: none;
}

.wp-block-quote.is-style-ns-pull-quote p {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading, inherit);
	font-size: clamp(1.75rem, 1.25rem + 1.6vw, 2.5rem);
	font-weight: 400;
	line-height: 1.08;
	letter-spacing: -.015em;
}

.wp-block-quote.is-style-ns-pull-quote cite {
	display: block;
	margin-top: 1rem;
	font-size: .75rem;
	font-style: normal;
	font-weight: 600;
	line-height: 1.4;
}

/* ── Block style: Post Terms › Pills ──────────────────────────────────── */
.wp-block-post-terms.is-style-ns-pills {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.wp-block-post-terms.is-style-ns-pills .wp-block-post-terms__separator {
	display: none;
}

.wp-block-post-terms.is-style-ns-pills a {
	display: inline-flex;
	align-items: center;
	min-height: 1.75rem;
	padding: 0 .8rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--ns-mint) 28%, #eef6fb);
	color: inherit;
	font-size: .75rem;
	line-height: 1;
	text-decoration: none;
	transition: background-color .2s var(--ns-ease), color .2s var(--ns-ease);
}

.wp-block-post-terms.is-style-ns-pills a:hover {
	background: var(--ns-mint);
}

/* ── Block style: Post Terms › Eyebrow ────────────────────────────────── */
.wp-block-post-terms.is-style-ns-eyebrow {
	font-size: .6875rem;
	font-weight: 500;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--ns-accent);
}

.wp-block-post-terms.is-style-ns-eyebrow a {
	color: inherit;
	text-decoration: none;
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.ns-share__btn,
	.ns-share__status,
	.ns-toc__link,
	.ns-toc__link::before {
		transition: none;
	}

	.ns-share__btn:hover,
	.ns-toc__link.is-active {
		transform: none;
	}
}
