/*
Theme Name: EventMarkets
Theme URI: https://eventmarkets.ai
Author: Alex McFarland LLC
Description: IGN-inspired editorial theme for eventmarkets.ai — bold Inter 900 headlines, left sidebar navigation, gradient story cards, polls, and platform-review scorecards. Original implementation per site/DESIGN.md.
Version: 0.2.3
Requires PHP: 7.4
License: Proprietary
Text Domain: eventmarkets
*/

/* ========== Tokens ========== */
:root {
  --em-ink: #181C25;
  --em-ink-soft: #41495A;
  --em-ink-40: rgba(24, 28, 37, 0.7);
  --em-bg: #F6F8F7;
  --em-surface: #FFFFFF;
  --em-surface-alt: #F7F7F7;
  --em-border: rgba(138, 147, 153, 0.15);
  --em-border-strong: rgba(138, 147, 153, 0.35);
  --em-accent: #0E8345;
  --em-accent-dark: #0A6636;
  --em-up: #0E8345;
  --em-down: #C0392B;
  --em-up-bright: #34C97B;   /* on-dark variant of --em-up */
  --em-down-bright: #FF7A66; /* on-dark variant of --em-down */
  --em-black: #0B0C0E;
  --em-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --em-sidebar-w: 300px;
  --em-radius: 16px;
  --em-radius-sm: 8px;
  --em-maxw: 1200px;
}

/* ========== Base ========== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--em-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--em-ink);
  background: var(--em-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--em-accent); }

h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 900; line-height: 1.1; }
h1 { font-size: 48px; letter-spacing: -1px; }
h2 { font-size: 34px; letter-spacing: -0.5px; }
h3 { font-size: 18px; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ========== Shell: sidebar + main ========== */
.em-shell { display: flex; min-height: 100vh; }

.em-sidebar {
  width: var(--em-sidebar-w);
  flex: 0 0 var(--em-sidebar-w);
  background: var(--em-surface);
  border-right: 1px solid var(--em-border);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 16px;
  z-index: 40;
}
.em-logo { display: block; padding: 4px 8px 18px; }
.em-logo svg { height: 30px; width: auto; display: block; }

.em-promo {
  border: 1px solid var(--em-border); border-radius: var(--em-radius);
  padding: 16px; text-align: center; margin-bottom: 18px;
}
.em-promo h3 { font-size: 16px; margin-bottom: 6px; }
.em-promo p { font-size: 13px; color: var(--em-ink-soft); margin: 0 0 12px; }
.em-promo .em-btn-outline { width: 100%; }

.em-nav { flex: 1 1 auto; overflow-y: auto; }
.em-nav ul { list-style: none; margin: 0; padding: 0; }
.em-nav li a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 15px; font-weight: 500; color: var(--em-ink);
}
.em-nav li a:hover { background: var(--em-surface-alt); color: var(--em-ink); }
.em-nav li.current-menu-item > a,
.em-nav li.current_page_item > a { background: #ECEFEE; font-weight: 700; }
.em-nav .em-nav-icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--em-ink-soft); }

.em-sidebar-cta { margin-top: 14px; }

