/*
Theme Name: Migo Foldmap
Theme URI: https://migopprimary.com/
Description: A friend's road atlas, open on the passenger seat: buff map paper, white roads and one orchid felt-pen route with round stop pins.
Version: 1.0.0
Author: Migo
Text Domain: migo-foldmap
*/

/* ---------- Type ---------- */

@font-face {
	font-family: "Recursive";
	src: url("assets/fonts/recursive-casual-latin.woff2") format("woff2");
	font-weight: 500 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Andada Pro";
	src: url("assets/fonts/andada-pro-latin.woff2") format("woff2");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Andada Pro";
	src: url("assets/fonts/andada-pro-italic-latin.woff2") format("woff2");
	font-weight: 400 700;
	font-style: italic;
	font-display: swap;
}

/* ---------- Map tokens ---------- */

:root {
	--land: #f2ecda;
	--land-light: #f8f4e8;
	--crease: rgba(110, 92, 52, 0.09);
	--crease-light: rgba(255, 255, 255, 0.6);
	--paper: #ffffff;
	--casing: #cdc5b0;
	--casing-soft: #e7e0cc;
	--water: #cfe3ea;
	--park: #dce8c8;
	--ink: #1f2420;
	--muted: #5a5d55;
	--route: #a24bc8;
	--route-halo: rgba(162, 75, 200, 0.16);
	--link: #7a2fa3;
	--face-head: "Recursive", "Trebuchet MS", system-ui, sans-serif;
	--face-body: "Andada Pro", Georgia, "Times New Roman", serif;
	--measure: 36rem;
	--panel-radius: 12px;
	--gutter: clamp(1rem, 4vw, 2.5rem);
	--lane: 76px; /* the route's left margin inside a reading panel */
	--lane-x: 30px; /* where the route line runs inside that margin */
}

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

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

body {
	margin: 0;
	color: var(--ink);
	font-family: var(--face-body);
	font-size: 1.125rem;
	line-height: 1.7;
	background-color: var(--land);
	/* Two fold creases: one down the middle of the sheet, one across it. */
	background-image:
		linear-gradient(90deg, transparent calc(50% - 7px), var(--crease) calc(50% - 1px), var(--crease-light) calc(50% + 1px), transparent calc(50% + 7px)),
		linear-gradient(180deg, transparent 0, transparent 41rem, var(--crease) calc(41rem + 6px), var(--crease-light) calc(41rem + 8px), transparent calc(41rem + 14px));
	background-repeat: no-repeat;
	min-height: 100vh;
	overflow-wrap: break-word;
}

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

a {
	color: var(--link);
	text-decoration-thickness: 1.5px;
	text-underline-offset: 0.2em;
}
a:hover {
	text-decoration-color: var(--route);
	text-decoration-thickness: 3px;
}

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

h1,
h2,
h3,
h4 {
	font-family: var(--face-head);
	font-weight: 750;
	line-height: 1.15;
	letter-spacing: -0.005em;
	margin: 0 0 0.6em;
	text-wrap: balance;
}

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

.skip-link {
	position: absolute;
	left: 1rem;
	top: -4rem;
	z-index: 20;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--face-head);
	font-weight: 650;
	padding: 0.6rem 1rem;
	border: 2px solid var(--ink);
	border-radius: 999px;
}
.skip-link:focus {
	top: 1rem;
}

.sheet {
	width: min(100% - 2 * var(--gutter), 74rem);
	margin-inline: auto;
}

/* ---------- Header: the map cover strip ---------- */

.cover {
	background: var(--paper);
	border-bottom: 1.5px solid var(--casing);
	position: relative;
	z-index: 2;
}
.cover__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
	flex-wrap: wrap;
	padding-block: 0.9rem;
}
.cover__logo {
	display: inline-flex;
	line-height: 0;
	border-radius: 8px;
}
.cover__logo img {
	width: 138px;
	height: auto;
}

