/**
 * IHOF — Global Network section (home page).
 * Editorial Precision aesthetic: dark inked panel, hard edges, single red accent.
 */

body[class*="preset-"] .ihof-mapnet {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(ellipse 62% 56% at 4% 100%, rgba(200, 16, 46, 0.32), transparent 62%),
		radial-gradient(ellipse 44% 38% at 100% 0%, rgba(200, 16, 46, 0.10), transparent 55%),
		radial-gradient(ellipse 56% 42% at 50% 130%, rgba(200, 16, 46, 0.08), transparent 60%),
		var(--ihof-color-ink);
	color: var(--ihof-color-ink-inverse);
	border-bottom: 1px solid rgba(247, 247, 247, 0.08);
}

body[class*="preset-"] .ihof-mapnet > .ihof-red-rule {
	margin: 28px 0 36px;
}

/* Editorial header on the dark band */
body[class*="preset-"] .ihof-mapnet .ihof-section-label,
body[class*="preset-"] .ihof-mapnet .ihof-section-label span {
	color: rgba(247, 247, 247, 0.48);
}

body[class*="preset-"] .ihof-mapnet .ihof-section-label::after {
	background: rgba(247, 247, 247, 0.14);
}

body[class*="preset-"] .ihof-mapnet .ihof-section-head {
	border-bottom-color: rgba(247, 247, 247, 0.18);
}

body[class*="preset-"] .ihof-mapnet .ihof-section-head h2 {
	color: var(--ihof-color-ink-inverse);
}

body[class*="preset-"] .ihof-mapnet .ihof-section-head p {
	color: rgba(247, 247, 247, 0.72);
}

/* ------- Dark map frame ------- */

body[class*="preset-"] .ihof-mapnet-frame {
	position: relative;
	padding: 18px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.005) 40%, transparent 100%),
		rgba(0, 0, 0, 0.32);
	border: 1px solid rgba(247, 247, 247, 0.14);
	color: var(--ihof-color-ink-inverse);
	box-shadow:
		0 24px 60px rgba(0, 0, 0, 0.55),
		0 0 0 1px rgba(0, 0, 0, 0.6) inset;
}

body[class*="preset-"] .ihof-mapnet-frame-rule {
	position: absolute;
	left: 18px;
	right: 18px;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(247, 247, 247, 0.22), transparent);
	pointer-events: none;
	z-index: 2;
}

body[class*="preset-"] .ihof-mapnet-frame-rule-top    { top: 18px; }
body[class*="preset-"] .ihof-mapnet-frame-rule-bottom { bottom: 18px; }

body[class*="preset-"] .ihof-mapnet-corner {
	position: absolute;
	width: 14px;
	height: 14px;
	border: 1px solid var(--ihof-color-accent);
	pointer-events: none;
	z-index: 3;
}

body[class*="preset-"] .ihof-mapnet-corner-tl { top: 8px;    left: 8px;    border-right: 0;  border-bottom: 0; }
body[class*="preset-"] .ihof-mapnet-corner-tr { top: 8px;    right: 8px;   border-left: 0;   border-bottom: 0; }
body[class*="preset-"] .ihof-mapnet-corner-bl { bottom: 8px; left: 8px;    border-right: 0;  border-top: 0;    }
body[class*="preset-"] .ihof-mapnet-corner-br { bottom: 8px; right: 8px;   border-left: 0;   border-top: 0;    }

/* ------- Stage ------- */

body[class*="preset-"] .ihof-mapnet-stage {
	position: relative;
	width: 100%;
	aspect-ratio: 1672 / 941;
	overflow: hidden;
	background: #04050a;
	isolation: isolate;
}

body[class*="preset-"] .ihof-mapnet-ghost {
	position: absolute;
	left: -0.04em;
	top: 50%;
	transform: translateY(-50%);
	color: rgba(247, 247, 247, 0.035);
	font-family: var(--ihof-font-display);
	font-size: min(22vw, 240px);
	font-style: italic;
	font-weight: 300;
	letter-spacing: -0.02em;
	line-height: 1;
	pointer-events: none;
	user-select: none;
	white-space: nowrap;
	z-index: 2;
}

body[class*="preset-"] .ihof-mapnet-layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
}

body[class*="preset-"] .ihof-mapnet-source {
	z-index: 3;
	object-fit: cover;
	filter: saturate(0.9) contrast(1.16) brightness(0.92);
	will-change: opacity, transform, filter;
}

body[class*="preset-"] .ihof-mapnet-puzzle {
	z-index: 5;
	pointer-events: none;
	opacity: 0;
	will-change: opacity;
}

body[class*="preset-"] .ihof-mapnet-target {
	z-index: 7;
	object-fit: cover;
	opacity: 0;
	will-change: opacity, transform;
}

