
/* =====================================================================
   SECTION START: Medal Standings
   ===================================================================== */
.mainWrapper .medalContailer{padding-top: 20px;}
.medal-standings {
    position: relative;
    background: #f9f9fb;
    border-radius: 8px;
    margin-bottom: 60px;
    margin-top: 0;
}
.prose-block{margin-top: 60px;}

/* Centers the inner content and applies the 24px side gutter,
   mirroring Figma's "Container:margin" > "Container" wrapper */

.ms-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 0 24px;
}


/* ---------- Heading-Row ---------- */
.medalHeading-Row {
  display: flex;
  align-items: flex-start;
  padding-top: 70px;
  flex-shrink: 0;
  width: 100%;
}
.ms-heading-wrap{
  width: 100%;
  order: initial;
}
.medal-heading-wrap {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  width: 100%;
}


.medal-heading h2 {
color: var(--accent);
font-family: Rubik;
font-size: 42px;
font-style: normal;
font-weight: 600;
line-height: 56px; /* 133.333% */
}

.ms-legend {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 320px;
  padding-top: 12px;
}

.ms-legend-item {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ms-legend-swatch {
  height: 3px;
  width: 28px;
  border-radius: 1px;
}
.ms-legend-swatch.gold {
  background: #ebb024;
}
.ms-legend-swatch.silver {
  background: #ababab;
}
.ms-legend-swatch.bronze {
  background: #aa6c32;
}

.ms-legend-label {
  font-size: 14px;
  line-height: 18px;
  color: #262626;
  text-transform: uppercase;
  white-space: nowrap;
}



/* ---------- Right column: the medal table ---------- */
.ms-right {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  padding-bottom: 40px;
  width: 100%;
  margin-top: 60px;
  order: initial;
}

.ms-rank-row {
  display: flex;
  align-items: center;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid rgba(11, 11, 11, 0.1);
}

.ms-rank-row.is-hidden {
  display: none;
}

.ms-loadmore-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-bottom: 40px;
}

.ms-loadmore-wrap:has(.ms-loadmore.is-hidden) {
  padding: 0;
}

.ms-loadmore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #262626;
  border-radius: 4px;
  padding: 12px 24px;
  color: #262626;
  font-family: Rubik;
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 20px; /* 111.111% */
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ms-loadmore svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.ms-loadmore:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ms-loadmore.is-hidden {
  display: none;
}


/* Big "01" / "02" watermark-style rank number, very low opacity
   (0.07) so it sits behind/beside the content as a background motif */
.ms-rank-number {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0;
  width: 42px;
  opacity: 0.07;
}
.firstRank-row .ms-rank-number {
    margin-left: 0;
}
.ms-rank-number span {
  color: var(--accent);
  font-family: Rubik;
  font-size: 35px;
  font-style: normal;
  font-weight: 700;
  line-height: 35px; 
  letter-spacing:normal;
}

.ms-row-body {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  margin-left: 10px;
}
.firstRank-row .ms-row-body {
    margin-left: 10px;
}

.ms-row-top {
  display: flex;
  align-items: center;
  width: 100%;
  padding-left: 10px;
}

.ms-country {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  align-self: stretch;
  justify-content: center;
}

.ms-country-inner {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.ms-flag {
  font-size: 20px;
  line-height: 30px;
}

.ms-country-name {
color: #000;
font-family: Rubik;
font-size: 18px;
font-style: normal;
font-weight: 500;
line-height: 22px; /* 122.222% */
text-transform: uppercase;
}

.ms-medals {
  display: flex;
  flex: 1 0 0;
  gap: 44px;
  align-items: center;
  min-width: 0;
}

.ms-medal-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 28px;
  width: 28px;
}

.ms-medal-count span {
  font-size: 18px;
  font-weight: 500;
  line-height: 22px;
  text-align: center;
  white-space: nowrap;
}
.ms-medal-count.gold span {
  color: #ebb024;
}
.ms-medal-count.silver span {
  color: #ababab;
}
.ms-medal-count.bronze span {
  color: #aa6c32;
}

.ms-total {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 49px;
  flex-shrink: 0;
  border-left: 1px solid rgba(11, 11, 11, 0.1);
  padding-left: 20px;
}

.ms-total-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.ms-total-num span {
  font-size: 22px;
  font-weight: 700;
  line-height: 22px;
  color: #0b0b0b;
  text-align: center;
  white-space: nowrap;
}

.ms-total-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 14px;
  padding-top: 2px;
}

