/* Kisure Sports Frontend v797
   Final article-linked layout correction.
   Scope: news article Match Summary + Transfer Summary only.
   Goals:
   - keep FE796 flat brand treatment; no gradients/glass/glow
   - fix transfer logo/name collision with explicit logo/copy grid tracks
   - keep transfer crests compact, fully visible and uncropped
   - use white crest edge only in dark mode; neutral depth in light mode
   - make venue/season detail row unambiguously readable in light mode
*/

body.is-news-article-page {
  --ks797-ink: #102033;
  --ks797-muted: #5e6e82;
  --ks797-line: #d9e2e8;
  --ks797-white: #ffffff;
  --ks797-green: #063f3b;
  --ks797-green-deep: #043531;
  --ks797-green-detail: #064d48;
  --ks797-teal: #078b87;
  --ks797-teal-bright: #5ce4dc;
  --ks797-dark-line: #314646;
}

/* --------------------------------------------------------------------------
   MATCH DETAILS — explicit light-mode venue/season readability.
   This is intentionally more specific than legacy theme rules.
   -------------------------------------------------------------------------- */
html[data-theme="light"] body.site-body.is-news-article-page .article-linked-data-stack .article-match-scoreboard__more-body {
  background: var(--ks797-green-detail) !important;
  background-image: none !important;
  border: 1px solid #37615f !important;
  color: var(--ks797-white) !important;
  -webkit-text-fill-color: var(--ks797-white) !important;
}

html[data-theme="light"] body.site-body.is-news-article-page .article-linked-data-stack .article-match-scoreboard__more-body .article-match-scoreboard__details--last {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .55rem 1.15rem !important;
  margin: .75rem 0 0 !important;
  padding: .75rem .85rem 0 !important;
  background: transparent !important;
  border-top: 1px solid rgba(255,255,255,.58) !important;
  color: var(--ks797-white) !important;
  -webkit-text-fill-color: var(--ks797-white) !important;
  opacity: 1 !important;
}

html[data-theme="light"] body.site-body.is-news-article-page .article-linked-data-stack .article-match-scoreboard__more-body .article-match-scoreboard__details--last :is(span,a) {
  display: inline-flex !important;
  align-items: center !important;
  gap: .4rem !important;
  color: var(--ks797-white) !important;
  -webkit-text-fill-color: var(--ks797-white) !important;
  font-weight: 800 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html[data-theme="light"] body.site-body.is-news-article-page .article-linked-data-stack .article-match-scoreboard__more-body .article-match-scoreboard__details--last i {
  color: var(--ks797-teal-bright) !important;
  -webkit-text-fill-color: var(--ks797-teal-bright) !important;
  opacity: 1 !important;
}

/* If venue/season are the only expanded detail, keep the panel compact. */
html[data-theme="light"] body.site-body.is-news-article-page .article-linked-data-stack .article-match-scoreboard__more-body > .article-match-scoreboard__details--last:only-child,
html[data-theme="dark"] body.site-body.is-news-article-page .article-linked-data-stack .article-match-scoreboard__more-body > .article-match-scoreboard__details--last:only-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: 0 !important;
  min-height: 2.35rem !important;
}

/* Dark mode remains the already-approved white-on-solid-dark-green treatment. */
html[data-theme="dark"] body.site-body.is-news-article-page .article-linked-data-stack .article-match-scoreboard__more-body .article-match-scoreboard__details--last :is(span,a) {
  color: var(--ks797-white) !important;
  -webkit-text-fill-color: var(--ks797-white) !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}

/* --------------------------------------------------------------------------
   TRANSFER SUMMARY — explicit, collision-proof structure.
   -------------------------------------------------------------------------- */
body.is-news-article-page .article-transfer-summary-block__move {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(76px, 104px) minmax(0, 1fr) !important;
  align-items: center !important;
  column-gap: 1rem !important;
  row-gap: .75rem !important;
  min-width: 0 !important;
}

body.is-news-article-page .article-transfer-summary-block__club {
  min-width: 0 !important;
  overflow: visible !important;
  align-items: center !important;
}

