/* === museum-theme.css - ОБЩИЙ CSS для всей коллекции === */

/* 1. БАЗОВЫЕ СТИЛИ (одинаковые для всех) */
body {
  margin: 0;
  padding: 10px;
  background: #f2f3f4;
  color: #222222;
  font-family: Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  max-width: 100%;
}

h1 {
  border-bottom: 2px solid #00aaaa;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

a {
  color: #00aaaa;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code, pre {
  background-color: #1e1e1e; /* Темный фон для кода */
  color: #d4d4d4;          /* Светло-серый текст кода */
  border: 1px solid #333; /* Тонкая граница */
}


blockquote {
  border-left: 4px solid #007bff;
  background-color: #f8f9fa;
  padding: 10px 20px;
  margin: 0 0 20px;
}


details {
  margin: 10px 0;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
}

summary {
  cursor: pointer;
  color: #008888;
  font-weight: bold;
  list-style: none;
  padding-left: 20px;
  position: relative;
}

summary::before {
  content: "▶";
  position: absolute;
  left: 0;
  color: #00aaaa;
}

details[open] summary::before {
  content: "▼";
}

/* 2. ОБЩИЕ КЛАССЫ ДЛЯ КАРТОЧЕК */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 15px;
  padding: 20px 0;
  justify-content: center;
}

.item-card {
  display: flex;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  min-height: 150px;
  width: 100%;
}

.item-image {
  flex: 0 0 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: #f8f9fa;
  border-right: 1px solid #ddd;
}

.item-image img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.item-info {
  flex: 1;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.item-title {
  font-size: 1.3em;
  font-weight: bold;
  color: #00aaaa;
  display: block;
  margin-bottom: 8px;
}

.item-description {
  font-weight: bold;
  margin-bottom: 5px;
  color: #333333;
  font-size: 1.1em;
}

.item-meta {
  color: #666666;
  font-size: 0.9em;
  margin-top: 5px;
}

/* 3. СПЕЦИФИЧЕСКИЕ СТИЛИ ДЛЯ ЭКСПОНАТОВ */
/* (можно переопределить общие стили если нужно) */
.exhibits-grid {
  /* Наследует все от .items-grid */
}

.exhibit-card {
  /* Наследует все от .item-card */
}

/* 4. СПЕЦИФИЧЕСКИЕ СТИЛИ ДЛЯ МОДЕЛЕЙ */
.models-grid {
  /* Наследует все от .items-grid */
}

.model-card {
  /* Наследует все от .item-card */
}

/* Можно сделать небольшие отличия если нужно */
.model-card .item-description {
  
}

.model-card .item-meta {
  
}

/* 5. АДАПТИВНОСТЬ ДЛЯ ВСЕХ КАРТОЧЕК */
@media screen and (min-width: 2000px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(550px, 1fr));
  }
}

@media screen and (min-width: 1400px) and (max-width: 1999px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  }
}

@media screen and (min-width: 1024px) and (max-width: 1399px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 12px;
  }
  
  .item-card {
    min-height: 140px;
  }
  
  .item-image {
    flex: 0 0 140px;
    padding: 12px;
  }
  
  .item-image img {
    max-height: 110px;
  }
  
  .item-info {
    padding: 12px;
  }
}

@media screen and (min-width: 768px) and (max-width: 1023px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 12px;
  }
  
  .item-card {
    min-height: 130px;
  }
  
  .item-image {
    flex: 0 0 130px;
    padding: 10px;
  }
  
  .item-image img {
    max-height: 100px;
  }
  
  .item-info {
    padding: 12px;
  }
  
  .item-title {
    font-size: 1.2em;
  }
  
  .item-description {
    font-size: 1em;
  }
}

@media screen and (max-width: 767px) {
  .items-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .item-card {
    width: 100%;
    max-width: 400px;
    min-height: auto;
  }
}

