/* The TGL Dispatch — editorial layer. Loads after tgl-design on Dispatch views and the homepage.
   Built on the base tokens (src/styles/tokens.css); category tints are the only new colours. */

.dispatch { --dx-tint: var(--accent); --dx-wide: min(100% - 2 * var(--gutter), var(--container-wide, 1600px)); }
.dispatch .container { width: var(--dx-wide); }
.dx-measure { max-width: 46rem; }
.dispatch .container.dx-measure { width: min(100% - 2 * var(--gutter), 46rem); }

/* Category tints: restrained, one per desk. */
.dx-cat--gaming { --dx-tint: #2be4ff; }
.dx-cat--pc-hardware { --dx-tint: #7aa2ff; }
.dx-cat--retro-classics { --dx-tint: #ffb547; }
.dx-cat--cars-motorsport { --dx-tint: #ff5d5d; }
.dx-cat--music-entertainment { --dx-tint: #c08bff; }
.dx-cat--game-servers { --dx-tint: #5ee6a8; }
.dx-cat--tgl-community { --dx-tint: var(--violet-glow, #8b6cff); }

/* ---------- Breadcrumbs ---------- */
.dx-crumbs ol { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; margin: 0 0 1.5rem; padding: 0; list-style: none;
  font: 500 0.78rem/1.4 var(--font-sans); color: var(--fg-faint); }
.dx-crumbs li + li::before { content: "/"; margin-right: 0.6rem; opacity: 0.5; }
.dx-crumbs a { color: var(--fg-muted); text-decoration: none; }
.dx-crumbs a:hover, .dx-crumbs a:focus-visible { color: var(--fg); text-decoration: underline; }
.dx-crumbs [aria-current] { color: var(--fg); overflow-wrap: anywhere; }

/* ---------- Masthead ---------- */
.dx-masthead { padding: calc(var(--nav-h, 80px) + clamp(2rem, 5vw, 4.5rem)) 0 clamp(1.5rem, 3vw, 2.5rem);
  background:
    radial-gradient(60% 120% at 85% 0%, rgb(139 108 255 / 0.16), transparent 60%),
    radial-gradient(50% 90% at 0% 10%, rgb(43 228 255 / 0.08), transparent 60%),
    var(--ink);
  border-bottom: 1px solid var(--line-soft); }
.dx-masthead__title { margin: 0; font: 700 clamp(3rem, 9vw, 8.5rem)/0.9 var(--font-display); letter-spacing: -0.04em; color: var(--fg); }
.dx-masthead__title--sub { font-size: clamp(2.2rem, 6vw, 5rem); overflow-wrap: anywhere; }
.dx-masthead__kicker { display: block; margin: 0 0 0.5rem; font: 600 clamp(0.8rem, 1.2vw, 1rem)/1 var(--font-hud); letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--accent); }
.dx-masthead__lede { max-width: 58ch; margin: 1.25rem 0 0; font-size: var(--step-1); line-height: 1.55; color: var(--fg-muted); }

.dx-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: clamp(1.75rem, 3vw, 2.75rem); }
.dx-tools > * { min-width: 0; max-width: 100%; }
.dx-filter { flex: 1 1 32rem; }
.dx-filter ul { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.dx-filter a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; border: 1px solid var(--line); border-radius: 999px;
  font: 600 0.8rem/1 var(--font-sans); color: var(--fg-muted); text-decoration: none; transition: color var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast); }
.dx-filter a:hover { color: var(--fg); border-color: var(--fg-faint); }
.dx-filter a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.dx-search { display: flex; gap: 0.5rem; flex: 0 1 26rem; }
.dx-search input { flex: 1; min-width: 0; min-height: 44px; padding: 0 1rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgb(255 255 255 / 0.03); color: var(--fg); font: 400 0.95rem var(--font-sans); }
.dx-search input::placeholder { color: var(--fg-faint); }
.dx-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: transparent; }

/* ---------- Index ---------- */
.dx-index { padding-top: clamp(2rem, 4vw, 3.5rem); }
.dx-index__head { margin: clamp(2.5rem, 5vw, 4rem) 0 1.5rem; font: 600 var(--step-2)/1.1 var(--font-display); color: var(--fg); }
.dx-lead > .eyebrow { margin-bottom: 1rem; }
.dx-grid { display: grid; gap: clamp(1.25rem, 2vw, 2rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
@media (min-width: 2200px) { .dx-grid { grid-template-columns: repeat(4, 1fr); } }
.dx-empty { padding: 4rem 0; max-width: 40rem; }
.dx-empty h2 { font: 600 var(--step-2)/1.15 var(--font-display); }
.dx-empty p { color: var(--fg-muted); }

/* ---------- Cards ---------- */
.dx-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.025), rgb(255 255 255 / 0)); transition: border-color var(--dur), transform var(--dur) var(--ease-out); }
.dx-card:hover, .dx-card:focus-within { border-color: color-mix(in srgb, var(--dx-tint) 45%, transparent); }
@media (prefers-reduced-motion: no-preference) { .dx-card:hover { transform: translateY(-3px); } }
.dx-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background:
  radial-gradient(70% 90% at 70% 30%, color-mix(in srgb, var(--dx-tint) 28%, transparent), transparent 70%), var(--ink-2); }
.dx-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dx-card__brand { position: absolute; inset: 0; display: grid; place-items: center; }
.dx-card__media .dx-card__brand img { width: auto; height: 46%; max-height: 46%; max-width: 70%; object-fit: contain; opacity: 0.85; filter: drop-shadow(0 0 30px color-mix(in srgb, var(--dx-tint) 50%, transparent)); }
.dx-card__body { display: flex; flex-direction: column; gap: 0.75rem; padding: clamp(1.1rem, 1.6vw, 1.5rem); }
.dx-card__title { margin: 0; font: 600 var(--step-1)/1.2 var(--font-display); letter-spacing: -0.01em; }
.dx-card__title a { color: var(--fg); text-decoration: none; }
.dx-card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card is the target */
.dx-card__title a:focus-visible { outline: none; }
.dx-card:has(.dx-card__title a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.dx-card__excerpt { margin: 0; color: var(--fg-muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dx-card__byline { margin: 0; font-size: 0.85rem; color: var(--fg-faint); }

.dx-card--lead { display: grid; }
@media (min-width: 1000px) {
  .dx-card--lead { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .dx-card--lead .dx-card__media { aspect-ratio: auto; min-height: clamp(22rem, 34vw, 36rem); }
  .dx-card--lead .dx-card__body { justify-content: center; padding: clamp(1.75rem, 3vw, 3.5rem); }
}
.dx-card--lead .dx-card__title { font-size: clamp(1.8rem, 3.2vw, 3.2rem); line-height: 1.05; letter-spacing: -0.025em; }
.dx-card--lead .dx-card__excerpt { -webkit-line-clamp: 5; font-size: var(--step-0); }
.dx-card--compact .dx-card__body { padding: 1rem 1.1rem; }

/* ---------- Meta ---------- */
.dx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; margin: 0; font: 500 0.78rem/1.3 var(--font-sans); color: var(--fg-faint); }
.dx-meta > * + *::before { content: ""; display: inline-block; width: 3px; height: 3px; margin-right: 0.9rem; border-radius: 50%; background: currentColor; vertical-align: middle; opacity: 0.6; }
.dx-meta__cat { font: 600 0.72rem/1 var(--font-hud); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dx-tint); }

/* ---------- Article ---------- */
.dx-article__head { padding: calc(var(--nav-h, 80px) + clamp(2rem, 5vw, 4rem)) 0 clamp(1.5rem, 3vw, 2.5rem);
  background: radial-gradient(70% 120% at 50% 0%, color-mix(in srgb, var(--dx-tint) 12%, transparent), transparent 70%), var(--ink); }
.dx-article__cat { display: inline-block; margin-bottom: 1rem; font: 600 0.78rem/1 var(--font-hud); letter-spacing: 0.2em; text-transform: uppercase; color: var(--dx-tint); text-decoration: none; }
.dx-article__title { margin: 0; font: 700 clamp(2.2rem, 5.2vw, 4.2rem)/1.02 var(--font-display); letter-spacing: -0.03em; color: var(--fg); text-wrap: balance; }
.dx-article__standfirst { margin: 1.25rem 0 0; font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.5; color: var(--fg-muted); text-wrap: pretty; }
.dx-meta--article { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line-soft); font-size: 0.85rem; }
.dx-article__cover { margin: 0 auto clamp(2rem, 4vw, 3.5rem); max-width: 1520px; }
.dx-article__cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); }
.dx-article__cover figcaption { margin-top: 0.6rem; font-size: 0.78rem; color: var(--fg-faint); }

.dx-prose { font-size: clamp(1.05rem, 0.4vw + 0.95rem, 1.18rem); line-height: 1.75; color: rgb(232 236 244 / 0.9); }
.dx-prose > * { margin-block: 0 1.35em; }
.dx-prose > p:first-child::first-letter { float: left; margin: 0.06em 0.12em 0 0; font: 700 3.6em/0.8 var(--font-display); color: var(--dx-tint); }
.dx-prose h2 { margin-top: 2.2em; font: 600 clamp(1.5rem, 2.4vw, 2rem)/1.2 var(--font-display); letter-spacing: -0.015em; color: var(--fg); }
.dx-prose h3 { margin-top: 1.8em; font: 600 1.25rem/1.3 var(--font-display); color: var(--fg); }
.dx-prose a { color: var(--accent); text-underline-offset: 0.2em; }
.dx-prose a:hover { color: var(--fg); }
.dx-prose strong { color: var(--fg); }
.dx-prose ul, .dx-prose ol { padding-left: 1.3em; }
.dx-prose li + li { margin-top: 0.45em; }
.dx-prose blockquote { margin-inline: 0; padding: 0.25em 0 0.25em 1.25em; border-left: 3px solid var(--dx-tint); font-size: 1.12em; color: var(--fg); }
.dx-prose .tgl-callout, .dx-prose .wp-block-group.is-style-callout { padding: 1.1em 1.3em; border: 1px solid var(--line); border-radius: var(--radius); background: rgb(255 255 255 / 0.03); }
.dx-prose figure { margin-inline: 0; }
.dx-prose table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.dx-prose .wp-block-table { overflow-x: auto; }
.dx-prose th, .dx-prose td { padding: 0.6em 0.8em; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.dx-prose th { color: var(--fg); font-weight: 600; }

.dx-discuss { margin: 3rem 0 0; padding: clamp(1.4rem, 3vw, 2rem); border: 1px solid color-mix(in srgb, var(--dx-tint) 35%, var(--line)); border-radius: var(--radius-lg);
  background: radial-gradient(80% 140% at 0% 0%, color-mix(in srgb, var(--dx-tint) 10%, transparent), transparent 70%); }
.dx-discuss h2 { margin: 0 0 0.5rem; font: 600 0.8rem/1 var(--font-hud); letter-spacing: 0.2em; text-transform: uppercase; color: var(--dx-tint); }
.dx-discuss p { margin: 0 0 1.25rem; font: 500 clamp(1.15rem, 2vw, 1.4rem)/1.4 var(--font-display); color: var(--fg); }

.dx-article__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft); }
.dx-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.dx-tags a { display: inline-flex; min-height: 36px; align-items: center; padding: 0 0.8rem; border-radius: 999px; background: rgb(255 255 255 / 0.05); color: var(--fg-muted); font-size: 0.82rem; text-decoration: none; }
.dx-tags a:hover { color: var(--fg); background: rgb(255 255 255 / 0.09); }
.dx-share { display: flex; align-items: center; gap: 0.9rem; }
.dx-share__title { margin: 0; font: 600 0.72rem/1 var(--font-hud); letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-faint); }
.dx-share ul { display: flex; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.dx-share a { display: inline-flex; min-height: 36px; align-items: center; padding: 0 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--fg-muted); font-size: 0.82rem; text-decoration: none; }
.dx-share a:hover, .dx-share a:focus-visible { color: var(--fg); border-color: var(--fg-faint); }
.dx-related { border-top: 1px solid var(--line-soft); }
.dx-related .dx-index__head { margin-top: 0; }