/* The menu is a small map legend: a framed box of symbol + word entries. */
.legend-nav ul,
.legend-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.legend-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.1rem;
	border: 1.5px solid var(--ink);
	border-radius: 9px;
	padding: 0.35rem 0.9rem;
	background: var(--paper);
}
.legend-nav a,
.legend-list a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	font-family: var(--face-head);
	font-weight: 650;
	font-size: 1rem;
	color: var(--ink);
	text-decoration: none;
}
.legend-nav a::before,
.legend-list a::before,
.legend-entry::before {
	content: "";
	flex: 0 0 auto;
	width: 28px;
	height: 16px;
	background: center / contain no-repeat;
}
.legend-nav li:nth-child(1) a::before {
	background-image: url("assets/legend/car.svg");
}
.legend-nav li:nth-child(2) a::before {
	background-image: url("assets/legend/viewpoint.svg");
}
.legend-nav li:nth-child(n + 3) a::before {
	background-image: url("assets/legend/junction.svg");
}
.legend-nav a:hover {
	color: var(--link);
	text-decoration: underline;
	text-decoration-color: var(--route);
	text-decoration-thickness: 3px;
}
/* The current place carries the orchid stop pin instead of its symbol. */
.legend-nav li.current-menu-item > a::before,
.legend-nav li.current-menu-parent > a::before,
.legend-nav li.current-post-ancestor > a::before,
.legend-nav li.current-menu-ancestor > a::before {
	background: radial-gradient(circle at 50% 50%, var(--paper) 0 3.4px, var(--route) 3.9px 8.4px, transparent 8.9px);
}

/* ---------- Pins and route pieces ---------- */

.pin {
	display: inline-block;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: radial-gradient(circle, var(--paper) 0 4.5px, var(--route) 5px);
	box-shadow: 0 0 0 3px var(--paper);
	flex: 0 0 auto;
}
.pin--start {
	width: 14px;
	height: 14px;
	background: var(--route);
	box-shadow: 0 0 0 3px var(--land);
}
.pin--finish {
	width: 30px;
	height: 30px;
	background: radial-gradient(circle, var(--route) 0 5px, var(--paper) 5.5px 9px, var(--route) 9.5px);
}
.pin--note {
	width: 20px;
	height: 20px;
	background: radial-gradient(circle, var(--paper) 0 5px, var(--route) 5.5px 9.5px, transparent 10px);
	box-shadow: none;
}

/* ---------- Panels ---------- */

.panel {
	background: var(--paper);
	border: 1.5px solid var(--casing);
	border-radius: var(--panel-radius);
	box-shadow: 0 1px 0 rgba(110, 92, 52, 0.12), 0 6px 18px -14px rgba(60, 48, 20, 0.35);
}

/* ---------- Home: the open map ---------- */

.atlas {
	position: relative;
	background: url("assets/map/roads.svg") right top / min(72%, 1100px) auto no-repeat;
}
.atlas__inner {
	position: relative;
	padding-top: clamp(2.5rem, 6vw, 5rem);
}
.atlas__tagline {
	font-size: clamp(2.6rem, 7vw, 5.4rem);
	font-weight: 800;
	line-height: 1.02;
	letter-spacing: -0.02em;
	max-width: 12ch;
	margin: 0;
	text-wrap: balance;
}
.atlas__lede {
	max-width: 30rem;
	margin: 1.1rem 0 0;
	font-size: 1.2rem;
	color: var(--ink);
	background: color-mix(in srgb, var(--land) 82%, transparent);
	border-radius: 8px;
}
.atlas__drive {
	position: relative;
	height: clamp(150px, 20vw, 230px);
	margin-top: 1.4rem;
	margin-left: calc(var(--lane-x) - 7px);
}
.atlas__drive .pin--start {
	position: absolute;
	left: calc((100% - 7px) * 0.38);
	top: 0;
	z-index: 1;
}
.atlas__drive svg {
	position: absolute;
	left: 7px;
	top: 7px;
	width: calc(100% - 7px);
	height: calc(100% - 7px);
	overflow: visible;
	animation: migo-draw 1.8s cubic-bezier(0.45, 0.05, 0.25, 1) 0.3s both;
}
.atlas__drive path {
	fill: none;
	stroke: var(--route);
	vector-effect: non-scaling-stroke;
	stroke-linecap: round;
}
.atlas__drive .halo {
	stroke-width: 11px;
	stroke-opacity: 0.16;
}
.atlas__drive .core {
	stroke-width: 4.5px;
}
@keyframes migo-draw {
	from {
		clip-path: inset(0 0 100% 0);
	}
	to {
		clip-path: inset(0 0 0 0);
	}
}