/* Buttons */
.em-btn, .em-btn-outline, .em-btn-pill {
  font: inherit; font-weight: 700; cursor: pointer; text-align: center;
  border-radius: var(--em-radius-sm); padding: 11px 18px; display: inline-block;
  transition: background .15s ease, color .15s ease;
}
.em-btn { background: var(--em-black); color: #fff; border: none; width: 100%; }
.em-btn:hover { background: #23252B; color: #fff; }
.em-btn-outline { background: transparent; border: 1px solid var(--em-border-strong); color: var(--em-ink); }
.em-btn-outline:hover { border-color: var(--em-ink); color: var(--em-ink); }
.em-btn-pill { border-radius: 999px; background: var(--em-accent); color: #fff; border: none; padding: 11px 26px; }
.em-btn-pill:hover { background: var(--em-accent-dark); color: #fff; }
.em-btn-pill:disabled { background: var(--em-surface-alt); color: var(--em-ink-40); cursor: not-allowed; }

/* Mobile top bar */
.em-topbar {
  display: none; position: sticky; top: 0; z-index: 50;
  background: var(--em-surface); border-bottom: 1px solid var(--em-border);
  padding: 10px 16px; align-items: center; justify-content: space-between;
}
.em-topbar .em-logo { padding: 0; }
.em-topbar .em-logo svg { height: 24px; }
.em-hamburger { background: none; border: none; padding: 8px; cursor: pointer; color: var(--em-ink); }

/* Main column */
.em-main { flex: 1 1 auto; min-width: 0; }
.em-container { max-width: var(--em-maxw); margin: 0 auto; padding: 0 24px; }

/* ========== Ticker strip ========== */
.em-ticker {
  background: var(--em-black); color: #fff;
  font-size: 13px; overflow: hidden; white-space: nowrap;
}
.em-ticker-inner { display: flex; gap: 28px; padding: 8px 24px; overflow-x: auto; scrollbar-width: none; }
.em-ticker-inner::-webkit-scrollbar { display: none; }
.em-tick { display: inline-flex; gap: 8px; align-items: baseline; flex: 0 0 auto; }
.em-tick .t-name { color: rgba(255,255,255,.75); font-weight: 500; }
.em-tick .t-price { font-weight: 700; }
.em-tick .t-delta { font-weight: 700; }
.em-tick .t-delta.up { color: var(--em-up-bright); }
.em-tick .t-delta.down { color: var(--em-down-bright); }

/* ========== Hero cards ========== */
.em-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 28px 0 56px; }
.em-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--em-ink);
}
.em-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.em-card-plate {
  position: relative; padding: 14px 16px 16px; color: #fff;
  min-height: 34%; display: flex; align-items: flex-end;
}
.em-card-plate h3 { font-size: 19px; line-height: 1.25; margin: 0; color: #fff; }
.em-card:hover .em-card-plate h3 { text-decoration: underline; text-decoration-thickness: 2px; }
.em-plate-a { background: linear-gradient(180deg, rgba(14,131,69,0) 0%, rgba(11,92,50,.96) 38%); }
.em-plate-b { background: linear-gradient(180deg, rgba(24,28,37,0) 0%, rgba(24,28,37,.96) 38%); }
.em-plate-c { background: linear-gradient(180deg, rgba(11,84,110,0) 0%, rgba(11,84,110,.96) 38%); }
.em-plate-d { background: linear-gradient(180deg, rgba(44,54,76,0) 0%, rgba(44,54,76,.96) 38%); }

/* ========== Section header ========== */
.em-section-head { display: flex; align-items: center; gap: 12px; margin: 48px 0 20px; }
.em-section-head h2 { margin: 0; }
.em-section-head .em-sec-icon { width: 26px; height: 26px; color: var(--em-accent); }
.em-section-head.accent h2 { color: var(--em-accent); }

/* ========== Layout: main + rail ========== */
.em-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; }

/* ========== List rows ========== */
.em-rows { display: flex; flex-direction: column; }
.em-row {
  display: flex; gap: 18px; padding: 18px 0;
  border-bottom: 1px solid var(--em-border);
}
.em-row-thumb { flex: 0 0 160px; position: relative; }
.em-row-thumb img { border-radius: 8px; aspect-ratio: 16/10; object-fit: cover; width: 160px; }
.em-row-body { min-width: 0; }
.em-row-body h3 { font-size: 18px; line-height: 1.3; margin-bottom: 6px; }
.em-row-meta { font-size: 15px; color: var(--em-ink-40); margin: 0 0 8px; }
.em-row-meta .em-ago { color: var(--em-ink); font-weight: 500; }
.em-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--em-accent);
}
.em-tag::before { content: ""; width: 8px; height: 8px; background: currentColor; border-radius: 2px; }

/* ========== Popular rail ========== */
.em-rail { position: sticky; top: 24px; }
.em-rail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.em-rail-head h2 { font-size: 22px; margin: 0; }
.em-rail-head .em-sec-icon { width: 20px; height: 20px; color: var(--em-accent); }
.em-rail hr { border: none; border-top: 1px solid var(--em-border-strong); margin: 0 0 4px; }
.em-pop { display: flex; gap: 14px; padding: 12px 0; }
.em-pop-num {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--em-ink); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.em-pop-body .em-ago { display: block; font-size: 13px; font-weight: 700; color: var(--em-accent); margin-bottom: 2px; }
.em-pop-body h3 { font-size: 15px; line-height: 1.35; margin: 0 0 4px; font-weight: 700; }
.em-comments { font-size: 12px; font-weight: 700; color: var(--em-ink-soft); display: inline-flex; align-items: center; gap: 5px; }
.em-comments::before { content: ""; width: 12px; height: 10px; background: var(--em-accent); border-radius: 3px 3px 3px 0; }

/* Recommends rail cards */
.em-rec { padding: 12px 0; }
.em-rec img { border-radius: 8px; aspect-ratio: 16/9; object-fit: cover; margin-bottom: 8px; }
.em-rec h3 { font-size: 15px; font-weight: 700; line-height: 1.35; margin: 0 0 4px; }

