/* Match Center legacy — estrazione meccanica dalla base 1.6.02.
   Attivo solo sulle card prive della classe/antenato virtus-match-center.
   Ordine e dichiarazioni originali preservati; nessuna regola generica SportsPress. */

/* Match Center 1.5.61: intestazione e geometria coerenti con le card gara. */
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks td {
  position: relative !important;
  min-height: 168px !important;
  padding-top: 54px !important;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo {
  position: absolute !important;
  top: 68px !important;
  margin: 0 !important;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo.logo-odd { left: 12px !important; }
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo.logo-even { right: 12px !important; }

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .sp-event-date {
  position: relative !important;
  z-index: 2;
  width: 120px;
  margin: 20px auto 0 !important;
  transform: none !important;
  font-size: 24px !important;
  line-height: 1.05 !important;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 4px 10px;
  border-bottom: 1px solid #a79d78;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta .virtus-match-competition,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta .virtus-match-round {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--vsp-accent);
  font-family: var(--vsp-font-label);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta .virtus-match-round { text-align: right; }

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-date .virtus-match-time {
  margin-top: 7px;
  font-size: 22px;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-matchday {
  display: none !important;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) {
  --gap: 12px 0px !important;
  --row-gap: 12px !important;
  --column-gap: 0px !important;
}

/* Match Center: riduzione loghi del 10% rispetto alla misura base. */
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo img,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks img.attachment-sportspress-fit-icon {
  width: 90px !important;
  min-width: 90px !important;
  height: 90px !important;
  max-width: 90px !important;
  max-height: 90px !important;
  object-fit: contain !important;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .sp-event-logos {
  align-items: center !important;
}

/* Centra il blocco data/ora rispetto ai loghi laterali. */
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .sp-event-date {
  position: relative;
  z-index: 2;
  transform: translateY(14px);
}

@media (max-width: 1024px) and (min-width: 768px) {
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo img,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks img.attachment-sportspress-fit-icon {
    width: 80px !important;
    min-width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
  }
}

@media (max-width: 767px) {
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo img,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks img.attachment-sportspress-fit-icon {
    width: 60px !important;
    min-width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
  }
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-widget {
  margin-block-end: 0 !important;
  --kit-widget-spacing: 0px !important;
  --widgets-spacing-row: 0px !important;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-widget-shortcode,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-widget-button,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sportspress,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-template,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-table-wrapper,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) table.sp-event-blocks {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-widget-button {
  margin-top: 8px !important;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-competition {
  display: block;
  width: min(100%, 310px);
  margin: 0 auto 12px;
  padding: 0 0 9px;
  border-bottom: 1px solid #a79d78;
  color: var(--vsp-accent);
  font-family: var(--vsp-font-label);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

/* SportsPress stampa il turno come “(1)” accanto alla data: nelle card
   Last/Next e gia rappresentato dalla competizione e viene nascosto. */
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-date .sp-event-day,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-date + .sp-event-day {
  display: none !important;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-date .virtus-match-date,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-date .virtus-match-time {
  display: block;
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-date .virtus-match-date {
  color: var(--vsp-text);
}

.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-date .virtus-match-time {
  margin-top: 8px;
  color: var(--vsp-accent);
  font-family: var(--vsp-font-label);
  letter-spacing: 1.5px;
}

@media (max-width: 767px) {
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) {
    --gap: 6px 0px !important;
    --row-gap: 6px !important;
    --column-gap: 0px !important;
  }

  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .sp-event-date,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .sp-event-results {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
  }

  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-widget-button {
    margin-top: 0px !important;
  }
}

/* Override finali Match Center 1.5.61. */
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks td {
  position: relative !important;
  min-height: 168px !important;
  padding-top: 54px !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo {
  position: absolute !important;
  top: 68px !important;
  margin: 0 !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo.logo-odd { left: 12px !important; }
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo.logo-even { right: 12px !important; }
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .sp-event-date {
  position: relative !important;
  z-index: 2;
  width: 120px;
  margin: 20px auto 0 !important;
  transform: none !important;
  font-size: 24px !important;
  line-height: 1.05 !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 4px 10px;
  border-bottom: 1px solid #a79d78;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta .virtus-match-competition,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta .virtus-match-round {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--vsp-accent);
  font-family: var(--vsp-font-label);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta .virtus-match-round { text-align: right; }
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-date .virtus-match-time {
  margin-top: 7px;
  font-size: 22px;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-matchday { display: none !important; }

/* Data e stato/risultato centrati sullo stesso asse verticale dei loghi. */
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .sp-event-date {
  margin-top: 10px !important;
}

/* Il centro gara occupa esattamente la stessa fascia verticale dei loghi. */
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-center-score {
  position: absolute;
  z-index: 3;
  top: 82px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 90px;
  transform: translateX(-50%);
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-center-score .sp-event-date,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-center-score .sp-event-results {
  position: static !important;
  width: 120px;
  margin: 0 !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-center-score .sp-event-results {
  margin-top: 7px !important;
}

@media (max-width: 767px) {
  /* Allineamento mobile: stessa altezza dei loghi, senza imporre font. */
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-center-score {
    height: 60px;
  }
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .sp-event-results {
  position: relative !important;
  z-index: 2;
  width: 120px;
  margin: 7px auto 0 !important;
  font-size: 22px !important;
  line-height: 1.05 !important;
}

/* Allineamento finale richiesto: filetto sopra le etichette, poi gara centrata. */
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks td {
  min-height: 184px !important;
  padding-top: 66px !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta {
  min-height: 44px;
  padding: 13px 4px 0;
  border-top: 1px solid #a79d78;
  border-bottom: 0;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo {
  top: 82px !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .sp-event-date {
  margin-top: 10px !important;
}

/* Override conclusivo 1.5.68: card compatta e filetto oro sotto le etichette. */
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) {
  min-height: 0 !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks td {
  min-height: 154px !important;
  padding-top: 48px !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta {
  min-height: 34px;
  padding: 0 4px 8px;
  border-top: 0;
  border-bottom: 1px solid #a79d78 !important;
  border-bottom-color: #a79d78 !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo {
  top: 54px !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo img,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks img.attachment-sportspress-fit-icon {
  width: 76px !important;
  min-width: 76px !important;
  height: 76px !important;
  max-width: 76px !important;
  max-height: 76px !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-center-score {
  top: 54px;
  height: 76px;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-widget-button {
  margin-top: 2px !important;
}
@media (max-width: 767px) {
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks td {
    min-height: 138px !important;
    padding-top: 44px !important;
  }
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta {
    min-height: 32px;
    padding-bottom: 7px;
  }
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo {
    top: 50px !important;
  }
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo img,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks img.attachment-sportspress-fit-icon {
    width: 60px !important;
    min-width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
  }
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-center-score {
    top: 50px;
    height: 60px;
  }
}

/* Match Center 1.5.69: controlli del carosello all'esterno della card. */
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) {
  overflow: visible !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-swiper-button-prev,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .swiper-button-prev {
  left: -28px !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-swiper-button-next,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .swiper-button-next {
  right: -28px !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-swiper-button,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .swiper-button-prev,
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .swiper-button-next {
  z-index: 12;
}
@media (max-width: 767px) {
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-swiper-button-prev,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .swiper-button-prev {
    left: -14px !important;
  }
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-swiper-button-next,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .swiper-button-next {
    right: -14px !important;
  }
}

/* Match Center 1.5.72: struttura mobile coerente con le card calendario. */
@media (max-width: 767px) {
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) {
    border-radius: 20px !important;
  }

  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks td {
    min-height: 142px !important;
    padding-top: 48px !important;
  }

  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta {
    min-height: 36px;
    padding: 0 6px 10px;
    border-top: 0 !important;
    border-bottom: 1px solid #a79d78 !important;
    border-bottom-color: #a79d78 !important;
  }

  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta .virtus-match-competition,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-meta .virtus-match-round {
    font-family: var(--vsp-font-body);
    font-size: 12px;
    letter-spacing: .6px;
  }

  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-center-score {
    top: 54px !important;
  }

  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-widget-button {
    width: 100%;
    margin-top: 0 !important;
    padding-top: 12px !important;
    border-top: 1px solid #a79d78 !important;
    border-top-color: #a79d78 !important;
  }

  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-competition {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-competition-logo {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
  }

  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) table.sp-event-blocks {
    padding-bottom: 12px !important;
    border-bottom: 1px solid #a79d78 !important;
    border-bottom-color: #a79d78 !important;
  }
}

/* Match Center 1.5.74: due soli filetti e intestazione sempre su una riga. */
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-competition {
  display: inline-flex !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-competition-logo {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) table.sp-event-blocks {
  padding-bottom: 12px !important;
  border-bottom: 1px solid #a79d78 !important;
  border-bottom-color: #a79d78 !important;
}
.sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-widget-button {
  border-top: 0 !important;
  border-top-color: transparent !important;
}
@media (min-width: 768px) {
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks td {
    min-height: 168px !important;
  }
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .sp-event-blocks .team-logo,
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-center-score {
    top: 68px !important;
  }
}
@media (max-width: 767px) {
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .virtus-match-competition-logo {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }
  .sp-match-card:where(:not(.virtus-match-center, .virtus-match-center .sp-match-card)) .elementor-widget-button {
    border-top: 0 !important;
    border-top-color: transparent !important;
  }
}
