/* =========================================================
   [sp_match_odds] component CSS
   OWNER: scommessepro-odds-comparator plugin (assets/match-odds.css)
   Enqueued only on posts containing [sp_match_odds].
   Every selector starts with .spmo[data-sp-module] so it outranks
   the global `.sp-article a` / `.entry-content .sp-article …` rules
   in main.css without !important.
   Tokens read the article scope (--spp-*) and fall back to the
   legacy dark theme, so the component never depends on v2 CSS.
   Production component introduced in plugin 0.5.0.
   ========================================================= */

.spmo {
  /* Revision 6 mapping to the article's tonal roles; fallbacks are the same live colours. */
  --spmo-surface: var(--spp-surface-commercial, #121214);
  --spmo-raised: var(--spp-surface-commercial-raised, #1d1d22);
  --spmo-line: var(--spp-line-subtle, rgba(255, 255, 255, .08));
  --spmo-line-strong: var(--spp-line-strong, #2f2f36);
  --spmo-line-ui: var(--spp-line-interactive, #7a7a84);
  --spmo-text: var(--spp-text, #e8e8e8);
  --spmo-text-strong: var(--spp-text-strong, #ffffff);
  --spmo-muted: var(--spp-text-muted, #9999a2);
  --spmo-action: var(--spp-accent, #00c853);
  --spmo-action-ink: var(--spp-accent-ink, #07170d);
  --spmo-action-ring: var(--spp-accent-ring, rgba(0, 200, 83, .18));
  --spmo-odds: var(--spp-odds-best, #7aefaa);
  --spmo-odds-line: var(--spp-odds-best-line, rgba(0, 200, 83, .5));
  --spmo-odds-tint: var(--spp-odds-best-tint, rgba(0, 200, 83, .1));
  --spmo-focus: var(--spp-focus, #7ef0a9);
  --spmo-radius: var(--spp-radius, 18px);
  --spmo-radius-sm: var(--spp-radius-sm, 10px);
  --spmo-display: var(--spp-font-display, inherit);
  --spmo-shadow: var(--spp-shadow-commercial, none);
  color: var(--spmo-text);
}

.spmo[data-sp-module] *,
.spmo[data-sp-module] *::before,
.spmo[data-sp-module] *::after { box-sizing: border-box; }

.spmo[data-sp-module] a { text-decoration: none; }
.spmo[data-sp-module] a:focus-visible {
  outline: 2px solid var(--spmo-focus);
  outline-offset: 2px;
}

.spmo[data-sp-module] .spmo-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Registry logo container (shared by pick, table, chips) ---------- */
.spmo[data-sp-module] .spmo-logo {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 32px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--spmo-logo-bg, #ffffff);
}
.spmo[data-sp-module] .spmo-logo img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 21px;
  margin: 0;
  object-fit: contain;
}

/* =========================================================
   view="pick": lives inside the article's editorial pick card
   ========================================================= */
.spmo[data-sp-module].spmo--pick { display: grid; gap: 8px; }

.spmo[data-sp-module] .spmo-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  color: var(--spmo-muted);
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.3;
}
.spmo[data-sp-module] .spmo-head__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.spmo[data-sp-module] .spmo-head__label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--spmo-action);
  box-shadow: 0 0 0 4px var(--spmo-action-ring);
}

.spmo[data-sp-module] .spmo-offers {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.spmo[data-sp-module] .spmo-offers > li { margin: 0; padding: 0; }

.spmo[data-sp-module] .spmo-offer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--spmo-line);
  border-radius: var(--spmo-radius-sm);
  background: var(--spmo-raised);
  color: var(--spmo-text);
}
.spmo[data-sp-module] .spmo-offer:hover { border-color: var(--spmo-line-ui); }

.spmo[data-sp-module] .spmo-offer__odds {
  font-family: var(--spmo-display);
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.spmo[data-sp-module] .spmo-offer.is-top .spmo-offer__odds { color: var(--spmo-odds); }

.spmo[data-sp-module] .spmo-offer__go {
  color: var(--spmo-muted);
  font-size: .8rem;
  font-weight: 800;
  white-space: nowrap;
}
.spmo[data-sp-module] .spmo-offer:hover .spmo-offer__go { color: var(--spmo-text); }

/* Leading row: one operator, one primary action. */
.spmo[data-sp-module] .spmo-offer--lead {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "logo odds" "cta cta";
  row-gap: 10px;
  padding: 12px;
  border-color: var(--spmo-line-ui);
}
.spmo[data-sp-module] .spmo-offer--lead .spmo-logo { grid-area: logo; width: 96px; height: 36px; }
.spmo[data-sp-module] .spmo-offer--lead .spmo-offer__odds { grid-area: odds; justify-self: end; font-size: 2rem; }
.spmo[data-sp-module] .spmo-cta {
  grid-area: cta;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--spmo-action);
  color: var(--spmo-action-ink);
  font-size: .9rem;
  font-weight: 850;
  text-align: center;
}
.spmo[data-sp-module] .spmo-offer--lead:hover .spmo-cta { filter: brightness(1.06); }

@media (min-width: 420px) {
  .spmo[data-sp-module] .spmo-offer--lead {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "logo odds cta";
  }
  .spmo[data-sp-module] .spmo-offer--lead .spmo-offer__odds { justify-self: start; }
}
@media (min-width: 768px) {
  /* Inside the desktop pick card the odds column is ~340px: stack again. */
  .spmo[data-sp-module].spmo--pick .spmo-offer--lead {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "logo odds" "cta cta";
  }
  .spmo[data-sp-module].spmo--pick .spmo-offer--lead .spmo-offer__odds { justify-self: end; }
}

.spmo[data-sp-module] .spmo-jump {
  justify-self: start;
  margin-top: 2px;
  color: var(--spmo-text);
  font-size: .86rem;
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: var(--spmo-line-ui);
  text-underline-offset: 4px;
}
.spmo[data-sp-module] .spmo-jump:hover { text-decoration-color: var(--spmo-action); }

/* Non-live hero states: one quiet line, no commercial chrome. */
.spmo[data-sp-module] .spmo-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--spmo-line);
  border-radius: var(--spmo-radius-sm);
  background: var(--spmo-raised);
  color: var(--spmo-muted);
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.4;
}
.spmo[data-sp-module] .spmo-status svg { flex: none; width: 18px; height: 18px; }

/* ---------- Match strip (view="pick"): kickoff from the dataset when listed,
   names and crests from the shared team registry, text-only fallback ---------- */
.spmo[data-sp-module] .spmo-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--spmo-line);
}
.spmo[data-sp-module] .spmo-team {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  font-family: var(--spmo-display);
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.15;
}
.spmo[data-sp-module] .spmo-team--away { justify-content: flex-end; text-align: right; }
.spmo[data-sp-module] .spmo-team img { flex: none; width: 30px; height: 30px; margin: 0; object-fit: contain; }
.spmo[data-sp-module] .spmo-kick { text-align: center; line-height: 1.2; }
.spmo[data-sp-module] .spmo-kick b { display: block; font-family: var(--spmo-display); font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.spmo[data-sp-module] .spmo-kick span { display: block; color: var(--spmo-muted); font-size: .68rem; font-weight: 700; white-space: nowrap; }
.spmo[data-sp-module] .spmo-comp { grid-column: 1 / -1; justify-self: center; color: var(--spmo-muted); font-size: .68rem; font-weight: 750; }
.spmo[data-sp-module] .spmo-match--kickoff { display: flex; justify-content: space-between; gap: 10px; color: var(--spmo-muted); font-size: .78rem; font-weight: 700; }
.spmo[data-sp-module] .spmo-match--kickoff b { color: var(--spmo-text); font-variant-numeric: tabular-nums; }
@media (max-width: 360px) {
  .spmo[data-sp-module] .spmo-team { flex-direction: column; gap: 4px; text-align: center; }
  .spmo[data-sp-module] .spmo-team--away { flex-direction: column-reverse; }
}

/* =========================================================
   view="board"
   ========================================================= */
.spmo[data-sp-module].spmo--board {
  margin: 0 0 16px;
  padding: 20px;
  border: 1px solid var(--spmo-line-strong);
  border-radius: var(--spmo-radius);
  background: var(--spmo-surface);
  box-shadow: var(--spmo-shadow);
  scroll-margin-top: calc(var(--spbb-header-offset, 64px) + 190px);
}
@media (min-width: 769px) {
  .spmo[data-sp-module].spmo--board { padding: 24px; scroll-margin-top: 24px; }
}

/* ---------- Board disclosure: one element, two behaviours, no JavaScript ----------
   Server HTML: <details class="spmo-disclosure"> without [open].
   < 769px: native disclosure; the summary is a full-width secondary action.
   >= 769px: ::details-content forced visible and the summary hidden, so the
   same board reads as always open. Browsers without ::details-content keep
   the working native disclosure (graceful fallback, never hidden content). */
.spmo[data-sp-module] .spmo-disclosure { margin: 0; }
.spmo[data-sp-module] .spmo-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  padding: 4px 2px;
  cursor: pointer;
  list-style: none;
}
.spmo[data-sp-module] .spmo-summary::-webkit-details-marker { display: none; }
.spmo[data-sp-module] .spmo-summary__title {
  display: block;
  color: var(--spmo-text-strong);
  font-family: var(--spmo-display);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}
.spmo[data-sp-module] .spmo-summary__meta { display: block; margin-top: 3px; color: var(--spmo-muted); font-size: .8rem; font-weight: 650; line-height: 1.35; }
.spmo[data-sp-module] .spmo-summary__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--spmo-line-ui);
  border-radius: 50%;
}
.spmo[data-sp-module] .spmo-summary__icon::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border-right: 2px solid var(--spmo-text);
  border-bottom: 2px solid var(--spmo-text);
  transform: rotate(45deg);
}
.spmo[data-sp-module] .spmo-disclosure[open] .spmo-summary__icon::before { margin-top: 3px; transform: rotate(-135deg); }
.spmo[data-sp-module] .spmo-summary:focus-visible { outline: 2px solid var(--spmo-focus); outline-offset: 3px; border-radius: 8px; }
.spmo[data-sp-module] .spmo-disclosure[open] .spmo-summary { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--spmo-line); }
@media (max-width: 768px) {
  .spmo[data-sp-module].spmo--board { padding: 12px 16px; }
}
@supports selector(::details-content) {
  @media (min-width: 769px) {
    .spmo[data-sp-module] .spmo-disclosure::details-content { content-visibility: visible; display: block; }
    .spmo[data-sp-module] .spmo-summary { display: none; }
  }
}

