/*
Theme Name: IfCalc
Description: The IfCalc design system. Navigation and homepage are generated from the calculator registry, so a new category needs no menu setup.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: ifcalc-theme
*/

/* ---------------------------------------------------------------------------
   Design tokens
   Light is the base. Dark redefines only colour, never spacing or type, so the
   two can never drift apart.
--------------------------------------------------------------------------- */

:root {
	--bg:        #ffffff;
	--surface:   #f6f8f7;
	--surface-2: #eef2f0;
	--ink:       #11161b;
	--ink-2:     #46525e;
	--muted:     #6b7783;
	--line:      #e3e8ea;
	--accent:    #0d6b45;
	--accent-2:  #0a5537;
	--accent-bg: #e9f3ee;
	--on-accent: #ffffff;

	--radius:    12px;
	--radius-sm: 8px;
	--shadow:    0 1px 2px rgba(17, 22, 27, .04), 0 4px 16px rgba(17, 22, 27, .05);
	--shadow-lg: 0 2px 6px rgba(17, 22, 27, .06), 0 18px 48px rgba(17, 22, 27, .10);

	--wrap:      1120px;
	--wrap-text: 720px;

	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	--step--1: clamp(.82rem, .80rem + .10vw, .88rem);
	--step-0:  clamp(1rem, .97rem + .15vw, 1.08rem);
	--step-1:  clamp(1.2rem, 1.13rem + .35vw, 1.4rem);
	--step-2:  clamp(1.5rem, 1.36rem + .70vw, 1.95rem);
	--step-3:  clamp(1.9rem, 1.62rem + 1.4vw, 2.75rem);
	--step-4:  clamp(2.4rem, 1.85rem + 2.7vw, 4rem);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg:        #0f1214;
		--surface:   #161b1e;
		--surface-2: #1d2428;
		--ink:       #eef1f3;
		--ink-2:     #b9c3cb;
		--muted:     #8d9aa5;
		--line:      #2a3237;
		--accent:    #4ade80;
		--accent-2:  #6ee79b;
		--accent-bg: #14261d;
		--on-accent: #07120c;
		--shadow:    0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
		--shadow-lg: 0 2px 6px rgba(0,0,0,.45), 0 18px 48px rgba(0,0,0,.5);
	}
}

:root[data-theme="dark"] {
	--bg:        #0f1214;
	--surface:   #161b1e;
	--surface-2: #1d2428;
	--ink:       #eef1f3;
	--ink-2:     #b9c3cb;
	--muted:     #8d9aa5;
	--line:      #2a3237;
	--accent:    #4ade80;
	--accent-2:  #6ee79b;
	--accent-bg: #14261d;
	--on-accent: #07120c;
	--shadow:    0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
	--shadow-lg: 0 2px 6px rgba(0,0,0,.45), 0 18px 48px rgba(0,0,0,.5);
}

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: var(--step-0);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0 0 .5em;
	font-weight: 700;
	/*
	 * Danish, German, Dutch, Swedish and Norwegian build single words far longer
	 * than a phone column: "Kilometergodtgjørelseskalkulator" is 32 characters and
	 * overflowed the whole document at 320px. hyphens:auto breaks them properly
	 * using the dictionary for the page's lang attribute; overflow-wrap is the
	 * guarantee for browsers or languages with no hyphenation dictionary.
	 */
	hyphens: auto;
	overflow-wrap: break-word;
}

h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); margin-top: 2em; }
h3 { font-size: var(--step-1); margin-top: 1.6em; }

p, ul, ol { margin: 0 0 1.1em; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }

img { max-width: 100%; height: auto; }

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap--text { width: min(100% - 2.5rem, var(--wrap-text)); margin-inline: auto; }

.skip-link {
	position: absolute; left: -9999px;
	background: var(--accent); color: var(--on-accent);
	padding: .7rem 1rem; border-radius: var(--radius-sm); z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.visually-hidden {
	position: absolute; width: 1px; height: 1px;
	padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */

.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--line);
}