body.is-news-article-page .article-transfer-summary-block__club.has-logo {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  grid-template-areas:
    "logo label"
    "logo name" !important;
  column-gap: .65rem !important;
  row-gap: .12rem !important;
}

body.is-news-article-page .article-transfer-summary-block__club.no-logo {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  grid-template-areas:
    "label"
    "name" !important;
  row-gap: .16rem !important;
}

body.is-news-article-page .article-transfer-summary-block__club > img {
  grid-area: logo !important;
  display: block !important;
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  min-width: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  clip-path: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  margin: 0 !important;
}

body.is-news-article-page .article-transfer-summary-block__club > span {
  grid-area: label !important;
  min-width: 0 !important;
  margin: 0 !important;
  line-height: 1.1 !important;
}

body.is-news-article-page .article-transfer-summary-block__club > :is(a,strong) {
  grid-area: name !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
}

body.is-news-article-page .article-transfer-summary-block__club > a {
  display: block !important;
  text-decoration: none !important;
}

body.is-news-article-page .article-transfer-summary-block__club > a > strong {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
}

/* Crest visibility: no green edge. Neutral light-mode depth; white dark-mode edge. */
html[data-theme="light"] body.is-news-article-page .article-transfer-summary-block__club > img {
  filter: drop-shadow(0 1px 2px rgba(16,32,51,.22)) !important;
}

html[data-theme="dark"] body.is-news-article-page .article-transfer-summary-block__club > img {
  filter:
    drop-shadow(1px 0 0 rgba(255,255,255,.95))
    drop-shadow(-1px 0 0 rgba(255,255,255,.95))
    drop-shadow(0 1px 0 rgba(255,255,255,.95))
    drop-shadow(0 -1px 0 rgba(255,255,255,.95)) !important;
}

/* Keep the player marker centered in its dedicated column. */
body.is-news-article-page .article-transfer-summary-block__player {
  min-width: 0 !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .45rem !important;
  overflow: visible !important;
}

body.is-news-article-page .article-transfer-summary-block .ks-player-face-frame--article {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
}

/* Solid, mature light/dark surfaces. No gradients, glow or glass. */
html[data-theme="light"] body.site-body.is-news-article-page .article-transfer-summary-block {
  background: #ffffff !important;
  background-image: none !important;
  border-color: var(--ks797-line) !important;
  color: var(--ks797-ink) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html[data-theme="dark"] body.site-body.is-news-article-page .article-transfer-summary-block {
  background: var(--ks797-green) !important;
  background-image: none !important;
  border-color: var(--ks797-dark-line) !important;
  color: var(--ks797-white) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html[data-theme="light"] body.site-body.is-news-article-page .article-transfer-summary-block :is(
  .article-transfer-summary-block__header,
  .article-transfer-summary-block__move,
  .article-transfer-summary-block__meta,
  .article-transfer-summary-block__footer
) {
  background: #ffffff !important;
  background-image: none !important;
  border-color: var(--ks797-line) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body.site-body.is-news-article-page .article-transfer-summary-block :is(
  .article-transfer-summary-block__header,
  .article-transfer-summary-block__move,
  .article-transfer-summary-block__meta,
  .article-transfer-summary-block__footer
) {
  background: var(--ks797-green) !important;
  background-image: none !important;
  border-color: var(--ks797-dark-line) !important;
  box-shadow: none !important;
}

@media (max-width: 700px) {
  body.is-news-article-page .article-transfer-summary-block__move {
    grid-template-columns: minmax(0,1fr) 54px minmax(0,1fr) !important;
    column-gap: .55rem !important;
    padding-left: .75rem !important;
    padding-right: .75rem !important;
  }

  body.is-news-article-page .article-transfer-summary-block__club.has-logo {
    grid-template-columns: 38px minmax(0,1fr) !important;
    column-gap: .45rem !important;
  }

  body.is-news-article-page .article-transfer-summary-block__club > img {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
  }

  body.is-news-article-page .article-transfer-summary-block .ks-player-face-frame--article {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
  }

  body.is-news-article-page .article-transfer-summary-block__club > :is(a,strong),
  body.is-news-article-page .article-transfer-summary-block__club > a > strong {
    font-size: .78rem !important;
    line-height: 1.15 !important;
  }
}
