/* ==========================================================================
   MBC Sport — Styles principaux & Shortcodes
   ========================================================================== */

/* 1. Reset & Layouts de base
   -------------------------------------------------------------------------- */
.mbc-carousel,
.mbc-next,
.mbc-ranking,
.mbc-sport {
  width: 100%;
  min-width: 0;
  font-family: inherit;
}

.mbc-carousel *,
.mbc-next *,
.mbc-ranking *,
.mbc-sport * {
  box-sizing: border-box;
}

/* Accessibilité : Focus visible */
.mbc-carousel button:focus-visible,
.mbc-carousel a:focus-visible,
.mbc-carousel__track:focus-visible,
.mbc-ranking__scroll:focus-visible,
.mbc-next a:focus-visible {
  outline: 3px solid #ff9b4f;
  outline-offset: 3px;
}

/* 2. Composant : Carousel (Carrousel de matchs)
   -------------------------------------------------------------------------- */
.mbc-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.mbc-carousel__controls button {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid #298cec;
  border-radius: 10px;
  background: #102944;
  color: #fff;
  font-size: 23px;
  cursor: pointer;
}

.mbc-carousel__controls button:disabled {
  opacity: 0.4;
  cursor: default;
}

.mbc-carousel__status {
  font-size: 13px;
}

.mbc-carousel__track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  padding: 4px 0 12px;
  scrollbar-width: thin;
}