.site-header__inner {
	display: flex; align-items: center; gap: 1.25rem;
	min-height: 62px;
}

.logo {
	display: inline-flex; align-items: baseline; gap: .06em;
	font-size: 1.32rem; font-weight: 800; letter-spacing: -.045em;
	color: var(--ink); text-decoration: none; flex: none;
}
.logo:hover { color: var(--ink); }
.logo__if {
	background: var(--accent); color: var(--on-accent);
	padding: .06em .3em .1em; border-radius: 6px;
	font-weight: 800;
}

.nav { display: flex; gap: .15rem; margin-left: .5rem; flex: 1 1 auto; }

/*
 * Direct children only. The search field now lives inside the nav, and its
 * results are links too - inheriting the nav's white-space: nowrap stopped the
 * descriptions wrapping and stretched the dropdown to 854px, and on mobile the
 * `a + a` border doubled up with the results' own dividers.
 */
.nav > a {
	color: var(--ink-2); text-decoration: none;
	padding: .45rem .6rem; border-radius: var(--radius-sm);
	font-size: var(--step--1); font-weight: 600; white-space: nowrap;
}
.nav > a:hover { color: var(--ink); background: var(--surface); }
.nav > a[aria-current="page"] { color: var(--accent); background: var(--accent-bg); }

/* Compact search at the head of the nav row. */
.search--nav { flex: 0 1 200px; min-width: 0; margin-right: .4rem; }
/* .4rem plus a zero-padding input measures 38px - the same as the language
   picker and the menu button beside it. */
.search--nav .search__field { padding: .4rem .6rem; border-radius: var(--radius-sm); }
.search--nav .search__input { font-size: var(--step--1); padding: 0; }
.search--nav .search__field svg { width: 16px; height: 16px; }

/*
 * The field is 200px; the results are not. A calculator name and its one-line
 * description need room, so the panel keeps its own width and hangs from the
 * left edge of the field.
 */
.search--nav .search__results { right: auto; width: 380px; max-width: 90vw; }

.header-tools { display: flex; align-items: center; gap: .4rem; flex: none; }

.icon-btn {
	display: inline-grid; place-items: center;
	width: 38px; height: 38px; padding: 0;
	background: none; border: 1px solid var(--line);
	border-radius: var(--radius-sm); color: var(--ink-2);
	cursor: pointer;
}
.icon-btn:hover { color: var(--ink); background: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; }

.nav-toggle { display: none; }

/*
 * 900px fitted the English nav. Portuguese ("Todas as calculadoras", "Habitação",
 * "Investimento") needs ~1046px, so between 901 and 1045 the nav pushed the
 * language picker off the right edge. The breakpoint follows the longest
 * translation, not English.
 */
@media (max-width: 1100px) {
	.nav {
		position: fixed; inset: 62px 0 auto; flex-direction: column;
		background: var(--bg); border-bottom: 1px solid var(--line);
		padding: .6rem 1.25rem 1.1rem; gap: .1rem; margin: 0;
		box-shadow: var(--shadow-lg);
	}
	.nav[hidden] { display: none; }
	.nav > a { padding: .8rem .4rem; font-size: var(--step-0); border-radius: 0; }
	.nav > a + a { border-top: 1px solid var(--line); }

	/* Full width at the top of the dropdown panel. */
	.search--nav { flex: none; margin: .2rem 0 .7rem; }
	.search--nav .search__field { padding: .6rem .9rem; }
	.search--nav .search__input { font-size: var(--step-0); }
	.search--nav .search__results { right: 0; min-width: 0; }
	.nav-toggle { display: inline-grid; }
}

/* ---------------------------------------------------------------------------
   Search
--------------------------------------------------------------------------- */

.search { --ease: cubic-bezier(.2, .7, .3, 1); position: relative; }

.search__field {
	display: flex; align-items: center; gap: .6rem;
	background: var(--bg); border: 1px solid var(--line);
	border-radius: var(--radius); padding: .5rem .9rem;
	box-shadow: var(--shadow);
	transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search__field:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--muted)); }