/* 1X2 matrix: one row per priced operator, registry order, no reordering between extractions. */
.spmo[data-sp-module] .spmo-table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: separate;
  border-spacing: 0 6px;
  table-layout: fixed;
  background: none;
}
.spmo[data-sp-module] .spmo-table th,
.spmo[data-sp-module] .spmo-table td {
  padding: 0;
  border: 0;
  background: none;
  vertical-align: middle;
}
.spmo[data-sp-module] .spmo-table col.spmo-col-book { width: 96px; }
.spmo[data-sp-module] .spmo-table thead th {
  padding: 0 3px 2px;
  color: var(--spmo-muted);
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
}
.spmo[data-sp-module] .spmo-table thead th b {
  display: block;
  color: var(--spmo-text);
  font-family: var(--spmo-display);
  font-size: .95rem;
  font-weight: 800;
}
.spmo[data-sp-module] .spmo-table thead th span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spmo[data-sp-module] .spmo-table thead th .spmo-crest {
  display: block;
  width: 26px;
  height: 26px;
  margin: 0 auto 4px;
  object-fit: contain;
}
.spmo[data-sp-module] .spmo-table thead th .spmo-crest--draw {
  display: grid;
  place-items: center;
  border: 1px dashed var(--spmo-line-ui);
  border-radius: 50%;
  color: var(--spmo-muted);
  font-size: .7rem;
  font-weight: 900;
}
.spmo[data-sp-module] .spmo-table tbody th { padding-right: 8px; text-align: left; }
.spmo[data-sp-module] .spmo-table tbody td { padding: 0 3px; }

