/* Team section styles - moved from index.html */

/* Conteneur principal de la section team */
.elementor-element-af195fa {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 30px !important;
  align-items: stretch !important;
}

/* DESKTOP GRID OVERRIDE - Strict 4 columns */
@media screen and (min-width: 769px) {
  .elementor-element-af195fa {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    justify-content: start !important;
    justify-items: stretch !important;
  }

  /* Fix for phantom grid items (Elementor pseudo-elements) */
  .elementor-element-af195fa::before,
  .elementor-element-af195fa::after {
    display: none !important;
    content: none !important;
  }
}



.elementor-element-af195fa>.team-member-card.team-member-hidden {
  display: none !important;
}

/* Conteneurs individuels des membres de l'équipe (Existing + New) */
.elementor-element-af195fa>.elementor-element,
.elementor-element-af195fa>.team-member-card:not(.team-member-hidden) {
  flex: 1 1 250px !important;
  max-width: 300px !important;
  min-width: 250px !important;
  display: flex !important;
  flex-direction: column !important;
}

@media screen and (min-width: 769px) {

  .elementor-element-af195fa>.elementor-element,
  .elementor-element-af195fa>.team-member-card:not(.team-member-hidden) {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
  }
}

/* Conteneurs des widgets team member */
.elementor-widget-qi_addons_for_elementor_team_member {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.elementor-widget-qi_addons_for_elementor_team_member .elementor-widget-container {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Conteneur interne du team member */
.qodef-qi-team-member {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.qodef-qi-team-member .qodef-m-inner {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.qodef-qi-team-member .qodef-m-media {
  flex: 0 0 auto !important;
}

.qodef-qi-team-member .qodef-m-content {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

/* Images des membres */
.qodef-qi-team-member .qodef-m-media-image img {
  width: 100% !important;
  height: auto !important;
  object-fit: cover !important;
  object-position: center top !important;
}

/* Titres et rôles */
.qodef-qi-team-member .qodef-m-title {
  margin-bottom: 10px !important;
}

.qodef-qi-team-member .qodef-m-role {
  opacity: 0.9 !important;
}

/* Section contenu - Transformée en overlay au survol */
.qodef-qi-team-member .qodef-m-content {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  padding: 30px 20px !important;
  background: rgba(80, 80, 80, 0.8) !important;
  /* Gris foncé semi-transparent */
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  opacity: 0 !important;
  transition: opacity 0.4s ease, transform 0.4s ease !important;
  transform: translateY(20px) !important;
  z-index: 2 !important;
  pointer-events: none !important;
  color: #ffffff !important;
}

.qodef-qi-team-member:hover .qodef-m-content {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

.qodef-qi-team-member .qodef-m-inner {
  position: relative !important;
  overflow: hidden !important;
}

/* Centrage des titres, rôles et descriptions */
.qodef-qi-team-member .qodef-m-title,
.qodef-qi-team-member .qodef-m-role,
.qodef-qi-team-member .qodef-m-description {
  text-align: center !important;
  justify-content: center !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  color: #ffffff !important;
}

.qodef-qi-team-member .qodef-m-title,
.qodef-qi-team-member .qodef-m-title strong {
  margin: 0 auto 2px auto !important;
  font-size: 1.25em !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  /* Gras automatique */
  text-transform: none !important;
}

.qodef-qi-team-member .qodef-m-role,
.qodef-qi-team-member .qodef-m-role strong {
  margin: 0 auto 5px auto !important;
  font-size: 1em !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  /* Gras automatique */
  opacity: 1 !important;
}

.qodef-qi-team-member .qodef-m-description {
  margin: 2px auto 0 auto !important;
  font-size: 0.9em !important;
  line-height: 1.4 !important;
  font-weight: 400 !important;
  opacity: 0.9 !important;
}

/* Centrage des icônes sociales */
.qodef-qi-team-member .qodef-m-social-icons {
  text-align: center !important;
  justify-content: center !important;
  display: flex !important;
  align-items: center !important;
  margin: 15px auto 0 auto !important;
  gap: 15px !important;
}

.qodef-qi-team-member .qodef-m-social-icons a {
  color: #ffffff !important;
}

.qodef-qi-team-member .qodef-m-social-icons svg {
  fill: #ffffff !important;
  width: 18px !important;
  height: 18px !important;
}

/* Responsive pour les titres longs */
@media screen and (max-width: 768px) {

  /* Conteneur principal en grille 2x2 */
  .elementor-element-af195fa {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    padding: 0 15px !important;
  }

  /* Conteneurs individuels */
  .elementor-element-af195fa>.elementor-element {
    flex: none !important;
    max-width: none !important;
    min-width: auto !important;
    width: 100% !important;
  }

  /* Images - taille uniforme */
  .qodef-qi-team-member .qodef-m-media-image img {
    max-height: 280px !important;
    min-height: 280px !important;
    width: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
  }

  /* Contenu - hauteur uniforme */
  .qodef-qi-team-member .qodef-m-content {
    min-height: 140px !important;
    padding: 15px !important;
  }

  /* Titres */
  .qodef-qi-team-member .qodef-m-title {
    font-size: 1em !important;
    line-height: 1.2 !important;
    margin-bottom: 8px !important;
  }

  /* Rôles */
  .qodef-qi-team-member .qodef-m-role {
    font-size: 0.85em !important;
    line-height: 1.3 !important;
    padding: 0 5px !important;
  }
}

/* Desktop: uniformiser la hauteur des images des membres avec un ratio fixe */
@media screen and (min-width: 769px) {
  .qodef-qi-team-member .qodef-m-media-image {
    width: 100% !important;
    aspect-ratio: 4 / 5 !important;
    /* proche des sources 1080x1215 */
    overflow: hidden !important;
  }

  .qodef-qi-team-member .qodef-m-media-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
  }
}

/* ===== TEAM EXPANSION STYLES ===== */

/* See More Link Styles */
.qodef-m-see-more {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
}

.qodef-see-more-link {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  text-decoration: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.qodef-see-more-link:hover {
  background: rgba(0, 0, 0, 0.9);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Extended Team Section */
.extended-team-section {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  animation: fadeInUp 0.6s ease-out;
  transform-origin: top;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Team Grid Container - Same layout as base team section */
/* Team Grid Container - Same layout as base team section */
.team-grid-container {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 30px !important;
  align-items: stretch !important;
  width: 100% !important;
  margin: 0 auto !important;
}

@media screen and (min-width: 769px) {
  .team-grid-container {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    justify-content: start !important;
    justify-items: stretch !important;
  }

  /* Fix for phantom grid items (Elementor pseudo-elements) */
  .team-grid-container::before,
  .team-grid-container::after {
    display: none !important;
    content: none !important;
  }
}

/* Team Member Cards in Extended Section - Same style as base cards */
/* Team Member Cards in Extended Section - Same style as base cards */
.extended-team-section .team-member-card {
  flex: 1 1 250px !important;
  max-width: 300px !important;
  min-width: 250px !important;
  display: flex !important;
  flex-direction: column !important;
  transition: all 0.3s ease, opacity 0.4s ease !important;
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  animation: slideInUp 0.5s ease-out forwards !important;
}

@media screen and (min-width: 769px) {
  .extended-team-section .team-member-card {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
  }
}

/* Apply the same styles as base team member cards */
.extended-team-section .qodef-qi-team-member {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.extended-team-section .qodef-qi-team-member .qodef-m-inner {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.extended-team-section .qodef-qi-team-member .qodef-m-media {
  flex: 0 0 auto !important;
}

.extended-team-section .qodef-qi-team-member .qodef-m-content {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

/* Images - same as base */
.extended-team-section .qodef-qi-team-member .qodef-m-media-image img {
  width: 100% !important;
  height: auto !important;
  object-fit: cover !important;
  object-position: center top !important;
}

/* Content section - same as base (overlay) */
.extended-team-section .qodef-qi-team-member .qodef-m-content {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  padding: 30px 20px !important;
  background: rgba(80, 80, 80, 0.8) !important;
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  opacity: 0 !important;
  transition: opacity 0.4s ease, transform 0.4s ease !important;
  transform: translateY(20px) !important;
  z-index: 2 !important;
  pointer-events: none !important;
  color: #ffffff !important;
}

.extended-team-section .qodef-qi-team-member:hover .qodef-m-content {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

/* Titles and roles - same as base */
.extended-team-section .qodef-qi-team-member .qodef-m-title,
.extended-team-section .qodef-qi-team-member .qodef-m-role {
  text-align: center !important;
  justify-content: center !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

.extended-team-section .qodef-qi-team-member .qodef-m-title {
  margin: 0 auto 2px auto !important;
  font-size: 1.25em !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  color: #ffffff !important;
}

.extended-team-section .qodef-qi-team-member .qodef-m-role {
  margin: 0 auto 5px auto !important;
  font-size: 1em !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

.extended-team-section .qodef-qi-team-member .qodef-m-description {
  margin: 2px auto 0 auto !important;
  font-size: 0.9em !important;
  line-height: 1.4 !important;
  font-weight: 400 !important;
  color: #ffffff !important;
  opacity: 0.9 !important;
}

/* Social icons - same as base */
.extended-team-section .qodef-qi-team-member .qodef-m-social-icons {
  text-align: center !important;
  justify-content: center !important;
  display: flex !important;
  align-items: center !important;
  margin: 15px auto 0 auto !important;
  gap: 15px !important;
}

.extended-team-section .team-member-card:nth-child(1) {
  animation-delay: 0.1s;
}

.extended-team-section .team-member-card:nth-child(2) {
  animation-delay: 0.15s;
}

.extended-team-section .team-member-card:nth-child(3) {
  animation-delay: 0.2s;
}

.extended-team-section .team-member-card:nth-child(4) {
  animation-delay: 0.25s;
}

.extended-team-section .team-member-card:nth-child(5) {
  animation-delay: 0.3s;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.extended-team-section .team-member-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Pagination Styles - Simple with arrows */
.team-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 40px;
  padding: 20px;
}

.pagination-btn {
  padding: 8px 12px;
  background: transparent;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  font-weight: normal;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #999;
  color: #000;
}

.pagination-btn:disabled {
  background: transparent;
  color: #ccc;
  border-color: #eee;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 14px;
  font-weight: normal;
  color: #666;
  padding: 0 15px;
}

/* Responsive Design for Extended Section - Same as base */
@media screen and (max-width: 768px) {
  .team-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 0 15px;
  }

  .extended-team-section .team-member-card {
    flex: none;
    max-width: none;
    min-width: auto;
    width: 100%;
  }

  /* Images - same as base mobile */
  .extended-team-section .qodef-qi-team-member .qodef-m-media-image img {
    max-height: 280px !important;
    min-height: 280px !important;
    width: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
  }

  /* Content - same as base mobile */
  .extended-team-section .qodef-qi-team-member .qodef-m-content {
    min-height: 140px !important;
    padding: 15px !important;
  }

  /* Titles - same as base mobile */
  .extended-team-section .qodef-qi-team-member .qodef-m-title {
    font-size: 1em !important;
    line-height: 1.2 !important;
    margin-bottom: 8px !important;
  }

  /* Roles - same as base mobile */
  .extended-team-section .qodef-qi-team-member .qodef-m-role {
    font-size: 0.85em !important;
    line-height: 1.3 !important;
    padding: 0 5px !important;
  }

  .extended-team-section {
    margin-top: 15px;
    padding: 15px 0;
  }

  .team-pagination {
    gap: 10px;
    margin-top: 30px;
  }

  .pagination-btn {
    min-width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .qodef-m-see-more {
    top: 10px;
    right: 10px;
  }

  .qodef-see-more-link {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Desktop: same aspect ratio as base */
@media screen and (min-width: 769px) {
  .extended-team-section .qodef-qi-team-member .qodef-m-media-image {
    width: 100% !important;
    aspect-ratio: 4 / 5 !important;
    overflow: hidden !important;
  }

  .extended-team-section .qodef-qi-team-member .qodef-m-media-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
  }
}

/* ===== PREVIOUS TEAM MEMBER SECTION STYLES ===== */

/* Previous Team Grid Container - Same layout as main team */
.previous-team-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 30px !important;
  align-items: stretch !important;
  width: 100% !important;
  margin: 0 auto !important;
}

@media screen and (min-width: 769px) {
  .previous-team-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    justify-content: start !important;
    justify-items: stretch !important;
  }
}

/* Previous Team Member Cards - Same style as main team cards */
.previous-team-grid .team-member-card {
  flex: 1 1 250px !important;
  max-width: 300px !important;
  min-width: 250px !important;
  display: flex !important;
  flex-direction: column !important;
  transition: all 0.3s ease, opacity 0.4s ease !important;
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  animation: slideInUp 0.5s ease-out forwards !important;
}

@media screen and (min-width: 769px) {
  .previous-team-grid .team-member-card {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
  }
}

/* Hidden state for pagination - ensure cards beyond 4 are hidden */
.previous-team-grid .previous-team-hidden {
  display: none !important;
}

/* Previous Team See More Button - Uses same styles as Team section */
/* The .qodef-m-see-more class from line 271-276 handles positioning */
/* The .qodef-see-more-link class from line 278-289 handles button styling */

/* Mobile Responsive for Previous Team */
@media screen and (max-width: 768px) {
  .previous-team-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    padding: 0 15px !important;
  }

  .previous-team-grid .team-member-card {
    flex: none !important;
    max-width: none !important;
    min-width: auto !important;
    width: 100% !important;
  }
}