.search__field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.search__field svg { width: 20px; height: 20px; color: var(--muted); flex: none; }

.search__input {
	flex: 1; min-width: 0; border: 0; background: none;
	color: inherit; font: inherit; outline: none; padding: .35rem 0;
}

/* The hero field is the primary action on the site, so it is sized like one. */
.search--hero .search__field {
	padding: 1rem 1.25rem;
	border-radius: 14px;
	box-shadow: var(--shadow-lg);
}
.search--hero .search__input { font-size: var(--step-1); }
.search--hero .search__field svg { width: 22px; height: 22px; }

/*
 * The keyboard hint. Shown only where there is a pointer and a physical
 * keyboard to press - on a touch screen it would be a label for a key that
 * does not exist.
 */
.search__kbd kbd {
	font: inherit;
	/* "Ctrl" is four characters where the glyph is one; the gap absorbs it. */
	letter-spacing: 0;
	background: none;
	border: 0;
	padding: 0;
}

.search__kbd {
	display: none;
	flex: none;
	align-items: center;
	gap: .1em;
	padding: .25rem .45rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: var(--surface);
	color: var(--muted);
	font-size: .75rem;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
	.search--hero .search__kbd { display: inline-flex; }
}

.search--hero .search__field:focus-within .search__kbd { opacity: 0; }

.search__results {
	position: absolute; left: 0; right: 0; top: calc(100% + .5rem);
	background: var(--bg); border: 1px solid var(--line);
	border-radius: var(--radius); box-shadow: var(--shadow-lg);
	overflow: hidden; z-index: 60; max-height: 60vh; overflow-y: auto;
	text-align: left;
}
.search__results[hidden] { display: none; }

.search__hit {
	display: flex; align-items: baseline; gap: 1rem;
	padding: .7rem 1rem; text-decoration: none;
	color: var(--ink); border-bottom: 1px solid var(--line);
}
.search__hit:last-child { border-bottom: 0; }
.search__hit:hover,
.search__hit[data-active="true"] { background: var(--accent-bg); color: var(--ink); }

.search__hit-main { flex: 1; min-width: 0; }
.search__hit strong { display: block; font-size: var(--step-0); font-weight: 650; }
.search__hit-main span {
	display: block; font-size: var(--step--1); color: var(--muted);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Which category the match sits in, for telling near-identical names apart. */
.search__hit-cat {
	flex: none;
	font-size: .68rem; font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; color: var(--accent);
}
.search__hit-cat:empty { display: none; }

.search__empty { padding: 1rem; color: var(--muted); font-size: var(--step--1); }

/* ---------------------------------------------------------------------------
   Hero
--------------------------------------------------------------------------- */

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); text-align: center; }

.hero h1 {
	font-size: var(--step-4); letter-spacing: -.04em; margin-bottom: .3em;
}
.hero h1 em {
	font-style: normal; color: var(--accent);
}
.hero__sub {
	font-size: var(--step-1); color: var(--ink-2);
	max-width: 34ch; margin: 0 auto 2rem;
}
.hero__search { max-width: 640px; margin-inline: auto; }

/*
 * Quick actions. Links to the calculator, not chips that type into the field:
 * one step instead of three, and named from the registry so they arrive in the
 * reader's own language.
 */
.hero__quick {
	display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
	margin: 1.25rem 0 0; padding: 0; list-style: none;
}
.hero__quick a {
	--ease: cubic-bezier(.2, .7, .3, 1);
	display: inline-flex; align-items: center; gap: .4rem;
	background: var(--bg); border: 1px solid var(--line);
	border-radius: 999px; padding: .45rem .95rem;
	font-size: var(--step--1); font-weight: 600;
	color: var(--ink-2); text-decoration: none;
	transition: border-color .22s var(--ease), color .22s var(--ease),
	            background-color .22s var(--ease), transform .22s var(--ease);
}
.hero__quick a::after {
	content: "\2192";
	color: var(--accent);
	transition: transform .22s var(--ease);
}
.hero__quick a:hover {
	border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
	color: var(--ink);
	background: var(--accent-bg);
	transform: translateY(-1px);
}
.hero__quick a:hover::after { transform: translateX(2px); }
.hero__quick a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.hero__quick a, .hero__quick a::after, .search__field { transition-duration: .01ms; }
	.hero__quick a:hover { transform: none; }
	.hero__quick a:hover::after { transform: none; }
}