/* A route of stops, used on the home page and the niche archive. */
.stops {
	list-style: none;
	margin: 0;
	padding: 0 0 0 var(--lane);
	position: relative;
}
.stops::before {
	content: "";
	position: absolute;
	left: calc(var(--lane-x) - 14px);
	top: 0;
	bottom: 2.2rem;
	width: 28px;
	background: url("assets/map/route-wave.svg") center top / 28px 220px repeat-y;
}
.stop {
	position: relative;
	padding-bottom: clamp(2rem, 4vw, 3rem);
}
.stop > .pin {
	position: absolute;
	left: calc(var(--lane-x) - var(--lane) - 12px);
	top: 1.35rem;
}
.stop:last-child {
	padding-bottom: 0;
}

.stop-card {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 0;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
}
.stop-card__map {
	background: var(--land-light);
	border-right: 1.5px solid var(--casing-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem;
}
.stop-card__map img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
}
.stop-card__text {
	padding: clamp(1.2rem, 3vw, 2rem);
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}
.stop-card__title {
	font-size: clamp(1.45rem, 2.6vw, 2rem);
	margin: 0;
}
.stop-card__title a {
	color: var(--ink);
	text-decoration: none;
	background-image: linear-gradient(var(--route), var(--route));
	background-size: 0 3px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size 0.25s ease;
}
.stop-card__title a:hover,
.stop-card__title a:focus-visible {
	background-size: 100% 3px;
}
.stop-card__excerpt {
	margin: 0;
	color: var(--ink);
}
.stop-card__meta {
	margin: auto 0 0;
	font-family: var(--face-head);
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--muted);
}
.stop-card--compact {
	grid-template-columns: 200px minmax(0, 1fr);
}
.stop-card--compact .stop-card__title {
	font-size: 1.35rem;
}

/* A lay-by: a bay set off the route, holding an advertisement. */
.layby {
	position: relative;
	max-width: 46rem;
}
.layby::before {
	content: "";
	position: absolute;
	left: calc(var(--lane-x) - var(--lane));
	top: 2.1rem;
	width: calc(var(--lane) - var(--lane-x) + 4px);
	height: 9px;
	background: var(--paper);
	border-block: 2px solid var(--casing);
}
.layby .area-de-descanso {
	margin: 0;
}

.own-text {
	padding: clamp(1.3rem, 3vw, 2.2rem) clamp(1.2rem, 3vw, 2.4rem);
	max-width: 46rem;
}
.own-text > :first-child {
	margin-top: 0;
}
.own-text > :last-child {
	margin-bottom: 0;
}
.own-text h2 {
	font-size: 1.5rem;
	margin-top: 0;
}
.own-text.prose h2::before {
	content: none;
}

.home-route {
	padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

/* ---------- Advertising: lay-bys and plain panels ---------- */

.area-de-descanso {
	display: block;
	margin: 2.4rem 0;
	padding: 0.6rem 0.75rem 0.75rem;
	background: var(--land-light);
	border: 1.5px solid var(--casing);
	border-radius: 14px;
	text-align: center;
	position: relative;
	clear: both;
}
.area-de-descanso .mojon,
.mojon {
	display: block;
	margin: 0 0 0.45rem;
	text-align: left;
	font-family: var(--face-head);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--muted);
}
.area-de-descanso iframe {
	display: block;
	max-width: 100%;
	margin-inline: auto;
	border: 0;
}
.plain-stop {
	padding-block: 0 clamp(2rem, 5vw, 3.5rem);
}
.plain-stop .area-de-descanso {
	margin: 0;
	background: var(--paper);
	max-width: 62rem;
	margin-inline: auto;
}

/* ---------- Article: title panel ---------- */

.title-panel {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: clamp(1rem, 3vw, 2rem);
	align-items: stretch;
	padding-block: clamp(1.6rem, 4vw, 3rem) clamp(1.4rem, 3vw, 2.2rem);
}
.title-panel__card {
	padding: clamp(1.3rem, 3vw, 2.4rem);
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}
.title-panel h1 {
	font-size: clamp(2rem, 4.4vw, 3.2rem);
	font-weight: 800;
	line-height: 1.06;
	letter-spacing: -0.015em;
	margin: 0;
}
.title-panel__excerpt {
	margin: 0;
	font-size: 1.22rem;
	line-height: 1.55;
	color: var(--ink);
}
.title-panel__map {
	margin: 0;
	padding: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	background: var(--water);
}
.title-panel__map img {
	display: block;
	width: 100%;
	height: auto;
}

