/* Localise-moi — one stylesheet, no framework. */

:root {
	--bg: #f4f6f9;
	--surface: #fff;
	--text: #1b1f24;
	--muted: #5f6b7a;
	--border: #e3e7ed;
	--primary: #1a73e8;
	--primary-hover: #1557b0;
	--primary-soft: #e8f0fe;
	--error: #c5221f;
	--shadow: 0 1px 2px rgb(16 24 40 / 0.06), 0 1px 3px rgb(16 24 40 / 0.08);
	--radius: 14px;
	--header-height: 60px;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0f1216;
		--surface: #181c22;
		--text: #e6e9ee;
		--muted: #98a2b0;
		--border: #2a3039;
		--primary: #8ab4f8;
		--primary-hover: #aecbfa;
		--primary-soft: #1c2a3f;
		--error: #f28b82;
		--shadow: none;
	}
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
	margin: 0;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.6 system-ui, sans-serif;
}

main {
	flex: 1;
}

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

a {
	color: var(--primary);
	text-underline-offset: 2px;
}

a:hover {
	color: var(--primary-hover);
}

h1,
h2,
h3 {
	line-height: 1.25;
	margin: 0 0 0.75rem;
}

h1 {
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	letter-spacing: -0.02em;
}

h2 {
	font-size: 1.2rem;
}

p {
	margin: 0 0 1rem;
}

:is(p, ul, ol, blockquote, details):last-child {
	margin-bottom: 0;
}

code {
	font-size: 0.9em;
	padding: 0.1em 0.35em;
	border-radius: 6px;
	background: var(--primary-soft);
}

[hidden] {
	display: none !important;
}

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

.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	height: var(--header-height);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0 max(1rem, calc((100% - 1080px) / 2));
	background: color-mix(in srgb, var(--surface) 90%, transparent);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 700;
	font-size: 1.15rem;
	color: var(--text);
	text-decoration: none;
}

.brand svg {
	color: var(--primary);
}

.menu-button {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--text);
	cursor: pointer;
}

.menu-button:hover {
	background: var(--primary-soft);
}

.nav-link,
.lang-switch {
	padding: 0.45rem 0.8rem;
	border-radius: 999px;
	color: var(--text);
	font-weight: 500;
	text-decoration: none;
}

.nav-link:hover,
.lang-switch:hover {
	color: var(--primary);
	background: var(--primary-soft);
}

.nav-link[aria-current='page'] {
	color: var(--primary);
	background: var(--primary-soft);
}

.lang-switch {
	border: 1px solid var(--border);
	font-size: 0.85rem;
	letter-spacing: 0.04em;
}

/* Mobile: the nav is a popover opened by the menu button */
.site-nav:popover-open {
	position: fixed;
	inset: calc(var(--header-height) + 8px) 12px auto auto;
	margin: 0;
	min-width: 220px;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.25rem;
	padding: 0.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	box-shadow: 0 10px 30px rgb(0 0 0 / 0.15);
}

.site-nav:popover-open .lang-switch {
	align-self: flex-start;
	margin: 0.25rem 0.5rem;
}

/* Desktop: the nav is always visible */
@media (min-width: 760px) {
	.menu-button {
		display: none;
	}

	.site-nav,
	.site-nav:popover-open {
		position: static;
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 0.25rem;
		min-width: 0;
		margin: 0;
		padding: 0;
		border: 0;
		background: none;
		box-shadow: none;
		overflow: visible;
	}

	.lang-switch {
		margin-left: 0.5rem;
	}
}

/* ---------- Layout ---------- */

.container {
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	padding: 2rem 1rem 3rem;
}

.container.narrow {
	max-width: 820px;
}

.container > * + * {
	margin-top: 1.25rem;
}

.grid {
	display: grid;
	gap: 1.25rem;
}

@media (min-width: 760px) {
	.grid {
		grid-template-columns: 1fr 1fr;
	}
}

.card {
	padding: 1.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.hero {
	padding: 1rem 0 0.5rem;
}

.lead {
	font-size: 1.2rem;
	color: var(--text);
}

.muted {
	color: var(--muted);
}

.error {
	color: var(--error);
	font-weight: 500;
}

/* ---------- Buttons ---------- */

.button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 1.2rem;
	border: 0;
	border-radius: 999px;
	background: var(--primary);
	color: var(--surface);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s;
}

.button:hover {
	background: var(--primary-hover);
	color: var(--surface);
}

.button:disabled {
	opacity: 0.6;
	cursor: progress;
}

/* A button that looks like a link */
.link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--primary);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.link:hover {
	text-decoration: underline;
}

/* ---------- Facts (label / value lists) ---------- */

.facts {
	margin: 0 0 1rem;
}