/* ---------------------------------------------------------------------------
   Sections and cards
--------------------------------------------------------------------------- */

.section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); }

.section__head {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap;
}
.section__head h2 { margin: 0; font-size: var(--step-2); }
.section__head p { margin: 0; color: var(--muted); font-size: var(--step--1); }

.grid { display: grid; gap: 1rem; }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(255px, 100%), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }

/*
 * --ease is a gentle overshoot-free curve: quick to leave, slow to settle, so
 * the lift reads as weight rather than a jump.
 */
.card {
	--ease: cubic-bezier(.2, .7, .3, 1);
	display: flex; flex-direction: column; gap: .4rem;
	background: var(--bg); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 1.15rem;
	text-decoration: none; color: var(--ink);
	transition: border-color .22s var(--ease), transform .22s var(--ease),
	            box-shadow .22s var(--ease), background-color .22s var(--ease);
}
.card:hover {
	border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
	color: var(--ink);
	transform: translateY(-3px);
	box-shadow: var(--shadow-lg);
}
.card:focus-visible {
	outline: 2px solid var(--accent); outline-offset: 3px;
	transform: translateY(-3px); box-shadow: var(--shadow-lg);
}
.card__eyebrow {
	font-size: .7rem; font-weight: 700; letter-spacing: .09em;
	text-transform: uppercase; color: var(--accent);
}
.card__title {
	font-size: var(--step-0); font-weight: 700; letter-spacing: -.01em;
	/* Danish and Norwegian titles run past 30 characters in a 255px column. */
	hyphens: auto; overflow-wrap: break-word;
	transition: color .22s var(--ease);
}
.card:hover .card__title { color: var(--accent); }
.card__desc { font-size: var(--step--1); color: var(--muted); line-height: 1.5; margin: 0; }
.card__cta {
	margin-top: auto; padding-top: .7rem;
	font-size: var(--step--1); font-weight: 650; color: var(--accent);
	transition: transform .22s var(--ease);
}
/* Reads as the arrow sliding, without needing its own element. */
.card:hover .card__cta { transform: translateX(3px); }

.cat-card { position: relative; }
.cat-card__icon {
	width: 40px; height: 40px; border-radius: 10px;
	display: grid; place-items: center; margin-bottom: .5rem;
	background: var(--accent-bg); color: var(--accent);
}
.cat-card__icon svg { width: 21px; height: 21px; }
.cat-card__count { font-size: var(--step--1); color: var(--muted); }

.qcard {
	--ease: cubic-bezier(.2, .7, .3, 1);
	display: flex; align-items: flex-start; gap: .7rem;
	background: var(--bg); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 1rem 1.15rem;
	text-decoration: none; color: var(--ink); font-weight: 600;
	line-height: 1.4;
	hyphens: auto; overflow-wrap: break-word;
	transition: border-color .22s var(--ease), transform .22s var(--ease),
	            box-shadow .22s var(--ease);
}
.qcard:hover, .qcard:focus-visible {
	border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
	color: var(--ink);
	transform: translateY(-3px);
	box-shadow: var(--shadow-lg);
}
.qcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* The badge is the only mark that moves, so the eye lands on the question. */
.qcard__if { transition: transform .22s var(--ease); }
.qcard:hover .qcard__if { transform: scale(1.06); }
.qcard__if {
	flex: none; font-size: .7rem; font-weight: 800; letter-spacing: .06em;
	background: var(--accent); color: var(--on-accent);
	border-radius: 5px; padding: .25em .45em; margin-top: .15em;
}