.legend-entry {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--face-head);
	font-weight: 650;
	font-size: 0.98rem;
	color: var(--ink);
	text-decoration: none;
	align-self: flex-start;
	min-height: 32px;
	padding: 0.1rem 0.75rem 0.1rem 0.5rem;
	border: 1.5px solid var(--ink);
	border-radius: 8px;
}
a.legend-entry:hover {
	color: var(--link);
}
.legend-entry--car::before {
	background-image: url("assets/legend/car.svg");
}

.byline {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	margin-top: auto;
	padding-top: 1rem;
	border-top: 1.5px solid var(--casing-soft);
	font-family: var(--face-head);
	font-size: 0.95rem;
	line-height: 1.35;
}
.byline img {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	flex: 0 0 auto;
}
.byline__who strong {
	display: block;
	font-weight: 750;
}
.byline__who span,
.byline__when {
	color: var(--muted);
	font-weight: 550;
}
.byline__when {
	margin-left: auto;
	text-align: right;
}
.byline__when span {
	display: block;
}

/* ---------- Article: the reading column with its route margin ---------- */

.reading {
	width: min(100% - 2 * var(--gutter), calc(var(--measure) + var(--lane) + 14rem));
	margin: 0 auto clamp(2.5rem, 6vw, 4.5rem);
	padding: clamp(1.5rem, 4vw, 3rem) clamp(1.2rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 2.5rem) 0;
}
.route-lane {
	position: relative;
	display: flow-root;
	padding-left: var(--lane);
}
.route-lane:not(.finish) {
	padding-bottom: 2.5rem;
}
.route-lane::before {
	content: "";
	position: absolute;
	left: calc(var(--lane-x) - 14px);
	top: 0.6rem;
	bottom: 0;
	width: 28px;
	background: url("assets/map/route-wave.svg") center top / 28px 220px repeat-y;
}
.route-lane > .pin--start {
	position: absolute;
	left: calc(var(--lane-x) - 7px);
	top: 0.35rem;
}

.prose > :first-child {
	margin-top: 0;
}
.prose > :last-child {
	margin-bottom: 0;
}
.prose > :not(figure):not(.legend-table):not(.area-de-descanso):not(table) {
	max-width: var(--measure);
}
.prose p,
.prose ul,
.prose ol,
.prose dl {
	margin: 0 0 1.15em;
}
.prose h2 {
	position: relative;
	font-size: clamp(1.5rem, 2.8vw, 1.85rem);
	margin: 2.6em 0 0.7em;
	scroll-margin-top: 1.5rem;
}
.prose h2::before {
	content: "";
	position: absolute;
	left: calc(var(--lane-x) - var(--lane) - 12px);
	top: 0.05em;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: radial-gradient(circle, var(--paper) 0 4.5px, var(--route) 5px);
	box-shadow: 0 0 0 4px var(--paper);
}
.prose h3 {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 1.9em 0 0.5em;
}
.prose strong {
	font-weight: 700;
}
.prose ul {
	padding-left: 1.3rem;
}
.prose ul li::marker {
	color: var(--route);
}
.prose li + li {
	margin-top: 0.35em;
}

/* Steps: numbered stops along a short spur, only for real sequences. */
.prose ol {
	list-style: none;
	counter-reset: migo-stop;
	padding: 0;
	position: relative;
}
.prose ol > li {
	counter-increment: migo-stop;
	position: relative;
	padding: 0.1rem 0 0.9rem 3rem;
	margin: 0;
}
.prose ol > li::before {
	content: counter(migo-stop);
	position: absolute;
	left: 0;
	top: 0.1rem;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--route);
	color: var(--paper);
	font-family: var(--face-head);
	font-weight: 800;
	font-size: 0.95rem;
	line-height: 2rem;
	text-align: center;
}
.prose ol > li:not(:last-child)::after {
	content: "";
	position: absolute;
	left: calc(1rem - 1.5px);
	top: 2.3rem;
	bottom: 0.1rem;
	width: 3px;
	border-radius: 2px;
	background: var(--route-halo);
}

