/* ============================================================
   SWITALSKI.LAW — Insights / Blog listing (Faza 5.2).
   Port of insights-index.jsx inline styles + Insights.html's .ix-*
   <style> block. Loaded ONLY on the posts-page listing (home.php,
   inc/enqueue.php), AFTER post.css — the featured-card image/fallback
   plate and the "no image" wordmark card reuse post.css's
   .sl-post-hero__img / .sl-post-hero__ph* / .sl-post-related__thumb-tag
   classes rather than re-implementing them (Faza 5.2 brief, ISSUE 2).
   Dark (--ink) page throughout.

   Breakpoints per tokens.css consolidation: 640 / 920 / 1100 (the
   prototype's 1000 folds into 1100, its 860 folds into 920).
   Tokens only — zero hardcoded values.
   ============================================================ */

body.sl-insights-page {
	background: var(--bg-dark);
	color: var(--fg-inv);
}

/* ------------------------------------------------------------
   [hidden] override — assets/js/insights.js toggles this native
   attribute; these components' own `display` rules below would
   otherwise beat the UA [hidden] rule on specificity ties, so the
   override is explicit rather than relied upon by cascade order.
   ------------------------------------------------------------ */
.ix-card[hidden],
.ix-featured[hidden],
.ix-grid[hidden],
.ix-empty[hidden] {
	display: none;
}

/* ------------------------------------------------------------
   Header — eyebrow, H1, lead, dot-mesh wash
   ------------------------------------------------------------ */
.ix-head {
	position: relative;
	overflow: hidden;
	padding: clamp(56px, 7vw, 96px) var(--s-6) 0;
}

.ix-head__mesh {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: radial-gradient(circle at center, var(--hub-mesh-dot) 1px, transparent 1.4px);
	background-size: var(--hub-mesh-size) var(--hub-mesh-size);
	opacity: var(--hub-mesh-opacity-cta);
	-webkit-mask-image: radial-gradient(ellipse 60% 70% at 80% 0%, var(--ink-pure) 0%, transparent 70%);
	mask-image: radial-gradient(ellipse 60% 70% at 80% 0%, var(--ink-pure) 0%, transparent 70%);
}

.ix-head__inner {
	position: relative;
	max-width: var(--container-max);
	margin: 0 auto;
}

.ix-head__h1 {
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
	font-size: var(--t-ix-h1);
	line-height: 0.96;
	letter-spacing: -0.015em;
	color: var(--paper);
	margin: var(--s-1) 0 var(--sp-22);
	max-width: var(--mw-920);
}

.ix-head__sub {
	font-family: var(--font-body);
	font-size: var(--t-ix-sub);
	line-height: 1.55;
	color: var(--n-300);
	margin: 0;
	max-width: var(--mw-680);
}

/* ------------------------------------------------------------
   Body — filter bar, featured card, grid, empty state
   ------------------------------------------------------------ */
.ix-body {
	padding: 0 var(--s-6) clamp(72px, 9vw, 120px);
}

.ix-body__inner {
	max-width: var(--container-max);
	margin: 0 auto;
}

/* Filter bar */
.ix-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-5);
	flex-wrap: wrap;
	padding: 0 0 var(--sp-26);
	margin-bottom: var(--sp-40);
	border-bottom: var(--bw-1) solid var(--border-inv-mid);
}

.ix-bar__pills {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-10);
}