.ms-total-label span {
  font-size: 8px;
  line-height: 12px;
  color: #6a5f52;
  text-align: center;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Thin 3-segment progress bar under each row. Segment widths use
   inline flex-grow values matching that row's actual gold/silver/
   bronze counts (e.g. style="flex:45 0 0") */
.ms-bar {
  display: flex;
  gap: 1px;
  align-items: center;
  width: 100%;
  padding: 0 1px;
}

.ms-bar-segment {
  flex: 1 0 0;
  min-width: 0;
  height: 4px;
  border-radius: 1px;
}
.ms-bar-segment.gold {
  background: #ebb024;
}
.ms-bar-segment.silver {
  background: #ababab;
}
.ms-bar-segment.bronze {
  background: #bb4d00;
}

/* ---------- Decorative medal icons (top-left, large) ---------- */
.ms-medal-icons-large {
  position: absolute;
  top: 1px;
  left: 24px;
  display: flex;
  gap: 27.9px;
}

.ms-medal-icons-large img {
  display: block;
}

.ms-search {
    position: relative;
    max-width: 353px;
    height: 42px;
    width: 100%;
}

.ms-search__icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--accent);
  pointer-events: none;
}

.ms-search__input {
  width: 100%;
  height: 100%;
  border: 1px solid #dedede;
  border-radius: 4px;
  padding: 0 14px 0 40px;
  font-family: "Rubik", sans-serif;
  font-size: 14px;
  color: #262626;
  background: #fff;
}

.ms-search__input::placeholder {
  color: #a3a3a3;
}

.ms-search__input:focus {
  outline: none;
  border-color: var(--accent);
}


@media (max-width: 991px) {
  .firstRank-row .ms-rank-number{margin-left: 0;}
  .firstRank-row .ms-rank-number {
    width: 36px;
    opacity: 0.15;
    align-items: flex-start
  }
  .ms-rank-row {
    align-items: flex-start;
  }
  .firstRank-row .ms-row-body {
    margin-left: 15px;
  }
  .ms-rank-row {
    border-bottom: none;
  }
  .ms-row {
    flex-direction: column;
    gap: 20px;
  }

  /* Large medal icons: shrink and sit above everything, static */
  .ms-medal-icons-large {
    gap: 14px;
  }
  .ms-medal-icons-large img {
    height: 40px;
    width: 22px;
  }

  /* Break .medalCol-left apart so its two children can be reordered
     independently against .ms-right (the row list) */
  .medalCol-left {
    display: contents;
  }

  .medal-heading-wrap {
    order: 1;
    width: 100%;
    padding-top: 0;
    gap: 20px;
  }
 
  .medal-heading h2 {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.2em;
    font-size: 28px;
    line-height: 32px;
  }
  .medal-heading h2 > br {
    display: none;
  }

  .ms-legend {
    width: 100%;
    justify-content: flex-start;
    gap: 29px;
  }
  .ms-legend-swatch {
    width: 20px;
  }


  /* Smaller faded rank number, tighter row spacing */
  .ms-rank-number {
    width: 32px;
    opacity: 0.15;
    align-items: flex-start;
  }
  .ms-rank-number span {
    font-size: 30px;
    line-height: 32px;
    letter-spacing: 0;
  }

  .ms-row-top {
    padding-left: 0;
    position: relative;
  }
  .ms-country-inner {
    gap: 6px;
  }
  .ms-flag {
    font-size: 16px;
    line-height: 20px;
  }
  .ms-country-name {
    font-size: 15px;
    line-height: 18px;
  }

  .ms-medals {
    display: flex;
    flex: 1 0 0;
    gap: 0px;
    align-items: center;
    min-width: 0;
    flex-wrap: wrap;
    position: relative;
    top: 12px;
    width: 100%;
    justify-content: space-between;
    margin-top: 10px;
    margin-bottom: 10px;
  }
  .ms-medal-count {
    width: 22px;
    min-width: 22px;
  }
  .ms-medal-count span {
    font-size: 15px;
    line-height: 18px;
  }

  .ms-country {
    position: absolute;
  }

  .ms-total {
    padding-left: 12px;
  }
  .ms-total-num span {
    font-size: 15px;
    line-height: 18px;
  }
  .ms-total-label span {
    font-size: 10px;
  }

  /* CTA moves to the very bottom, full width, centered */
  .ms-cta {
    order: 3;
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    margin-top: 4px;
    max-width: 186px;
    margin: 0 auto;
  }
  .ms-cta span {
    font-size: 14px;
  }
}

@media (max-width:767px){
  .mainWrapper .customContainer {
    padding: 0;
    box-shadow: none;
  }
  .medalHeading-Row {
    gap: 10px;
    flex-wrap: wrap;
}
  .prose-block {
    margin-left: -15px;
    margin-right: -15px;
}
}

@media (max-width: 575px) {
  .mainWrapper .customContainer {
    margin-top: 23px;
  }
  .medal-standings {
    padding: 16px 10px;
    margin-bottom: 30px;
  }
  .medal-standings{margin-bottom: 30px;margin-top: 30px;}
  .ms-container {
    padding: 0 0px;
  }
}
/* ================SECTION END: Medal Standings===================== */