/* Figures: map drawings laid on the panel, captioned underneath. */
.prose figure,
.prose .wp-block-image {
	margin: 2.2rem 0;
	padding: 0.6rem;
	background: var(--land-light);
	border: 1.5px solid var(--casing);
	border-radius: var(--panel-radius);
}
.prose figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 7px;
}
.prose figcaption {
	padding: 0.65rem 0.35rem 0.15rem;
	font-size: 0.95rem;
	line-height: 1.5;
	font-style: italic;
	color: var(--muted);
}
.prose figcaption strong {
	font-style: normal;
	font-family: var(--face-head);
	font-weight: 700;
	color: var(--ink);
}

/* Tables: a map legend, with an orchid rule under the head row. */
.legend-table {
	margin: 2rem 0;
	overflow-x: auto;
	border: 1.5px solid var(--ink);
	border-radius: 10px;
	background: var(--paper);
}
.legend-table table,
.prose table {
	width: 100%;
	min-width: 34rem;
	border-collapse: collapse;
	font-size: 0.98rem;
	line-height: 1.45;
}
.prose table caption {
	caption-side: top;
	text-align: left;
	padding: 0.75rem 1rem 0.2rem;
	font-family: var(--face-head);
	font-weight: 700;
	font-size: 1rem;
}
.prose th,
.prose td {
	text-align: left;
	vertical-align: top;
	padding: 0.65rem 1rem;
}
.prose thead th {
	font-family: var(--face-head);
	font-weight: 700;
	font-size: 0.92rem;
	border-bottom: 3px solid var(--route);
	white-space: nowrap;
}
.prose tbody tr + tr td,
.prose tbody tr + tr th {
	border-top: 1px solid var(--casing-soft);
}
.prose tbody td:first-child,
.prose tbody th {
	font-family: var(--face-head);
	font-weight: 650;
	font-size: 0.95rem;
}

/* Asides: notes on the way, each marked with a hollow pin. */
.prose aside {
	position: relative;
	margin: 2rem 0;
	padding: 1rem 1.25rem 1rem 3.1rem;
	background: var(--land-light);
	border: 1.5px solid var(--casing);
	border-radius: var(--panel-radius);
	font-size: 1.03rem;
	line-height: 1.6;
}
.prose aside::before {
	content: "";
	position: absolute;
	left: 1rem;
	top: 1.3rem;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: radial-gradient(circle, var(--land-light) 0 5px, var(--route) 5.5px 9.5px, transparent 10px);
}
.prose aside > :first-child {
	margin-top: 0;
}
.prose aside > :last-child {
	margin-bottom: 0;
}

.prose blockquote {
	margin: 2rem 0;
	padding: 0.2rem 0 0.2rem 1.4rem;
	border-left: 5px solid var(--route);
	box-shadow: -6px 0 0 var(--route-halo);
	font-family: var(--face-head);
	font-weight: 600;
	font-size: 1.3rem;
	line-height: 1.4;
}
.prose blockquote p {
	margin: 0 0 0.5em;
}
.prose blockquote p:last-child {
	margin: 0;
}

/* Questions and answers fold out like a map panel. */
.prose details {
	margin: 0.75rem 0;
	border: 1.5px solid var(--casing);
	border-radius: 10px;
	background: var(--paper);
}
.prose details + details {
	margin-top: 0.6rem;
}
.prose summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-height: 44px;
	padding: 0.65rem 1rem;
	font-family: var(--face-head);
	font-weight: 650;
	font-size: 1.05rem;
	line-height: 1.35;
}
.prose summary::-webkit-details-marker {
	display: none;
}
.prose summary::before {
	content: "+";
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 2px solid var(--route);
	color: var(--route);
	font-weight: 800;
	line-height: 22px;
	text-align: center;
	transition: transform 0.2s ease;
}
.prose details[open] summary::before {
	content: "\2212";
}
.prose details > :not(summary) {
	margin: 0;
	padding: 0 1rem 1rem 3.4rem;
}

/* Terms: legend entries. */
.prose dl {
	display: grid;
	grid-template-columns: minmax(7rem, max-content) 1fr;
	gap: 0.55rem 1.1rem;
	padding: 1rem 1.2rem;
	border: 1.5px solid var(--ink);
	border-radius: 10px;
	background: var(--paper);
}
.prose dt {
	font-family: var(--face-head);
	font-weight: 700;
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
}
.prose dt::before {
	content: "";
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--route);
	transform: translateY(-1px);
}
.prose dd {
	margin: 0;
}

