/**
 * thedistributed/coverage-globe — "Coverage · Geo-anchored ingest".
 *
 * Scoped view styles reproducing the "===== COVERAGE / SOURCE GLOBE ====="
 * homepage section 1:1. Every value here is lifted verbatim from the mock's
 * inline styles; theme.json presets supply the colours/fonts with the mock's
 * literal hex/family as the fallback, so the block renders identically whether
 * or not the presets are loaded.
 *
 * Tokens: ink #1A1A1B, ink-2 #5C5C5A, ink-3 #8A857C, accent #BE531B,
 * cream #F4F1EA, hair #e7e3da, canvas #FBFBF9.
 * Status: Live #BE531B, Seeded #8A857C, Planned #c9c2b6.
 */

.td-coverage {
	background: var(--wp--preset--color--cream, #F4F1EA);
	border-top: 1px solid #e7e3da;
}

.td-coverage__wrap {
	max-width: 1280px;
	margin: 0 auto;
	padding: clamp(56px, 7vw, 100px) clamp(24px, 5vw, 64px);
}

/* ---- top row ------------------------------------------------------------ */

.td-coverage__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
}

.td-coverage__kicker {
	margin: 0;
	font-family: var(--wp--preset--font-family--geist-mono, "Geist Mono", monospace);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent, #BE531B);
}

.td-coverage__status {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}

.td-coverage__ingest {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--wp--preset--font-family--geist-mono, "Geist Mono", monospace);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink, #1A1A1B);
}

.td-coverage__livedot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wp--preset--color--up, #1B8E4A);
	flex: none;
}

.td-coverage__clock {
	font-family: var(--wp--preset--font-family--geist-mono, "Geist Mono", monospace);
	font-size: 11px;
	letter-spacing: 0.12em;
	color: var(--wp--preset--color--ink, #1A1A1B);
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
}

/* ---- 2-col grid (lede / sphere) ----------------------------------------- */

.td-coverage__grid2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(36px, 5vw, 72px);
	align-items: center;
	margin-top: clamp(36px, 5vw, 64px);
}

.td-coverage__h {
	margin: 0;
	font-family: var(--wp--preset--font-family--fraunces, "Fraunces", serif);
	font-weight: 900;
	font-size: clamp(38px, 5.2vw, 72px);
	line-height: 1.0;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--ink, #1A1A1B);
}

