/* ==========================================================================
   What's New — floating widget.
   Mounted bottom-right via wp_footer (inc/whats-new.php), hydrated by
   assets/js/whats-new.js. Glass surfaces + --t-* tokens so it tracks the
   active theme. Sits clear of the bottom-centre Discover HUD (z-index 100);
   lifts above it on narrow viewports where the HUD spans full width.
   ========================================================================== */

.turis-wn {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99;
	font-family: inherit;
	color: var(--t-fg);
	transition: right var(--t-d-norm) var(--t-ease-out);
}
.turis-wn[hidden] { display: none; }

/* The Discover HUD, when minimised, pins to the bottom-right (a 52px
   launcher at right:20px) — the same corner as this widget. Slide the
   widget left so the two sit side by side instead of stacking. Only an
   issue on desktop; below 900px the widget already lifts above the HUD. */
@media (min-width: 901px) {
	body:has(#turisHud[data-hud-minimized]) .turis-wn { right: 84px; }
}

/* --------------------------------------------------------------------------
   Launcher
   -------------------------------------------------------------------------- */
.turis-wn__launcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 9px 16px 9px 11px;
	border-radius: var(--t-r-pill);
	cursor: pointer;
	color: var(--t-fg);
	font: inherit;
	font-size: 0.84rem;
	font-weight: 560;
	letter-spacing: -0.01em;
	background: color-mix(in srgb, var(--t-bg) 84%, transparent);
	-webkit-backdrop-filter: blur(18px) saturate(140%);
	backdrop-filter: blur(18px) saturate(140%);
	border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
	box-shadow:
		0 1px 0 color-mix(in srgb, currentColor 6%, transparent) inset,
		0 18px 40px -22px rgba(0, 0, 0, 0.32),
		0 5px 12px -10px rgba(0, 0, 0, 0.16);
	transition:
		transform var(--t-d-fast) var(--t-ease-out),
		box-shadow var(--t-d-norm) var(--t-ease-out),
		border-color var(--t-d-norm) var(--t-ease-out);
}
.turis-wn__launcher:hover {
	transform: translateY(-1px);
	border-color: color-mix(in srgb, currentColor 22%, transparent);
	box-shadow:
		0 1px 0 color-mix(in srgb, currentColor 8%, transparent) inset,
		0 24px 48px -22px rgba(0, 0, 0, 0.38),
		0 6px 14px -10px rgba(0, 0, 0, 0.2);
}
.turis-wn__launcher:active { transform: translateY(0) scale(0.98); }

/* --------------------------------------------------------------------------
   Dynamic glow — a slow sheen tracing the border, so the widget reads as a
   live, always-shipping surface. Monochrome: the sheen is the active ink
   colour, so it adapts to light/dark automatically. Applied to the launcher
   and the toast (the two attention pieces).
   -------------------------------------------------------------------------- */
@property --turis-wn-angle {
	syntax: "<angle>";
	initial-value: 0deg;
	inherits: false;
}

.turis-wn__launcher,
.turis-wn__toast { isolation: isolate; }

.turis-wn__launcher::before,
.turis-wn__toast::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1.5px;
	background: conic-gradient(
		from var(--turis-wn-angle),
		transparent 0deg,
		color-mix(in srgb, var(--t-fg) 45%, transparent) 35deg,
		color-mix(in srgb, var(--t-fg) 90%, transparent) 62deg,
		color-mix(in srgb, var(--t-fg) 45%, transparent) 90deg,
		transparent 135deg,
		transparent 360deg
	);
	-webkit-mask:
		linear-gradient(#000 0 0) content-box,
		linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	        mask-composite: exclude;
	opacity: 0.5;
	pointer-events: none;
	animation: turis-wn-rotate 5s linear infinite;
}
.turis-wn__launcher:hover::before { opacity: 0.85; }
.turis-wn__launcher.is-unread::before { opacity: 1; animation-duration: 3.2s; }
.turis-wn__toast::before { opacity: 0.7; animation-duration: 4s; }

@keyframes turis-wn-rotate {
	to { --turis-wn-angle: 360deg; }
}

.turis-wn__launcher-mark {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: var(--t-r-pill);
	flex-shrink: 0;
	background: color-mix(in srgb, var(--t-fg) 8%, transparent);
	color: var(--t-fg);
}

.turis-wn__launcher-label { white-space: nowrap; }

