/* ==========================================================================
   Container principal
   ========================================================================== */
.teams-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
  box-sizing: border-box;
  padding-top: 50px;
  padding-bottom: 60px;
}

/* ==========================================================================
   Títulos
   ========================================================================== */
.teams-title {
  font-size: 28px;
  margin: 0 0 6px 0;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.teams-subtitle {
  font-size: 18px;
  color: var(--text-topbar);
  margin-bottom: 30px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Grid de Equipas
   ========================================================================== */
.teams-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* Mobile-first: 1 card por linha */
  box-sizing: border-box;
}

/* Tablet: 2 cards por linha */
@media (min-width: 700px) {
  .teams-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* Desktop: 3 cards por linha */
@media (min-width: 1024px) {
  .teams-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   Links dos cards
   ========================================================================== */
.team-link {
  text-decoration: none;
  color: inherit;
  display: block; /* Garante comportamento correto do link em bloco */
}

/* ==========================================================================
   Card da equipa
   ========================================================================== */
.team-card {
  background: var(--surface);
  border-radius: 0.4rem;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  min-width: 0; /* Permite encolher no Firefox */
  box-sizing: border-box;
}

.team-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.09);
}

/* Seletor reforçado para as imagens */
.team-card img {
  width: 72px !important; /* Garante que o tamanho fixo padrão seja respeitado */
  height: 72px !important; /* Evita distorções verticais do SVG */
  max-width: 100% !important; /* Força contenção absoluta dentro do flexbox */
  object-fit: contain;
  flex-shrink: 0;
}

/* ==========================================================================
   Info da equipa
   ========================================================================== */
.team-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0; /* Correção Firefox */
  flex: 1; /* Força a caixa de texto a ocupar o espaço restante */
}

.team-name {
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.2px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.team-stadium {
  font-size: 15px;
  color: #6d7280;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.stadium-icon {
  width: 20px !important;
  height: auto !important;
  opacity: 0.8;
  flex-shrink: 0;
}

/* ==========================================================================
   Responsivo para telas pequenas (Mobile Fix)
   ========================================================================== */
@media (max-width: 540px) {
  .team-card {
    gap: 16px;
    padding: 16px;
    align-items: center; /* Alinha o ícone e o texto verticalmente ao centro */
  }

  .team-card img {
    width: 54px !important; /* Reduz o tamanho do SVG proporcionalmente no telemóvel */
    height: 54px !important; /* Mantém o aspeto quadrado padrão */
  }

  .team-name {
    font-size: 16px; /* Ajuste ligeiro para não quebrar linhas desnecessariamente */
  }

  .team-stadium {
    font-size: 13px;
  }
}
