/* Новые стили для дайджеста этнографических музеев */

/* Цветовая палитра из примера */
:root {
  --primary-color: #1e2b50; /* Темно-синий */
  --secondary-color: #4fabff; /* Голубой */
  --accent-color: #5ece7b; /* Зеленый */
  --orange-color: #ff9f59; /* Оранжевый */
  --teal-color: #00868b; /* Бирюзовый */
  --dark-teal: #025c5f; /* Темный бирюзовый */
  --light-bg: #f7f9fc; /* Светлый фон */
  --lighter-bg: #E0F7FA; /* Очень светлый голубой */
  --white: #ffffff;
  --text-color: #333333;
  --border-color: #e0e0e0;
  --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

/* Базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-bg);
}

/* Заголовки с шрифтом из примера */
h1, h2, h3, h4, h5, h6 {
  font-family: "Playfair Display", serif;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 1rem;
  line-height: 1.3;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Шапка сайта */
.header {
  background: linear-gradient(135deg, var(--white) 0%, var(--lighter-bg) 100%);
  padding: 2rem 0;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.logo {
  height: 60px;
  width: auto;
  transition: var(--transition);
  object-fit: contain;
}

.logo:hover {
  transform: scale(1.05);
}

/* Специальные размеры для каждого логотипа */
.logo:first-child {
  height: 55px; /* Серебряное ожерелье */
}

.logo:nth-child(2) {
  height: 65px; /* RussiaTravel.club */
}

.logo:nth-child(3) {
  height: 50px; /* НАИТО */
}

.partner-info {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #666;
  font-style: italic;
}

.partner-link {
  color: var(--teal-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.partner-link:hover {
  color: var(--dark-teal);
  text-decoration: underline;
}

.partner-link i {
  font-size: 0.8em;
  margin-left: 0.3em;
  opacity: 0.7;
}

/* Контейнер */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Введение */
.intro {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  text-align: center;
}

.intro h2 {
  color: var(--teal-color);
  margin-bottom: 1.5rem;
}

.intro p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* Фильтры */
.filters {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.filter-section {
  margin-bottom: 1rem;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section h4 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border-color);
  background: var(--white);
  color: var(--text-color);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 500;
}

.filter-btn:hover {
  border-color: var(--teal-color);
  color: var(--teal-color);
}

.filter-btn.active {
  background: var(--teal-color);
  border-color: var(--teal-color);
  color: white;
}

/* Тематические разделы */
.theme-section {
  margin-bottom: 3rem;
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
}

.theme-section.hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  margin-bottom: 0;
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
}

.theme-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  text-align: center;
}

.theme-header h2 {
  color: white;
  margin-bottom: 0.5rem;
}

.theme-description {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Сетка карточек музеев */
.museums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

/* Карточка музея */
.museum-card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.museum-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.museum-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: var(--transition);
}

.museum-card:hover .museum-image {
  transform: scale(1.05);
}

.museum-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.museum-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  height: 2.6em; /* Фиксированная высота для 2 строк */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.museum-region {
  display: inline-block;
  background: var(--lighter-bg);
  color: var(--teal-color);
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.museum-highlight {
  background: var(--orange-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.2;
  /* Создаем фиксированную область для блока + отступа */
  margin-bottom: 0;
}

.museum-highlight-container {
  height: 4rem; /* Фиксированная высота для блока + отступа */
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
}

.museum-description {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #666;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 4.5em; /* Фиксированная высота для 3 строк */
}

.museum-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: var(--accent-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.museum-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.learn-more-btn {
  background: var(--teal-color);
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.learn-more-btn:hover {
  background: var(--dark-teal);
}

.museum-location {
  font-size: 0.8rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.2;
}

.museum-location i {
  font-size: 0.9em;
  flex-shrink: 0;
}

/* Модальное окно для деталей */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: var(--white);
  margin: 5% auto;
  padding: 2rem;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: slideIn 0.3s ease;
}

.modal-image {
  max-width: 100%;
}

.close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  color: #999;
  transition: var(--transition);
}

.close:hover {
  color: var(--primary-color);
}

/* Статистика */
.stats {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  text-align: center;
}

.stat-item {
  padding: 1rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--teal-color);
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Анимации */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Адаптивность */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8rem;
  }
  
  .logos {
    gap: 1rem;
  }
  
  .logo {
    height: 45px;
  }
  
  .logo:first-child {
    height: 40px;
  }
  
  .logo:nth-child(2) {
    height: 50px;
  }
  
  .logo:nth-child(3) {
    height: 35px;
  }
  
  .museums-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-content {
    margin: 10% auto;
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .intro, .filters, .stats {
    padding: 1rem;
  }
  
  .theme-header {
    padding: 1rem;
  }
  
  .museum-content {
    padding: 1rem;
  }
}

/* Адаптивные стили для десктопа */
@media (min-width: 768px) {
  .museum-footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }
  
  .learn-more-btn {
    flex-shrink: 0;
  }
  
  .museum-location {
    text-align: right;
    flex-shrink: 1;
  }
}

/* Стили для больших экранов - кнопки на одном уровне */
@media (min-width: 1200px) {
  .museum-footer {
    align-items: center;
  }
  
  .museum-location {
    align-self: center;
  }
}

/* Стили для печати (PDF) */
@media print {
  .filters, .modal {
    display: none !important;
  }
  
  .museum-card {
    page-break-inside: avoid;
    margin-bottom: 1rem;
    box-shadow: none;
    border: 1px solid var(--border-color);
  }
  
  .theme-section {
    page-break-before: auto;
    page-break-inside: avoid;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
}