/* ========================================
   COMPONENTS
======================================== */

/* Boutons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-md);
  background: var(--color-secondary);
  color: white;
  font-weight: var(--font-weight-bold);
  transition: var(--transition);
}

.button:hover {
  background: var(--color-secondary-dark);
  transform: translateY(-2px);
}

.button--secondary {
  background: transparent;
  border: 2px solid white;
}

/* Cartes */

.club-card {
  background: white;
  border: 1px solid var(--color-border);
  border-top: 5px solid var(--color-secondary);
  border-radius: var(--radius-md);
  padding: var(--spacing-3);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.club-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.club-card h3 {
  color: var(--color-primary);
}

/* Réseaux */

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2);
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Focus accessible */

:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

/* Préférences utilisateur */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================
   PAGE HERO
======================================== */

.page-hero {
  padding-block: var(--spacing-5);
  padding-top: calc(1.9rem + 48px);
  color: white;
  background: linear-gradient(
    135deg,
    var(--color-primary-dark),
    var(--color-primary)
  );
}

.page-hero__eyebrow {
  margin-bottom: var(--spacing-1);
  color: var(--color-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.page-hero h1 {
  margin-bottom: var(--spacing-2);
  font-size: clamp(2rem, 8vw, 3.5rem);
}

.page-hero p:last-child {
  max-width: 650px;
  margin-bottom: 0;
  font-size: var(--font-size-lg);
  color: rgb(255 255 255 / 0.85);
}

/* ========================================
   SECTION EYEBROW
======================================== */

.section__eyebrow {
  margin-bottom: 0.35rem;
  color: var(--color-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ========================================
   TEAMS GRID
======================================== */

.teams-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-3);
}

/* ========================================
   TEAM CARD
======================================== */

.team-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Bandeau catégorie */

.team-card__category {
  padding: 0.65rem var(--spacing-2);
  background: var(--color-primary);
  color: white;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-black);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Contenu */

.team-card__content {
  flex: 1;
  padding: var(--spacing-3);
}

.team-card__content h3 {
  margin-bottom: 0.25rem;
  color: var(--color-primary);
  font-size: var(--font-size-xl);
}

.team-card__subtitle {
  margin-bottom: var(--spacing-3);
  color: var(--color-secondary);
  font-weight: var(--font-weight-bold);
}

/* Informations */

.team-card__details {
  display: flex;
  gap: var(--spacing-2);
  margin: 0;
  flex-direction: row;
  justify-content: space-between;
}

.team-card__details > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.team-card__details dt {
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.team-card__details dd {
  margin: 0;
  font-weight: var(--font-weight-medium);
}

/* Lien */

.team-card__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0.75rem var(--spacing-3);
  border-top: 1px solid var(--color-border);
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
  transition:
    background var(--transition),
    color var(--transition);
}

.team-card__link:hover {
  background: var(--color-secondary);
  color: white;
}

.team-card__link span {
  font-size: 1.25rem;
  transition: transform var(--transition);
}

.team-card__link:hover span {
  transform: translateX(4px);
}

/* ========================================
   RESPONSIVE
======================================== */

@media (min-width: 600px) {
  .teams-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .teams-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   TEAM HERO
======================================== */

.team-hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--spacing-4);
  color: white;
  background: linear-gradient(
    135deg,
    var(--color-primary-dark),
    var(--color-primary)
  );
}

.team-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/patterns/stripes.svg") center / 420px repeat;
  opacity: 0.08;
  pointer-events: none;
}

.team-hero .container {
  position: relative;
  z-index: 1;
}

.team-hero__back {
  display: inline-block;
  margin-bottom: var(--spacing-3);
  color: rgb(255 255 255 / 0.8);
  font-weight: var(--font-weight-medium);
}

.team-hero__back:hover {
  color: white;
}

.team-hero__content {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
}

.team-hero__badge {
  display: none;
}

.team-hero h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(2.5rem, 10vw, 4rem);
}

.team-hero__team-number {
  margin: 0;
  color: var(--color-secondary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

/* ========================================
   TEAM INFORMATION
======================================== */

.team-information-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-2);
}