.ix-pill {
	font-family: var(--font-body);
	font-size: var(--fs-13);
	font-weight: 600;
	letter-spacing: 0.01em;
	padding: var(--sp-9) var(--s-4);
	border-radius: var(--r-pill);
	cursor: pointer;
	white-space: nowrap;
	border: var(--bw-1-5) solid var(--border-inv-ctl-2);
	background: transparent;
	color: var(--n-200);
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.ix-pill:hover,
.ix-pill:focus-visible {
	border-color: var(--gold);
	background: var(--gold-tint-10);
	color: var(--gold);
}

.ix-pill.is-active {
	border-color: var(--gold);
	background: var(--gold);
	color: var(--ink);
}

.ix-pill:focus-visible {
	outline: var(--bw-2) solid var(--gold);
	outline-offset: var(--sp-2);
}

.ix-bar__meta {
	display: flex;
	align-items: center;
	gap: var(--sp-14);
}

.ix-meta {
	font-family: var(--font-mono);
	font-size: var(--fs-11);
	color: var(--n-400);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.ix-bar__count {
	font-family: var(--font-mono);
	font-size: var(--fs-11);
	color: var(--n-400);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.ix-bar__sep {
	width: var(--bw-1);
	height: var(--sp-14);
	background: var(--border-inv-ctl-2);
}

.ix-bar__sort {
	font-family: var(--font-mono);
	font-size: var(--fs-11);
	color: var(--gold);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	display: inline-flex;
	align-items: center;
	gap: var(--sp-7);
}

.ix-bar__dot {
	width: var(--sp-5);
	height: var(--sp-5);
	background: var(--gold);
	border-radius: var(--r-pill);
	flex-shrink: 0;
}

/* Shared meta dot (featured + grid cards) */
.ix-dot {
	width: var(--s-1);
	height: var(--s-1);
	background: var(--n-500);
	border-radius: var(--r-pill);
	flex-shrink: 0;
}

.ix-dot--sm {
	width: var(--sp-3);
	height: var(--sp-3);
}

/* Category chip (shared by featured + grid cards) */
.ix-badge {
	font-family: var(--font-mono);
	font-size: var(--fs-10-5);
	padding: var(--sp-5) var(--sp-11);
	background: var(--gold);
	color: var(--ink);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 700;
	white-space: nowrap;
	display: inline-block;
}

.ix-badge--sm {
	font-size: var(--fs-9-5);
	padding: var(--s-1) var(--s-2);
}

/* Read-link (shared by featured + grid cards) */
.ix-readlink {
	font-family: var(--font-body);
	font-weight: 600;
	color: var(--gold);
	display: inline-flex;
	align-items: center;
	gap: var(--sp-7);
	border-bottom: var(--bw-2) solid var(--gold);
	padding-bottom: var(--sp-1);
	align-self: flex-start;
	font-size: var(--fs-14);
}

.ix-readlink--sm {
	font-size: var(--fs-12-5);
}

.ix-readlink__arrow {
	display: inline-block;
	transition: transform .18s ease;
}

.ix-featured:hover .ix-readlink__arrow,
.ix-card:hover .ix-readlink__arrow {
	transform: translateX(var(--sp-3));
}

/* ------------------------------------------------------------
   Featured card — full-width horizontal plate
   ------------------------------------------------------------ */
.ix-featured {
	display: grid;
	grid-template-columns: var(--ix-featured-primary) 1fr;
	gap: 0;
	background: var(--surface-inv-card);
	border: var(--bw-1) solid var(--border-inv-row);
	box-shadow: var(--shadow-card-gold-lg);
	text-decoration: none;
	overflow: hidden;
	margin-bottom: var(--sp-40);
	transition: transform .2s ease, box-shadow .2s ease;
	animation: ixFade .5s ease both;
}

.ix-featured:hover,
.ix-featured:focus-visible {
	box-shadow: 0 0 0 0 var(--gold);
	transform: translate(var(--s-2), var(--s-2));
}

.ix-featured:focus-visible {
	outline: var(--bw-2) solid var(--gold);
	outline-offset: var(--sp-3);
}

.ix-featured__visual {
	position: relative;
	min-height: var(--ix-featured-visual-min);
	background: var(--ink-pure);
	overflow: hidden;
}

.ix-featured__visual img {
	transition: transform .6s ease;
}

.ix-featured:hover .ix-featured__visual img {
	transform: scale(1.035);
}

.ix-featured__ribbon {
	position: absolute;
	top: var(--sp-18);
	left: var(--sp-18);
	font-family: var(--font-mono);
	font-size: var(--fs-9-5);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold);
	border: var(--bw-1) solid var(--gold-line-50);
	padding: var(--s-1) var(--sp-9);
	background: var(--ix-scrim);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.ix-featured__body {
	display: flex;
	flex-direction: column;
	gap: var(--sp-18);
	justify-content: center;
	padding: var(--ix-featured-pad);
}

.ix-featured__meta {
	display: flex;
	align-items: center;
	gap: var(--s-3);
	flex-wrap: wrap;
}

.ix-featured__title {
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
	font-size: var(--t-ix-featured-title);
	line-height: 1.02;
	letter-spacing: -0.01em;
	color: var(--paper);
	margin: 0;
}

.ix-featured__excerpt {
	font-family: var(--font-body);
	font-size: var(--fs-16);
	line-height: 1.6;
	color: var(--n-200);
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ------------------------------------------------------------
   Grid — vertical cards
   ------------------------------------------------------------ */
.ix-grid {
	display: grid;
	grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
	gap: var(--s-5);
	align-items: stretch;
}

.ix-grid.ix-grid--single {
	grid-template-columns: minmax(0, 560px);
}

.ix-card {
	display: flex;
	flex-direction: column;
	background: var(--surface-inv-card);
	border: var(--bw-1) solid var(--border-inv-row);
	text-decoration: none;
	overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
	animation: ixFade .5s ease both;
}

.ix-card:hover,
.ix-card:focus-visible {
	background: var(--surface-inv-card-hover);
	box-shadow: var(--shadow-card-gold-md);
	transform: translate(calc(-1 * var(--s-1)), calc(-1 * var(--s-1)));
}

.ix-card:focus-visible {
	outline: var(--bw-2) solid var(--gold);
	outline-offset: var(--sp-3);
}

.ix-card__thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--ink-pure);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ix-card__thumb img {
	transition: transform .5s ease;
}

.ix-card:hover .ix-card__thumb img {
	transform: scale(1.04);
}

.ix-card__thumb .ix-badge {
	position: absolute;
	top: var(--s-3);
	left: var(--s-3);
}

.ix-card__body {
	padding: var(--sp-20) var(--sp-22) var(--sp-22);
	display: flex;
	flex-direction: column;
	gap: var(--s-3);
	flex: 1;
}

.ix-card__meta {
	display: flex;
	align-items: center;
	gap: var(--sp-9);
}

.ix-card__title {
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
	font-size: var(--fs-20);
	line-height: 1.12;
	letter-spacing: -0.005em;
	color: var(--paper);
	margin: 0;
}

.ix-card .ix-readlink {
	margin-top: auto;
	padding-top: var(--s-1);
}

/* ------------------------------------------------------------
   Empty state
   ------------------------------------------------------------ */
.ix-empty {
	border: var(--bw-1) dashed var(--border-inv-ctl-2);
	padding: var(--s-8) var(--s-6);
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--s-3);
}

.ix-empty__title {
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
	font-size: var(--fs-24);
	color: var(--paper);
	letter-spacing: -0.005em;
}

.ix-empty__body {
	font-family: var(--font-body);
	font-size: var(--fs-15);
	color: var(--n-300);
	margin: 0;
	max-width: var(--mw-480);
}

/* ------------------------------------------------------------
   Entrance animation — reduced-motion is handled globally by
   base.css's kill switch (animation-duration → 0.01ms).
   ------------------------------------------------------------ */
@keyframes ixFade {
	from { opacity: 0; transform: translateY(var(--sp-14)); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1100px) {
	.ix-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 920px) {
	.ix-featured {
		grid-template-columns: 1fr;
	}

	.ix-featured__visual {
		min-height: var(--mw-160);
		aspect-ratio: 16 / 9;
	}
}

@media (max-width: 640px) {
	.ix-grid {
		grid-template-columns: 1fr;
	}
}