@media screen and (max-width: 480px) {
  .item-card {
    flex-direction: column;
    min-height: auto;
    max-width: 300px;
  }
  
  .item-image {
    flex: 0 0 auto;
    height: 150px;
    border-right: none;
    border-bottom: 1px solid #ddd;
    padding: 15px;
  }
  
  .item-image img {
    max-height: 120px;
  }
  
  .item-info {
    padding: 15px;
  }
  
  body {
    padding: 8px;
    font-size: 14px;
  }
}

@media screen and (max-width: 360px) {
  .item-image {
    height: 120px;
    padding: 10px;
  }
  
  .item-image img {
    max-height: 100px;
  }
  
  .item-info {
    padding: 12px;
  }
  
  .item-title {
    font-size: 1.1em;
  }
}

/* 6. Улучшение читаемости */
.item-description {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}


/* ===================== СТИЛИ ДЛЯ ЭФЕМЕРОВ (отдельные) =========================== */

/* 7. СТИЛИ ДЛЯ СПИСКА ЭФЕМЕРОВ (ИСПРАВЛЕННЫЙ) */
.ephemera-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  padding: 25px 0;
}

.ephemera-list-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 4px solid #d35400;
}

.ephemera-list-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Изображение - фиксированная высота */
.ephemera-list-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #ddd;
  flex-shrink: 0; /* Фиксируем высоту изображения */
}

.ephemera-list-image img {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: 4px;
}

/* Информационная часть - растягивается по контенту */
.ephemera-list-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Занимает всю доступную высоту */
}

.ephemera-list-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #d35400;
  margin-bottom: 10px;
  line-height: 1.3;
  text-decoration: none;
}

.ephemera-list-title:hover {
  color: #a04000;
  text-decoration: underline;
}

/* Описание - полный текст без обрезки */
.ephemera-list-description {
  color: #444;
  font-size: 0.95em;
  line-height: 1.5;
  margin-bottom: 12px;
  word-break: break-word; /* Перенос длинных слов */
}

/* Блок с мета-информацией */
.ephemera-list-meta {
  color: #666;
  font-size: 0.85em;
  margin-bottom: 10px;
  line-height: 1.4;
}

.ephemera-list-meta-item {
  margin-bottom: 4px;
}

.ephemera-list-meta-item strong {
  color: #d35400;
}

/* Связанные модели - в виде строчных элементов */
.ephemera-list-models {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.ephemera-list-models-title {
  font-size: 0.9em;
  font-weight: bold;
  color: #d35400;
  margin-bottom: 6px;
}

.ephemera-list-models-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ephemera-list-model-item {
  display: inline-block;
  background: #e8f4f8;
  color: #0077aa;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  text-decoration: none;
  border: 1px solid #b6e0f0;
  transition: all 0.2s ease;
}

.ephemera-list-model-item:hover {
  background: #d0e8f2;
  text-decoration: none;
  border-color: #0077aa;
}

/* Бейджи - без обрезки текста */
.ephemera-list-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.ephemera-list-badge {
  display: inline-block;
  background: #f0f0f0;
  color: #555;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.85em;
  white-space: nowrap;
  max-width: 100%; /* Не обрезаем текст */
  overflow: hidden;
  text-overflow: ellipsis; /* Но если очень длинный - многоточие */
}

.ephemera-list-badge.type {
  background: #f8e8d8;
  color: #d35400;
}

.ephemera-list-badge.year {
  background: #e8f4f8;
  color: #0088aa;
}

.ephemera-list-badge.rare {
  background: #f8d7da;
  color: #c0392b;
}

/* 8. АДАПТИВНОСТЬ ДЛЯ СПИСКА ЭФЕМЕРОВ */
@media screen and (min-width: 1600px) {
  .ephemera-list-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}

@media screen and (min-width: 1200px) and (max-width: 1599px) {
  .ephemera-list-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
  }
}

