/*
 * Nuuk Tops: what Tailwind utilities cannot say cleanly. The markup (templates, Renderer, top.js)
 * carries the rest, so the site's Tailwind build must @source this plugin. It writes
 * [display:flex], not flex: a legacy theme .flex (Magic) also sets flex-grow: 1 and loads later.
 * Site adapters override the tokens below on .nuuk-top. Item colours come inline on each .nt-item.
 * Reveal animations only run when top.js adds .nt-anim (motion allowed, JS on).
 */

.nuuk-top {
	--nt-font-display: "Anton", Impact, "Haettenschweiler", "Arial Narrow Bold", sans-serif;
	--nt-font-body: Georgia, "Times New Roman", serif;
	--nt-ink: #111111;
	--nt-paper: #ffffff;
	--nt-paper-2: #f3f3f1;
	--nt-bar-top: 0px;
	--nt-bar-h: 52px;
	--nt-acc: #d6d6d0;
	--nt-acc-ink: #111111;
	--nt-on-acc: #111111;
	--nt-cta-bg: var(--nt-acc);
	--nt-cta-ink: var(--nt-on-acc);
	--nt-gl: max(16px, env(safe-area-inset-left, 0px));
	--nt-gr: max(16px, env(safe-area-inset-right, 0px));
	--nt-wide: 1320px;
	--nt-cov: clamp(118px, 36vw, 176px);
	--nt-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--nt-ease-io: cubic-bezier(0.7, 0, 0.2, 1);
	/* Spacing utilities count 4px steps here whatever the root font size (18px on Magic). */
	--spacing: 4px;
}

/* Post HTML keeps the site's own spacing scale. */
.nuuk-top .nt-content {
	--spacing: 0.25rem;
}

.nuuk-top *,
.nuuk-top *::before,
.nuuk-top *::after {
	box-sizing: border-box;
}

/* Zero class weight: any utility on the element wins. */
:where(.nuuk-top) img {
	max-width: 100%;
	height: auto;
}

:where(.nuuk-top) button {
	font: inherit;
	color: inherit;
}

.nuuk-top :focus-visible {
	outline: 2px solid var(--nt-acc);
	outline-offset: 2px;
}