.why { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.why h3 { margin: 0 0 .3em; font-size: var(--step-0); }
.why p { margin: 0; color: var(--muted); font-size: var(--step--1); }
.why__num {
	display: block; font-size: .7rem; font-weight: 800; letter-spacing: .1em;
	color: var(--accent); margin-bottom: .6rem;
}

/* ---------------------------------------------------------------------------
   Page content
--------------------------------------------------------------------------- */

.page-head { padding: 2.5rem 0 .5rem; }

/* ---------------------------------------------------------------------------
   Directory and category pages
--------------------------------------------------------------------------- */

.page-head--directory { padding-bottom: 0; }

.page-head__intro {
	max-width: 58ch;
	margin: -.2rem 0 0;
	font-size: var(--step-1);
	line-height: 1.5;
	color: var(--ink-2);
}

/*
 * Moving between the six collections is the main action on these pages, so the
 * categories sit under the heading rather than only in the site nav.
 */
.catnav {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin: 1.6rem 0 .5rem;
}

.catnav__item {
	--ease: cubic-bezier(.2, .7, .3, 1);
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .45rem .9rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--bg);
	color: var(--ink-2);
	font-size: var(--step--1);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color .2s var(--ease), color .2s var(--ease),
	            background-color .2s var(--ease);
}

.catnav__item:hover {
	border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
	background: var(--accent-bg);
	color: var(--ink);
}

.catnav__item.is-current {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--on-accent);
}

.catnav__item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.catnav__count {
	font-size: .72rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	opacity: .6;
}

.catnav__item.is-current .catnav__count { opacity: .8; }

/*
 * The full directory, in sections. Sixty-five cards in one grid is a wall; six
 * headed lists is something a reader can scan.
 */
.ifc-sections > .ifc-section + .ifc-section {
	margin-top: clamp(2.5rem, 5vw, 3.5rem);
	padding-top: clamp(2rem, 4vw, 2.75rem);
	border-top: 1px solid var(--line);
}

.ifc-section__head { margin-bottom: 1.25rem; }

.ifc-section__title {
	margin: 0 0 .3rem;
	font-size: var(--step-2);
	letter-spacing: -.02em;
	/* The section heading is already scoped by its own block. */
	scroll-margin-top: 5rem;
}

.ifc-section__sub {
	margin: 0;
	max-width: 60ch;
	color: var(--muted);
	font-size: var(--step--1);
}