.prose code {
	font-size: 0.92em;
	background: var(--land-light);
	padding: 0.05em 0.3em;
	border-radius: 4px;
}

/* Lay-bys inside an article: the bay sits off the route, reached by a short spur. */
.prose .area-de-descanso::before {
	content: "";
	position: absolute;
	left: calc(var(--lane-x) - var(--lane) - 1.5px);
	top: 1.7rem;
	width: calc(var(--lane) - var(--lane-x) + 1.5px);
	height: 9px;
	background: var(--paper);
	border-block: 2px solid var(--casing);
}

/* ---------- Article ending: finish pin, team note, more routes ---------- */

.finish {
	position: relative;
}
.finish.route-lane::before {
	content: none;
}
.finish__pin {
	position: absolute;
	left: calc(var(--lane-x) - 15px);
	top: -15px;
}
.finish__line {
	margin: -15px 0 1.2rem;
	font-family: var(--face-head);
	font-weight: 700;
	font-size: 1.1rem;
	line-height: 30px;
}
.team-note {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	gap: 1rem;
	padding: 1.2rem 1.3rem;
	background: var(--land-light);
	border: 1.5px solid var(--casing);
	border-radius: var(--panel-radius);
	max-width: var(--measure);
}
.team-note img {
	width: 56px;
	height: 56px;
	border-radius: 12px;
}
.team-note h2 {
	font-size: 1.1rem;
	margin: 0 0 0.3rem;
}
.team-note p {
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
}
.more-routes {
	margin-top: 2rem;
	max-width: var(--measure);
}
.more-routes h2 {
	font-size: 1.25rem;
}
.more-routes ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.6rem;
}
.more-routes a {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	gap: 0.75rem;
	align-items: center;
	min-height: 44px;
	padding: 0.55rem 0.9rem;
	border: 1.5px solid var(--casing);
	border-radius: 10px;
	color: var(--ink);
	text-decoration: none;
	font-family: var(--face-head);
	font-weight: 650;
	line-height: 1.3;
}
.more-routes a::before {
	content: "";
	width: 28px;
	height: 16px;
	background: url("assets/legend/road.svg") center / contain no-repeat;
}
.more-routes a:hover {
	border-color: var(--route);
	color: var(--link);
}
.more-routes small {
	display: block;
	font-family: var(--face-body);
	font-weight: 400;
	font-size: 0.95rem;
	color: var(--muted);
}

/* ---------- Archive ---------- */

.legend-box {
	margin-block: clamp(1.6rem, 4vw, 3rem) clamp(1.6rem, 4vw, 2.6rem);
	padding: clamp(1.2rem, 3vw, 2rem) clamp(1.2rem, 3vw, 2.2rem);
	background: var(--paper);
	border: 2px solid var(--ink);
	border-radius: 14px;
	max-width: 50rem;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0.4rem 1.2rem;
	align-items: start;
}
.legend-box__symbol {
	width: 56px;
	height: 32px;
	background: url("assets/legend/car.svg") center / contain no-repeat;
	margin-top: 0.4rem;
}
.legend-box h1 {
	font-size: clamp(2.2rem, 5vw, 3.4rem);
	font-weight: 800;
	margin: 0;
}
.legend-box p {
	grid-column: 2;
	margin: 0;
	font-size: 1.12rem;
	max-width: 38rem;
}
.legend-box--plain {
	grid-template-columns: minmax(0, 1fr);
}
.legend-box--plain p {
	grid-column: 1;
}
.archive-route {
	padding-bottom: clamp(2.5rem, 6vw, 4rem);
}
.pager {
	display: flex;
	gap: 1rem;
	margin-top: 2rem;
	font-family: var(--face-head);
	font-weight: 650;
}

/* ---------- Pages: about, contact, policies, search, missing ---------- */

.page-sheet {
	width: min(100% - 2 * var(--gutter), calc(var(--measure) + 6rem));
	margin: clamp(1.6rem, 4vw, 3rem) auto clamp(2.5rem, 6vw, 4.5rem);
	padding: clamp(1.4rem, 4vw, 3rem) clamp(1.2rem, 4vw, 3rem);
}
.page-sheet__head {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	margin-bottom: 1.4rem;
	padding-bottom: 1.1rem;
	border-bottom: 1.5px solid var(--casing-soft);
}
.page-sheet__head h1 {
	font-size: clamp(2rem, 4.4vw, 2.9rem);
	font-weight: 800;
	margin: 0;
}
.page-sheet .prose h2 {
	font-size: 1.4rem;
	margin-top: 2em;
}
.page-sheet .prose h2::before {
	content: none;
}
.page-sheet .team-note {
	margin-top: 2rem;
}
.page-sheet > h1 {
	font-size: clamp(1.9rem, 4vw, 2.6rem);
	font-weight: 800;
}