/* Cartes de Match */
.mbc-carousel__card {
  flex: 0 0 calc((100% - 20px) / 2);
  min-width: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid #285174;
  border-radius: 14px;
  background: linear-gradient(135deg, #133859, #09233b);
  color: #fff;
}

/* États de carte */
.mbc-carousel__card--past {
  background: linear-gradient(135deg, #203442, #122331);
  border-color: #65717e;
}

.mbc-carousel__card--live {
  background: linear-gradient(135deg, #155445, #092f29);
  border-color: #46b991;
}

.mbc-carousel__card--neutral {
  background: linear-gradient(135deg, #39434c, #212a32);
}

/* En-tête de carte */
.mbc-carousel__card header {
  text-align: center;
  border-bottom: 2px solid #ff7615;
  padding-bottom: 16px;
}

.mbc-carousel .mbc-carousel__card h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.5;
  margin: 0;
  color: #b6c5d3;
}

.mbc-carousel .mbc-carousel__date {
  display: block;
  margin: 7px 0;
  padding: 0;
  background: none;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.mbc-carousel__labels {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #b6cee2;
  font-size: 12px;
}

/* Badges & Tags */
.mbc-carousel__badge {
  display: inline-block;
  background: #b6ffdb;
  color: #123c2d !important;
  border-radius: 5px;
  padding: 3px 8px;
  margin-bottom: 8px;
  font-weight: 700;
}

.mbc-carousel__venue {
  background: #ff7615;
  border: 0;
  color: #09233b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: 5px;
  padding: 3px 8px;
}

.mbc-carousel__result {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: inherit;
}

.mbc-carousel__result--win {
  background: #09b075;
  color: #fff;
}

.mbc-carousel__result--loss {
  background: #fc4956;
  color: #fff;
}

/* Alignement des équipes */
.mbc-carousel__teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 24px 0;
  flex: 1;
}

.mbc-carousel__teams > div {
  align-self: start;
  justify-content: flex-start;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.mbc-carousel__teams > div > strong {
  display: block;
  min-height: 2.8em;
  font-size: 14px;
  text-transform: uppercase;
  line-height: 1.4;
  overflow-wrap: anywhere;
  color: #fff;
}

.mbc-carousel__teams > b {
  align-self: start;
  margin-top: 24px;
  color: #fff;
  font-size: 26px;
  line-height: 32px;
  white-space: nowrap;
}

/* Pied de carte & Liens */
.mbc-carousel__card footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: auto;
  padding: 0;
  border: 0;
}

.mbc-carousel__card footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid #6fb7f066;
  border-radius: 999px;
  background: linear-gradient(135deg, #224d70, #123550);
  color: #f2f8ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-decoration: none;
  box-shadow: 0 3px 10px #0002;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.mbc-carousel__card footer a:hover {
  background: #285c85;
  border-color: #83c7ff;
  color: #fff;
}

/* Logos Équipes */
.mbc-next__logo,
.mbc-carousel .mbc-next__logo {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #298cec;
  padding: 9px;
  overflow: hidden;
}

.mbc-next__logo img,
.mbc-carousel .mbc-next__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mbc-next__logo--empty {
  background: #102944;
  color: #164367;
}

/* 3. Composant : Next Match (Prochain Match)
   -------------------------------------------------------------------------- */
.mbc-next {
  padding: 24px;
  border: 1px solid #285174;
  border-radius: 18px;
  background: linear-gradient(145deg, #17324b, #081725);
  color: #fff;
}

.mbc-next__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 2px solid #ff7615;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.mbc-next .mbc-next__header h2 {
  font-size: 24px;
  color: #fff;
  text-transform: uppercase;
  margin: 0;
  border-left: 5px solid #ff7615;
  padding-left: 12px;
}

.mbc-next__competition {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #b9cee1;
}

.mbc-next__competition strong {
  color: #ff861e;
}

.mbc-next__teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.mbc-next__team {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mbc-next__team--away {
  justify-content: flex-end;
  text-align: right;
}

.mbc-next__vs {
  font-size: 28px;
  color: #ff7615;
}

.mbc-next__date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 22px auto;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #285174;
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
}

.mbc-next__date svg,
.mbc-next__location svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.mbc-next__date time {
  display: flex;
  flex-direction: column;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
}

.mbc-next__date strong {
  color: #ff7615;
}

.mbc-next__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid #285174;
  padding-top: 16px;
}

.mbc-next__location {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mbc-next__location > div {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: #b9cee1;
  overflow-wrap: anywhere;
}

.mbc-next__location strong {
  color: #fff;
}

.mbc-next__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #298cec;
  border-radius: 9px;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.mbc-next__link:hover {
  background: #224c74;
  color: #fff;
}

/* 4. Composant : Ranking (Classements)
   -------------------------------------------------------------------------- */
.mbc-rankings {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.mbc-ranking {
  padding: 24px;
  border: 1px solid #285174;
  border-radius: 18px;
  background: linear-gradient(145deg, #17324b, #081725);
  color: #fff;
}

.mbc-ranking__header {
  display: block;
  border-bottom: 2px solid #ff7615;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.mbc-ranking .mbc-ranking__header h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 750;
  color: #fff;
  text-transform: uppercase;
  margin: 0 0 12px;
  border-left: 5px solid #ff7615;
  padding-left: 12px;
}

.mbc-ranking .mbc-ranking__header > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-size: 16px;
  color: #b9cee1;
}

.mbc-ranking .mbc-ranking__header > div > span {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.mbc-ranking .mbc-ranking__header > div > strong {
  font-size: 13px;
  color: #ff861e;
}

.mbc-ranking__scroll {
  overflow-x: auto;
  width: 100%;
}

.mbc-ranking table {
  width: 100%;
  margin: 0;
  color: #fff;
  font-size: 14px;
  border: 0 !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}

.mbc-ranking th,
.mbc-ranking td {
  padding: 12px 10px;
  text-align: center;
  white-space: nowrap;
  background: transparent;
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09) !important;
}

.mbc-ranking thead th {
  font-size: 12px;
  color: #b9cee1;
  text-transform: uppercase;
}

.mbc-ranking tbody th {
  text-align: left;
  min-width: 200px;
}

.mbc-ranking tbody td:nth-child(3),
.mbc-ranking__club th {
  font-weight: 800;
}

.mbc-ranking__team {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mbc-ranking .mbc-ranking__badge {
  width: 42px;
  height: 42px;
  min-width: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: #123550;
  padding: 7px;
  overflow: hidden;
}

.mbc-ranking .mbc-ranking__badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  margin: 0;
}

.mbc-ranking__club {
  background: #204c76 !important;
  border-left: 3px solid #ff7615;
}

.mbc-ranking__footer {
  padding-top: 14px;
  color: #b9cee1;
  font-size: 12px;
  line-height: 1.6;
}

/* 5. Composant : Liste Simple (MBC Sport Matchs)
   -------------------------------------------------------------------------- */
.mbc-sport-matchs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.mbc-sport-match {
  padding: 18px;
  border: 1px solid #285174;
  border-radius: 12px;
  background: #102944;
  color: #fff;
}

.mbc-sport-affiche {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}

.mbc-sport-affiche > span:last-child {
  text-align: right;
}

.mbc-sport-score {
  color: #ff861e;
}

.mbc-sport-meta {
  font-size: 13px;
  color: #bdd0e2;
}

.mbc-sport-link {
  color: #9dceff;
}

/* 6. Media Queries & Motion
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .mbc-carousel__card {
    flex-basis: 100%;
    padding: 18px 14px;
  }

  .mbc-carousel .mbc-carousel__card h3 {
    font-size: 12px;
  }

  .mbc-carousel .mbc-carousel__date {
    font-size: 16px;
  }

  .mbc-carousel__teams {
    gap: 8px;
    padding: 20px 0;
  }

  .mbc-carousel__teams > div > strong {
    font-size: 12px;
  }

  .mbc-carousel__teams > b {
    font-size: 22px;
    margin-top: 16px;
  }

  .mbc-carousel .mbc-next__logo {
    width: 64px;
    height: 64px;
    padding: 7px;
  }

  .mbc-next,
  .mbc-ranking {
    padding: 16px;
  }

  .mbc-next__teams {
    gap: 10px;
  }

  .mbc-next__team {
    flex-direction: column;
    text-align: center;
    font-size: 13px;
    gap: 10px;
  }

  .mbc-next__team--away .mbc-next__logo {
    order: -1;
  }

  .mbc-next__vs {
    font-size: 22px;
  }

  .mbc-next__date time {
    font-size: 16px;
  }

  .mbc-ranking th,
  .mbc-ranking td {
    padding: 10px 8px;
  }

  .mbc-ranking__header > div {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mbc-carousel__card footer a {
    transition: none;
  }
}