/* Unread dot — a notification badge on the corner of the icon mark. */
.turis-wn__dot {
	position: absolute;
	top: -3px;
	right: -3px;
	width: 9px;
	height: 9px;
	border-radius: var(--t-r-pill);
	background: var(--t-fg);
	box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--t-bg) 84%, transparent);
}
.turis-wn__dot[hidden] { display: none; }
.turis-wn__launcher.is-unread .turis-wn__dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--t-fg);
	opacity: 0.45;
	animation: turis-wn-ping 2.4s var(--t-ease-out) infinite;
}
@keyframes turis-wn-ping {
	0%   { transform: scale(1);   opacity: 0.35; }
	70%  { transform: scale(2.6); opacity: 0; }
	100% { transform: scale(2.6); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Shared glass surface for toast + panel
   -------------------------------------------------------------------------- */
.turis-wn__toast,
.turis-wn__panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 12px);
	background: color-mix(in srgb, var(--t-bg) 88%, transparent);
	-webkit-backdrop-filter: blur(20px) saturate(140%);
	backdrop-filter: blur(20px) saturate(140%);
	border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
	box-shadow:
		0 1px 0 color-mix(in srgb, currentColor 6%, transparent) inset,
		0 30px 60px -28px rgba(0, 0, 0, 0.4),
		0 8px 18px -12px rgba(0, 0, 0, 0.22);
	color: var(--t-fg);
}
.turis-wn__toast[hidden],
.turis-wn__panel[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.turis-wn__toast {
	display: flex;
	align-items: flex-start;
	width: min(330px, calc(100vw - 40px));
	border-radius: var(--t-r-lg);
	padding: 2px;
	opacity: 0;
	transform: translateY(10px) scale(0.98);
	transform-origin: 100% 100%;
	transition:
		opacity var(--t-d-norm) var(--t-ease-out),
		transform 420ms var(--t-ease-spring);
}
.turis-wn__toast.is-in { opacity: 1; transform: translateY(0) scale(1); }

.turis-wn__toast-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding: 13px 6px 14px 15px;
	text-align: left;
	background: none;
	border: 0;
	cursor: pointer;
	color: inherit;
	font: inherit;
}
.turis-wn__toast-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 0.66rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--t-mute);
}
.turis-wn__spark {
	width: 6px;
	height: 6px;
	border-radius: var(--t-r-pill);
	background: var(--t-fg);
	box-shadow: 0 0 0 0 color-mix(in srgb, var(--t-fg) 50%, transparent);
	animation: turis-wn-spark 2.6s var(--t-ease-out) infinite;
}
@keyframes turis-wn-spark {
	0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--t-fg) 45%, transparent); }
	50%      { box-shadow: 0 0 0 5px color-mix(in srgb, var(--t-fg) 0%, transparent); }
}
.turis-wn__toast-title {
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
}
.turis-wn__toast-excerpt {
	font-size: 0.8rem;
	line-height: 1.45;
	color: var(--t-mute);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.turis-wn__toast-close {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin: 8px 8px 0 0;
	border-radius: var(--t-r-pill);
	background: none;
	border: 0;
	cursor: pointer;
	color: var(--t-mute);
	transition: background var(--t-d-fast) var(--t-ease-out), color var(--t-d-fast) var(--t-ease-out);
}
.turis-wn__toast-close:hover {
	background: color-mix(in srgb, currentColor 10%, transparent);
	color: var(--t-fg);
}

/* --------------------------------------------------------------------------
   Panel
   -------------------------------------------------------------------------- */
.turis-wn__panel {
	display: flex;
	flex-direction: column;
	width: min(384px, calc(100vw - 32px));
	max-height: min(560px, calc(100vh - 120px));
	border-radius: var(--t-r-xl);
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px) scale(0.985);
	transform-origin: 100% 100%;
	transition:
		opacity var(--t-d-norm) var(--t-ease-out),
		transform 440ms var(--t-ease-spring);
}
.turis-wn.is-shown .turis-wn__panel { opacity: 1; transform: translateY(0) scale(1); }

.turis-wn__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 12px 14px 18px;
	border-bottom: 1px solid color-mix(in srgb, currentColor 9%, transparent);
}
.turis-wn__head-title {
	flex: 1;
	font-size: 1.05rem;
	font-weight: 600;
	letter-spacing: -0.015em;
}
.turis-wn__head-title[hidden] { display: none; }

.turis-wn__back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 1;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
	color: var(--t-mute);
	font: inherit;
	font-size: 0.82rem;
	font-weight: 550;
	transition: color var(--t-d-fast) var(--t-ease-out);
}
.turis-wn__back:hover { color: var(--t-fg); }
.turis-wn__back[hidden] { display: none; }

.turis-wn__panel-close {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: var(--t-r-pill);
	background: color-mix(in srgb, currentColor 6%, transparent);
	border: 0;
	cursor: pointer;
	color: var(--t-mute);
	transition: background var(--t-d-fast) var(--t-ease-out), color var(--t-d-fast) var(--t-ease-out);
}
.turis-wn__panel-close:hover {
	background: color-mix(in srgb, currentColor 12%, transparent);
	color: var(--t-fg);
}

