/* =========================================================================
   Melissa Kampers X Desk — front-end styles
   Fourth panel of the newsroom console family (Radar, World Signal,
   Video Desk): same tokens, same header signature, same calm. The cards
   are native HTML — no X scripts, no iframes, nothing external.
   ========================================================================= */

.mkxd {
	/* Light tokens (auto appearance on a light theme). */
	--mkxd-card: #ffffff;
	--mkxd-text: #1d2027;
	--mkxd-muted: #565d69;
	--mkxd-border: #dcdfe6;
	--mkxd-accent: #2742e0;
	--mkxd-accent-2: #0b7b86;
	--mkxd-live: #b3173d;
	--mkxd-focus: var(--mkxd-accent);
	--mkxd-shadow: 0 1px 2px rgba(22, 23, 28, 0.04), 0 10px 28px rgba(22, 23, 28, 0.06);
	--mkxd-shadow-up: 0 2px 6px rgba(22, 23, 28, 0.06), 0 20px 48px rgba(22, 23, 28, 0.12);

	max-width: 76rem;
	margin: 1.75em auto;
	font-family: inherit;
	color: var(--mkxd-text);
}

/* Dark tokens, shared by auto-in-dark and always-dark. */
[data-theme="dark"] .mkxd--auto,
.mkxd--dark {
	--mkxd-card: #11141d;
	--mkxd-text: #e8ebf2;
	--mkxd-muted: #9aa4b5;
	--mkxd-border: rgba(141, 164, 255, 0.16);
	--mkxd-accent: #8da4ff;
	--mkxd-accent-2: #34d8c5;
	--mkxd-live: #ff8095;
	--mkxd-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(5, 8, 18, 0.3);
	--mkxd-shadow-up: 0 2px 8px rgba(0, 0, 0, 0.4), 0 22px 52px rgba(5, 8, 18, 0.5);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .mkxd--auto {
		--mkxd-card: #11141d;
		--mkxd-text: #e8ebf2;
		--mkxd-muted: #9aa4b5;
		--mkxd-border: rgba(141, 164, 255, 0.16);
		--mkxd-accent: #8da4ff;
		--mkxd-accent-2: #34d8c5;
		--mkxd-live: #ff8095;
		--mkxd-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(5, 8, 18, 0.3);
		--mkxd-shadow-up: 0 2px 8px rgba(0, 0, 0, 0.4), 0 22px 52px rgba(5, 8, 18, 0.5);
	}
}

/* Header row: the console signature. ------------------------------------- */
.mkxd__head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	padding: 0 0.15rem 0.9rem;
	font-size: 0.6875rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.mkxd__brand {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-weight: 700;
	color: var(--mkxd-text);
}

.mkxd__brand-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--mkxd-accent);
	box-shadow: 0 0 8px var(--mkxd-accent);
}

.mkxd__sub {
	color: var(--mkxd-muted);
	font-weight: 500;
}

.mkxd__updated {
	margin-left: auto;
	color: var(--mkxd-muted);
	font-weight: 500;
	white-space: nowrap;
}

/* The grid ----------------------------------------------------------------- */
.mkxd__grid {
	display: grid;
	gap: 1.1rem;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mkxd--cols-2 .mkxd__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mkxd--cols-4 .mkxd__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 980px) {
	.mkxd__grid,
	.mkxd--cols-2 .mkxd__grid,
	.mkxd--cols-4 .mkxd__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Cards: a native, calm quotation of the post. ----------------------------- */
.mkxd__card {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	padding: 1.1rem 1.2rem 1.15rem;
	background: var(--mkxd-card);
	border: 1px solid var(--mkxd-border);
	border-radius: 16px;
	box-shadow: var(--mkxd-shadow);
	text-decoration: none;
	color: var(--mkxd-text);
	transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.mkxd__card:hover,
.mkxd__card:focus-visible {
	transform: translateY(-4px);
	border-color: var(--mkxd-accent);
	box-shadow: var(--mkxd-shadow-up);
}

.mkxd__card:focus-visible {
	outline: 2px solid var(--mkxd-focus);
	outline-offset: 3px;
}

.mkxd__top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
}

.mkxd__author {
	font-size: 0.875rem;
	letter-spacing: -0.01em;
}

.mkxd__author strong {
	font-weight: 750;
}

.mkxd__handle {
	color: var(--mkxd-muted);
	font-size: 0.8125rem;
}

.mkxd__mark {
	flex-shrink: 0;
	color: var(--mkxd-muted);
	opacity: 0.7;
	transform: translateY(2px);
}

.mkxd__card:hover .mkxd__mark {
	color: var(--mkxd-accent);
	opacity: 1;
}

/* The post text: the card's reason to exist. */
.mkxd__text {
	font-size: 0.95rem;
	line-height: 1.6;
	white-space: pre-line;
	display: -webkit-box;
	-webkit-line-clamp: 7;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mkxd__meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: auto;
	font-size: 0.72rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--mkxd-muted);
}

.mkxd__cta {
	font-weight: 700;
	color: var(--mkxd-accent);
	white-space: nowrap;
}

.mkxd__card:hover .mkxd__cta {
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

/* Screen-reader-only suffix. */
.mkxd-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Mobile: swipe row with scroll-snap, like the Video Desk. ----------------- */
@media (max-width: 640px) {
	.mkxd { margin-inline: 0; }

	.mkxd__sub { display: none; }
	.mkxd__updated { margin-left: 0; }

	.mkxd__grid,
	.mkxd--cols-2 .mkxd__grid,
	.mkxd--cols-4 .mkxd__grid {
		display: flex;
		gap: 0.85rem;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		padding-bottom: 0.5rem;
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}

	.mkxd__card {
		flex: 0 0 80vw;
		max-width: 330px;
		scroll-snap-align: start;
	}
}

/* Reduced motion ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	.mkxd__card { transition: none; }
	.mkxd__card:hover { transform: none; }
}

/* Print: posts are quotations of a live medium; the article carries them. */
@media print {
	.mkxd { display: none; }
}