.search-form {
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
	margin: 1.2rem 0 0.5rem;
}
.search-form input[type="search"] {
	flex: 1 1 14rem;
	min-height: 48px;
	padding: 0 1rem;
	font: inherit;
	font-size: 1.05rem;
	color: var(--ink);
	background: var(--paper);
	border: 2px solid var(--ink);
	border-radius: 999px;
}
.search-form button,
.button-line {
	min-height: 48px;
	padding: 0 1.3rem;
	font-family: var(--face-head);
	font-weight: 700;
	font-size: 1rem;
	color: var(--paper);
	background: var(--ink);
	border: 2px solid var(--ink);
	border-radius: 999px;
	cursor: pointer;
}
.search-form button:hover {
	background: var(--link);
	border-color: var(--link);
}
.results {
	list-style: none;
	margin: 1.6rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.9rem;
}
.results a {
	display: block;
	padding: 0.9rem 1.1rem;
	border: 1.5px solid var(--casing);
	border-radius: 10px;
	color: var(--ink);
	text-decoration: none;
}
.results a:hover {
	border-color: var(--route);
}
.results strong {
	display: block;
	font-family: var(--face-head);
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--link);
}
.results span {
	display: block;
	color: var(--muted);
	font-size: 1rem;
}
.dead-end {
	display: block;
	width: 100%;
	max-width: 26rem;
	height: auto;
	margin: 0.5rem 0 1.2rem;
}

/* Measurement choice on the cookies page. */
.desvio {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.7rem;
	margin: 1.2rem 0;
	padding: 1rem 1.1rem;
	background: var(--land-light);
	border: 1.5px solid var(--casing);
	border-radius: var(--panel-radius);
}
.desvio button,
.pliegue button {
	min-height: 44px;
	min-width: 7.5rem;
	padding: 0 1.2rem;
	font-family: var(--face-head);
	font-weight: 700;
	font-size: 0.98rem;
	color: var(--ink);
	background: var(--paper);
	border: 2px solid var(--ink);
	border-radius: 999px;
	cursor: pointer;
}
.desvio button:hover,
.pliegue button:hover {
	background: var(--land-light);
}
.etapa {
	flex: 1 1 100%;
	margin: 0;
	font-family: var(--face-head);
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--muted);
}

/* ---------- Footer: the legend panel ---------- */

.foot {
	background: url("assets/map/roads.svg") left bottom / cover no-repeat;
	border-top: 1.5px solid var(--casing-soft);
	padding-block: clamp(2rem, 5vw, 3.5rem);
}
.foot__panel {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
	gap: 1.5rem clamp(1.5rem, 4vw, 3rem);
	padding: clamp(1.3rem, 3vw, 2.2rem);
	background: var(--paper);
	border: 2px solid var(--ink);
	border-radius: 16px;
}
.foot__brand {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
}
.foot__brand img {
	width: 64px;
	height: 64px;
	border-radius: 13px;
}
.foot__name {
	margin: 0;
	font-family: var(--face-head);
	font-weight: 800;
	font-size: 1.35rem;
	line-height: 1.2;
}
.foot__tagline {
	margin: 0.15rem 0 0.8rem;
	color: var(--ink);
}
.foot__publisher {
	margin: 0;
	font-size: 0.98rem;
	line-height: 1.55;
	color: var(--muted);
}
.foot__publisher a {
	color: var(--link);
}
.legend-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 1.5rem;
	align-content: start;
}
.legend-list a {
	font-size: 0.98rem;
	font-weight: 600;
	line-height: 1.25;
}
.legend-list a:hover {
	color: var(--link);
	text-decoration: underline;
	text-decoration-color: var(--route);
}
.legend-list li:nth-child(6n + 1) a::before {
	background-image: url("assets/legend/road.svg");
}
.legend-list li:nth-child(6n + 2) a::before {
	background-image: url("assets/legend/track.svg");
}
.legend-list li:nth-child(6n + 3) a::before {
	background-image: url("assets/legend/lake.svg");
}
.legend-list li:nth-child(6n + 4) a::before {
	background-image: url("assets/legend/park.svg");
}
.legend-list li:nth-child(6n + 5) a::before {
	background-image: url("assets/legend/viewpoint.svg");
}
.legend-list li:nth-child(6n + 6) a::before {
	background-image: url("assets/legend/bridge.svg");
}
.legend-list li.current-menu-item > a::before {
	background: radial-gradient(circle at 50% 50%, var(--paper) 0 3.4px, var(--route) 3.9px 8.4px, transparent 8.9px);
}
.foot__base {
	margin: 1rem 0 0;
	font-family: var(--face-head);
	font-size: 0.85rem;
	font-weight: 550;
	color: var(--muted);
}

