/* === Глобальные стили === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f0f0f0;
  color: #333;
}

/* Плавная прокрутка */
html {
  scroll-behavior: smooth;
}

/* === Шапка сайта === */
.header {
  background-color: #007fbd;
  color: white;
  padding: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 170px;
  flex-wrap: wrap;
}

.logo {
  width: 200px;
  height: auto;
  max-height: 160px;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: 130px;
  font-size: 26px;
  font-weight: bold;
}

.nav a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav a:hover {
  color: #ffffffcc;
}

/* === Блок "Наши новости" === */
.news-section {
  max-width: 1200px;
  margin: 60px auto 0; /* Добавлен отступ сверху — 60px */
  padding: 0 20px;
}

.section-title {
  text-align: center;
  font-size: 36px;
  font-weight: bold;
  color: #222;
  margin-bottom: 40px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.slider-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-btn {
  background-color: #007fbd;
  color: white;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease, transform 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-btn:hover {
  background-color: #005f8a;
  transform: scale(1.05);
}

.slider-btn.prev-btn { margin-right: 20px; }
.slider-btn.next-btn { margin-left: 20px; }

.news-slider {
  display: flex;
  gap: 24px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 1130px;
  padding: 10px 0;
  scroll-snap-type: x mandatory;
}

.news-card {
  flex: 0 0 360px;
  scroll-snap-align: start;
  background: white;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.news-image {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.news-text, .news-date {
  padding: 20px;
  font-size: 20px;
  color: #333;
  line-height: 1.6;
  font-weight: 500;
}

.news-date {
  font-size: 14px;
  color: #666;
  margin: -10px 0 15px;
  font-style: italic;
}

/* === Динамическая панель новости === */
.news-panel {
  position: relative; /* Чтобы кнопка позиционировалась относительно панели */
  display: none;
  margin-top: 30px;
  margin-bottom: 50px;
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  animation: slideDown 0.3s ease-out;
}

/* Кнопка "Свернуть" на панели новости */
.close-panel-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 36px;
  color: #aaa;
  cursor: pointer;
  opacity: 0.8;
  transition: color 0.3s ease, opacity 0.3s ease;
  z-index: 10;
  line-height: 1;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-panel-btn:hover {
  color: #555;
  opacity: 1;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

#panel-title {
  font-size: 26px;
  color: #333;
  margin-bottom: 10px;
  text-align: center;
}

#panel-date {
  text-align: center;
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
  font-style: italic;
}

.panel-images {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding: 10px 0 20px;
  margin-bottom: 20px;
}

.panel-images img {
  width: 300px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  flex: 0 0 auto;
}

#panel-content {
  font-size: 18px;
  color: #333;
  line-height: 1.8;
  text-align: justify;
}

/* === Блок "О нашем центре" === */
.about-section-wrapper {
  background-color: white;
  padding: 80px 0;
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.about-content {
  max-width: 800px;
  margin: 0 auto 50px;
  font-size: 18px;
  color: #555;
  line-height: 1.7;
  text-align: justify;
}

.rooms-title {
  text-align: center;
  font-size: 26px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
}

/* Слайдер аудиторий */
.rooms-slider-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.rooms-slider {
  display: flex;
  gap: 26px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 1000px;
  padding: 10px 0;
  scroll-snap-type: x mandatory;
}

.room-card {
  flex: 0 0 380px;
  scroll-snap-align: start;
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.room-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.room-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.room-name {
  text-align: center;
  font-size: 21px;
  color: #333;
  font-weight: 500;
  padding: 20px;
  line-height: 1.5;
}

/* === Модальное окно === */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
}

.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 95vw;
  max-height: 95vh;
  padding: 20px;
}

#modalImage, #modalNewsPhoto {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-title {
  color: white;
  font-size: 24px;
  font-weight: bold;
  margin: 15px 0 10px;
  text-align: center;
}

.close {
  color: white;
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1000;
}

.close:hover {
  text-shadow: 0 0 10px #fff;
}

.thumbnails {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.thumbnail-btn {
  background: transparent;
  border: 2px solid transparent;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s ease;
  opacity: 0.7;
}

.thumbnail-btn:hover,
.thumbnail-btn.active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.6);
}

.thumbnail-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === Блок "Статистика" === */
.stats-section {
  padding: 80px 0;
  background-color: #f8f9fa;
  margin-top: 60px;
}

.stats-cards {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.stat-card {
  background: white;
  padding: 30px 20px;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  text-align: center;
  min-width: 220px;
  max-width: 280px;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.stat-number {
  font-size: 40px;
  font-weight: bold;
  color: #007fbd;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 16px;
  color: #555;
  line-height: 1.5;
}

/* === Блок "Контакты" === */
.contacts-section {
  padding: 80px 0;
  background-color: #ffffff;
  margin-top: 60px;
}

.contacts-grid {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  max-width: 280px;
  transition: transform 0.3s ease;
}

.contact-item:hover {
  transform: translateY(-5px);
}

.contact-icon {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
}

.icon {
  width: 28px;
  height: 28px;
  opacity: 0.8;
}

.contact-info {
  display: flex;
  flex-direction: column;
  font-size: 16px;
  color: #333;
}

.contact-info strong {
  font-size: 18px;
  color: #007fbd;
  margin-bottom: 5px;
}

.contact-link {
  color: #005f8a;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.contact-link:hover {
  color: #003c5c;
  text-decoration: underline;
}

.contact-info small {
  color: #666;
  font-style: italic;
  margin-top: 4px;
  font-size: 14px;
}

/* Ссылка на новость — без подчёркивания */
.news-card-link {
  text-decoration: none;
  color: inherit;
}

.news-link:hover .news-image {
  transform: scale(1.02);
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-link:hover {
  opacity: 0.9;
}