.facts > div {
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--border);
}

.facts > div:first-child {
	padding-top: 0;
}

.facts > div:last-child {
	border-bottom: 0;
}

.facts dt {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--muted);
}

.facts dd {
	margin: 0.15rem 0 0;
	overflow-wrap: anywhere;
}

.facts dd.big {
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: -0.01em;
}

address {
	font-style: normal;
	white-space: pre-line;
}

/* ---------- Home ---------- */

.travelmap {
	display: grid;
	gap: 1.5rem;
	align-items: center;
}

.travelmap img[alt='TravelMap'] {
	margin-bottom: 0.75rem;
}

@media (prefers-color-scheme: dark) {
	/* Light text for the dark logo, blue icon kept */
	.travelmap img[alt='TravelMap'] {
		filter: invert(1) hue-rotate(180deg);
	}
}

.travelmap > a img {
	display: block;
	border-radius: 10px;
	box-shadow: var(--shadow);
}

@media (min-width: 760px) {
	.travelmap {
		grid-template-columns: 1fr 360px;
	}
}

.ad {
	min-height: 100px;
}

/* ---------- FAQ ---------- */

.toc ol {
	margin: 0;
	padding-left: 1.4rem;
}

.toc li + li {
	margin-top: 0.3rem;
}

blockquote {
	margin: 0 0 1rem;
	padding: 0.25rem 0 0.25rem 1rem;
	border-left: 3px solid var(--primary);
	color: var(--muted);
}

blockquote footer {
	font-size: 0.9rem;
}

details {
	margin-bottom: 0.5rem;
	border: 1px solid var(--border);
	border-radius: 10px;
}

summary {
	padding: 0.75rem 1rem;
	font-weight: 600;
	cursor: pointer;
}

details[open] summary {
	border-bottom: 1px solid var(--border);
}

details > :not(summary) {
	margin: 1rem;
}

details img {
	display: block;
	border-radius: 8px;
}

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

.not-found {
	text-align: center;
	padding: 3rem 1.5rem;
}

/* ---------- Geolocation page ---------- */

.geo {
	display: grid;
}

.geo-map {
	height: 55dvh;
	min-height: 320px;
}

.map {
	position: relative;
	height: 100%;
	background: var(--border);
}

.map-error {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	margin: 0;
	color: var(--muted);
}

.geo-panel {
	display: grid;
	gap: 1rem;
	align-content: start;
	padding: 1rem;
}

.geo-panel h1 {
	font-size: 1.5rem;
	margin: 0;
}

.geo-panel h2 {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

/* Desktop: the page doesn't scroll. Map fixed on the right, only the left panel scrolls. */
@media (min-width: 900px) {
	body:has(.geo) {
		height: 100dvh;
		overflow: hidden;
	}

	body:has(.geo) .site-footer {
		display: none;
	}

	.geo {
		grid-template-columns: 400px 1fr;
		grid-template-rows: minmax(0, 1fr);
		height: calc(100dvh - var(--header-height));
	}

	.geo-map {
		order: 2;
		height: auto;
	}

	.geo-panel {
		overflow-y: auto;
		overscroll-behavior: contain;
	}
}

.help {
	display: grid;
	place-items: center;
	flex: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--primary-soft);
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
}

.pin-blue::before,
.pin-grey::before {
	content: '';
	display: inline-block;
	width: 0.65em;
	height: 0.65em;
	margin-right: 0.45em;
	border-radius: 50%;
	background: #1a73e8;
	box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px #1a73e8;
}

.pin-grey::before {
	background: #8a8f98;
	box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px #8a8f98;
}

select {
	width: 100%;
	padding: 0.65rem 0.8rem;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
}

select:disabled {
	opacity: 0.6;
}

[data-places-count] {
	margin: 0.75rem 0 0;
}

.places-list {
	margin: 0.5rem 0 0;
	padding-left: 1.4rem;
}

.places-list li {
	padding: 0.35rem 0;
}

.places-list small {
	display: block;
	color: var(--muted);
}

.infowindow {
	max-width: 260px;
	color: #1b1f24;
	font: 14px/1.5 system-ui, sans-serif;
}

.infowindow strong {
	display: block;
	margin-bottom: 0.25rem;
}

/* Spinner (map loading) */
.spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 36px;
	height: 36px;
	margin: -18px 0 0 -18px;
	border: 3px solid color-mix(in srgb, var(--primary) 25%, transparent);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

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

.site-footer {
	padding: 1.5rem 1rem;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 0.9rem;
	text-align: center;
}

.site-footer a {
	color: inherit;
}

.noscript {
	display: block;
	padding: 1rem;
	background: var(--error);
	color: #fff;
	text-align: center;
}