.information-card {
  padding: var(--spacing-2);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.information-card__label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.information-card strong {
  color: var(--color-primary);
  font-size: var(--font-size-lg);
}

/* ========================================
   STAFF
======================================== */

.staff-grid {
  display: grid;
  gap: var(--spacing-2);
}

.person-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-2);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.person-card__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-black);
}

.person-card__name {
  display: flex;
  align-items: start;
  justify-content: start;
}

.person-card__photo {
  display: flex;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  background-size: contain;
}

.person-card h3 {
  margin-bottom: 0.1rem;
  color: var(--color-primary);
}

.person-card p {
  margin: 0;
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}
/* ========================================
   STAFF CARD - TEAMS
======================================== */

.person-card__content {
  min-width: 0;
}

.person-card__role {
  margin: 0.15rem 0 0;
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}

.person-card__teams {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.person-card__teams .meta-pill {
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.person-card__teams .meta-pill:hover {
  background: rgb(16 32 124 / 0.12);
  border-color: rgb(16 32 124 / 0.2);
}
/* ========================================
   PLAYERS
======================================== */

.players-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.player-card {
  display: flex;
  align-items: center;
  min-height: 72px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.player-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.player-card__number {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 64px;
  background: var(--color-primary);
  color: white;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-black);
}

.player-card__identity {
  display: flex;
  flex-direction: column;
  padding-inline: var(--spacing-2);
}

.player-card__identity strong {
  color: var(--color-primary);
}

.player-card__identity span {
  color: var(--color-text-light);
}

/* ========================================
   EVENTS
======================================== */

.events-list {
  display: grid;
  gap: var(--spacing-2);
}

.home-loading {
  display: flex;
  width: 100%;
  min-height: 90px;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-1);
}

.home-loading__bar {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: home-loading-pulse 0.9s ease-in-out infinite alternate;
}

.home-loading__bar:nth-child(2) {
  animation-delay: 0.15s;
}

.home-loading__bar:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes home-loading-pulse {
  from {
    opacity: 0.3;
    transform: translateY(0);
  }

  to {
    opacity: 1;
    transform: translateY(-5px);
  }
}

.event-card {
  display: flex;
  overflow: hidden;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.event-card__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 76px;
  padding: 0.5rem;
  background: var(--color-primary);
  color: white;
  text-align: center;
}

.event-card__date span {
  font-size: 0.7rem;
  font-weight: var(--font-weight-bold);
}

.event-card__date strong {
  font-size: 1.8rem;
  line-height: 1;
}

.event-card__content {
  padding: var(--spacing-2);
}

.event-card__type {
  color: var(--color-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.event-card h3 {
  margin: 0.2rem 0;
  color: var(--color-primary);
}

.event-card p {
  margin: 0;
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}

/* ========================================
   ARTICLES
======================================== */

.articles-list {
  display: grid;
  gap: var(--spacing-5);
  max-width: 900px;
  margin-inline: auto;
}

.article-card {
  overflow: hidden;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.palmares-card-horizontal,
.palmares-card-horizontal--reverse {
  display: flex;
  overflow: hidden;
  background: white;
}
.palmares-card-horizontal {
  flex-direction: row;
}
.palmares-card-horizontal--reverse {
  flex-direction: row-reverse;
}
.palmares-card__content,
.article-card__content {
  padding: var(--spacing-3);
}
.palmares-card__content {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.article-card__date {
  display: inline-flex;
  margin-bottom: 0.5rem;
  color: var(--color-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

.article-card__title {
  margin-bottom: var(--spacing-2);
  color: var(--color-primary);
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.article-card__text {
  color: var(--color-text);
  line-height: 1.7;
  white-space: pre-line;
}

/* ========================================
   ARTICLE GALLERY
======================================== */

.article-card__gallery,
.palmares-card__gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  background: var(--color-border);
}

.palmares-card__gallery {
  width: 50%;
  background: transparent;
}
.article-card__photo,
.palmares-card__photo {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--color-primary);
  cursor: pointer;
}

.article-card__photo::after,
.palmares-card__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0);
  transition: background-color 0.2s ease;
}

.article-card__photo:hover::after,
.article-card__photo:focus-visible::after,
.palmares-card__photo:hover::after,
.palmares-card__photo:focus-visible::after {
  background: rgb(0 0 0 / 0.12);
}

.article-card__photo img,
.palmares-card__photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card__photo:hover img,
.article-card__photo:focus-visible img,
.palmares-card__photo:hover img,
.palmares-card__photo:focus-visible img {
  transform: scale(1.03);
}

.article-card__photo:focus-visible,
.palmares-card__photo:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: -3px;
}

/*
 * Une seule photo
 */

.palmares-card__gallery:has(.palmares-card__photo:only-child),
.article-card__gallery:has(.article-card__photo:only-child) {
  grid-template-columns: 1fr;
}

.article-card__photo:only-child img {
  aspect-ratio: 16 / 9;
}

.palmares-card__photo:only-child img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
/*
 * Trois photos :
 * la première prend toute la largeur
 */

.article-card__gallery:has(.article-card__photo:nth-child(3)):not(
    :has(.article-card__photo:nth-child(4))
  ) {
  grid-template-columns: repeat(2, 1fr);
}

.article-card__gallery:has(.article-card__photo:nth-child(3)):not(
    :has(.article-card__photo:nth-child(4))
  )
  .article-card__photo:first-child {
  grid-column: 1 / -1;
}

.article-card__gallery:has(.article-card__photo:nth-child(3)):not(
    :has(.article-card__photo:nth-child(4))
  )
  .article-card__photo:first-child
  img {
  aspect-ratio: 16 / 9;
}
.palmares-card__gallery:has(.palmares-card__photo:nth-child(3)):not(
    :has(.palmares-card__photo:nth-child(4))
  ) {
  grid-template-columns: repeat(2, 1fr);
}
.palmares-card__gallery:has(.palmares-card__photo:nth-child(3)):not(
    :has(.palmares-card__photo:nth-child(4))
  )
  .palmares-card__photo:first-child {
  grid-column: 1 / -1;
}

.palmares-card__gallery:has(.palmares-card__photo:nth-child(3)):not(
    :has(.palmares-card__photo:nth-child(4))
  )
  .palmares-card__photo:first-child
  img {
  aspect-ratio: 16 / 9;
}

/* ========================================
   CALENDAR
======================================== */
.calendar__event {
  color: black;
  min-width: 0;
}
.clip-corner {
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 24px),
    calc(100% - 24px) 100%,
    0 100%
  );
}
@media (min-width: 64rem) {
  .md\:w-\[293px\] {
    width: 293px;
  }
}
.bg-background-secondary {
  background-color: rgb(var(--neutral-5));
}
.calendar__event.event {
  background: var(--color-secondary);
}
.event-match__forfait-banner {
  rotate: 45deg;
  position: absolute;
  right: -40px;
  top: -45px;
  width: 100px;
  background-color: rgb(255, 87, 34, 0.9);
  text-align: center;
  text-transform: uppercase;
  z-index: 10;
}
.event-match_competition {
  width: 50px;
  height: 50px;
  position: absolute;
  right: -10px;
  align-content: center;
  z-index: 10;
  text-align: center;
}
@media (min-width: 64rem) {
  .event-match__forfait-banner {
    right: -50px;
    top: -45px;
  }
}

/* ========================================
   IMAGE VIEWER
======================================== */

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-3);
  background: rgb(0 0 0 / 0.92);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.image-viewer--open {
  opacity: 1;
  visibility: visible;
}