/* ========== Article ========== */
.em-article { max-width: 800px; }
.em-article-hero { border-radius: 12px; overflow: hidden; margin: 24px 0; }
.em-article-hero img { width: 100%; aspect-ratio: 2 / 1; max-height: 400px; object-fit: cover; }
@media (max-width: 640px) { .em-article-hero img { aspect-ratio: 16 / 10; max-height: 280px; } }
.em-article h1 { margin: 18px 0 10px; }
.em-dek { font-size: 19px; color: var(--em-ink-soft); margin: 0 0 18px; line-height: 1.5; }
.em-byline {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
  border-top: 1px solid var(--em-border); border-bottom: 1px solid var(--em-border);
  padding: 12px 0; margin: 18px 0 26px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--em-ink-soft);
}
.em-byline a { color: var(--em-ink); text-decoration: underline; text-underline-offset: 2px; }
.em-content { font-size: 17px; line-height: 1.7; }
.em-content p { margin: 0 0 1.35em; }
.em-content h2 { font-size: 28px; margin: 1.4em 0 .6em; }
.em-content h3 { font-size: 21px; margin: 1.3em 0 .5em; }
.em-content img { border-radius: 10px; }
.em-content a { color: var(--em-accent); text-decoration: underline; text-underline-offset: 2px; }
.em-content a:hover { color: var(--em-accent-dark); }
.em-content table {
  width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 15px;
  background: var(--em-surface); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--em-border-strong);
}
.em-content th {
  background: var(--em-ink); color: #fff; text-align: left;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 10px 14px;
}
.em-content td { padding: 10px 14px; border-top: 1px solid var(--em-border); }
.em-content tr:nth-child(even) td { background: var(--em-surface-alt); }
.em-content blockquote {
  margin: 2em 0; padding: 0;  border: none;
}
.em-content blockquote p {
  font-size: clamp(26px, 3.4vw, 40px); font-weight: 900; line-height: 1.15;
  letter-spacing: -0.5px; color: var(--em-accent);
  border-bottom: 2px solid var(--em-accent); padding-bottom: 22px; position: relative;
}
.em-content blockquote p::after {
  content: "\201D"; position: absolute; right: 0; bottom: -34px;
  font-size: 44px; color: var(--em-accent); font-weight: 900;
}

/* Callout box */
.em-callout {
  border: 2px solid var(--em-ink); border-radius: 12px;
  padding: 22px 26px; margin: 2em 0;
}
.em-callout > h3, .em-callout > h2 {
  font-size: 24px; text-decoration: underline; text-underline-offset: 4px; margin-bottom: 12px;
}

/* ========== Poll ========== */
.em-poll {
  background: var(--em-surface); border: 1px solid var(--em-border);
  border-radius: var(--em-radius); padding: 26px 30px; margin: 2.2em 0;
  box-shadow: 0 1px 2px rgba(24,28,37,.04);
}
.em-poll-q {
  font-size: 26px; font-weight: 900; letter-spacing: -0.4px;
  border-bottom: 1px solid var(--em-border-strong); padding-bottom: 14px; margin: 0 0 16px;
}
.em-poll-opts { list-style: none; margin: 0 0 18px; padding: 0; }
.em-poll-opts li { padding: 7px 0; }
.em-poll-opts label { display: flex; align-items: center; gap: 12px; font-size: 16px; cursor: pointer; }
.em-poll-opts input[type="radio"] {
  appearance: none; width: 20px; height: 20px; margin: 0;
  border: 2px solid var(--em-border-strong); border-radius: 5px; cursor: pointer;
  display: inline-grid; place-content: center;
}
.em-poll-opts input[type="radio"]:checked { border-color: var(--em-accent); background: var(--em-accent); }
.em-poll-opts input[type="radio"]:checked::before {
  content: ""; width: 10px; height: 10px; background: #fff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.em-poll-actions { display: flex; align-items: center; justify-content: space-between; }
.em-poll-results { font-size: 14px; font-weight: 700; color: var(--em-ink-soft); background: none; border: none; cursor: pointer; }
.em-poll-results::after { content: " \203A"; }
.em-poll-bars { margin-top: 6px; }
.em-poll-bar { margin: 10px 0; }
.em-poll-bar .b-label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.em-poll-bar .b-track { background: var(--em-surface-alt); border-radius: 6px; height: 12px; overflow: hidden; }
.em-poll-bar .b-fill { background: var(--em-accent); height: 100%; border-radius: 6px; min-width: 2px; }
.em-poll-note { font-size: 12px; color: var(--em-ink-40); margin-top: 10px; }
.em-poll-note.error { color: var(--em-down); font-weight: 700; }

/* ========== Live market widget ========== */
.em-market-widget {
  background: var(--em-surface); border: 1px solid var(--em-border);
  border-radius: var(--em-radius); padding: 22px 26px; margin: 2em 0;
  box-shadow: 0 1px 2px rgba(24,28,37,.04);
}
.em-mw-source {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--em-ink-soft); margin: 0 0 8px; display: flex; align-items: center; gap: 7px;
}
.em-mw-live { width: 8px; height: 8px; border-radius: 50%; background: var(--em-accent); animation: em-pulse 2s infinite; }
@keyframes em-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.em-mw-q { font-size: 21px; font-weight: 900; letter-spacing: -0.3px; margin: 0 0 14px; line-height: 1.25; }
.em-mw-outcomes { list-style: none; margin: 0 0 14px; padding: 0; }
.em-mw-outcomes li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--em-border); font-size: 16px;
}
.em-mw-outcomes li:first-child { border-top: none; }
.em-mw-label { flex: 1 1 auto; font-weight: 500; min-width: 0; }
.em-mw-price { font-weight: 900; font-variant-numeric: tabular-nums; }
.em-mw-delta { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.em-mw-delta.up { color: var(--em-up); }
.em-mw-delta.down { color: var(--em-down); }
.em-mw-foot {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 0; font-size: 13px;
}
.em-mw-foot a { color: var(--em-accent); font-weight: 700; text-decoration: none; }
.em-mw-foot a:hover { color: var(--em-accent-dark); }
.em-mw-updated { color: var(--em-ink-40); }

/* ========== Scorecard ========== */
.em-scorecard {
  display: flex; gap: 26px; align-items: flex-start;
  border-top: 2px solid var(--em-ink); border-bottom: 1px solid var(--em-border);
  padding: 26px 0; margin: 2.2em 0;
}
.em-hex { flex: 0 0 110px; position: relative; width: 110px; height: 124px; }
.em-hex svg { display: block; width: 100%; height: 100%; }
.em-hex .hex-num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff;
}
.em-hex .hex-num b { font-size: 57px; font-weight: 900; line-height: 1; }
.em-hex .hex-num span { font-size: 10px; font-weight: 900; letter-spacing: .18em; margin-top: 3px; }
.em-verdict h2 { font-size: 24px; margin-bottom: 8px; }
.em-verdict p { margin: 0; font-size: 17px; line-height: 1.6; }

