.experience-section {
  padding: 60px 20px;
  /* background: var(--color-light); */
  color: var(--color-dark);
  font-family: var(--font-main);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.experience-header {
  text-align: center;
  margin-bottom: 40px;
}

.experience-title {
  font-size: 1.9rem;
  font-weight: 700;
  color: #252525;
  margin-bottom: 8px;
}

.experience-subtitle {
  font-size: 1.1rem;
  color: var(--color-primary);
  font-weight: 500;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

.team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

/* Компьютерная версия - блоки горизонтально */
@media (min-width: 768px) {
  .team-grid {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .team-member {
    flex: 1;
    min-width: 300px;
    max-width: 48%;
  }
}

/* Мобильная версия - блоки вертикально */
@media (max-width: 767px) {
  .team-grid {
    flex-direction: column;
    align-items: center;
  }
}

/* Карточка */
.team-member {
  display: flex;
  flex-direction: row;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  width: 100%;
  min-height: 260px;
}

.team-member:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

/* Фото - исправляем обрезку */
.member-image {
  flex: 0 0 160px;
  min-height: 260px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px; /* Добавляем отступы чтобы фото не обрезалось */
}

.member-image img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}



/* Текст */
.member-info {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: start;
  overflow: hidden;
}

.member-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-role {
  font-size: 0.85rem;
  color: #919191;
  font-weight: 500;
  margin: 0 0 10px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

/* Адаптив: перенос роли */
@media (max-width: 767px) {
  .member-role {
    white-space: normal;
    word-wrap: break-word;
    margin: 8px 0 10px 0;
  }
}

/* Текст отзыва */
.member-bio {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #333;
  margin: 0 0 12px 0;
  flex: 1;
  overflow: hidden;
}

.member-bio p {
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.member-bio p:last-child {
  margin-bottom: 0;
}

/* На десктопе — текст полностью */
@media (min-width: 768px) {
  .member-bio p {
    display: block !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    overflow: visible !important;
    margin: 0 0 6px 0;
  }
}

/* На мобильных — обрезаем весь блок */
@media (max-width: 767px) {
  .member-bio {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all var(--transition);
    margin: 0 0 12px 0;
  }

  .member-bio p {
    margin: 0 0 6px 0;
    line-height: 1.4;
  }

  .member-bio p:last-child {
    margin-bottom: 0;
  }

  /* Раскрытие при клике */
  .member-info.expanded .member-bio {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
    margin: 0 0 12px 0;
    display: block;
  }

  /* Увеличиваем карточку при разворачивании */
  .team-member.expanded {
    min-height: auto;
  }

  .team-member.expanded .member-image {
    min-height: 280px;
    height: auto;
  }

  .team-member.expanded .member-image img {
    min-height: 280px;
    height: auto;
  }
}

/* Кнопки в стиле Instagram */
.btn-expand,
.btn-collapse {
  display: inline-block;
  background: none;
  border: none;
  color: var(--color-gray);
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  padding: 0;
  margin: 0;
  text-decoration: none;
  transition: color var(--transition);
  align-self: flex-start;
  margin-top: 4px;
}

.btn-expand:hover,
.btn-collapse:hover {
  color: var(--color-primary);
}

.btn-text {
  display: inline;
}

.btn-icon {
  display: none;
}

/* Показываем кнопки только на мобильных */
@media (min-width: 768px) {
  .btn-expand,
  .btn-collapse {
    display: none;
  }
}

/* На мобильных показываем кнопку "ещё" только когда текст обрезан */
@media (max-width: 767px) {
  .btn-expand {
    display: inline-block;
  }
  
  .btn-collapse {
    display: none;
  }
  
  /* Показываем кнопку "скрыть" только когда текст развернут */
  .member-info.expanded .btn-expand {
    display: none;
  }
  
  .member-info.expanded .btn-collapse {
    display: inline-block;
  }
}

/* Адаптив для мобильных устройств */
@media (max-width: 480px) {
  .experience-section {
    padding: 40px 15px;
  }
  
  .experience-title {
    font-size: 1.6rem;
  }
  
  .experience-subtitle {
    font-size: 1rem;
  }
  
  .team-member {
    flex-direction: column;
    min-height: auto;
  }
  
  .member-image {
    flex: 0 0 200px;
    min-height: 200px;
    width: 100%;
    padding: 15px;
  }
  
  .member-image img {
    min-height: 200px;
    object-fit: contain;
  }
  
  .member-info {
    padding: 20px;
  }
  
  .member-name {
    font-size: 1.1rem;
  }
  
  .member-role {
    font-size: 0.8rem;
  }
  
  .member-bio {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  
  /* Уменьшаем количество строк до разворачивания */
  .member-bio {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  
  .member-bio p {
    margin: 0 0 5px 0;
  }
}

/* Дополнительные медиа-запросы для очень маленьких экранов */
@media (max-width: 360px) {
  .experience-title {
    font-size: 1.4rem;
  }
  
  .experience-subtitle {
    font-size: 0.9rem;
  }
  
  .member-image {
    flex: 0 0 180px;
    min-height: 180px;
    padding: 10px;
  }
  
  .member-image img {
    min-height: 180px;
    object-fit: contain;
  }
  
  .member-info {
    padding: 15px;
  }
  
  .member-name {
    font-size: 1rem;
  }
  
  .member-bio {
    font-size: 0.78rem;
  }
}

/* Улучшенная анимация для плавного раскрытия */
.member-bio {
  transition: all 0.4s ease;
}

.team-member {
  transition: all 0.4s ease;
}

/* Фикс для предотвращения наезжания текста */
.member-info {
  position: relative;
}

.btn-expand, 
.btn-collapse {
  position: relative;
  z-index: 2;
  background: white;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 8px;
}

.experience-footer {
  text-align: center;
  margin-top: 50px;
  padding: 30px 20px;
  border-radius: 20px;
  color: #252525;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.experience-footer::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="white" opacity="0.1"/><circle cx="80" cy="80" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="50" r="1" fill="white" opacity="0.05"/><circle cx="10" cy="90" r="1" fill="white" opacity="0.1"/><circle cx="90" cy="10" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
  z-index: 1;
}

.experience-footer p {
  font-size: 1.3rem;
  font-weight: 300;
  line-height: 1.6;
  margin: 0;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.experience-footer strong {
  font-weight: 700;
  color: var(--color-primary-dark);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


@keyframes shine {
  0% {
    left: -100%;
  }
  20% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .experience-footer {
    margin-top: 40px;
    padding: 25px 15px;
    border-radius: 15px;
  }
  
  .experience-footer p {
    font-size: 1.1rem;
    line-height: 1.5;
  }
}

@media (max-width: 480px) {
  .experience-footer {
    margin-top: 30px;
    padding: 20px 12px;
    border-radius: 12px;
  }
  
  .experience-footer p {
    font-size: 1rem;
    line-height: 1.4;
  }
  
  .experience-footer::after {
    animation: shine-mobile 4s infinite;
  }
}

@keyframes shine-mobile {
  0% {
    left: -100%;
  }
  15% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Эффект при наведении */
.experience-footer:hover {
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

.experience-footer:hover::after {
  animation-duration: 2s;
}