/* Основные стили сайта */

/* ===== КАРТОЧКИ НОВОСТЕЙ И СОБЫТИЙ ===== */
.news-card,
.event-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(140, 100, 216, 0.08);
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.news-card:hover,
.event-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 48px rgba(140, 100, 216, 0.2);
}

/* Цветная полоска сверху */
.news-card::before,
.event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #8C64D8 0%, #D18AEF 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
  z-index: 2;
}

.news-card:hover::before,
.event-card:hover::before {
  transform: scaleX(1);
}

/* Контейнер изображения */
.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e9d5ff;
  flex-shrink: 0;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  display: block;
}

.news-card:hover .card-img-wrap img,
.event-card:hover .card-img-wrap img {
  transform: scale(1.07);
}

/* Оверлей на изображении при ховере */
.card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(140, 100, 216, 0.35) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.news-card:hover .card-img-overlay,
.event-card:hover .card-img-overlay {
  opacity: 1;
}

/* Бейдж типа (категория) */
.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(140, 100, 216, 0.9);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 3;
}

/* Тело карточки */
.card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Дата */
.card-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #8C64D8;
  font-weight: 500;
  margin-bottom: 0.6rem;
}

/* Заголовок */
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.4;
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.25s ease;
}

.news-card:hover .card-title,
.event-card:hover .card-title {
  color: #8C64D8;
}

/* Описание */
.card-desc {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-bottom: 1rem;
}

/* Кнопка "Подробнее" */
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8C64D8;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  width: fit-content;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(140, 100, 216, 0.08);
  transition: background 0.25s ease, gap 0.25s ease, color 0.25s ease;
  margin-top: auto;
}

.card-link:hover {
  background: rgba(140, 100, 216, 0.18);
  gap: 10px;
  color: #7047c0;
}

.card-link i {
  font-size: 1rem;
  transition: transform 0.25s ease;
}

.card-link:hover i {
  transform: translateX(3px);
}

/* Нет фото */
.card-no-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c084fc;
  font-size: 2.5rem;
  flex-shrink: 0;
}
/* ===== КОНЕЦ КАРТОЧЕК ===== */

/* Общие стили */
body {
  font-family: 'Montserrat', sans-serif;
  color: #333;
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* Отступ для якорных ссылок, чтобы учесть фиксированный хедер */
}

/* Секции с id (якорями) */
section[id],
div[id]:not(#mobile-menu):not(#map):not(#accessibility-panel) {
  scroll-margin-top: 100px; /* Отступ для якорных ссылок */
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
}

/* Стили для активных ссылок */
.active-link {
  color: #8C64D8 !important;
  font-weight: 600;
  position: relative; /* Добавляем позиционирование для всех ссылок */
}

.active-link::after {
  content: '';
  position: absolute;
  width: 100% !important;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #8C64D8 !important;
}

/* Анимации */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Эффекты для карточек раздела "О нашем центре" */
.about-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  backface-visibility: hidden;
  position: relative;
}

.about-card:hover {
  transform: translateY(-15px) rotate3d(1, 1, 0, 5deg);
  box-shadow: 0 15px 30px rgba(140, 100, 216, 0.2);
}

.about-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 50%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  border-radius: 0.5rem;
}

.about-card:hover::after {
  opacity: 1;
}

/* Анимация иконок при наведении */
.about-card .w-16 {
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  position: relative;
}

.about-card:hover .w-16 {
  transform: translateZ(20px) scale(1.1) rotate(10deg);
}

.about-card i {
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.about-card:hover i {
  transform: translateZ(30px) scale(1.2);
  color: #8C64D8;
}

/* Эффект парения при наведении */
@keyframes floating {
  0% { transform: translateY(0) rotate3d(1, 1, 0, 0deg); }
  50% { transform: translateY(-10px) rotate3d(1, 1, 0, 5deg); }
  100% { transform: translateY(0) rotate3d(1, 1, 0, 0deg); }
}

.about-card:hover {
  animation: floating 3s ease-in-out infinite;
} 

/* Кастомный Alert Modal */
.custom-alert-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* По умолчанию не кликабельно */
}
.custom-alert-overlay.flex {
   opacity: 1;
   pointer-events: auto; /* Делаем кликабельным при показе */
}

.custom-alert-box {
  background-color: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  width: 90%;
  position: relative;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.custom-alert-overlay.flex .custom-alert-box.show {
    transform: scale(1);
    opacity: 1;
}

.custom-alert-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #9ca3af; /* gray-400 */
  cursor: pointer;
  transition: color 0.2s ease;
}
.custom-alert-close:hover {
  color: #374151; /* gray-700 */
}

.custom-alert-title {
  color: #1f2937; /* gray-800 */
}

.custom-alert-message {
  color: #4b5563; /* gray-600 */
  word-wrap: break-word;
}

/* Класс для скрытия модального окна - переименован */
.modal-hidden {
  display: none;
}

/* Стили для просмотрщика историй */
#story-viewer-overlay {
  /* Стили оверлея уже заданы через Tailwind, но можно добавить transition */
  transition: opacity 0.3s ease;
}

#story-viewer-box {
  /* Стили бокса уже заданы через Tailwind, но можно добавить transition */
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Анимация появления/скрытия для оверлея (если нужно, сейчас используется Tailwind hidden/flex) */
/*
#story-viewer-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
*/

/* Прогресс-бар - стили уже заданы через Tailwind */
#story-progress-bar {
  /* width: 0%; - управляется через JS */
  /* background-color: white; */
  /* transition: width 6s linear; - управляется через JS */
}

/* Можно добавить стили для кнопок, если Tailwind классы недостаточны */
#story-viewer-prev,
#story-viewer-next,
#story-viewer-close {
  /* Например, немного увеличить область клика */
  padding: 0.25rem; 
}