/* R03: targeted corrections to the existing Héritage 1902 components. */
.desktop-nav .nav-main {
  position: relative;
  display: flex;
  align-items: center;
  height: 77px;
  padding: 0;
  font: 500 12px var(--ui);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.desktop-nav button.nav-main {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.desktop-nav .nav-main::after {
  content: "";
  position: absolute;
  inset: auto auto 25px 0;
  height: 1px;
  width: 0;
  background: var(--gold);
}

.desktop-nav .nav-main:is(.current, :hover, [aria-expanded="true"])::after { width: 100%; }

.desktop-nav .nav-submenu {
  top: 100%;
  left: -18px;
  display: block;
  z-index: 1;
}

.desktop-nav .nav-submenu[hidden] { display: none; }

html.drawer-open { overflow: hidden; }
.menu-drawer:not([open]) { display: none; }

.menu-drawer {
  inset: 0 0 0 auto;
  width: min(100%, 420px);
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 24px;
  border-radius: 0;
  overscroll-behavior: contain;
}

.menu-drawer::backdrop { background: #071d168a; }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.menu-drawer .drawer-heading .eyebrow { margin: 0; }

.drawer-heading button {
  flex: 0 0 44px;
  height: 44px;
  border: 1px solid #c8a97080;
  border-radius: 50%;
  background: transparent;
  color: var(--ivory);
  font-size: 25px;
  cursor: pointer;
}

.menu-drawer nav > a {
  display: flex;
  min-height: 52px;
  align-items: center;
  border-bottom: 1px solid #e2cca030;
  font: 500 27px var(--display);
}

.menu-drawer details > a { display: flex; align-items: center; }
.menu-drawer summary { align-content: center; -webkit-tap-highlight-color: #d7bd8229; }
.menu-drawer :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 600px) {
  .menu-drawer { top: 52px; height: calc(100dvh - 52px); max-height: calc(100dvh - 52px); }
}

.fixture-team.home { justify-content: flex-end; text-align: right; }
.fixture-team.away { justify-content: flex-start; }
.fixture-team .initials { width: 40px; height: 40px; flex: none; }
@media (max-width: 1150px) { .fixture-team .initials { width: 32px; height: 32px; } }
.fixture-team > strong { min-width: 0; overflow-wrap: break-word; }
.fixture-score { justify-self: center; min-width: 4ch; text-align: center; }

@media (min-width: 601px) {
  .page-matches .fixture-row {
    grid-template-columns: clamp(78px, 9vw, 125px) minmax(0, 1fr) 70px minmax(0, 1fr) clamp(68px, 13vw, 185px) 90px;
    column-gap: 14px;
  }
  .page-matches .fixture-team { padding: 0; }
  .page-matches .fixture-team.home > img { order: 1; }
  .page-matches .fixture-status { justify-self: end; white-space: normal; }
}
@media (max-width: 600px) {
  .fixture-row, .fixture-row.compact { grid-template-columns: minmax(0, 1fr) 57px minmax(0, 1fr); }
  .fixture-team.home, .fixture-team.away { align-items: center; justify-content: flex-start; text-align: center; padding: 0; }
  .fixture-team.home > img, .fixture-team.home > .initials { order: -1; }
  .fixture-team .initials { width: 37px; height: 37px; }
  .fixture-team > strong { max-width: 100%; margin: 0; }
}

/* Original face crops stay separate from the unapproved studio kit files. */
.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #203c30;
}

.portrait-frame > img {
  position: absolute;
  display: block;
  max-width: none;
  height: auto;
}

.portrait-frame.kit-approved { aspect-ratio: 3 / 4; }
.portrait-frame.kit-approved > img { inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.roster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.roster-card {
  display: grid;
  grid-template-rows: auto 1fr;
  aspect-ratio: auto;
  background: linear-gradient(130deg, #1e3d30, #0c241b);
}

.roster-card > :is(.portrait-frame, .portrait-placeholder) {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  border-bottom: 1px solid #d5b88161;
}

.roster-card > .portrait-placeholder > small { transform: none; }
.portrait-placeholder > .club-crest { width: 42%; height: auto; max-width: 94px; opacity: .8; }

.roster-copy {
  position: static;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 15px 16px 16px;
}

.roster-copy > strong {
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1.05;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.roster-copy > small { font-size: 10px; color: #e4c98f; }
.profile-portrait { align-items: center; }

.profile-portrait > :is(.portrait-frame, .portrait-placeholder) {
  width: min(100%, 255px);
  height: auto;
  aspect-ratio: 4 / 5;
  border: 4px solid #153329;
  outline: 1px solid #bd9b5a;
  box-shadow: 0 0 0 7px #b79a602f, 0 18px 35px #030d0a59;
  border-radius: 12px;
  mask-image: none;
}

.profile-portrait > .kit-approved { aspect-ratio: 3 / 4; }
.profile-watermark { pointer-events: none; }
.watch-card { padding-left: 16px; flex-direction: row; align-items: center; gap: 13px; }
.watch-card .scorer-portrait {
  flex: 0 0 clamp(49px, 5.5vw, 78px);
  border-radius: 7px;
  border: 1px solid #aa895566;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  gap: 0;
}
.watch-card .scorer-portrait small { display: none; }
.watch-card .scorer-portrait .club-crest { width: 63%; }
.watch-goals { top: 50%; transform: translateY(-50%); }

.spotlight { height: 510px; }
.spotlight .player-stage { bottom: 88px; touch-action: pan-y; }
.spotlight .player-slide {
  width: clamp(130px, 27vw, 360px);
  padding: 0;
  justify-content: start;
  visibility: hidden;
  pointer-events: none;
}

.spotlight .player-slide:is(.active, .next, .previous) { visibility: visible; pointer-events: auto; }
.spotlight .player-slide:is(.next, .previous) {
  opacity: .78;
  filter: saturate(.74);
  cursor: pointer;
  --offset: min(25.5vw, 305px);
}

.spotlight .player-slide.next { transform: translateX(calc(-50% + var(--offset))) translateY(22px) scale(.79); }
.spotlight .player-slide.previous { transform: translateX(calc(-50% - var(--offset))) translateY(22px) scale(.79); }
.spotlight .player-slide > .spotlight-portrait {
  width: 178px;
  height: auto;
  aspect-ratio: 4 / 5;
  border: 1px solid #bd9d62;
  border-radius: 12px;
  mask-image: none;
  margin: 0;
}

.spotlight .player-copy h3 { margin: 12px auto 5px; font-size: clamp(20px, 2.1vw, 31px); }
.spotlight .player-copy > p { letter-spacing: .11em; color: #e1cc9f; }
.spotlight .portrait-pending { margin-top: 4px; min-height: 36px; }
.spotlight .player-slide:not(.active) .portrait-pending { visibility: hidden; }

.carousel-pagination {
  position: absolute;
  z-index: 6;
  inset: auto 0 17px;
  width: max-content;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: auto;
}

.carousel-pages { display: flex; justify-content: center; flex-wrap: wrap; width: min(448px, 65vw); }
.carousel-pages button {
  position: relative;
  width: 16px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.carousel-pages button::after {
  content: "";
  position: absolute;
  inset: 10px 5px;
  background: #d7bd82;
  opacity: .62;
  border-radius: 50%;
}

.carousel-pages button[aria-current="true"]::after { opacity: 1; box-shadow: 0 0 0 2px #10271f, 0 0 0 3px #dfba6c; }
.carousel-count { color: #e6d4a9; font: 600 12px var(--ui); font-variant-numeric: tabular-nums; white-space: nowrap; }

.carousel-pause {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #d7bd827d;
  color: var(--ivory);
  background: transparent;
  cursor: pointer;
}

.carousel-pause:disabled { opacity: .45; cursor: default; }
.formation-masthead .masthead-photo { object-position: 65% 33%; }
.formation-masthead .masthead-overlay { background: linear-gradient(90deg, #0b2117f7, #10271fb0 54%, #10271f25), linear-gradient(0deg, #10271fbe, transparent 60%); }
.masthead-credit { color: #eadbc2; font-size: 11px; margin-top: 18px; text-align: right; }
.club-archive-caption { display: block; padding: 7px 14px; color: #eae1cf; background: var(--forest); font-size: 10px; }
.formation-card-photo { margin: 0 0 17px; }
.formation-card-photo img { width: 100%; height: auto; aspect-ratio: 2.1; object-fit: cover; border-radius: 6px; }
.formation-card-photo figcaption { margin-top: 7px; color: #615745; font-size: 11px; line-height: 1.5; }

@media (max-width: 900px) and (min-width: 601px) {
  .roster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .watch-card { padding-right: 52px; }
  .watch-goals { right: 13px; }
}

@media (max-width: 600px) {
  .roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roster-copy { padding: 12px 10px; }
  .roster-copy > small { font-size: 9px; }
  .profile-portrait { height: auto; min-height: 0; margin-bottom: 18px; }
  .profile-portrait > :is(.portrait-frame, .portrait-placeholder) { width: clamp(175px, 52vw, 245px); }
  .player-hero { min-height: unset; }
  .spotlight { height: 430px; }
  .spotlight .player-stage { bottom: 93px; }
  .spotlight .player-slide { width: min(39vw, 190px); }
  .spotlight .player-slide:is(.next, .previous) { --offset: 30vw; }
  .spotlight .player-slide > .spotlight-portrait { width: clamp(85px, 32vw, 128px); }
  .spotlight .player-slide:is(.next, .previous) > .spotlight-portrait { width: clamp(60px, 23vw, 93px); }
  .spotlight .player-slide:is(.next, .previous) .player-copy { width: 88%; }
  .spotlight .player-copy h3 { margin-top: 8px; line-height: 1.04; overflow-wrap: anywhere; }
  .spotlight .player-slide:not(.active) .player-copy h3 { font-size: 17px; }
  .spotlight .player-copy > p { font-size: 8px; }
  .spotlight-controls { top: auto; bottom: 76px; }
  .carousel-pagination { gap: 8px; padding-inline: 12px; }
  .carousel-pages { width: min(57vw, 250px); }
  .carousel-pages button { width: calc(100% / 14); height: 23px; }
  .carousel-pages button::after { inset: 9px calc(50% - 2.5px); }
}