@media screen and (min-width: 768px) and (max-width: 1199px) {
  .ephemera-list-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
  }
  
  .ephemera-list-image {
    height: 160px;
    padding: 18px;
  }
  
  .ephemera-list-image img {
    max-height: 140px;
  }
  
  .ephemera-list-info {
    padding: 18px;
  }
}

@media screen and (max-width: 767px) {
  .ephemera-list-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .ephemera-list-card {
    max-width: 100%;
  }
}

@media screen and (max-width: 480px) {
  .ephemera-list-grid {
    gap: 15px;
  }
  
  .ephemera-list-image {
    height: 160px;
    padding: 15px;
  }
  
  .ephemera-list-image img {
    max-height: 140px;
  }
  
  .ephemera-list-info {
    padding: 15px;
  }
  
  .ephemera-list-title {
    font-size: 1.1em;
  }
  
  .ephemera-list-description {
    font-size: 0.9em;
  }
}

@media screen and (max-width: 360px) {
  .ephemera-list-image {
    height: 140px;
    padding: 12px;
  }
  
  .ephemera-list-image img {
    max-height: 120px;
  }
  
  .ephemera-list-info {
    padding: 12px;
  }
  
  .ephemera-list-title {
    font-size: 1.05em;
  }
  
  .ephemera-list-badge {
    white-space: normal; /* На очень маленьких экранах - перенос текста в бейджах */
    font-size: 0.8em;
  }
}

/* ===================== СТИЛИ ДЛЯ ШАБЛОНА (добавлены без удаления существующих) =========================== */

/* 9. СТИЛИ ДЛЯ ОБЩЕГО ШАБЛОНА СТРАНИЦЫ */
.page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px;
}

/* Простое меню как было */
.main-nav p {
  margin: 10px 0;
  line-height: 1.6;
}

.main-nav a {
  white-space: nowrap; /* чтобы скобки и ссылки не разрывались */
}

/* Адаптивность для меню - на мобильных уменьшаем отступы и делаем более компактным */
@media screen and (max-width: 1023px) {
  .main-nav p {
    line-height: 1.8;
  }
}

@media screen and (max-width: 767px) {
  .page-header p {
    font-size: 0.9em;
    line-height: 1.4;
  }
  
  .main-nav p {
    font-size: 0.9em;
    line-height: 2;
  }
  
  /* На очень маленьких экранах позволяем перенос внутри ссылок */
  .main-nav a {
    white-space: normal;
    word-break: break-word;
  }
}

@media screen and (max-width: 480px) {
  .main-nav p {
    font-size: 0.85em;
    line-height: 2.2;
  }
  
  /* На телефонах делаем меню более плотным */
  .main-nav a {
    display: inline-block;
    margin: 2px 0;
  }
}

/* Стили для основного контента */
.page-content {
  min-height: 70vh;
  padding: 20px 0;
}

.page-footer {
  margin-top: 40px;
  padding: 20px 0;
  font-size: 0.9em;
  color: #666;
  border-top: 1px solid #eee;
}

/* 10. АДАПТИВНОСТЬ ДЛЯ ШАБЛОНА */
@media screen and (max-width: 767px) {
  .page-wrapper {
    padding: 8px;
  }
  
  .page-content {
    padding: 15px 0;
  }
}

@media screen and (max-width: 480px) {
  .page-wrapper {
    padding: 5px;
  }
  
  .page-content {
    padding: 10px 0;
  }
}




/* ===================== СТИЛИ ДЛЯ СТРАНИЦ ЭКСПОНАТОВ/МОДЕЛЕЙ/ЭФЕМЕР ==================== */

/* Блок характеристик в виде GRID (аккуратная таблица) */
.specs-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 15px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.spec-name {
  font-weight: bold;
  color: #008888;
  text-align: right;
  white-space: nowrap;
  min-width: 180px;
  padding-right: 10px;
  border-right: 2px solid #e0e0e0;
}

.spec-value {
  color: #333;
  line-height: 1.5;
  word-break: break-word;
  min-width: 0; /* важно для переноса длинного текста */
}