.nuuk-top .screen-reader-text {
	/* biome-ignore lint/complexity/noImportantStyles: standard WordPress screen-reader-text rule */
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ===== Full-bleed bands: the background runs past the shell to the viewport edges ===== */
.nuuk-top :is(.nt-bar, .nt-mast, .nt-item, .nt-cta, .nt-foot) {
	box-shadow: 0 0 0 100vmax var(--nt-band, var(--nt-ink));
	clip-path: inset(0 -100vmax);
}

.nuuk-top :is(.nt-mast, .nt-index, .nt-foot) {
	padding-right: max(var(--nt-gr), (100% - 1200px) / 2);
	padding-left: max(var(--nt-gl), (100% - 1200px) / 2);
}

/* ===== Bar ===== */
.nuuk-top .nt-strip {
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
}

.nuuk-top .nt-strip::-webkit-scrollbar {
	display: none;
}

/* Rank pills: up to 100 per page and mostly state, so plain CSS. */
.nuuk-top .nt-pl {
	position: relative;
	flex: none;
	display: inline-grid;
	place-items: center;
	min-width: 38px;
	height: 38px;
	padding: 0 6px;
	border-radius: 2px;
	font: 400 0.98rem / 1 var(--nt-font-display);
	color: #fff;
	text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
	.nuuk-top a.nt-pl:not(.is-cur):hover {
		background: rgba(255, 255, 255, 0.12);
	}
}

.nuuk-top a.nt-pl:focus-visible {
	outline-offset: -2px;
}

/* Optional hue tick under a published rank: set --nt-hue on the pill. */
.nuuk-top .nt-pl::after {
	content: "";
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 4px;
	height: 3px;
	background: var(--nt-hue, transparent);
}

.nuuk-top .nt-pl.is-cur {
	background: #fff;
	color: var(--nt-ink);
}

.nuuk-top .nt-pl.is-cur::after {
	left: 4px;
	right: 4px;
}

.nuuk-top .nt-pl.is-soon {
	color: #6f6f6f;
	cursor: default;
}

.nuuk-top .nt-pl.is-soon::after {
	content: none;
}

.nuuk-top .nt-pl.is-dec {
	margin-left: 10px;
}

.nuuk-top .nt-pl.is-dec::before,
.nuuk-top .nt-pl.is-edge::before {
	content: "";
	position: absolute;
	left: -6px;
	top: 12px;
	bottom: 12px;
	border-left: 1px solid #fff;
	opacity: 0.3;
}

.nuuk-top .nt-pl.is-edge {
	margin-left: 12px;
}

.nuuk-top .nt-pl.is-edge::before {
	left: -8px;
	top: 8px;
	bottom: 8px;
	border-left-width: 2px;
	opacity: 1;
}

/* Controls tapped often: no text selection, no callout, no double-tap zoom delay. */
.nuuk-top :is(.nt-nav__b, .nt-pl, .nt-back) {
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	touch-action: manipulation;
}

/* Press feedback: transform transitions, which the scale utilities (scale property) would not run. */
.nuuk-top :is(.nt-pl, .nt-cta a, .nt-foot__cta) {
	transition:
		background-color 0.2s,
		color 0.2s,
		transform 0.12s var(--nt-ease-out);
}

.nuuk-top .nt-back {
	transition: transform 0.12s var(--nt-ease-out);
}

.nuuk-top .nt-nav__b {
	transition:
		background-color 0.15s,
		color 0.15s,
		border-color 0.15s,
		transform 0.12s var(--nt-ease-out);
}

.nuuk-top :is(.nt-back, a.nt-pl, .nt-cta a, .nt-foot__cta):active {
	transform: scale(0.97);
}

.nuuk-top .nt-nav__b:active {
	transform: scale(0.95);
}

/* Hover peek (created by top.js); exit faster than entry. */
.nuuk-top .nt-peek {
	position: fixed;
	z-index: 50;
	top: 0;
	left: 0;
	opacity: 0;
	transform: translateY(-4px);
	transition:
		opacity 0.12s var(--nt-ease-out),
		transform 0.12s var(--nt-ease-out);
}

.nuuk-top .nt-peek:not(.is-shown) {
	transition-duration: 0.08s;
}

.nuuk-top .nt-peek.is-shown {
	opacity: 1;
	transform: none;
}

/* ===== Mast (hub only) ===== */
.nuuk-top .nt-mast__wm {
	-webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.16);
}

.nuuk-top .nt-hund {
	color: var(--nt-acc);
}

@supports (-webkit-text-stroke: 2px #fff) {
	.nuuk-top .nt-hund {
		color: transparent;
		-webkit-text-stroke: 2px #fff;
	}
}

.nuuk-top .nt-mast__intro p {
	margin: 0 0 0.8em;
}

.nuuk-top .nt-mast__intro > :last-child {
	margin-bottom: 0;
}

.nuuk-top .nt-mast__intro a {
	color: inherit;
	text-underline-offset: 3px;
}

.nuuk-top .nt-mast__status::before {
	content: "";
	flex: none;
	width: 0.62rem;
	height: 0.62rem;
	border-radius: 50%;
	background: var(--nt-acc);
}

.nuuk-top .nt-mast__status.is-done::before {
	background: #fff;
	animation: none;
}

/* ===== Items ===== */
.nuuk-top .nt-item {
	--nt-bg: var(--nt-paper);
	--nt-fg: var(--nt-ink);
	--nt-fg2: #141414;
	--nt-mute: #4a4a4a;
	--nt-rule: var(--nt-ink);
	--nt-acc-txt: var(--nt-acc-ink);
	--nt-box-bg: var(--nt-ink);
	--nt-box-fg: #fff;
	--nt-band: var(--nt-bg);
}

.nuuk-top .nt-item.is-dark {
	--nt-bg: var(--nt-ink);
	--nt-fg: #fff;
	--nt-fg2: rgba(255, 255, 255, 0.88);
	--nt-mute: rgba(255, 255, 255, 0.6);
	--nt-rule: #fff;
	--nt-acc-txt: var(--nt-acc);
	--nt-box-bg: #fff;
	--nt-box-fg: var(--nt-ink);
}

.nuuk-top .nt-photo {
	position: relative;
	height: min(150vw, calc(100svh - var(--nt-bar-top) - var(--nt-bar-h) - 24px), 1000px);
	min-height: 420px;
}