.spmo[data-sp-module] .spmo-odd {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--spmo-line);
  border-radius: 12px;
  background: var(--spmo-raised);
  color: var(--spmo-text);
  font-family: var(--spmo-display);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.spmo[data-sp-module] a.spmo-odd:hover { border-color: var(--spmo-line-ui); }
/* Strongest displayed quota: colour + border + weight (never colour alone). */
.spmo[data-sp-module] .spmo-odd.is-top {
  border-color: var(--spmo-odds-line);
  background: var(--spmo-odds-tint);
  color: var(--spmo-odds);
  font-weight: 900;
}
.spmo[data-sp-module] .spmo-odd.is-na { color: var(--spmo-muted); border-style: dashed; }

/* Approved 1X2 selection (pick family = MATCH_RESULT): lime = selected state. */
.spmo[data-sp-module] .spmo-table thead th.is-pick b { color: var(--spmo-action); }
.spmo[data-sp-module] .spmo-pickmark {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--spmo-action);
  color: var(--spmo-action-ink);
  font-size: .6rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.spmo[data-sp-module] td.is-pick .spmo-odd { box-shadow: inset 0 -3px 0 var(--spmo-action); }

/* Primary market (only when the pick family is not MATCH_RESULT). */
.spmo[data-sp-module] .spmo-market {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--spmo-line);
}
.spmo[data-sp-module] .spmo-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.spmo[data-sp-module] .spmo-chips > li { margin: 0; padding: 0; }
.spmo[data-sp-module].spmo--board { container-type: inline-size; }
@container (min-width: 620px) {
  .spmo[data-sp-module] .spmo-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.spmo[data-sp-module] .spmo-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--spmo-line);
  border-radius: var(--spmo-radius-sm);
  background: var(--spmo-raised);
  color: var(--spmo-text);
}
.spmo[data-sp-module] .spmo-chip:hover { border-color: var(--spmo-line-ui); }
.spmo[data-sp-module] .spmo-chip .spmo-logo { width: 76px; height: 30px; }
.spmo[data-sp-module] .spmo-chip b { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.spmo[data-sp-module] .spmo-chip.is-top { border-color: var(--spmo-odds-line); background: var(--spmo-odds-tint); }
.spmo[data-sp-module] .spmo-chip.is-top b { color: var(--spmo-odds); font-weight: 900; }

.spmo[data-sp-module] .spmo-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 18px;
  margin-top: 14px;
  color: var(--spmo-muted);
  font-size: .8rem;
  line-height: 1.45;
}
.spmo[data-sp-module] .spmo-full {
  color: var(--spmo-text);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: var(--spmo-line-ui);
  text-underline-offset: 4px;
}
.spmo[data-sp-module] .spmo-full:hover { text-decoration-color: var(--spmo-action); }

@media (max-width: 400px) {
  .spmo[data-sp-module].spmo--board { padding: 16px 12px; }
  .spmo[data-sp-module] .spmo-table col.spmo-col-book { width: 80px; }
  .spmo[data-sp-module] .spmo-table .spmo-logo { width: 74px; height: 30px; padding: 5px 6px; }
  .spmo[data-sp-module] .spmo-table tbody td { padding: 0 2px; }
  .spmo[data-sp-module] .spmo-chip .spmo-logo { width: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  .spmo[data-sp-module] * { transition: none !important; scroll-behavior: auto !important; }
}
