/* Jump journal — progression tracker + per-jump entries.
   Colors come from the theme's palette so this stays in step with the site. */

.nga-journal {
	--nga-ink: var(--wp--preset--color--contrast, #0F1E33);
	--nga-accent: var(--wp--preset--color--accent-1, #1E90CE);
	/* Freefall is a legend colour, not a brand one: it has to stay clearly apart from the
	   canopy phase (--nga-sky here, #4FC3F7 on the map), so it does not follow the palette. */
	--nga-freefall: #F2542D;
	--nga-sky: var(--wp--preset--color--accent-3, #1F4E79);
	--nga-slate: var(--wp--preset--color--accent-4, #5B6B7F);
	--nga-wash: var(--wp--preset--color--accent-5, #EEF4F9);
	--nga-line: var(--wp--preset--color--accent-6, #0F1E3326);
	/* Text on ink-filled badges. Ink is the navy text colour, so badge text is the page colour. */
	--nga-on-ink: var(--wp--preset--color--base, #fff);
	/* Entry cards sit on the wash; stats, chips and controls sit one step lighter than the card. */
	--nga-card: var(--nga-wash);
	--nga-tile: color-mix(in srgb, var(--nga-ink) 6%, var(--nga-wash));
	--nga-font: var(--wp--preset--font-family--manrope, system-ui, sans-serif);
}

/* ---------- progression ---------- */
.nga-progress {
	background: var(--nga-wash);
	border-radius: 10px;
	padding: clamp(1.2rem, 3vw, 2rem);
	margin-bottom: 2.5rem;
}
.nga-progress h2 { margin: 0 0 1.2rem; font-size: 1.4rem; }

.nga-cats {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	gap: 0.5rem;
	list-style: none;
	margin: 0 0 1.6rem;
	padding: 0;
}
.nga-cat {
	position: relative;
	text-align: center;
	padding: 0.6rem 0.2rem 0.5rem;
	border-radius: 8px;
	background: transparent;
	border: 1px solid var(--nga-line);
	font-family: var(--nga-font);
}
.nga-cat-letter { display: block; font-weight: 800; font-size: 1.25rem; line-height: 1.1; color: var(--nga-slate); }
.nga-cat-tag { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; min-height: 1em; color: var(--nga-slate); }
.nga-cat-count { display: block; font-size: 0.78rem; font-weight: 700; min-height: 1em; color: var(--nga-slate); font-variant-numeric: tabular-nums; }
.nga-cat.is-done { background: var(--nga-sky); border-color: var(--nga-sky); }
.nga-cat.is-done .nga-cat-letter, .nga-cat.is-done .nga-cat-tag, .nga-cat.is-done .nga-cat-count { color: var(--nga-on-ink); }
.nga-cat.is-current { border-color: var(--nga-accent); border-width: 2px; }
.nga-cat.is-current .nga-cat-letter { color: var(--nga-ink); }
.nga-cat.is-current .nga-cat-tag, .nga-cat.is-current .nga-cat-count { color: var(--nga-accent); }

.nga-req-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 0.9rem 1.6rem;
}
.nga-req-top {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	align-items: baseline;
	font-family: var(--nga-font);
	font-size: 0.9rem;
	margin-bottom: 0.3rem;
}
.nga-req-label { font-weight: 600; }
.nga-req-count { color: var(--nga-slate); font-variant-numeric: tabular-nums; }
.nga-bar { height: 7px; border-radius: 99px; background: var(--nga-tile); border: 1px solid var(--nga-line); overflow: hidden; }
.nga-bar > span { display: block; height: 100%; background: var(--nga-accent); border-radius: 99px; }
.nga-req.is-complete .nga-bar > span { background: var(--nga-sky); }
.nga-req.is-complete .nga-req-count::after { content: " ✓"; color: var(--nga-sky); }

.nga-currency {
	margin: 1.5rem 0 0;
	font-family: var(--nga-font);
	font-size: 0.9rem;
	padding: 0.6rem 0.9rem;
	border-radius: 8px;
	background: var(--nga-tile);
	border-left: 4px solid var(--nga-sky);
}
.nga-currency.is-warn { border-left-color: var(--nga-accent); }
.nga-currency.is-bad { border-left-color: #b3261e; }

/* ---------- jump entries ---------- */
.nga-jump {
	border: 1px solid var(--nga-line);
	border-radius: 10px;
	margin-bottom: 0.8rem;
	background: var(--nga-card);
	overflow: hidden;
}
.nga-jump[open] { border-color: var(--nga-sky); }
.nga-jump > summary {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	padding: 0.9rem 1rem;
	cursor: pointer;
	list-style: none;
	font-family: var(--nga-font);
}
.nga-jump > summary::-webkit-details-marker { display: none; }
.nga-jump > summary:hover { background: var(--nga-tile); }
.nga-jump-num {
	font-weight: 800;
	font-size: 1.05rem;
	color: var(--nga-on-ink);
	background: var(--nga-ink);
	border-radius: 7px;
	padding: 0.35rem 0.55rem;
	min-width: 2.6rem;
	text-align: center;
}
/* Training notes: same shape as a jump, visually quieter since there's no flight data. */
.nga-jump.is-note .nga-jump-num {
	background: transparent;
	color: var(--nga-slate);
	border: 1px dashed var(--nga-line);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.4rem 0.45rem;
}
.nga-jump-head { flex: 1 1 auto; min-width: 0; }
.nga-jump-title { display: block; font-weight: 700; line-height: 1.25; }
.nga-jump-meta { display: block; font-size: 0.82rem; color: var(--nga-slate); }
.nga-jump-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.nga-chip {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--nga-sky);
	background: var(--nga-tile);
	border-radius: 99px;
	padding: 0.2rem 0.6rem;
	white-space: nowrap;
}
.nga-jump-caret {
	flex: 0 0 auto;
	width: 0.6rem; height: 0.6rem;
	border-right: 2px solid var(--nga-slate);
	border-bottom: 2px solid var(--nga-slate);
	transform: rotate(45deg);
	transition: transform 0.15s ease;
}
.nga-jump[open] .nga-jump-caret { transform: rotate(-135deg); }
.nga-jump-body { padding: 0.4rem 1rem 1.3rem; border-top: 1px solid var(--nga-line); }
.nga-jump-body h3 { font-size: 1rem; margin: 1.4rem 0 0.6rem; }
.nga-page-link { margin: 1.2rem 0 0; font-family: var(--nga-font); font-size: 0.85rem; }

/* A jump's own page (/jump/…/): the same body, out of its card and under the page title. */
.nga-jump-page .nga-jump-body { padding: 0; border-top: 0; }
.nga-jump-page .nga-jump-body h2 { font-size: 1.2rem; margin: 1.8rem 0 0.7rem; }
.nga-jump-page-meta { font-family: var(--nga-font); font-size: 0.9rem; color: var(--nga-slate); margin: 0.3rem 0 0; }
.nga-jump-page.is-note .nga-notes { margin-top: 0; border-top: 0; }
.nga-jump-page > .nga-page-link { margin-top: 2rem; }

.nga-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
	gap: 0.6rem;
	margin: 1rem 0 0;
}
.nga-stat { background: var(--nga-tile); border-radius: 8px; padding: 0.6rem 0.7rem; }
.nga-stat-label { display: block; font-family: var(--nga-font); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--nga-slate); }
.nga-stat-value { display: block; font-family: var(--nga-font); font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* Notes close each entry, under the data, so a rule sets them apart from the source footnote. */
.nga-notes { margin-top: 1.2rem; border-top: 1px solid var(--nga-line); }
.nga-notes-todo { margin-top: 1.2rem; font-family: var(--nga-font); font-size: 0.85rem; background: color-mix(in srgb, #d9a400 14%, transparent); border: 1px dashed #d9a400; border-radius: 8px; padding: 0.6rem 0.8rem; }
.nga-hint { color: var(--nga-slate); }

.nga-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.nga-video { margin: 0; }
.nga-video video { width: 100%; height: auto; border-radius: 8px; background: #000; display: block; }
.nga-video figcaption { font-family: var(--nga-font); font-size: 0.78rem; color: var(--nga-slate); margin-top: 0.3rem; }
.nga-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.7rem; }
.nga-photos img { width: 100%; height: auto; border-radius: 8px; display: block; }

/* ---------- flight path ---------- */
.nga-flight-loading { font-family: var(--nga-font); font-size: 0.85rem; color: var(--nga-slate); }
.nga-fp-wrap { display: grid; gap: 0.8rem; }
.nga-fp-note { font-family: var(--nga-font); font-size: 0.8rem; color: var(--nga-slate); margin: 0; }

/* The map needs a real height of its own; everything else stacks under it. */
.nga-fp-map {
	width: 100%;
	aspect-ratio: 16 / 10;
	min-height: 320px;
	background: var(--wp--preset--color--base, #0F1E33);
	border-radius: 10px;
	overflow: hidden;
}
.nga-fp-map.is-svg { aspect-ratio: auto; height: auto; min-height: 0; background: var(--nga-tile); }
.nga-fp-map .maplibregl-ctrl-attrib { font-size: 10px; }
.nga-fp-map canvas { outline: none; }

/* Fullscreen puts the whole wrapper on screen so the playback controls stay usable, which means
   the map has to fill whatever is left rather than holding its 16/10 box. Kept as separate rules:
   a browser that doesn't know one of these selectors would otherwise drop the whole block. */
.nga-fp-wrap:fullscreen {
	box-sizing: border-box; /* the browser sizes this to the screen; the padding must fit inside */
	background: var(--wp--preset--color--base, #FBFCFD);
	padding: 0.8rem;
	grid-template-rows: minmax(0, 1fr) auto;
	overflow: auto;
}
.nga-fp-wrap:fullscreen .nga-fp-map { aspect-ratio: auto; height: 100%; min-height: 0; }
/* Fullscreen is the map plus the playback bar, nothing else — the readout and the altitude
   profile stay behind on the page. */
.nga-fp-wrap:fullscreen .nga-fp-readout,
.nga-fp-wrap:fullscreen .nga-fp-profile { display: none; }
.nga-fp-wrap.maplibregl-pseudo-fullscreen {
	box-sizing: border-box; /* maplibre sets width/height to 100%; the padding must fit inside */
	background: var(--wp--preset--color--base, #FBFCFD);
	padding: 0.8rem;
	grid-template-rows: minmax(0, 1fr) auto;
	overflow: auto;
}
.nga-fp-wrap.maplibregl-pseudo-fullscreen .nga-fp-map { aspect-ratio: auto; height: 100%; min-height: 0; }
.nga-fp-wrap.maplibregl-pseudo-fullscreen .nga-fp-readout,
.nga-fp-wrap.maplibregl-pseudo-fullscreen .nga-fp-profile { display: none; }

/* Exit / deploy / landing / target pins, and the jumper that moves along the track. */
.nga-map-marker { display: flex; align-items: center; gap: 0.35rem; pointer-events: none; }
.nga-map-marker .dot {
	width: 11px; height: 11px; border-radius: 50%;
	background: #fff; border: 2.5px solid var(--wp--preset--color--base, #0F1E33); box-shadow: 0 0 0 1px rgba(255,255,255,0.6);
}
.nga-map-marker .lbl {
	font-family: var(--nga-font); font-size: 0.68rem; font-weight: 700;
	color: #fff; background: rgba(15, 30, 51, 0.78);
	padding: 0.1rem 0.4rem; border-radius: 4px; white-space: nowrap;
}
.nga-map-marker.is-exit .dot { border-color: #F2542D; }
.nga-map-marker.is-deploy .dot { border-color: #4FC3F7; }
.nga-map-marker.is-land .dot { border-color: #fff; background: var(--wp--preset--color--base, #0F1E33); }
.nga-map-marker.is-target .dot { background: transparent; border-style: dashed; border-color: #FFD166; }
.nga-map-jumper {
	width: 16px; height: 16px; border-radius: 50%;
	background: #fff; border: 3px solid #F2542D;
	box-shadow: 0 0 12px rgba(242, 84, 45, 0.9);
	pointer-events: none;
}

.nga-fp-profile { width: 100%; height: auto; background: var(--nga-tile); border-radius: 10px; }
.nga-fp-ptext { font-family: var(--nga-font); font-size: 11px; fill: var(--nga-ink); font-weight: 600; }
.nga-fp-jumprun { fill: none; stroke: var(--nga-slate); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: 0.7; }
.nga-fp-freefall { fill: none; stroke: var(--nga-freefall); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.nga-fp-canopy { fill: none; stroke: var(--nga-sky); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.nga-fp-mark { fill: #fff; stroke: var(--nga-ink); stroke-width: 2; }
.nga-fp-target { fill: none; stroke: var(--nga-ink); stroke-width: 2; stroke-dasharray: 2 2; }
.nga-fp-dot { fill: var(--nga-ink); stroke: #fff; stroke-width: 2; }
.nga-fp-area { fill: color-mix(in srgb, var(--nga-sky) 22%, transparent); stroke: var(--nga-sky); stroke-width: 1.5; }
.nga-fp-vline { stroke: var(--nga-accent); stroke-width: 1.2; stroke-dasharray: 3 3; }

.nga-fp-controls { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-family: var(--nga-font); }
.nga-fp-controls button {
	font: inherit; font-weight: 700; font-size: 0.8rem;
	border: 1px solid var(--nga-line); background: var(--nga-tile); color: var(--nga-ink);
	border-radius: 7px; padding: 0.35rem 0.7rem; cursor: pointer;
}
.nga-fp-controls button:hover { background: color-mix(in srgb, var(--nga-ink) 12%, var(--nga-wash)); }
.nga-fp-speed { display: inline-flex; gap: 0.25rem; }
.nga-fp-speed button.is-on { background: var(--nga-ink); color: var(--nga-on-ink); border-color: var(--nga-ink); }
.nga-fp-range { flex: 1 1 8rem; accent-color: var(--nga-accent); }

.nga-fp-readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: 0.5rem; margin: 0; }
.nga-fp-readout div { background: var(--nga-tile); border-radius: 8px; padding: 0.45rem 0.6rem; }
.nga-fp-readout dt { font-family: var(--nga-font); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--nga-slate); }
.nga-fp-readout dd { margin: 0; font-family: var(--nga-font); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- winds + footer ---------- */
.nga-winds { margin-top: 1.4rem; font-family: var(--nga-font); font-size: 0.85rem; }
.nga-winds summary { cursor: pointer; font-weight: 700; }
.nga-winds table { width: 100%; border-collapse: collapse; margin-top: 0.6rem; }
.nga-winds th, .nga-winds td { text-align: left; padding: 0.25rem 0.5rem; border-bottom: 1px solid var(--nga-line); font-variant-numeric: tabular-nums; }
.nga-archived { margin-top: 1.4rem; font-size: 0.78rem; color: var(--nga-slate); font-family: var(--nga-font); }
.nga-empty { font-family: var(--nga-font); color: var(--nga-slate); }

@media (max-width: 782px) {
	.nga-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.nga-fp-map { min-height: 260px; }
	.nga-jump-chips { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.nga-jump-caret { transition: none; }
}
