/* SportGest Connect — stili widget WordPress */
/* Palette identica al sito pubblico (apps/public/globals.css) */
:root {
  --sg-primary:  #16a34a;
  --sg-secondary:#f5a200;
  --sg-bg:       #ffffff;
  --sg-card:     #f9fafb;
  --sg-border:   #e5e7eb;
  --sg-text:     #111827;
  --sg-muted:    #6b7280;
  --sg-dim:      #9ca3af;
  --sg-radius:   12px;
  --sg-font:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Base ────────────────────────────────────────────────────────────────────── */
body .sg-widget {
  font-family: var(--sg-font) !important;
  color: var(--sg-text) !important;
  box-sizing: border-box !important;
  line-height: 1.5 !important;
}
body .sg-widget *,
body .sg-widget *::before,
body .sg-widget *::after {
  box-sizing: border-box !important;
}
body .sg-error { color: #ef4444 !important; font-size: .875rem !important; }
body .sg-info  { color: var(--sg-muted) !important; font-size: .875rem !important; }

/* ── Classifica ──────────────────────────────────────────────────────────────── */
body .sg-classifica {
  border-radius: 14px !important;
  overflow: hidden !important;
  border: 1px solid var(--sg-border) !important;
}
body .sg-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: .875rem !important;
  font-family: var(--sg-font) !important;
}
body .sg-table thead tr {
  background: var(--sg-primary) !important;
}
body .sg-table th {
  background: var(--sg-primary) !important;
  color: #ffffff !important;
  padding: 10px 10px !important;
  text-align: center !important;
  font-weight: 700 !important;
  font-size: .6875rem !important;
  letter-spacing: .05em !important;
  text-transform: uppercase !important;
  border: none !important;
}
body .sg-table th:nth-child(2) { text-align: left !important; }
body .sg-table td {
  padding: 9px 10px !important;
  text-align: center !important;
  border-bottom: 1px solid var(--sg-border) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  vertical-align: middle !important;
  background: transparent !important;
}
body .sg-table tr:nth-child(odd)  td { background: var(--sg-card) !important; }
body .sg-table tr:nth-child(even) td { background: #ffffff !important; }
body .sg-table tr.sg-our-team td {
  background: rgba(22,163,74,.06) !important;
}
body .sg-table .sg-team-name {
  text-align: left !important;
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
}
body .sg-table .sg-pos-good { color: var(--sg-primary) !important; font-weight: 700 !important; }
body .sg-table .sg-pos-bad  { color: var(--sg-dim) !important; }
body .sg-table .sg-punti    { font-weight: 800 !important; }
body .sg-table tr.sg-our-team .sg-punti { color: var(--sg-primary) !important; }
body .sg-logo-xs {
  width: 20px !important;
  height: 20px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

/* ── Partite / Risultati ─────────────────────────────────────────────────────── */
body .sg-risultati {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
body .sg-match-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  background: var(--sg-card) !important;
  border-radius: 10px !important;
  border: 1px solid var(--sg-border) !important;
}
body .sg-match-esito {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: .65rem !important;
  font-weight: 800 !important;
  color: #fff !important;
  flex-shrink: 0 !important;
}
body .sg-match-esito.sg-v  { background: var(--sg-primary) !important; }
body .sg-match-esito.sg-p  { background: var(--sg-muted) !important; }
body .sg-match-esito.sg-s  { background: #ef4444 !important; }
body .sg-match-competition {
  font-size: .6875rem !important;
  color: var(--sg-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  flex-shrink: 0 !important;
}
body .sg-match-teams {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex: 1 !important;
  min-width: 0 !important;
  font-size: .875rem !important;
  font-weight: 500 !important;
}
body .sg-match-teams .sg-home,
body .sg-match-teams .sg-away {
  flex: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body .sg-match-teams .sg-home { text-align: right !important; }
body .sg-score {
  font-weight: 800 !important;
  font-size: .9375rem !important;
  color: var(--sg-text) !important;
  min-width: 48px !important;
  text-align: center !important;
  flex-shrink: 0 !important;
}
body .sg-match-meta {
  font-size: .6875rem !important;
  color: var(--sg-dim) !important;
  flex-shrink: 0 !important;
  text-align: right !important;
}

/* Prossima partita */
body .sg-next-match {
  background: var(--sg-card) !important;
  border-radius: var(--sg-radius) !important;
  border: 1px solid var(--sg-border) !important;
  padding: 24px 20px !important;
  text-align: center !important;
}
body .sg-match-header {
  font-size: .6875rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--sg-muted) !important;
  margin-bottom: 14px !important;
}
body .sg-next-match .sg-match-teams {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  font-size: 1.0625rem !important;
  font-weight: 700 !important;
  flex: unset !important;
}
body .sg-vs { color: var(--sg-muted) !important; font-weight: 400 !important; }
body .sg-match-date {
  margin-top: 12px !important;
  font-size: .875rem !important;
  color: var(--sg-primary) !important;
  font-weight: 600 !important;
}

/* ── Rosa ────────────────────────────────────────────────────────────────────── */
body .sg-rosa {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  gap: 16px !important;
}
body .sg-player-card {
  background: var(--sg-card) !important;
  border-radius: var(--sg-radius) !important;
  border: 1px solid var(--sg-border) !important;
  overflow: hidden !important;
  text-align: center !important;
  position: relative !important;
}
body .sg-player-photo {
  width: 100% !important;
  aspect-ratio: 1 !important;
  object-fit: cover !important;
  display: block !important;
}
body .sg-player-placeholder {
  width: 100% !important;
  aspect-ratio: 1 !important;
  background: rgba(22,163,74,.08) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 2.5rem !important;
  opacity: .3 !important;
}
body .sg-player-number {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  background: rgba(0,0,0,.55) !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: .75rem !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
}
body .sg-player-info {
  padding: 10px 10px !important;
}
body .sg-player-info strong {
  display: block !important;
  font-size: .8125rem !important;
  font-weight: 700 !important;
  color: var(--sg-text) !important;
  margin-bottom: 3px !important;
}
body .sg-player-role {
  font-size: .6875rem !important;
  color: var(--sg-primary) !important;
  font-weight: 600 !important;
}

/* ── News ────────────────────────────────────────────────────────────────────── */
body .sg-news {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  gap: 16px !important;
}
body .sg-news-item {
  background: var(--sg-card) !important;
  border-radius: var(--sg-radius) !important;
  border: 1px solid var(--sg-border) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
body .sg-news-thumb {
  width: 100% !important;
  aspect-ratio: 16/9 !important;
  object-fit: cover !important;
  display: block !important;
}
body .sg-news-content {
  padding: 14px !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
body .sg-news-date {
  font-size: .6875rem !important;
  color: var(--sg-dim) !important;
}
body .sg-news-title {
  font-size: .9375rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  color: var(--sg-text) !important;
  margin: 0 !important;
}
body .sg-news-excerpt {
  font-size: .8125rem !important;
  color: var(--sg-muted) !important;
  line-height: 1.5 !important;
  margin: 0 !important;
  flex: 1 !important;
}

/* ── Highlights ──────────────────────────────────────────────────────────────── */
body .sg-highlights {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 16px !important;
}
body .sg-video-card {
  background: var(--sg-bg) !important;
  border-radius: var(--sg-radius) !important;
  border: 1px solid var(--sg-border) !important;
  overflow: hidden !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.06) !important;
  display: block !important;
  text-decoration: none !important;
  transition: transform .15s, box-shadow .15s !important;
}
body .sg-video-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(0,0,0,.1) !important;
}
body .sg-video-thumb-link {
  display: block !important;
  position: relative !important;
}
body .sg-video-thumb {
  width: 100% !important;
  aspect-ratio: 16/9 !important;
  object-fit: cover !important;
  display: block !important;
  background: #111 !important;
}
body .sg-play-btn {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0,0,0,.18) !important;
}
body .sg-play-btn span {
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  background: rgba(0,0,0,.65) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.25rem !important;
  padding-left: 4px !important;
  color: #fff !important;
}
body .sg-video-title {
  padding: 10px 14px !important;
  font-size: .8125rem !important;
  font-weight: 700 !important;
  color: var(--sg-text) !important;
  line-height: 1.4 !important;
}

/* ── Sponsor — banda ─────────────────────────────────────────────────────────── */
body .sg-sponsor-band {
  border-top: 1px solid var(--sg-border) !important;
  border-bottom: 1px solid var(--sg-border) !important;
  background: var(--sg-card) !important;
  padding: 14px 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 32px !important;
}
/* Sponsor — griglia */
body .sg-sponsor-griglia {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
  gap: 16px !important;
  align-items: center !important;
}
body .sg-sponsor-item {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
body .sg-sponsor-item a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
}
body .sg-sponsor-logo {
  height: 52px !important;
  max-width: 140px !important;
  width: auto !important;
  object-fit: contain !important;
  display: block !important;
  opacity: .72 !important;
  filter: grayscale(0) !important;
  transition: opacity .25s, filter .25s, transform .25s !important;
}
body .sg-sponsor-item:hover .sg-sponsor-logo {
  opacity: 1 !important;
  transform: scale(1.06) !important;
}
body .sg-sponsor-name {
  font-size: .875rem !important;
  font-weight: 700 !important;
  color: var(--sg-text) !important;
  white-space: nowrap !important;
}

/* ── Staff / Organigramma ────────────────────────────────────────────────────── */
body .sg-staff {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  gap: 16px !important;
}
body .sg-staff-card {
  border-radius: var(--sg-radius) !important;
  border: 1px solid var(--sg-border) !important;
  background: var(--sg-card) !important;
  overflow: hidden !important;
  text-align: center !important;
}
body .sg-staff-photo-wrap {
  height: 130px !important;
  background: rgba(22,163,74,.07) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}
body .sg-staff-photo {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}
body .sg-staff-placeholder {
  font-size: 2.25rem !important;
  opacity: .2 !important;
}
body .sg-staff-info {
  padding: 10px !important;
}
body .sg-staff-info strong {
  display: block !important;
  font-size: .875rem !important;
  font-weight: 700 !important;
  color: var(--sg-text) !important;
}
body .sg-staff-info span {
  display: block !important;
  font-size: .75rem !important;
  color: var(--sg-primary) !important;
  font-weight: 600 !important;
  margin-top: 3px !important;
}

/* ── Bottoni ─────────────────────────────────────────────────────────────────── */
body .sg-btn {
  display: inline-block !important;
  padding: 7px 16px !important;
  background: var(--sg-primary) !important;
  color: #fff !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  font-size: .8125rem !important;
  font-weight: 700 !important;
  transition: opacity .15s !important;
  margin-top: 8px !important;
}
body .sg-btn:hover { opacity: .85 !important; color: #fff !important; }
body .sg-btn-sm    { padding: 4px 10px !important; font-size: .75rem !important; }
