/* ==========================================================================
   Переменные (сохранена ваша палитра)
   ========================================================================== */
:root {
  --color-bg: #ffffff;
  --color-text: #333333;
  --color-accent: #1e88e5;
  --color-light: #eaeff4;
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --card-bg: #ffffff;
  --font-main: 'Inter', sans-serif;
  --radius: 16px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  --transition: 0.25s ease;
}

.dark-mode {
  --color-bg: #121212;
  --color-text: #f5f5f5;
  --color-accent: #64b5f6;
  --color-light: #1e1e1e;
  --card-bg: #1e1e1e;
  --shadow-sm: 0 4px 12px rgba(255, 255, 255, 0.05);
  --shadow-md: 0 8px 24px rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 12px 32px rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Базовые стили
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

.main-content {
  padding: 2rem 0 4rem;
}

.page-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.content-container {
  display: flex;
  flex-direction: column;
  gap: 2.8rem;
}

.section-title {
  text-align: center;
  font-weight: 600;
  font-size: 2.8rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
  letter-spacing: -0.5px;
}

/* ==========================================================================
   Анимация появления
   ========================================================================== */
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.5s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Общий стиль информационных блоков
   ========================================================================== */
.info-block {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.info-block:hover {
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Hero-блок с прямоугольным фото училища
   ========================================================================== */
.history-hero {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.history-hero:hover {
  box-shadow: var(--shadow-lg);
}

.hero-wide-image {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.hero-text {
  padding: 2rem 2.5rem;
}

.hero-text p {
  font-size: 1.1rem;
  color: #2c2c2c;
  margin-bottom: 1.2rem;
  line-height: 1.7;
}

.dark-mode .hero-text p {
  color: #cccccc;
}

.hero-text strong {
  color: var(--color-accent);
  font-weight: 600;
}

/* ==========================================================================
   Портретная секция (Собинов)
   ========================================================================== */
.portrait-section {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  background: #f8faff;
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow-sm);
}

.dark-mode .portrait-section {
  background: #1a1f2b;
}

.portrait-image {
  width: 200px;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.portrait-text h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

.dark-mode .portrait-text h3 {
  color: #f0f0f0;
}

.portrait-text p {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ==========================================================================
   Отделения – центрированная flex-галерея
   ========================================================================== */
.departments-section {
  background: var(--card-bg);
}

.departments-section h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.departments-section > p {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  color: #444;
}

.departments-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.department-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform var(--transition);
  flex: 0 0 160px;
}

.department-card:hover {
  transform: translateY(-5px);
}

.department-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  margin-bottom: 0.7rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.department-card img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.department-card span {
  font-weight: 500;
  font-size: 0.95rem;
  color: #333;
}

.dark-mode .department-card span {
  color: #ccc;
}

/* ==========================================================================
   Педагогический состав (только текст)
   ========================================================================== */
.teachers-section h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.teachers-section p {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ==========================================================================
   Статистические карточки
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.8rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
  border-top: 4px solid var(--color-accent);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-accent);
  display: block;
  margin-bottom: 0.7rem;
  line-height: 1;
}

.stat-label {
  font-weight: 600;
  font-size: 1.15rem;
  color: #2c2c2c;
  margin-bottom: 0.8rem;
  display: block;
}

.dark-mode .stat-label {
  color: #dddddd;
}

.stat-desc {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.5;
}

/* ==========================================================================
   Детская музыкальная школа (без фото)
   ========================================================================== */
.school-section h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.school-section p {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ==========================================================================
   Научно-методическая работа
   ========================================================================== */
.methodic-section {
  border-left: 8px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 2.5rem;
  background: var(--card-bg);
}

.methodic-section h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.methodic-section p {
  font-size: 1.1rem;
}

/* ==========================================================================
   Конкурсная деятельность (без фото)
   ========================================================================== */
.contest-section h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.contest-section p {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ==========================================================================
   Известные выпускники
   ========================================================================== */
.graduates-section h3 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
}

.graduates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.8rem;
  margin-bottom: 2rem;
}

.graduate-card {
  display: flex;
  gap: 1.2rem;
  background: #f9fafc;
  border-radius: var(--radius);
  padding: 1.5rem;
  align-items: center;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.dark-mode .graduate-card {
  background: #1e1e1e;
}

.graduate-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.graduate-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.graduate-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.graduate-surname {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  /* принудительные разрывы убраны, фамилия не будет разрываться внутри слова */
}

.dark-mode .graduate-surname {
  color: #f5f5f5;
}

.graduate-fullname {
  font-weight: 500;
  font-size: 1rem;
  color: #333;
  margin-bottom: 0.3rem;
}

.dark-mode .graduate-fullname {
  color: #cccccc;
}

.graduate-desc {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
}

.dark-mode .graduate-desc {
  color: #bbbbbb;
}

.graduates-others {
  font-size: 1.05rem;
  color: #444;
  line-height: 1.7;
  border-top: 1px solid #e0e0e0;
  padding-top: 1.5rem;
  margin-top: 0.5rem;
}

.dark-mode .graduates-others {
  color: #cccccc;
  border-top-color: #333;
}

/* ==========================================================================
   Училище сегодня (вместо цитаты)
   ========================================================================== */
.today-section {
  background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.dark-mode .today-section {
  background: linear-gradient(135deg, #1a1f2b 0%, #121212 100%);
}

.today-section h3 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--color-accent);
}

.today-section p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  color: #2c2c2c;
}

.dark-mode .today-section p {
  color: #cccccc;
}

/* ==========================================================================
   Лайтбокс
   ========================================================================== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1001;
}

.lightbox-close:hover {
  color: var(--color-accent);
}

/* ==========================================================================
   Адаптивность
   ========================================================================== */
@media (max-width: 900px) {
  .portrait-section {
    flex-direction: column;
    text-align: center;
  }
  .portrait-image {
    width: 180px;
  }
  .graduates-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .section-title {
    font-size: 2rem;
  }
  .hero-text {
    padding: 1.5rem;
  }
  .hero-wide-image {
    max-height: 250px;
  }
  .departments-gallery {
    gap: 1rem;
  }
  .department-card {
    flex: 0 0 140px;
  }
  .stat-number {
    font-size: 2.8rem;
  }
  .graduate-card {
    flex-direction: column;
    text-align: center;
  }
  .graduate-card img {
    width: 100px;
    height: 100px;
  }
  .graduate-surname {
    font-size: 1rem; 
  }
}