/* На мобильных устройствах перестраиваем в одну колонку */
@media screen and (max-width: 768px) {
  .specs-grid {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  
  .spec-name {
    text-align: left;
    border-right: none;
    border-bottom: 1px dashed #e0e0e0;
    padding-bottom: 3px;
    margin-bottom: 3px;
    min-width: auto;
    padding-right: 0;
  }
  
  .spec-value {
    margin-bottom: 10px;
  }
}

/* Стиль для статуса "ПОИСК" - БЕЗ АНИМАЦИИ (не тормозит) */
.status-seek {
  background-color: #fff3cd;
  color: #856404;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 4px;
  border: 2px solid #ffc107;
  display: inline-block;
}

/* Убираем анимацию pulse - она действительно может тормозить */
/* Просто делаем яркий фон без анимации */

/* Улучшаем таблицу с фото - более компактно */
.photo-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 25px 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.photo-table tr {
  background: white;
}

.photo-table tr:nth-child(even) {
  background: #f9f9f9;
}

.photo-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
}

.photo-table td:first-child {
  width: 180px; /* Фиксированная ширина для фото */
  text-align: center;
  vertical-align: middle;
  background: #f8f9fa;
}

.photo-table img {
  max-width: 160px;
  max-height: 120px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  padding: 3px;
  transition: transform 0.15s ease; /* Очень короткая анимация - не тормозит */
}

.photo-table img:hover {
  transform: scale(1.02); /* Минимальное увеличение */
}

/* Адаптивность для таблицы с фото */
@media screen and (max-width: 768px) {
  .photo-table {
    display: block;
  }
  
  .photo-table tbody {
    display: block;
  }
  
  .photo-table tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: white;
  }
  
  .photo-table td:first-child {
    width: 100%;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
  }
  
  .photo-table td:last-child {
    padding: 15px;
  }
  
  .photo-table img {
    max-width: 100%;
    max-height: 200px;
  }
}

/* Общие улучшения для страниц */
.model, .exhibit, .ephemera {
  margin-top: 20px;
}

.description {
  line-height: 1.7;
  margin: 25px 0;
}

/* Старый блок .specs оставляем для совместимости, но он будет использоваться 
   только если в старых шаблонах остались старые классы */
.specs {
  background: #f8f9fa;
  border-left: 4px solid #00aaaa;
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.specs p {
  margin: 8px 0;
  line-height: 1.5;
}

.specs strong {
  color: #008888;
  min-width: 150px;
  display: inline-block;
}


/* ===================== СТИЛИ ДЛЯ СТРАНИЦЫ ЭФЕМЕРЫ ==================== */

/* Оранжевый акцент для эфемер */
.ephemera .specs {
  border-left-color: #d35400; /* Оранжевая полоска слева */
}

.ephemera .spec-name {
  color: #d35400; /* Оранжевый цвет для названий параметров */
}

.ephemera .item-title {
  color: #d35400; /* Оранжевый цвет для заголовков в списках */
}

.ephemera-list-card {
  border-left: 4px solid #d35400; /* Оранжевая полоска в карточках списка */
}

/* Для списка эфемер (если нужно) */
.ephemera-list-title {
  color: #d35400;
}

.ephemera-list-title:hover {
  color: #a04000;
}

/* Стили для тегов на странице экспоната */
.tags-container-small {
  line-height: 1.6;
}

.tag-link-small {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  background-color: #f0f0f0;
  border-radius: 3px;
  text-decoration: none;
  color: #333;
  font-size: 0.9em;
  border: 1px solid #ddd;
  transition: background-color 0.2s;
}

.tag-link-small:hover {
  background-color: #e0e0e0;
  text-decoration: none;
}

/* Или можно использовать более простой вариант без фона */
.tag-link-plain {
  color: #0066cc;
  text-decoration: none;
  border-bottom: 1px dotted #0066cc;
}

.tag-link-plain:hover {
  color: #ff6600;
  border-bottom: 1px solid #ff6600;
}