/* ---------- The measurement notice: a quiet strip at the foot of the window ---------- */

.pliegue {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 30;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.45rem 0.8rem;
	padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom, 0px));
	background: var(--paper);
	border-top: 1.5px solid var(--casing);
	font-size: 0.9rem;
	line-height: 1.45;
	color: var(--ink);
}
.pliegue p {
	margin: 0;
	flex: 1 1 26rem;
	max-width: 46rem;
}
.pliegue a {
	color: var(--link);
	font-weight: 600;
}
.pliegue button {
	min-width: 6.5rem;
	font-size: 0.92rem;
}
body:has(.pliegue:not([hidden])) .foot {
	padding-bottom: 10rem;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 860px) {
	.title-panel {
		grid-template-columns: minmax(0, 1fr);
	}
	.title-panel__map {
		order: -1;
	}

	.stop-card,
	.stop-card--compact {
		grid-template-columns: minmax(0, 1fr);
	}
	.stop-card__map {
		border-right: 0;
		border-bottom: 1.5px solid var(--casing-soft);
	}
	.foot__panel {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 640px) {
	:root {
		--lane: 40px;
		--lane-x: 14px;
	}
	body {
		font-size: 1.0625rem;
	}
	.cover__inner {
		padding-block: 0.7rem;
	}
	.cover__logo img {
		width: 112px;
	}
	.legend-nav {
		width: 100%;
	}
	.legend-nav ul {
		justify-content: flex-start;
		padding: 0.15rem 0.75rem;
	}
	.atlas {
		background-size: 220% auto;
		background-position: 70% 0;
	}
	.reading {
		width: min(100% - 1.25rem, 40rem);
		padding: 1.3rem 1rem 1.5rem;
	}
	/* On phones the route gives way to a pin before each heading. */
	.route-lane {
		padding-left: 0;
	}
	.route-lane::before,
	.route-lane > .pin--start,
	.prose .area-de-descanso::before {
		display: none;
	}
	.prose h2 {
		padding-left: 2.1rem;
	}
	.page-sheet .prose h2,
	.own-text.prose h2 {
		padding-left: 0;
	}
	.prose h2::before {
		left: 0;
		top: 0.06em;
		box-shadow: none;
	}
	.route-lane:not(.finish) {
		padding-bottom: 0;
	}
	.finish {
		padding-top: 2rem;
	}
	.finish__pin {
		position: static;
		display: block;
		margin-bottom: 0.6rem;
	}
	.finish__line {
		margin-top: 0;
	}
	.byline {
		flex-wrap: wrap;
	}
	.byline__when {
		margin-left: 0;
		text-align: left;
		flex-basis: 100%;
	}
	.legend-box {
		grid-template-columns: minmax(0, 1fr);
	}
	.legend-box p {
		grid-column: 1;
	}
	.legend-list {
		grid-template-columns: minmax(0, 1fr);
	}
	.team-note {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.6rem;
	}
	.team-note img {
		width: 44px;
		height: 44px;
		border-radius: 10px;
	}
	.prose dl {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.2rem;
	}
	.prose dd + dt {
		margin-top: 0.6rem;
	}
	.pliegue {
		font-size: 0.85rem;
		gap: 0.4rem 0.6rem;
		padding-block: 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
	}
	.pliegue p {
		flex-basis: 100%;
	}
	.pliegue button {
		flex: 1 1 0;
		min-width: 0;
	}
	body:has(.pliegue:not([hidden])) .foot {
		padding-bottom: 11rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
	.atlas__drive svg {
		clip-path: none;
	}
}
