/*
 * Shared shell corrections for the custom RHL frontend.
 * Keeps header/footer behavior independent from page-level resets.
 */
header.header a,
footer.rhl-footer a,
.rhl-crumb a,
.region-modal a,
.mobile-drawer a,
.mobile-bottom-nav a {
  text-decoration: none;
}

header.header .socials a,
footer.rhl-footer .ft-soc {
  box-sizing: border-box;
}

header.header .socials svg,
footer.rhl-footer .ft-soc svg {
  display: block;
  flex: 0 0 auto;
  margin: 0;
}

/*
 * Compact laptop shell.
 * The long wordmark yields to navigation first; the crest remains visible.
 * If translated labels ever grow, overflow is contained inside the nav
 * instead of painting over the brand.
 */
@media (min-width: 781px) and (max-width: 1580px) {
  header.header .head-main {
    gap: 18px;
    padding-right: 24px;
    padding-left: 24px;
  }

  header.header .brand {
    flex: 0 0 auto;
    min-width: 0;
  }

  header.header .brand-name {
    display: none;
  }

  header.header .brand-logo {
    height: 82px;
  }

  header.header .mainnav {
    min-width: 0;
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  header.header .mainnav::-webkit-scrollbar {
    display: none;
  }
}

@media (min-width: 781px) and (max-width: 1180px) {
  header.header .head-main {
    gap: 14px;
    padding-right: 18px;
    padding-left: 18px;
  }

  header.header .brand-logo {
    height: 72px;
  }

  header.header .mainnav {
    gap: 0;
  }

  header.header .mainnav .n {
    padding-right: 7px;
    padding-left: 7px;
    font-size: 11px;
    letter-spacing: .025em;
  }

  header.header .nav-regions {
    display: none;
  }
}

@media (min-width: 781px) and (max-width: 940px) {
  header.header .head-main {
    gap: 10px;
    padding-right: 14px;
    padding-left: 14px;
  }

  header.header .brand-logo {
    height: 64px;
  }

  header.header .mainnav .n {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 10.5px;
    letter-spacing: .01em;
  }

  header.header .nav-find {
    display: none;
  }
}

/*
 * Search layers.
 * The desktop result panel is positioned against the viewport by
 * rhl-nav-search.js, so it cannot be clipped by the scrollable navigation or
 * by the home-page header artwork.
 */
@media (min-width: 781px) {
  header.header {
    z-index: 320;
  }

  header.header .head-main,
  header.header .nav-find {
    overflow: visible;
  }

  header.header .nav-find {
    z-index: 330;
  }

  header.header .nav-search-results {
    z-index: 2100;
  }
}

/*
 * Dark player cards in the desktop header and mobile drawer. Page-level home
 * styles also define .ps-result for the white standings panel, so the shell
 * must fully establish its own dark surface instead of inheriting fragments.
 */
header.header .nav-search-results,
.mobile-search .nav-search-results {
  border-color: rgba(255, 255, 255, .13);
  background: linear-gradient(180deg, #171720 0%, #0a0a10 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .62);
}

header.header .nav-search-results .ps-result,
.mobile-search .nav-search-results .ps-result {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  color: #fff;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
  box-shadow: none;
}

header.header .nav-search-results .ps-photo,
.mobile-search .nav-search-results .ps-photo {
  width: 42px;
  height: 42px;
  box-sizing: border-box;
  padding: 2px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
  background: linear-gradient(145deg, #f7f7f8 0%, #dfe1e7 100%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .14);
}

header.header .nav-search-results .ps-photo img,
.mobile-search .nav-search-results .ps-photo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  background: #e9ebef;
}

header.header .nav-search-results .ps-result:last-child,
.mobile-search .nav-search-results .ps-result:last-child {
  border-bottom: 0;
}

header.header .nav-search-results .ps-result:hover,
header.header .nav-search-results .ps-result.active,
.mobile-search .nav-search-results .ps-result:hover,
.mobile-search .nav-search-results .ps-result.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(200, 16, 46, .27), rgba(200, 16, 46, .1));
  box-shadow: inset 3px 0 0 #e8253f;
}

