/* ============================================================
   COMPETITION PAGES AND HUB
   ------------------------------------------------------------
   One competition: a header with its logo and headline chips,
   the season as tiles, then the table and results beside the
   fixtures and the season's highlights, then its teams as crests.
   The hub (/competition/): every competition as a card, by sport.
   ============================================================ */

/* ---- the page takes the screen ------------------------------------ */
/* A competition is a dashboard, not an article: it uses the width a big
   screen has, so the table, results and fixtures sit side by side instead
   of one long column. */
.seo-page:has(.cp-grid),
.seo-page:has(.cph-grid) { max-width: 1520px; }
.seo-hero.cp-hero { padding-block: clamp(22px, 3vw, 34px); margin-bottom: var(--s-5); }
.seo-hero.cp-hero h1 { margin-bottom: 6px; }

/* ---- header ---------------------------------------------------- */
.seo-hero.cp-hero {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
}
.cp-hero-logo {
  flex: none;
  width: clamp(64px, 9vw, 104px);
  height: clamp(64px, 9vw, 104px);
  padding: 12px;
  border-radius: 22px;
  object-fit: contain;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 40px rgba(3, 16, 32, .35);
}
.cp-hero-text { min-width: 0; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cp-chip {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font-size: .82rem;
  font-weight: 700;
  color: var(--white, #fff);
}
.cp-chip--live { border-color: var(--live); background: color-mix(in srgb, var(--live) 22%, transparent); }
.cp-chip--live::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: var(--live);
  vertical-align: 1px;
}

/* ---- overview and tiles ------------------------------------------ */
.cp-overview { margin: 0 0 var(--s-5); }
.cp-lede {
  max-width: 72ch;
  margin: 0;
  font-size: clamp(1.02rem, .98rem + .3vw, 1.15rem);
  line-height: 1.6;
  color: var(--ink-mid);
}
.cp-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: var(--s-5);
}
.cp-tile {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--surface-line);
  border-top: 3px solid var(--electric);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(3, 16, 32, .06);
}
.cp-tile-num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  color: var(--ink);
}
.cp-tile-label {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- two columns ------------------------------------------------- */
.cp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: var(--s-4);
  align-items: start;
}
.cp-main, .cp-side { display: grid; gap: var(--s-4); min-width: 0; align-content: start; }
.cp-grid .mp-block { margin: 0; padding: var(--s-5); }
/* Wide screens: three columns. The table keeps the first; results move up
   beside it, and the side's fixtures and highlights take the third. */