@media (prefers-reduced-motion: reduce) {
	.catnav__item { transition-duration: .01ms; }
}
.breadcrumbs { font-size: var(--step--1); color: var(--muted); margin-bottom: .6rem; hyphens: auto; overflow-wrap: break-word; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs span { margin: 0 .35rem; opacity: .5; }

.entry { padding-bottom: 4rem; }
.entry h2 { font-size: var(--step-1); }
.entry h3 { font-size: var(--step-0); }

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */

.site-footer {
	background: var(--surface); border-top: 1px solid var(--line);
	padding: 3rem 0 2rem; margin-top: 4rem; font-size: var(--step--1);
}
.footer-grid {
	display: grid; gap: 2rem;
	grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
	margin-bottom: 2.5rem;
}
.site-footer h2 { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom {
	border-top: 1px solid var(--line); padding-top: 1.4rem;
	display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
	color: var(--muted);
}
.footer-note { max-width: 62ch; margin: 0; }

/* ---------------------------------------------------------------------------
   404
--------------------------------------------------------------------------- */

.notfound { padding: clamp(3rem, 9vw, 6rem) 0; text-align: center; }
.notfound__code {
	font-size: var(--step-4); font-weight: 800; color: var(--accent);
	letter-spacing: -.04em; line-height: 1;
}
.notfound .search { max-width: 520px; margin: 2rem auto 0; text-align: left; }

/* ---------------------------------------------------------------------------
   Language picker
   Sits in the header tools next to the menu button, so it costs no horizontal
   space that the navigation needed.
--------------------------------------------------------------------------- */

.langpick { position: relative; flex: none; }

.langpick__btn {
	display: inline-flex; align-items: center; gap: .4rem;
	height: 38px; padding: 0 .6rem;
	background: none; border: 1px solid var(--line);
	border-radius: var(--radius-sm); color: var(--ink-2);
	font: inherit; font-size: var(--step--1); font-weight: 600;
	cursor: pointer; white-space: nowrap;
}
.langpick__btn:hover { color: var(--ink); background: var(--surface); }
.langpick__btn svg { width: 17px; height: 17px; flex: none; }
.langpick__chev { width: 13px !important; height: 13px !important; opacity: .6; }
.langpick__btn[aria-expanded="true"] .langpick__chev { transform: rotate(180deg); }

.langpick__menu {
	position: absolute; right: 0; top: calc(100% + .4rem);
	min-width: 190px; margin: 0; padding: .3rem; list-style: none;
	background: var(--bg); border: 1px solid var(--line);
	border-radius: var(--radius); box-shadow: var(--shadow-lg);
	z-index: 70; max-height: 70vh; overflow-y: auto;
}
.langpick__menu[hidden] { display: none; }

.langpick__menu a {
	display: flex; align-items: center; gap: .55rem;
	padding: .5rem .6rem; border-radius: var(--radius-sm);
	text-decoration: none; color: var(--ink); font-size: var(--step--1);
}
.langpick__menu a:hover { background: var(--surface); color: var(--ink); }
.langpick__menu a[aria-selected="true"] { background: var(--accent-bg); color: var(--accent); font-weight: 650; }
.langpick__flag { font-size: 1.05rem; line-height: 1; }

/* Currency picker: the same dropdown, with a code instead of a flag. */
.currpick__code {
	font-size: var(--step--1);
	font-weight: 650;
	font-variant-numeric: tabular-nums;
	letter-spacing: .02em;
}

.currpick__menu { min-width: 150px; }

.currpick__menu button {
	display: flex; align-items: center; width: 100%;
	padding: .5rem .6rem; border: 0; border-radius: var(--radius-sm);
	background: none; color: var(--ink); font: inherit; cursor: pointer;
	text-align: left;
}
.currpick__menu button:hover { background: var(--surface); }
.currpick__menu button[aria-selected="true"] {
	background: var(--accent-bg); color: var(--accent); font-weight: 650;
}
.currpick__menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/*
 * Says plainly that nothing is converted. Without it a reader switching from
 * dollars to kroner could reasonably assume the figures had been recalculated.
 */
.currpick__note {
	margin: .3rem .15rem 0;
	padding: .55rem .6rem 0;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: .75rem;
	line-height: 1.4;
}

@media (max-width: 420px) {
	/* The globe alone on the narrowest phones; the flags carry the meaning. */
	.langpick__label { display: none; }
	.langpick__btn { padding: 0 .5rem; }
}

/* Discreet offer to switch, never a redirect ------------------------------ */

.lang-offer {
	display: flex; align-items: center; justify-content: center; gap: .9rem;
	flex-wrap: wrap;
	background: var(--accent-bg); color: var(--ink);
	border-bottom: 1px solid var(--line);
	padding: .6rem 1.25rem; font-size: var(--step--1);
}
.lang-offer[hidden] { display: none; }
.lang-offer a { font-weight: 650; }
.lang-offer button {
	background: none; border: 0; color: var(--muted);
	font: inherit; font-size: var(--step--1); cursor: pointer;
	text-decoration: underline; padding: 0;
}
.lang-offer button:hover { color: var(--ink); }

/*
 * Some visitors ask the OS for less motion. Colour and shadow still respond, so
 * nothing loses its affordance - only the travel is removed.
 */
@media (prefers-reduced-motion: reduce) {
	.card, .qcard, .cat-card,
	.card__title, .card__cta,
	.qcard__if {
		transition-duration: .01ms;
	}

	.card:hover, .card:focus-visible,
	.qcard:hover, .qcard:focus-visible {
		transform: none;
	}

	.card:hover .card__cta,
	.qcard:hover .qcard__if {
		transform: none;
	}
}
