/* Shared UI foundation across index, blog, micro-arena, and article pages.
   Keep this additive and non-destructive so existing page-level styles continue to work. */

/* Shared token aliases for reused UI elements */
:root {
  --ui-border: var(--border);
  --ui-panel: var(--panel);
  --ui-accent: var(--accent);
  --ui-text: var(--text);
  --ui-muted: var(--muted);
}

/* Shared CTA interaction language */
:where(.btn, .playlist-btn, .game-btn, .blog-chat-send, .chat-send, .quiz-next-btn, .quiz-restart-btn, .ask-ai-btn, .filter-btn, .ep-filter-btn, .selector-btn) {
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

:where(.btn, .playlist-btn, .game-btn, .blog-chat-send, .chat-send, .quiz-next-btn, .quiz-restart-btn, .ask-ai-btn, .filter-btn, .ep-filter-btn, .selector-btn):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Reading width ─────────────────────────────────────────────────
   Paragraphs and lists in articles and episode guides stop at --measure; figures, tables and charts keep the column. */
.article-subtitle,
.article-body > p,
.article-body > ul,
.article-body > ol,
.article-body > blockquote,
.article-body details > p,
.article-body details > ul,
.article-body details > ol,
.callout-text,
.unit-desc { max-width: var(--measure); }

/* The article byline links to the author page */
a.byline-name { display: block; text-decoration: none; transition: color 0.2s; }
a.byline-name:hover { color: var(--accent); }

/* Links inside article and episode-guide text */
.article-body a:not([class]) { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(0,212,255,0.35); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.article-body a:not([class]):hover { text-decoration-color: var(--accent); }

/* ── Reading cards ─────────────────────────────────────────────────
   "Keep reading" after articles and episode guides, and "Latest guides" on the homepage.
   Generated by `npm run sync:layout` from scripts/layout/reading-config.mjs. */
.keep-reading { max-width: 800px; margin: 0 auto; padding: 0 2rem var(--sp-7); }
.article-body:has(+ .keep-reading) { padding-bottom: var(--sp-6); } /* its 5rem was the gap to the share row */
.keep-reading-title { font-family: 'Exo 2', sans-serif; font-size: var(--fs-lead); font-weight: 700; color: #fff; margin: 0 0 var(--sp-4); }
.read-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--sp-4); }
.read-card { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); background: var(--panel); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: border-color 0.2s, transform 0.2s; }
.read-card:hover { border-color: rgba(0,212,255,0.5); transform: translateY(-2px); }
.read-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.read-tag { font-family: 'Share Tech Mono', monospace; font-size: var(--fs-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.read-tag-protoss { color: var(--protoss); }
.read-tag-zerg { color: var(--zerg-text); }
.read-tag-terran { color: var(--terran); }
.read-tag-repalyzer { color: var(--accent2); }
.read-tag-episode { color: var(--accent); }
.read-title { font-family: 'Exo 2', sans-serif; font-size: var(--fs-body); font-weight: 700; line-height: 1.35; color: #fff; }
.read-meta { margin-top: auto; font-size: var(--fs-small); color: var(--muted); }
.latest-guides { margin-top: var(--sp-6); }
.latest-guides .read-cards { grid-template-columns: repeat(3, 1fr); } /* six cards, two full rows */
@media (max-width: 900px) { .latest-guides .read-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .latest-guides .read-cards { grid-template-columns: 1fr; } }
.latest-guides-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.latest-guides-title { font-family: 'Exo 2', sans-serif; font-size: var(--fs-lead); font-weight: 700; color: #fff; margin: 0; }
.latest-guides-all { display: inline-block; padding: 5px 0; margin: -5px 0; font-size: var(--fs-small); color: var(--accent); text-decoration: none; white-space: nowrap; }
.latest-guides-all:hover { text-decoration: underline; }
@media (max-width: 768px) { .keep-reading { padding-left: 1.25rem; padding-right: 1.25rem; } }
@media print { .keep-reading, .latest-guides { display: none; } }

/* Shared cookie shell (applies across pages using #cookieBanner / #cookieModal) */
#cookieBanner {
  border-top: 1px solid var(--ui-border) !important;
  backdrop-filter: blur(16px) !important;
}

#cookieModal,
#consentModal,
#skCookieModal {
  backdrop-filter: blur(6px);
}

#cookieBanner button,
#cookieModal button,
#consentModal button,
#skCookieModal button {
  font-family: 'Exo 2', sans-serif !important;
  letter-spacing: 0.06em;
  text-transform: uppercase !important; font-weight: 700
}

#cookieBanner button:hover,
#cookieModal button:hover,
#consentModal button:hover,
#skCookieModal button:hover {
  border-color: var(--ui-accent) !important;
  color: var(--ui-accent) !important;
}

#cookieBanner button:last-child,
#cookieModal button:last-child,
#consentModal button:last-child,
#skCookieModal button:last-child {
  border-color: var(--ui-accent) !important;
}

#cookieBanner button:last-child:hover,
#cookieModal button:last-child:hover,
#consentModal button:last-child:hover,
#skCookieModal button:last-child:hover {
  background: transparent !important;
}

/* Shared tokenized surface helpers */
.ui-panel {
  background: var(--ui-panel);
  border: 1px solid var(--ui-border);
}

.ui-accent-border {
  border-left: 3px solid var(--ui-accent);
}