.nuuk-top :is(.nt-photo__img, .nt-cover) img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.nuuk-top .nt-photo__img img {
	filter: grayscale(1) contrast(1.15);
}

.nuuk-top .nt-photo__shade {
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.35) 0,
		rgba(0, 0, 0, 0) 26%,
		rgba(0, 0, 0, 0) 46%,
		rgba(0, 0, 0, 0.9) 100%
	);
}

.nuuk-top .nt-num {
	font-size: min(40vw, 22svh);
}

.nuuk-top .nt-item.is-top10 .nt-num {
	font-size: min(52vw, 30svh);
}

@supports (width: 1cqw) {
	.nuuk-top .nt-num {
		font-size: min(42cqw, 24svh);
	}

	.nuuk-top .nt-item.is-top10 .nt-num {
		font-size: min(56cqw, 32svh);
	}
}

.nuuk-top .nt-photo__txt {
	right: calc(var(--nt-gr) + var(--nt-cov) + 14px);
}

.nuuk-top .nt-photo:not(:has(.nt-cover img)) .nt-photo__txt {
	right: var(--nt-gr);
}

/* Same line height as .nt-box, so each line's colour band never covers the line above. */
.nuuk-top .nt-title {
	font-size: clamp(1.4rem, 6vw, 2.6rem);
	line-height: 1.2;
}

.nuuk-top .nt-item.is-top10 .nt-title {
	font-size: clamp(1.7rem, 7vw, 3.4rem);
}

.nuuk-top .nt-item.is-longword .nt-title {
	font-size: clamp(1.1rem, 4.4vw, 1.9rem);
}

.nuuk-top .nt-cover {
	bottom: calc(var(--nt-cov) * -0.35);
}

.nuuk-top .nt-cover:not(:has(img)) {
	display: none;
}