body[class*="preset-"] .ihof-mapnet-tile {
	position: absolute;
	background-repeat: no-repeat;
	background-color: #04050a;
	transform-origin: center;
	will-change: transform, opacity;
	box-shadow:
		inset 0 0 0 1px rgba(0, 0, 0, 0.45),
		0 6px 14px rgba(0, 0, 0, 0.35);
}

/* ------- Pins (Editorial Precision red) ------- */

/* Pin = rectangular hit area covering country shape + leader line + label text.
   Inline custom props position the rectangle (--x/--y/--w/--h) and the
   decorative dot inside it (--dot-x/--dot-y, both % of the rectangle). */
body[class*="preset-"] .ihof-mapnet-pin {
	position: absolute;
	left: var(--x);
	top: var(--y);
	width: var(--w, 4%);
	height: var(--h, 6%);
	z-index: 9;
	opacity: 0;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	will-change: opacity, transform;
}

body[class*="preset-"] .ihof-mapnet-pin:focus-visible {
	outline: 1px dashed rgba(255, 255, 255, 0.55);
	outline-offset: 4px;
}

body[class*="preset-"] .ihof-mapnet-pin:hover .ihof-mapnet-pin-core {
	box-shadow:
		0 0 14px rgba(200, 16, 46, 0.85),
		0 0 36px rgba(200, 16, 46, 0.5);
}

body[class*="preset-"] .ihof-mapnet-pin-core,
body[class*="preset-"] .ihof-mapnet-pin-pulse {
	position: absolute;
	left: var(--dot-x, 50%);
	top: var(--dot-y, 50%);
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	display: block;
	pointer-events: none;
}

body[class*="preset-"] .ihof-mapnet-pin-core {
	background:
		radial-gradient(circle at 50% 42%, #ffeef1 0 16%, var(--ihof-color-accent) 30%, var(--ihof-color-accent-strong) 60%, transparent 78%);
	box-shadow:
		0 0 10px rgba(200, 16, 46, 0.65),
		0 0 26px rgba(200, 16, 46, 0.35);
	transform: scale(0.2);
	will-change: transform;
}

body[class*="preset-"] .ihof-mapnet-pin-pulse {
	border: 1px solid var(--ihof-color-accent);
	transform: scale(0.4);
	opacity: 0;
	will-change: transform, opacity;
}

/* ------- Flash + ambience ------- */

body[class*="preset-"] .ihof-mapnet-flash {
	position: absolute;
	inset: 0;
	z-index: 10;
	background:
		radial-gradient(circle at center, rgba(255, 240, 242, 0.32), rgba(200, 16, 46, 0.22) 38%, transparent 70%);
	mix-blend-mode: screen;
	opacity: 0;
	pointer-events: none;
}

body[class*="preset-"] .ihof-mapnet-stage::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 12;
	pointer-events: none;
	box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.7);
}

/* ------- Ledger (counter + regions + replay) ------- */

body[class*="preset-"] .ihof-mapnet-ledger {
	display: grid;
	grid-template-columns: minmax(180px, 220px) 1fr auto;
	align-items: stretch;
	margin-top: 32px;
	border-top: 1px solid rgba(247, 247, 247, 0.22);
	border-bottom: 1px solid rgba(247, 247, 247, 0.1);
}

body[class*="preset-"] .ihof-mapnet-counter {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 22px 24px;
	border-right: 1px solid rgba(247, 247, 247, 0.1);
}

body[class*="preset-"] .ihof-mapnet-counter-num {
	font-family: var(--ihof-font-display);
	font-size: clamp(56px, 6vw, 88px);
	font-weight: 300;
	letter-spacing: -0.02em;
	line-height: 0.9;
	color: var(--ihof-color-ink-inverse);
	font-variant-numeric: tabular-nums;
}

body[class*="preset-"] .ihof-mapnet-counter-label {
	font-family: var(--ihof-font-mono);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(247, 247, 247, 0.5);
	line-height: 1.4;
}

body[class*="preset-"] .ihof-mapnet-regions {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
}

body[class*="preset-"] .ihof-mapnet-region {
	display: block;
	padding: 0;
	border-right: 1px solid rgba(247, 247, 247, 0.1);
	opacity: 0;
	transform: translateY(8px);
	will-change: opacity, transform;
}

body[class*="preset-"] .ihof-mapnet-region:last-child {
	border-right: 0;
}

body[class*="preset-"] .ihof-mapnet-region-link {
	display: grid;
	grid-template-rows: auto 1fr auto;
	gap: 14px;
	height: 100%;
	padding: 22px 24px;
	color: inherit;
	text-decoration: none;
}