.image-viewer__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 1200px);
  max-height: 100%;
}

.image-viewer__image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 100px);
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.4);
}

.image-viewer__counter {
  margin-top: 0.75rem;
  color: rgb(255 255 255 / 0.75);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

/*
 * Boutons
 */

.image-viewer__close,
.image-viewer__previous,
.image-viewer__next {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: var(--radius-full);
  background: rgb(0 0 0 / 0.35);
  color: white;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.image-viewer__close:hover,
.image-viewer__previous:hover,
.image-viewer__next:hover {
  background: rgb(255 255 255 / 0.15);
}

/*
 * Fermer
 */

.image-viewer__close {
  top: var(--spacing-2);
  right: var(--spacing-2);
  font-size: 2rem;
  line-height: 1;
}

/*
 * Navigation
 */

.image-viewer__previous,
.image-viewer__next {
  top: 50%;
  font-size: 2.5rem;
  line-height: 1;
  transform: translateY(-50%);
}

.image-viewer__previous {
  left: var(--spacing-2);
}

.image-viewer__next {
  right: var(--spacing-2);
}

.image-viewer__previous:hover,
.image-viewer__next:hover {
  transform: translateY(-50%) scale(1.05);
}

/*
 * Focus clavier
 */

.image-viewer button:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 3px;
}

/*
 * Empêche le scroll de la page
 */

body.no-scroll {
  overflow: hidden;
}

/*
 * Desktop
 */

@media (min-width: 768px) {
  .image-viewer {
    padding: var(--spacing-5);
  }
  .image-viewer__close {
    top: var(--spacing-3);
    right: var(--spacing-3);
  }
  .image-viewer__previous {
    left: var(--spacing-3);
  }
  .image-viewer__next {
    right: var(--spacing-3);
  }
}

/* ========================================
   RESPONSIVE
======================================== */

@media (min-width: 600px) {
  .team-information-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .players-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .staff-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .team-hero {
    padding-block: var(--spacing-5);
  }
  .team-hero__badge {
    display: block;
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    padding: 8px;
    background: white;
    border-radius: var(--radius-full);
  }
  .team-hero__badge img {
    width: 100%;
    height: 100%;
  }
}

@media (min-width: 900px) {
  .players-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.team-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 0.4rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  margin-right: 0.5rem;
}

.meta-pill,
.meta-pill--competition {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.2rem 0.55rem;
  background: rgb(16 32 124 / 0.06);
  border: 1px solid rgb(16 32 124 / 0.12);
  border-radius: var(--radius-full);
  color: var(--color-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  white-space: nowrap;
}

.meta-pill--competition {
  background: rgb(39 179 20 / 0.08);
  border-color: rgb(39 179 20 / 0.18);
  color: var(--color-secondary);
}

.skeleton {
  /* Make sure the skeleton wrapper doesn't influence the layout. */
  display: contents;

  /* Define the colors as css custom props */
  --_default-color: rgb(224 224 224 / 90%);
  --_shimmer-color: rgb(192 192 192 / 90%);

  :not(.wrapper) {
    /* Apply the animation that moves the background */
    animation: skeleton-shimmer 2s ease-out infinite;
    /* Create a background that has a small shimmer "stripe"
      and tilt it 100 degrees. */
    background: linear-gradient(
      100deg,
      var(--_default-color),
      var(--_default-color) 50%,
      var(--_shimmer-color) 60%,
      var(--_default-color) 70%
    );
    /* Make the background twice the width so we can offset it. */
    background-size: 200% 100%;
    background-attachment: fixed;
  }
}
.profile-image {
  margin-bottom: 16px;
  border-radius: 100%;
  aspect-ratio: 1;
  width: 100px;
}
.profile-name {
  width: 100px;
  height: 20px;
}

.lines {
  display: grid;
  gap: 1rem;
  > * {
    height: 1.5rem;
    &:last-child {
      width: 80%;
    }
  }
}

.skeleton__event {
  height: 195px;
  width: 220px;
  min-width: 0;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 24px),
    calc(100% - 24px) 100%,
    0 100%
  );
  flex-shrink: 0;
  flex-grow: 0;
}
@media (min-width: 64rem) {
  .skeleton__event {
    width: 293px;
  }
}

.image {
  aspect-ratio: 1;
}
@keyframes skeleton-shimmer {
  0% {
    background-position-x: 200%;
  }
  100% {
    background-position-x: 0%;
  }
}