.nuuk-top .nt-item.is-top1 .nt-photo[data-badge]::before {
	content: attr(data-badge);
	position: absolute;
	z-index: 4;
	top: 16px;
	right: 16px;
	padding: 6px 8px;
	border-radius: 4px;
	background: #fff;
	color: var(--nt-ink);
	font: 400 0.9rem / 1 var(--nt-font-display);
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

/* Body column: children share one measure, the related box a narrower one on phones. */
.nuuk-top .nt-body {
	padding: calc(var(--nt-cov) * 0.35 + 26px) var(--nt-gr) 72px var(--nt-gl);
	max-width: 46rem;
}

.nuuk-top .nt-item:not(:has(.nt-cover img)) .nt-body {
	padding-top: 32px;
}

.nuuk-top .nt-body > * {
	max-width: 40rem;
}

.nuuk-top .nt-body > .nt-related {
	max-width: 30rem;
}

/* Animated underline of fact and footer links. */
.nuuk-top :is(.nt-facts, .nt-foot) a:not(.nt-foot__cta) {
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition: background-size 0.3s;
}

@media (hover: hover) and (pointer: fine) {
	.nuuk-top :is(.nt-facts, .nt-foot) a:not(.nt-foot__cta):hover {
		background-size: 100% 1px;
	}
}

/* Related box: a link when a URL is set. */
.nuuk-top a.nt-related {
	transition: background-color 0.2s;
}

.nuuk-top a.nt-related::after {
	content: "\2197";
	position: absolute;
	right: 14px;
	bottom: 12px;
	font-size: 1rem;
	line-height: 1;
	color: var(--nt-acc);
	transition: transform 0.2s;
}

.nuuk-top .nt-item.is-dark a.nt-related::after,
.nuuk-top .nt-item.is-dark .nt-related__k {
	color: var(--nt-acc-ink);
}

@media (hover: hover) and (pointer: fine) {
	.nuuk-top a.nt-related:hover {
		background: #000;
	}

	.nuuk-top .nt-item.is-dark a.nt-related:hover {
		background: #f0f0ee;
	}

	.nuuk-top a.nt-related:hover::after {
		transform: translate(2px, -2px);
	}

	.nuuk-top a.nt-related:hover .nt-related__t {
		text-decoration: underline;
		text-decoration-thickness: 1px;
		text-underline-offset: 3px;
	}
}

/* Review body: post HTML. */
.nuuk-top .nt-content p,
.nuuk-top .nt-content ul,
.nuuk-top .nt-content ol,
.nuuk-top .nt-content blockquote,
.nuuk-top .nt-content figure {
	margin: 0 0 1.15em;
}

.nuuk-top .nt-content > p:first-of-type {
	display: flow-root;
}

.nuuk-top .nt-content > p:first-of-type::first-letter {
	float: left;
	padding: 0.07em 0.1em 0 0;
	font: 400 3.1em / 0.8 var(--nt-font-display);
	color: var(--nt-acc-txt);
}

.nuuk-top .nt-content a {
	color: inherit;
	text-decoration-color: var(--nt-acc);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.nuuk-top .nt-content h2,
.nuuk-top .nt-content h3,
.nuuk-top .nt-content h4 {
	margin: 1.6em 0 0.6em;
	font: 400 1.2rem / 1.2 var(--nt-font-display);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--nt-fg);
}

.nuuk-top .nt-content blockquote {
	padding-left: 1em;
	border-left: 3px solid var(--nt-acc);
	font-style: italic;
}

.nuuk-top .nt-content iframe,
.nuuk-top .nt-content video,
.nuuk-top .nt-content embed {
	max-width: 100%;
}

.nuuk-top .nt-content figcaption {
	margin-top: 0.4em;
	font-size: 0.8rem;
	color: var(--nt-mute);
}

/* ===== Meter and subscribe band: boxes a site's HTML or top.js fills ===== */
.nuuk-top .nt-item.is-metered .nt-content {
	max-height: 18em;
	overflow: hidden;
}

.nuuk-top .nt-item.is-metered .nt-sig {
	display: none;
}

.nuuk-top .nt-fade {
	position: relative;
	height: 7em;
	margin-top: -7em;
	background: linear-gradient(180deg, transparent, var(--nt-bg));
	pointer-events: none;
}

.nuuk-top .nt-meter {
	margin: 8px 0 0;
	padding: 24px 20px;
	background: var(--nt-box-bg);
	color: var(--nt-box-fg);
	border-top: 4px solid var(--nt-acc);
}

.nuuk-top .nt-cta {
	--nt-band: var(--nt-cta-bg);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
	max-width: var(--nt-wide);
	margin: 0 auto;
	padding: 28px var(--nt-gr) 28px var(--nt-gl);
	background: var(--nt-cta-bg);
	color: var(--nt-cta-ink);
}

.nuuk-top .nt-cta a i {
	position: absolute;
	right: 16px;
	top: 50%;
	width: 40px;
	height: 2px;
	margin-top: -1px;
	background: currentColor;
}

.nuuk-top .nt-cta a i::after {
	content: "";
	position: absolute;
	right: 0;
	top: -4px;
	width: 8px;
	height: 8px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: rotate(45deg);
}

/* Zero net height (no gap between bands) and constant: busy state never shifts the page. */
.nuuk-top .nt-sentinel.is-busy {
	background: linear-gradient(90deg, transparent, var(--nt-acc), transparent) 0 0 / 40% 100% no-repeat;
}

/* ===== Floating prev / next (created by top.js); exit faster than entry ===== */
.nuuk-top .nt-nav {
	position: fixed;
	z-index: 30;
	right: max(16px, env(safe-area-inset-right, 0px));
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	display: flex;
	flex-direction: column;
	gap: 6px;
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition:
		opacity 0.2s var(--nt-ease-out),
		transform 0.2s var(--nt-ease-out);
}

.nuuk-top .nt-nav:not(.is-shown) {
	transition-duration: 0.14s;
}

.nuuk-top .nt-nav.is-shown {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

/* Phones and tablets: smaller buttons, and text keeps clear of them. */
@media (max-width: 959px) {
	.nuuk-top .nt-nav {
		right: max(8px, env(safe-area-inset-right, 0px));
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		gap: 4px;
	}

	.nuuk-top .nt-body,
	.nuuk-top .nt-cta,
	.nuuk-top .nt-index,
	.nuuk-top .nt-foot__links {
		padding-right: calc(max(8px, env(safe-area-inset-right, 0px)) + 52px);
	}
}

/* ===== Desktop: sticky photo column ===== */
@media (min-width: 960px) {
	.nuuk-top {
		--nt-cov: clamp(150px, 14vw, 220px);
	}

	.nuuk-top .nt-photo {
		position: sticky;
		top: calc(var(--nt-bar-top) + var(--nt-bar-h) + 20px);
		height: min(calc(100svh - var(--nt-bar-top) - var(--nt-bar-h) - 40px), 920px);
		min-height: 0;
	}

	.nuuk-top .nt-photo__txt {
		right: calc(var(--nt-cov) + 48px);
	}

	.nuuk-top .nt-photo:not(:has(.nt-cover img)) .nt-photo__txt {
		right: 24px;
	}

	.nuuk-top .nt-cover {
		bottom: 24px;
	}

	.nuuk-top .nt-title {
		font-size: clamp(1.7rem, 2.8vw, 2.7rem);
	}

	.nuuk-top .nt-item.is-top10 .nt-title {
		font-size: clamp(2rem, 3.4vw, 3.4rem);
	}

	.nuuk-top .nt-item.is-longword .nt-title {
		font-size: clamp(1.4rem, 2vw, 2.1rem);
	}

	.nuuk-top .nt-body,
	.nuuk-top .nt-item:not(:has(.nt-cover img)) .nt-body {
		max-width: none;
		padding: 32px 0 12svh;
	}

	.nuuk-top .nt-body > *,
	.nuuk-top .nt-body > .nt-related {
		max-width: 36rem;
	}
}

/* ===== Reveal animations (only with .nt-anim, set by top.js) ===== */
@media (prefers-reduced-motion: no-preference) {
	/* Curtain in the band colour, retracting upwards: a transform, not a clip-path repaint. */
	.nuuk-top.nt-anim .nt-photo__img {
		isolation: isolate;
	}

	.nuuk-top.nt-anim .nt-photo__img::after {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 2;
		background: var(--nt-bg);
		transform-origin: 50% 0;
		transition: transform 0.75s var(--nt-ease-io);
	}

	.nuuk-top.nt-anim .nt-photo__img img {
		transform: scale(1.14);
		transition: transform 1.2s var(--nt-ease-out);
	}

	.nuuk-top.nt-anim .nt-num {
		clip-path: inset(100% 0 -4% 0);
		transition: clip-path 0.55s 0.1s var(--nt-ease-out);
	}

	.nuuk-top.nt-anim .nt-title {
		clip-path: inset(-4px 100% -4px 0);
		transition: clip-path 0.45s 0.15s var(--nt-ease-out);
	}

	.nuuk-top.nt-anim .nt-photo.is-on .nt-photo__img::after {
		transform: scaleY(0);
	}

	.nuuk-top.nt-anim .nt-photo.is-on .nt-photo__img img {
		transform: none;
	}

	.nuuk-top.nt-anim .nt-photo.is-on .nt-num {
		clip-path: inset(-4% 0 -4% 0);
	}

	.nuuk-top.nt-anim .nt-photo.is-on .nt-title {
		clip-path: inset(-4px -4px -4px 0);
	}

	/* Cover rise: top.js writes opacity and transform inline on the cover per frame. */
	.nuuk-top.nt-anim .nt-cover {
		transform-origin: 50% 100%;
	}

	@keyframes nt-blink {
		0%,
		100% {
			opacity: 1;
		}
		50% {
			opacity: 0.35;
		}
	}

	.nuuk-top .nt-mast__status::before {
		animation: nt-blink 1.6s ease-in-out infinite;
	}
}

@media (prefers-reduced-motion: reduce) {
	/* Peek and buttons still fade, without movement. */
	.nuuk-top .nt-peek,
	.nuuk-top .nt-peek:not(.is-shown),
	.nuuk-top .nt-nav,
	.nuuk-top .nt-nav:not(.is-shown) {
		transform: none;
		transition: opacity 0.15s ease;
	}

	.nuuk-top .nt-pl,
	.nuuk-top .nt-back,
	.nuuk-top .nt-foot__cta,
	.nuuk-top .nt-nav__b,
	.nuuk-top .nt-related,
	.nuuk-top .nt-related::after,
	.nuuk-top .nt-facts a,
	.nuuk-top .nt-foot a,
	.nuuk-top .nt-cta a {
		transition: none;
	}
}