.turis-wn__scroll {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

/* List */
.turis-wn__list { list-style: none; margin: 0; padding: 6px; }
.turis-wn__list[hidden] { display: none; }
.turis-wn__item { margin: 0; }

.turis-wn__card {
	display: flex;
	flex-direction: column;
	gap: 5px;
	width: 100%;
	padding: 13px 14px;
	border-radius: var(--t-r-md);
	background: none;
	border: 0;
	cursor: pointer;
	text-align: left;
	color: inherit;
	font: inherit;
	transition: background var(--t-d-fast) var(--t-ease-out);
}
.turis-wn__card:hover { background: color-mix(in srgb, currentColor 5%, transparent); }

.turis-wn__card-media {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	margin-bottom: 3px;
	border-radius: var(--t-r-sm);
	background-size: cover;
	background-position: center;
	background-color: var(--t-surface);
}

.turis-wn__card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 0.7rem;
	font-weight: 500;
	color: var(--t-mute);
}
.turis-wn__card-cat {
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--t-fg);
}
.turis-wn__card-dot { opacity: 0.5; }
.turis-wn__card-title {
	font-size: 0.94rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
}
.turis-wn__card-excerpt {
	font-size: 0.82rem;
	line-height: 1.5;
	color: var(--t-mute);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Detail */
.turis-wn__detail { padding: 18px 20px 24px; }
.turis-wn__detail[hidden] { display: none; }
.turis-wn__detail-title {
	margin: 8px 0 0;
	font-size: 1.32rem;
	font-weight: 600;
	line-height: 1.22;
	letter-spacing: -0.02em;
}
.turis-wn__detail-media {
	display: block;
	width: 100%;
	height: auto;
	margin: 16px 0 4px;
	border-radius: var(--t-r-md);
	border: 1px solid color-mix(in srgb, currentColor 8%, transparent);
	background-color: var(--t-surface);
}
.turis-wn__detail-body {
	margin-top: 14px;
	font-family: var(--wp--preset--font-family--sans, inherit);
	font-size: 0.9rem;
	line-height: 1.62;
	color: color-mix(in srgb, var(--t-fg) 88%, var(--t-mute));
}
.turis-wn__detail-body > :first-child { margin-top: 0; }
.turis-wn__detail-body > * { margin: 0 0 0.9em; }
.turis-wn__detail-body h2,
.turis-wn__detail-body h3 {
	font-size: 1.02rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--t-fg);
	margin: 1.3em 0 0.4em;
}
.turis-wn__detail-body a {
	color: var(--t-fg);
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}
/* Media — featured-image hero is handled by .turis-wn__detail-media above;
   these cover anything embedded in the post body: images, GIFs, MP4 video
   blocks, and oEmbed/iframe embeds. All go full-width, rounded, responsive. */
.turis-wn__detail-body :is(figure, .wp-block-image, .wp-block-video, .wp-block-embed) {
	margin: 0 0 0.9em;
}
.turis-wn__detail-body :is(img, video) {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	border-radius: var(--t-r-md);
	background: var(--t-surface);
}
.turis-wn__detail-body :is(iframe, .wp-block-embed__wrapper) {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: var(--t-r-md);
}
.turis-wn__detail-body figcaption {
	margin-top: 0.45em;
	font-size: 0.76rem;
	line-height: 1.45;
	color: var(--t-mute);
	text-align: center;
}
.turis-wn__detail-body ul,
.turis-wn__detail-body ol { padding-left: 1.2em; }
.turis-wn__detail-body li { margin: 0.3em 0; }

/* Footer */
.turis-wn__foot {
	padding: 11px 18px;
	border-top: 1px solid color-mix(in srgb, currentColor 9%, transparent);
}
.turis-wn__all {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 0.82rem;
	font-weight: 560;
	color: var(--t-fg);
	text-decoration: none;
}
.turis-wn__all svg {
	transition: transform var(--t-d-fast) var(--t-ease-out);
}
.turis-wn__all:hover svg { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   Narrow viewports — the Discover HUD spans full width at the bottom, so
   lift the widget above it and let the panel use more height.
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
	.turis-wn { right: 16px; bottom: 86px; }
	.turis-wn__panel { max-height: min(560px, calc(100vh - 180px)); }
	.turis-wn__launcher-label { display: none; }
	.turis-wn__launcher { padding: 9px; }
}

/* ==========================================================================
   /whats-new/ overview page (pattern: turis/whats-new-overview).
   Renders from the same `whats_new` source as the widget.
   ========================================================================== */
.turis-whatsnew__list {
	list-style: none;
	margin: clamp(2rem, 5vw, 3.5rem) 0 0;
	padding: 0;
	max-width: 720px;
}
.turis-whatsnew__entry {
	padding: clamp(1.4rem, 3vw, 2.2rem) 0;
	border-top: 1px solid var(--t-line);
}
.turis-whatsnew__entry:first-child { border-top: 0; }
.turis-whatsnew__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 0.5rem;
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--t-mute);
}
.turis-whatsnew__cat {
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--t-fg);
}
.turis-whatsnew__dot { opacity: 0.5; }
.turis-whatsnew__title {
	margin: 0 0 0.4rem;
	font-size: clamp(1.2rem, 2.4vw, 1.55rem);
	font-weight: 500;
	line-height: 1.22;
	letter-spacing: -0.015em;
}
.turis-whatsnew__excerpt {
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--t-mute);
	max-width: 60ch;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.turis-wn,
	.turis-wn__launcher,
	.turis-wn__toast,
	.turis-wn__panel,
	.turis-wn__all svg { transition-duration: 1ms; }
	.turis-wn__dot::after,
	.turis-wn__spark,
	.turis-wn__launcher::before,
	.turis-wn__toast::before { animation: none; }
	.turis-wn__launcher::before,
	.turis-wn__toast::before { opacity: 0.6; }
}