/* ---------- Closing CTA ---------- */
.dx-cta { padding: clamp(3rem, 6vw, 5.5rem) 0; border-top: 1px solid var(--line-soft);
  background: radial-gradient(60% 140% at 100% 100%, rgb(139 108 255 / 0.14), transparent 65%), var(--ink-2); }
.dx-cta__inner { display: grid; gap: 2rem; align-items: end; }
@media (min-width: 1000px) { .dx-cta__inner { grid-template-columns: 1.3fr 1fr; } .dx-cta__actions { justify-content: flex-end; } }
.dx-cta p:not(.eyebrow) { max-width: 52ch; color: var(--fg-muted); }

/* Pagination */
.dispatch .pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 2.5rem; }
.dispatch .pagination .page-numbers { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 0.8rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--fg-muted); text-decoration: none; }
.dispatch .pagination .page-numbers.current { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

@media (max-width: 600px) {
  .dx-tools { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .dx-filter { flex: none; }
  .dx-filter ul { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; scrollbar-width: thin; }
  .dx-filter a { white-space: nowrap; }
  .dx-search { flex-basis: auto; }
  .dx-prose > p:first-child::first-letter { font-size: 3em; }
}
@media (forced-colors: active) { .dx-filter a[aria-current="page"] { border: 2px solid CanvasText; } }