/* Score badge overlay on cards and list thumbs */
.em-card .em-hex, .em-row-thumb .em-hex { position: absolute; top: 12px; right: 12px; width: 62px; height: 70px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.em-card .em-hex .hex-num b, .em-row-thumb .em-hex .hex-num b { font-size: 30px; }
.em-card .em-hex .hex-num span, .em-row-thumb .em-hex .hex-num span { font-size: 7px; }
.em-row-thumb .em-hex { top: 6px; right: 6px; width: 42px; height: 47px; }
.em-row-thumb .em-hex .hex-num b { font-size: 20px; }

/* ========== Footer ========== */
.em-footer { background: var(--em-black); color: rgba(255,255,255,.8); margin-top: 72px; }
.em-footer-inner { max-width: var(--em-maxw); margin: 0 auto; padding: 40px 24px; }
.em-footer a { color: #fff; }
.em-footer a:hover { color: var(--em-up-bright); }
.em-footer nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px 26px; font-weight: 700; font-size: 14px;
}
.em-footer-cols { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.em-footer .em-disclaimer { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 26px; max-width: 720px; line-height: 1.6; }

/* ========== Archive head ========== */
.em-archive-head { margin: 34px 0 8px; }
.em-archive-head h1 { color: var(--em-accent); display: flex; align-items: center; gap: 12px; font-size: 40px; }

/* Pagination */
.em-pagination { display: flex; gap: 8px; margin: 34px 0; flex-wrap: wrap; }
.em-pagination .page-numbers {
  padding: 8px 14px; border: 1px solid var(--em-border-strong); border-radius: 8px;
  font-weight: 700; font-size: 14px;
}
.em-pagination .page-numbers.current { background: var(--em-ink); color: #fff; border-color: var(--em-ink); }

/* ========== Responsive ========== */
@media (max-width: 1180px) {
  .em-hero { grid-template-columns: repeat(2, 1fr); }
  .em-cols { grid-template-columns: 1fr; }
  .em-rail { position: static; }
}
@media (max-width: 1023px) {
  .em-sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.18);
  }
  body.em-nav-open .em-sidebar { transform: translateX(0); }
  .em-topbar { display: flex; }
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
}
@media (max-width: 640px) {
  .em-hero { grid-template-columns: 1fr; }
  .em-card { aspect-ratio: 16 / 10; }
  .em-row-thumb { flex-basis: 110px; }
  .em-row-thumb img { width: 110px; }
  .em-poll { padding: 20px; }
  .em-scorecard { flex-direction: column; }
}