header.header .nav-search-results .ps-result:hover .ps-photo,
header.header .nav-search-results .ps-result.active .ps-photo,
.mobile-search .nav-search-results .ps-result:hover .ps-photo,
.mobile-search .nav-search-results .ps-result.active .ps-photo {
  box-shadow: 0 5px 18px rgba(200, 16, 46, .34), 0 0 0 2px rgba(232, 37, 63, .46);
}

header.header .nav-search-results .ps-name,
header.header .nav-search-results .ps-points b,
.mobile-search .nav-search-results .ps-name,
.mobile-search .nav-search-results .ps-points b {
  color: #fff;
}

header.header .nav-search-results .ps-number,
.mobile-search .nav-search-results .ps-number {
  color: #ff4862;
}

header.header .nav-search-results .ps-club,
header.header .nav-search-results .ps-team-name,
.mobile-search .nav-search-results .ps-club,
.mobile-search .nav-search-results .ps-team-name {
  color: rgba(255, 255, 255, .58);
}

header.header .nav-search-results .ps-points em,
.mobile-search .nav-search-results .ps-points em {
  color: rgba(255, 255, 255, .42);
}

header.header .nav-search-results .ps-split,
.mobile-search .nav-search-results .ps-split {
  color: rgba(255, 255, 255, .4);
  font-variant-numeric: tabular-nums;
}

/*
 * Home standings search lives on a light surface. Scope every colour so the
 * dark header dropdown cannot leak white typography into these cards.
 */
[data-player-search] .player-search-results {
  z-index: 40;
  overflow-x: hidden;
  border: 1px solid #dfe1e7;
  border-top: 3px solid #c8102e;
  border-radius: 0 0 12px 12px;
  background: #fff;
  box-shadow: 0 22px 48px rgba(18, 20, 29, .18);
}

[data-player-search] .ps-result {
  position: relative;
  grid-template-columns: 46px minmax(0, 1fr) 78px;
  color: #171820;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e7e8ed;
  border-radius: 0;
  box-shadow: inset 0 0 0 0 #c8102e;
  transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

[data-player-search] .ps-result:last-of-type {
  border-bottom: 0;
}

[data-player-search] .ps-result:hover,
[data-player-search] .ps-result.active {
  color: #171820;
  background: linear-gradient(90deg, #fff0f3 0%, #fff8f9 72%, #fff 100%);
  box-shadow: inset 4px 0 0 #c8102e;
  transform: translateX(1px);
}

[data-player-search] .ps-photo {
  width: 42px;
  height: 42px;
  box-sizing: border-box;
  padding: 2px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(145deg, #f3f4f7, #e6e8ee);
  box-shadow: 0 4px 14px rgba(19, 22, 31, .14), 0 0 0 1px #d7dae2;
}

[data-player-search] .ps-photo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  background: #eef0f4;
}

[data-player-search] .ps-result:hover .ps-photo,
[data-player-search] .ps-result.active .ps-photo {
  box-shadow: 0 5px 17px rgba(200, 16, 46, .22), 0 0 0 2px rgba(200, 16, 46, .25);
}

[data-player-search] .ps-name {
  color: #15161d;
  font-weight: 700;
}

[data-player-search] .ps-number {
  padding: 3px 7px;
  border: 1px solid rgba(200, 16, 46, .22);
  border-radius: 999px;
  background: #171820;
  color: #ff415c;
  font-size: 10px;
  line-height: 1.1;
}

[data-player-search] .ps-club {
  color: #6b707c;
}

[data-player-search] .ps-team-name {
  color: #6b707c;
}

[data-player-search] .ps-split {
  color: #9499a4;
  font-variant-numeric: tabular-nums;
}

[data-player-search] .ps-team-logo {
  padding: 1px;
  border-radius: 50%;
  background: #fff;
}

[data-player-search] .ps-points {
  color: #c8102e;
}

[data-player-search] .ps-points i,
[data-player-search] .ps-points b {
  color: #c8102e;
}

[data-player-search] .ps-points em {
  color: #777d89;
}

[data-player-search] .ps-empty {
  color: #686e79;
  background: #fff;
}