@media (min-width: 1280px) {
  .cp-grid { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
  .cp-main { grid-template-columns: minmax(0, 1.75fr) minmax(250px, 1fr); }
  .cp-main > #standings { grid-row: span 3; }
  /* Beside two other columns the table drops goals for and against: goal
     difference already sums them, and points, GD and form stay in view. */
  .cp-table--soccer th:nth-child(7), .cp-table--soccer td:nth-child(7),
  .cp-table--soccer th:nth-child(8), .cp-table--soccer td:nth-child(8) { display: none; }
  .cp-table td, .cp-table th { padding-inline: 7px; }
}
@media (max-width: 960px) { .cp-grid { grid-template-columns: minmax(0, 1fr); } }

/* Long lists wait behind one tap. */
.cp-collapse > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.cp-collapse > summary::-webkit-details-marker { display: none; }
.cp-collapse > summary h2 { margin: 0; }
.cp-collapse > summary::after { content: "+"; font-size: 1.4rem; color: var(--electric); transition: transform .2s ease; }
.cp-collapse[open] > summary::after { transform: rotate(45deg); }
.cp-collapse[open] > summary { margin-bottom: var(--s-3); }

/* ---- table ------------------------------------------------------- */
.cp-table-wrap { overflow-x: auto; margin-top: var(--s-3); }
.cp-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cp-table th {
  padding: 8px 10px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--surface-line);
}
.cp-table td {
  padding: 9px 10px;
  text-align: center;
  border-bottom: 1px solid var(--surface-line);
}
.cp-table th:nth-child(2), .cp-table td.cp-team-cell { text-align: start; }
.cp-table tbody tr { transition: background .15s ease; }
.cp-table tbody tr:hover { background: var(--surface-sunk); }
.cp-table td:last-child:not(.cp-form-col),
.cp-table:not(.cp-form-table) td:nth-last-child(2) { font-weight: 800; color: var(--ink); }
.cp-pos { width: 2.2em; font-weight: 800; color: var(--ink-soft); }
.cp-table tbody tr:nth-child(-n + 4) .cp-pos { color: var(--electric); }
.cp-team-cell { min-width: 170px; }
.cp-team-cell a {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.cp-team-cell a:hover { color: var(--electric); }
.cp-crest {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-inline-end: 10px;
  vertical-align: middle;
  object-fit: contain;
}
.cp-crest--initials {
  border-radius: 50%;
  background: var(--surface-sunk);
  border: 1px solid var(--surface-line);
  font-size: .62rem;
  font-weight: 800;
  color: var(--ink-soft);
}
.cp-form-col { white-space: nowrap; }
.cp-pip {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-inline: 1px;
  border-radius: 6px;
  font-size: .66rem;
  font-weight: 800;
  color: #fff;
}
.cp-pip--w { background: var(--good, #0e7c55); }
.cp-pip--d { background: #94a3b8; }
.cp-pip--l { background: var(--danger, #b3261e); }

/* ---- fixtures and results ---------------------------------------- */
.cp-games { margin: var(--s-2) 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.cp-game {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 10px 14px;
  border: 1px solid var(--surface-line);
  border-radius: 12px;
  background: var(--surface-sunk);
  font-size: var(--t-meta);
  transition: border-color .15s ease, transform .15s ease;
}
.cp-game:hover { border-color: var(--electric); transform: translateX(2px); }
.cp-game a { font-weight: 700; color: var(--ink); text-decoration: none; }
.cp-game--next { border-inline-start: 3px solid var(--electric); }
.cp-game-date {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cp-more { margin-top: 10px; }
.cp-more > summary {
  display: inline-flex;
  padding: 7px 14px;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--t-meta);
  font-weight: 700;
  color: var(--electric);
  cursor: pointer;
  list-style: none;
}
.cp-more > summary::-webkit-details-marker { display: none; }
.cp-more[open] > summary { margin-bottom: 8px; }

/* ---- highlights -------------------------------------------------- */
.cp-facts { margin: var(--s-2) 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.cp-fact {
  padding: 12px 14px 12px 16px;
  border-inline-start: 4px solid var(--electric);
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--electric) 6%, var(--surface));
}
.cp-fact-tag {
  display: block;
  margin-bottom: 4px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--electric);
}
.cp-fact p { margin: 0; font-size: var(--t-meta); color: var(--ink-mid); line-height: 1.55; }

/* ---- teams ------------------------------------------------------- */
.cp-teams {
  margin: var(--s-3) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.cp-teams li {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  font-size: var(--t-meta);
  border: 1px solid var(--surface-line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .15s ease, transform .15s ease;
}
.cp-teams li:hover { border-color: var(--electric); transform: translateY(-2px); }
.cp-teams .cp-crest { width: 34px; height: 34px; }
.cp-teams a { font-weight: 700; color: var(--ink); text-decoration: none; min-width: 0; }

/* ---- hub --------------------------------------------------------- */
.cph-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--s-6); }
.cph-jump a {
  padding: 8px 14px;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.cph-jump a span { margin-inline-start: 4px; color: var(--ink-soft); font-weight: 600; }
.cph-jump a:hover { border-color: var(--electric); color: var(--electric); }
.cph-group { margin-bottom: var(--s-6); scroll-margin-top: 90px; }
.cph-group h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 var(--s-3); font-size: var(--t-h2); }
.cph-count { font-size: 1rem; font-weight: 700; color: var(--ink-soft); }
.cph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.cph-more { margin-top: 12px; }
.cph-more > summary {
  display: inline-flex;
  padding: 8px 14px;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
  color: var(--electric);
  cursor: pointer;
  list-style: none;
}
.cph-more > summary::-webkit-details-marker { display: none; }
.cph-more ul {
  margin: 14px 0 0;
  padding: 16px;
  list-style: none;
  columns: 4 220px;
  column-gap: 24px;
  border: 1px solid var(--surface-line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.cph-more li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; break-inside: avoid; font-size: var(--t-meta); }
.cph-more li a { color: var(--ink); text-decoration: none; font-weight: 600; }
.cph-more li a:hover { color: var(--electric); }
.cph-more li span { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.cph-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--surface-line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(3, 16, 32, .06);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.cph-card:hover {
  transform: translateY(-3px);
  border-color: var(--electric);
  box-shadow: 0 18px 36px rgba(3, 16, 32, .12);
}
.cph-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--surface-sunk);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--electric);
}
.cph-mark img { width: 44px; height: 44px; object-fit: contain; }
.cph-body { display: grid; gap: 2px; min-width: 0; }
.cph-country {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cph-name { font-size: 1.02rem; line-height: 1.25; }
.cph-facts { font-size: var(--t-meta); color: var(--ink-soft); }
.cph-leader { margin: 2px 0 0; font-size: var(--t-meta); color: var(--ink-mid); }
.cph-live {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--live);
  font-size: .68rem;
  font-weight: 800;
  color: #fff;
}

/* ---- motion ------------------------------------------------------ */
@keyframes cpRise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="off"]) .cp-tile,
  :root:not([data-motion="off"]) .cph-card { animation: cpRise .55s ease-out both; }
  :root:not([data-motion="off"]) .cp-tile:nth-child(2) { animation-delay: .05s; }
  :root:not([data-motion="off"]) .cp-tile:nth-child(3) { animation-delay: .1s; }
  :root:not([data-motion="off"]) .cp-tile:nth-child(4) { animation-delay: .15s; }
  :root:not([data-motion="off"]) .cp-tile:nth-child(5) { animation-delay: .2s; }
  :root:not([data-motion="off"]) .cp-tile:nth-child(6) { animation-delay: .25s; }
}

/* ---- phones ------------------------------------------------------ */
@media (max-width: 620px) {
  .seo-hero.cp-hero { flex-direction: column; align-items: flex-start; }
  .cp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-team-cell { min-width: 140px; }
  .cp-teams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cph-grid { grid-template-columns: minmax(0, 1fr); }
}
