/* ==========================================================================
   Коллективы ДМШ - Стили
   ========================================================================== */

/* 1. Сброс и базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #ffffff;
  color: #333;
  overflow-x: hidden;
}

/* 2. CSS переменные */
:root {
  /* Шрифты */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* Цвета */
  --color-bg: #ffffff;
  --color-text: #333333;
  --color-accent: #1e88e5; /* Основной акцентный цвет */
  --color-light: #eaeff4;
  --card-bg: #ffffff;
  
  /* Размеры и отступы */
  --radius: 12px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Тени */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Темная тема */
.dark-mode {
  --color-bg: #121212;
  --color-text: #f5f5f5;
  --color-accent: #64b5f6;
  --color-light: #1e1e1e;
  --card-bg: #1e1e1e;
  --shadow-sm: 0 2px 8px rgba(255, 255, 255, 0.05);
  --shadow-md: 0 4px 12px rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 6px 20px rgba(255, 255, 255, 0.08);
  --shadow-xl: 0 8px 30px rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Основные стили для страницы
   ========================================================================== */
.page-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: var(--spacing-sm);
}

.page-description {
  font-size: 1.1rem;
  color: var(--color-text);
  opacity: 0.8;
  max-width: 700px;
  margin: 0 auto;
}

.dark-mode .page-description {
  opacity: 0.9;
}

/* ==========================================================================
   Сетка коллективов
   ========================================================================== */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

/* ==========================================================================
   Карточка коллектива
   ========================================================================== */
.team-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.team-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-light);
}

.team-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-8px);
}

/* Анимация акцента при наведении */
.team-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease-out;
  z-index: 3;
}

.team-card:hover::before {
  transform: scaleX(1);
}

/* ==========================================================================
   Контейнер изображения
   ========================================================================== */
.team-image-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
  background-color: var(--color-light);
}

.team-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.team-card:hover .team-image-container img {
  transform: scale(1.05);
}

/* Заглушка для изображения */
.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-light);
    color: #ccc;
}
.image-placeholder .fas {
    font-size: 50px;
}


/* ==========================================================================
   Название и описание
   ========================================================================== */
.team-content-container {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Позволяет этому блоку занять все доступное место */
}

.team-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: var(--spacing-sm);
}

.dark-mode .team-title {
  color: var(--color-text);
}

.team-description {
  color: var(--color-text);
  opacity: 0.85;
  line-height: 1.6;
  font-size: 0.95rem;
  flex-grow: 1;

  /* Обрезка текста до 4 строк */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark-mode .team-description {
  opacity: 0.9;
}

/* ==========================================================================
   Пустое состояние
   ========================================================================== */
.no-teams {
  grid-column: 1 / -1; /* Растягиваем на всю ширину грида */
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  color: var(--color-text);
  opacity: 0.7;
}

/* ==========================================================================
   Адаптивный дизайн
   ========================================================================== */
@media (max-width: 992px) {
  .teams-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
  }
  .page-description {
    font-size: 1rem;
  }
  .teams-grid {
    gap: var(--spacing-md);
  }
}

@media (max-width: 576px) {
  .teams-grid {
    grid-template-columns: 1fr;
    padding: 0 var(--spacing-sm);
  }
  .team-title {
    font-size: 1.15rem;
  }
  .team-description {
    font-size: 0.9rem;
    -webkit-line-clamp: 3;
  }
  .team-card:hover {
    transform: none; /* Убираем hover-эффект на мобильных */
    box-shadow: var(--shadow-md);
  }
  .team-card::before {
    display: none; /* Убираем градиентную линию на мобильных */
  }
}

/* ==========================================================================
   Анимации
   ========================================================================== */
.team-card-link {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease-out forwards;
}

.team-card-link:nth-child(1) { animation-delay: 0.05s; }
.team-card-link:nth-child(2) { animation-delay: 0.1s; }
.team-card-link:nth-child(3) { animation-delay: 0.15s; }
.team-card-link:nth-child(4) { animation-delay: 0.2s; }
.team-card-link:nth-child(5) { animation-delay: 0.25s; }
.team-card-link:nth-child(6) { animation-delay: 0.3s; }


@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
