/* --- FILE: /css/pages/teams.css --- */

/* ============================================= */
/* --- SECTION 1 : PAGE LISTE (/teams) --- */
/* ============================================= */

#teams-list-section {
  margin-top: 2.5rem;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.team-card {
  background-color: var(--clr-bg-card);
  padding: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.team-card .team-banner {
  border-radius: 6px 6px 0 0;
  height: 100px;
  background-size: cover;
  background-position: center;
  background-image: var(--team-banner-bg);
  border-bottom: 3px solid var(--team-color);
}

.team-card .team-content {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.team-card .team-card-logo {
  width: 60px;
  height: 60px;
  object-fit: cover;
  margin-top: -45px;
  flex-shrink: 0;
  border-radius: 8px;
}

.team-card .team-card-details {
  flex-grow: 1;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  min-width: 0;
}

.team-card .team-card-name {
  font-size: 1.4rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-card .team-card-stats {
  font-size: 0.9rem;
  color: var(--clr-text-sub);
  text-align: right;
  flex-shrink: 0;
}

.team-card .team-card-stats span {
  display: block;
  font-weight: 600;
}

/* ============================================= */
/* --- SECTION 2 : PAGE DÉTAIL (/teams/[slug]) --- */
/* ============================================= */

#team-hero-banner {
  top: -60px;
  height: 280px;
  background-color: var(--clr-bg);
  display: flex;
  align-items: flex-end;
  padding: 0;
  margin-bottom: calc(1.5rem - 60px);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

#team-hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--team-banner-bg);
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  filter: blur(4px) brightness(0.7);
  z-index: -1;
  transform: scale(1.05);
}

html.dark #team-hero-banner::before {
  opacity: 0.25;
  filter: blur(4px) brightness(0.5);
}

#team-hero-banner .team-hero-content {
  color: var(--clr-text);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  padding: 1.5rem 16rem;
  box-sizing: border-box;
}

#team-hero-banner .team-hero-logo {
  width: 90px;
  height: 90px;
  border-radius: 6px;
  object-fit: cover;
}

#team-hero-banner .team-name {
  font-size: 3rem;
  font-weight: 800;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

#team-hero-banner .team-creation-date {
  font-size: 1.1rem;
  color: #fff;
  opacity: 0.8;
  margin-top: 0.25rem;
  font-weight: 500;
}

.team-details-container {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 2rem;
  align-items: start;
}

.team-main-content {
  display: flex;
  flex-direction: column;
}

.team-description {
  line-height: 1.7;
  font-size: 1.1rem;
  color: var(--clr-text-sub);
  white-space: pre-wrap;
}

.team-socials {
  margin-top: 2rem;
}

.team-stats-block {
  background-color: transparent;
}

.team-stats-block .stat-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(var(--clr-text-rgb), 0.05);
}

.team-stats-block .stat-item:last-child {
  border-bottom: none;
}

.team-stats-block .stat-label {
  font-weight: 600;
  color: var(--clr-text-sub);
}

.team-stats-block .stat-value {
  font-size: 1.2rem;
  font-weight: 700;
}

.team-socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--clr-text);
  background-color: var(--clr-bg-card);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  transition: background-color 0.2s;
  margin-right: 0.5rem;
}

.team-socials a:hover {
  background-color: var(--clr-bg-card-invert);
  color: var(--clr-text-invert);
}

a.series-card {
  text-decoration: none;
}

/* --- Responsive --- */
@media (max-width: 1440px) {
  #team-hero-banner .team-hero-content {
    padding-left: 4.5rem;
    padding-right: 4.5rem;
  }
}
@media (max-width: 1024px) {
  #team-hero-banner .team-hero-content {
    padding-left: 4rem;
    padding-right: 4rem;
  }
}

@media (max-width: 768px) {
  /* --- Bannière --- */
  #team-hero-banner {
    top: 0;
    margin-top: -90px;
    margin-left: -15px;
    margin-right: -15px;
    height: 300px; /* Hauteur de la bannière */
    border-radius: 0;
    align-items: flex-start; /* Aligne le contenu en haut de la bannière */
    background-color: transparent;
    margin-bottom: -8rem;
  }

  /* Effet visuel sur l'image de fond de la bannière */
  #team-hero-banner::before {
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    filter: blur(8px) brightness(0.6);
    width: 120%;
    left: -10%;
  }

  html.dark #team-hero-banner::before {
    filter: blur(8px) brightness(0.4);
  }

  /* Contenu à l'intérieur de la bannière */
  #team-hero-banner .team-hero-content {
    flex-direction: row;
    align-items: center;
    display: flex;
    /* Padding pour pousser le contenu sous le header */
    padding: calc(var(--mobile-bars-height) + 1.5rem) 15px 15px 15px;
    gap: 1rem;
    width: 100%;
  }

  #team-hero-banner .team-hero-logo {
    width: 70px;
    height: 70px;
  }

  #team-hero-banner .team-name {
    font-size: 2.2rem;
  }

  /* --- Contenu principal (Description, Stats) --- */
  .team-details-container {
    display: block; /* On s'assure que le flux est un simple empilement vertical */
  }

  /* Correction de l'espacement pour les stats */
  .team-stats-block {
    padding-top: 1.5rem;
  }
}

p.invite {
    color: var(--clr-text-fifth);
    margin-top: 1.5rem;
    text-align: center;
}
