/*
 * KISURE FE982 ??? authoritative player headshot compatibility layer.
 *
 * FE981 introduced the presentation contract. FE982 makes that contract win
 * over older high-specificity player/transfer/profile CSS without changing
 * any original provider media.
 */

:root{
  --ks-player-headshot-x:50%;
  --ks-player-headshot-y:9%;
  --ks-player-headshot-zoom:1.42;
  --ks-player-hero-headshot-x:50%;
  --ks-player-hero-headshot-y:7%;
  --ks-player-hero-headshot-zoom:1.55;
}

/* Every compact player viewport clips the image; old transfer CSS used
   overflow:visible which exposed shoulders/chest outside the intended frame. */
html[data-kisure-design="865"] body .ks-player-face-frame,
html[data-kisure-design="865"] body .ks-transfer-centre-page .ks-transfer-player-photo,
html[data-kisure-design="865"] body .ks-top-transfer-row__photo,
html[data-kisure-design="865"] body .ks-ref-transfer-row__photo,
html[data-kisure-design="865"] body .global-search-card__media.is-player-face,
html[data-kisure-design="865"] body .football-commentary-person__avatar{
  overflow:hidden !important;
}

/* Canonical compact headshot rule. Specificity intentionally exceeds the
   v588/v641/v945 transfer and player rules that used contain/transform:none. */
html[data-kisure-design="865"] body .ks-player-face-frame > img,
html[data-kisure-design="865"] body .ks-player-face-frame > img.ks-player-face-img,
html[data-kisure-design="865"] body .ks-transfer-centre-page .ks-transfer-player-photo > img,
html[data-kisure-design="865"] body .ks-transfer-centre-page .ks-transfer-player-photo > img.ks-player-face-img,
html[data-kisure-design="865"] body .ks-top-transfer-row__photo > img,
html[data-kisure-design="865"] body .ks-top-transfer-row__photo > img.ks-player-face-img,
html[data-kisure-design="865"] body .ks-ref-transfer-row__photo > img,
html[data-kisure-design="865"] body .global-search-card__media.is-player-face > img,
html[data-kisure-design="865"] body .football-commentary-person__avatar > img.ks-player-face-img{
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  max-height:none !important;
  object-fit:cover !important;
  object-position:var(--ks-player-headshot-x) var(--ks-player-headshot-y) !important;
  transform:scale(var(--ks-player-headshot-zoom)) !important;
  transform-origin:var(--ks-player-headshot-x) var(--ks-player-headshot-y) !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}

/* Player profile hero: match the actual compact/native portrait markup with
   enough specificity to override v942/v943/v945 max-width/max-height and
   transform rules. The viewport shows head + neck + minimal shoulder only. */
html[data-kisure-design="865"] body
[data-kisure-solid-hero="player"][data-kisure-native-portrait="1"]
> .football-player-hero__media[data-kisure-player-media-card="1"],
html[data-kisure-design="865"] body
[data-kisure-solid-hero="player"][data-kisure-native-portrait="1"]
> .football-player-hero__media[data-kisure-profile-media-card="1"],
html[data-kisure-design="865"] body
[data-kisure-solid-hero="player"][data-kisure-profile-layout="compact-v901"]
> .football-player-hero__media{
  overflow:hidden !important;
}

html[data-kisure-design="865"] body
[data-kisure-solid-hero="player"][data-kisure-native-portrait="1"]
> .football-player-hero__media[data-kisure-player-media-card="1"]
> img.ks-player-face-img--hero,
html[data-kisure-design="865"] body
[data-kisure-solid-hero="player"][data-kisure-native-portrait="1"]
> .football-player-hero__media[data-kisure-profile-media-card="1"]
> img.ks-player-face-img--hero,
html[data-kisure-design="865"] body
[data-kisure-solid-hero="player"][data-kisure-profile-layout="compact-v901"]
> .football-player-hero__media
> img.ks-player-face-img--hero{
  width:100% !important;
  height:100% !important;
  min-width:100% !important;
  min-height:100% !important;
  max-width:none !important;
  max-height:none !important;
  object-fit:cover !important;
  object-position:var(--ks-player-hero-headshot-x) var(--ks-player-hero-headshot-y) !important;
  transform:scale(var(--ks-player-hero-headshot-zoom)) !important;
  transform-origin:var(--ks-player-hero-headshot-x) var(--ks-player-hero-headshot-y) !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}

/* Small screens need a touch less zoom because the physical viewport shrinks. */
@media (max-width:520px){
  :root{
    --ks-player-headshot-zoom:1.36;
    --ks-player-hero-headshot-zoom:1.46;
  }
}

/* Printing should retain an uncropped semantic image. */
@media print{
  html[data-kisure-design="865"] body .ks-player-face-img{
    transform:none !important;
  }
}