.td-coverage__h i {
	font-style: italic;
	font-weight: 600;
	color: var(--wp--preset--color--accent, #BE531B);
}

.td-coverage__dek {
	margin: 22px 0 0;
	max-width: 46ch;
	font-family: var(--wp--preset--font-family--geist, "Geist", sans-serif);
	font-size: 17px;
	line-height: 1.55;
	color: var(--wp--preset--color--ink-2, #5C5C5A);
}

.td-coverage__dek-em {
	color: var(--wp--preset--color--ink, #1A1A1B);
	font-weight: 500;
}

.td-coverage__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	margin: 22px 0 0;
	padding: 0;
	list-style: none;
	font-family: var(--wp--preset--font-family--geist-mono, "Geist Mono", monospace);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-3, #8A857C);
}

.td-coverage__legend li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.td-coverage__lgdot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex: none;
}

.td-coverage__lgdot--live    { background: var(--wp--preset--color--accent, #BE531B); }
.td-coverage__lgdot--seeded  { background: var(--wp--preset--color--ink-3, #8A857C); }
.td-coverage__lgdot--planned { background: #c9c2b6; }

/* ---- the sphere --------------------------------------------------------- */

/* Canvas globe container (the d3-geo orthographic globe is drawn in view.js). */
.td-coverage__sphere {
	position: relative;
	width: min(100%, 480px);
	aspect-ratio: 1;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Faint sphere placeholder until the globe libs load (or if JS is off). */
.td-coverage__sphere::before {
	content: "";
	position: absolute;
	inset: 6%;
	border-radius: 50%;
	border: 1px solid rgba(190, 83, 27, 0.16);
	background: radial-gradient(120% 120% at 38% 30%, rgba(28, 25, 23, 0.03), rgba(28, 25, 23, 0.10));
	pointer-events: none;
	transition: opacity 0.5s ease;
}
.td-coverage__sphere[data-td-globe-ready="1"]::before {
	opacity: 0;
}

.td-coverage__canvas {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	position: relative;
	z-index: 1;
	touch-action: pan-y;
}

/* selected market label below the marker */
.td-coverage__pin {
	position: absolute;
	left: 50%;
	top: calc(41% + 16px);
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	text-align: center;
	z-index: 2;
	pointer-events: none;
}

.td-coverage__pin-country {
	font-family: var(--wp--preset--font-family--geist-mono, "Geist Mono", monospace);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink, #1A1A1B);
}

.td-coverage__pin-meta {
	font-family: var(--wp--preset--font-family--geist-mono, "Geist Mono", monospace);
	font-size: 9.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.td-coverage__pin-meta--live    { color: var(--wp--preset--color--accent, #BE531B); }
.td-coverage__pin-meta--seeded  { color: var(--wp--preset--color--ink-3, #8A857C); }
.td-coverage__pin-meta--planned { color: #c9c2b6; }

/* ---- caption ------------------------------------------------------------ */

.td-coverage__cap {
	margin: clamp(40px, 5vw, 64px) 0 16px;
	font-family: var(--wp--preset--font-family--geist-mono, "Geist Mono", monospace);
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-3, #8A857C);
}

.td-coverage__cap-accent {
	color: var(--wp--preset--color--accent, #BE531B);
}

/* ---- country grid ------------------------------------------------------- */

.td-coverage__countries {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
	gap: 0;
	/* Hairlines are drawn by the cells themselves (border-right / border-bottom),
	   so a partial last row blends into the page background instead of exposing
	   the container fill as a misaligned grey block. The container supplies only
	   the top + left outer edges. */
	background: transparent;
	border-top: 1px solid #e0dace;
	border-left: 1px solid #e0dace;
}

.td-coverage__cell {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 16px 18px;
	box-sizing: border-box;
	background: var(--wp--preset--color--canvas, #FBFBF9);
	border: 0;
	border-left: 2px solid transparent;
	border-right: 1px solid #e0dace;
	border-bottom: 1px solid #e0dace;
	text-align: left;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
	text-decoration: none;
	color: inherit;
}

.td-coverage__cell:hover {
	background: #fbf7f1;
	border-left-color: var(--wp--preset--color--accent, #BE531B);
}

.td-coverage__cell:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent, #BE531B);
	outline-offset: -2px;
}

/* selected cell: subtle accent-tint + left accent border */
.td-coverage__cell.is-selected {
	background: #fbf3ec;
	border-left-color: var(--wp--preset--color--accent, #BE531B);
}

.td-coverage__cell-l {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.td-coverage__cell-country {
	font-family: var(--wp--preset--font-family--geist, "Geist", sans-serif);
	font-size: 14px;
	font-weight: 500;
	color: var(--wp--preset--color--ink, #1A1A1B);
}

.td-coverage__cell-exch {
	font-family: var(--wp--preset--font-family--geist-mono, "Geist Mono", monospace);
	font-size: 10px;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--ink-3, #8A857C);
}

.td-coverage__cell-r {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	flex: none;
}

.td-coverage__cell-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	flex: none;
}

.td-coverage__cell-dot--live    { background: var(--wp--preset--color--accent, #BE531B); }
.td-coverage__cell-dot--seeded  { background: var(--wp--preset--color--ink-3, #8A857C); }
.td-coverage__cell-dot--planned { background: #c9c2b6; }

.td-coverage__cell-status {
	font-family: var(--wp--preset--font-family--geist-mono, "Geist Mono", monospace);
	font-size: 8.5px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.td-coverage__cell-status--live    { color: var(--wp--preset--color--accent, #BE531B); }
.td-coverage__cell-status--seeded  { color: var(--wp--preset--color--ink-3, #8A857C); }
.td-coverage__cell-status--planned { color: #c9c2b6; }

/* ---- footer line -------------------------------------------------------- */

.td-coverage__foot {
	margin: 28px 0 0;
	max-width: 62ch;
	font-family: var(--wp--preset--font-family--fraunces, "Fraunces", serif);
	font-style: italic;
	font-size: 15px;
	line-height: 1.5;
	color: var(--wp--preset--color--ink-3, #8A857C);
}

/* ---- responsive --------------------------------------------------------- */

@media (max-width: 760px) {
	.td-coverage__grid2 {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.td-coverage__top {
		flex-direction: column;
		gap: 14px;
	}

	.td-coverage__status {
		align-items: flex-start;
	}
}