body[class*="preset-"] .ihof-mapnet-region-link:hover,
body[class*="preset-"] .ihof-mapnet-region-link:focus-visible {
	color: var(--ihof-color-ink-inverse);
	outline: none;
}

body[class*="preset-"] .ihof-mapnet-region-link:focus-visible {
	box-shadow: inset 0 0 0 1px rgba(247, 247, 247, 0.55);
}

body[class*="preset-"] .ihof-mapnet-region-link:hover .ihof-mapnet-region-tick,
body[class*="preset-"] .ihof-mapnet-region-link:focus-visible .ihof-mapnet-region-tick {
	width: 42px;
}

body[class*="preset-"] .ihof-mapnet-region-tick {
	width: 28px;
	height: 2px;
	background: var(--ihof-color-accent);
	transition: width 180ms ease;
}

body[class*="preset-"] .ihof-mapnet-region-link > span:nth-child(2) {
	font-family: var(--ihof-font-display);
	font-size: clamp(22px, 2.4vw, 30px);
	font-weight: 400;
	letter-spacing: -0.005em;
	color: var(--ihof-color-ink-inverse);
	line-height: 1;
}

body[class*="preset-"] .ihof-mapnet-region-coord {
	font-family: var(--ihof-font-mono);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(247, 247, 247, 0.5);
}

body[class*="preset-"] .ihof-mapnet-replay {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 0 22px;
	min-height: 44px;
	align-self: center;
	margin: 16px 0 16px 24px;
	border: 1px solid rgba(247, 247, 247, 0.5);
	background: transparent;
	color: var(--ihof-color-ink-inverse);
	font-family: var(--ihof-font-body);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	border-radius: 0;
	transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

body[class*="preset-"] .ihof-mapnet-replay-dot {
	width: 8px;
	height: 8px;
	background: var(--ihof-color-accent);
	box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.22);
	transition: box-shadow 180ms ease;
}

body[class*="preset-"] .ihof-mapnet-replay:hover,
body[class*="preset-"] .ihof-mapnet-replay:focus-visible {
	background: var(--ihof-color-ink-inverse);
	color: var(--ihof-color-ink);
	border-color: var(--ihof-color-ink-inverse);
	outline: none;
}

body[class*="preset-"] .ihof-mapnet-replay:hover .ihof-mapnet-replay-dot,
body[class*="preset-"] .ihof-mapnet-replay:focus-visible .ihof-mapnet-replay-dot {
	box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.36);
}

/* ------- Responsive ------- */

@media (max-width: 900px) {
	body[class*="preset-"] .ihof-mapnet-ledger {
		grid-template-columns: 1fr;
	}

	body[class*="preset-"] .ihof-mapnet-counter,
	body[class*="preset-"] .ihof-mapnet-region {
		border-right: 0;
		border-bottom: 1px solid rgba(247, 247, 247, 0.1);
	}

	body[class*="preset-"] .ihof-mapnet-regions {
		grid-template-columns: 1fr 1fr;
	}

	body[class*="preset-"] .ihof-mapnet-replay {
		margin: 18px 24px;
		justify-self: start;
	}

	body[class*="preset-"] .ihof-mapnet-frame {
		padding: 12px;
	}

	body[class*="preset-"] .ihof-mapnet-frame-rule {
		left: 12px;
		right: 12px;
	}

	body[class*="preset-"] .ihof-mapnet-frame-rule-top    { top: 12px; }
	body[class*="preset-"] .ihof-mapnet-frame-rule-bottom { bottom: 12px; }

	body[class*="preset-"] .ihof-mapnet-corner {
		width: 10px;
		height: 10px;
	}

	body[class*="preset-"] .ihof-mapnet-corner-tl { top: 5px; left: 5px; }
	body[class*="preset-"] .ihof-mapnet-corner-tr { top: 5px; right: 5px; }
	body[class*="preset-"] .ihof-mapnet-corner-bl { bottom: 5px; left: 5px; }
	body[class*="preset-"] .ihof-mapnet-corner-br { bottom: 5px; right: 5px; }
}

@media (max-width: 560px) {
	body[class*="preset-"] .ihof-mapnet-regions {
		grid-template-columns: 1fr;
	}
}

/* ------- Reduced motion ------- */

@media (prefers-reduced-motion: reduce) {
	body[class*="preset-"] .ihof-mapnet-source { opacity: 0; }
	body[class*="preset-"] .ihof-mapnet-target { opacity: 1; }
	body[class*="preset-"] .ihof-mapnet-puzzle { display: none; }
	body[class*="preset-"] .ihof-mapnet-pin { opacity: 1; }
	body[class*="preset-"] .ihof-mapnet-pin-core { transform: scale(1); }
	body[class*="preset-"] .ihof-mapnet-region { opacity: 1; transform: none; }
}
