:root {
  --primary-color: #0088cc;
  --danger-color: #f44336;
  --border-color: #ddd;
  --text-muted: #777;
  --text-light: #999;
  --card-radius: 12px;
  --transition: 0.3s ease;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

body {
  font-family: 'Inter', sans-serif;
}

/* === Заголовок подборки === */
.dtitle {
  text-align: center;
  font-size: 10px;
  opacity: 0.4;
}

/* === Сетка рекомендаций === */
.recommendations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 30px;
}

/* === Сетка каталога === */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
  padding: 40px 60px 0;
}

/* === Карточка ресурса (Премиум) === */
.resource-card.premium {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: 120px;
  gap: 10px;
}

/* === Плейсхолдеры карточек === */
.resource-card.premium.placeholder,
.recommendation-card.placeholder {
  opacity: 0.3;
  border: 2px dashed #ccc;
  cursor: pointer;
  justify-content: center;
  align-items: center;
  text-align: left;
}

/* === Обёртка изображения === */
.image-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* === Рейтинг-оверлей === */
.rating-overlay {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rating-star {
  width: 12px;
  height: 12px;
}

@media (max-width: 768px) {
  .catalog-grid {
    padding: 20px 16px 0;
	gap: 12px;
    grid-template-columns: 1fr;
  }

  .recommendations-grid {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }

  .resource-card.premium {
    flex-direction: row; /* не column, а row */
    height: 100px;       /* чуть ниже для компактности */
  }

  .resource-card.premium .resource-image-wrapper {
    flex: 0 0 100px;
    height: 100%;
    width: auto;
  }

  .image-container {
    height: 100%;
  }

  .rating-overlay {
    font-size: 11px;
    padding: 2px 5px;
    bottom: 8px;
    left: 8px;
  }

  .dtitle {
    font-size: 9px;
    padding: 0 12px;
  }

  .titleprem {
    font-size: 14px;
  }

  .meta {
    font-size: 11px;
    gap: 6px;
  }

  .category-badge {
    font-size: 11px;
    padding: 1px 5px;
  }

  .description {
    font-size: 11px;
  }
}



/* === Кружок с подсказкой === */
.tooltip-circle {
  display: inline-block;
  margin-left: 6px;
  width: 16px;
  height: 16px;
  line-height: 18px;
  border-radius: 50%;
  border: solid 1px black;
  color: black;
  text-align: center;
  font-size: 12px;
  cursor: help;
  font-weight: bold;
}

/* === Хлебные крошки === */
.breadcrumb {
  font-size: 12px;
  margin: 0;
  color: var(--text-muted);
  padding: 0 0 0 60px;
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
  margin-right: 5px;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .breadcrumb {
    padding: 0 16px;
    font-size: 11px;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .breadcrumb a {
    margin-right: 6px;
    display: inline-block;
    word-break: keep-all;
  }
}


/* === Отключенные элементы === */
.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* === Ховер по карточке === */
.resource-card.premium:hover {
  transform: translateY(-3px);
}

/* === Обёртка изображения карточки === */
.resource-image-wrapper {
  flex: 0 0 120px;
  height: 100%; /* важно */
}

.resource-thumb-rect {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* === Контент карточки === */
.resource-content {
  padding: 6px;
  flex-direction: column;
}

/* === Заголовок карточки === */
.titleprem {
  margin: 0;
  font-size: 16px;
}

/* === Метаданные карточки === */
.meta {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0;
  padding-bottom: 4px;
}

.icon {
  width: 18px !important;
  height: 18px !important;
  vertical-align: text-bottom;
}

/* === Категория (бэйдж) === */
.catprem {
  font-size: 13px;
  font-weight: 600;
  margin: 3px 3px 3px 5px;
}

/* === Тип (плашка) === */
.type-pill {
  background-color: #f44336;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  margin-left: 10px;
  display: inline-block;
  vertical-align: middle;
}

/* === Контейнер всех карточек === */
.resource-container {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding: 0 60px;
  margin-top: 40px;
}
/* === Основной контент ресурса === */
.resource-main {
  flex: 3;
  background: #fff;
  padding: 32px;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 32px;
  min-width: 300px;
  font-size: 14px;
}

/* === Сайдбар с фото === */
.resource-sidebar {
  max-width: 400px;
}

.resource-sidebar .photo {
  width: 260px;
  height: 260px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: 0 auto;
}

/* === Оценка (лайк/дизлайк) === */
.rating-controls {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: -20px 0 10px;
}

.circle {
  width: 72px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.circle.like {
  background: linear-gradient(to bottom, #e0ffe0, #b2ffb2);
  border-radius: 8px 0 0 8px;
}

.circle.dislike {
  background: linear-gradient(to bottom, #ffe0e0, #ffb2b2);
  border-radius: 0 8px 8px 0;
}

.circle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}



/* === Заголовок ресурса === */
.resource-info h1 {
  margin: 0 0 -8px;
  font-size: 30px;
}

/* === Ссылка под заголовком === */
.resource-info .link {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 10px;
}

/* === Категория ресурса === */
.resource-info .cat {
  border-left: solid 4px black;
  background-color: #ddffdd;
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
  padding: 6px 12px 6px 6px;
}

.resource-info .cat a {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent; /* для мобильных */
}

.resource-info .cat h2 {
  margin: 0;
  padding: 0;
  background: none;
  font-size: 16px;
}

/* === Описание ресурса === */
.resource-info .desc {
  font-size: 12px;
}

.resource-info p {
  margin-bottom: 0;
  line-height: 1.6;
}

/* === Поддержка/информация === */
.sup {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #333;
  gap: 6px;
}

.sup img {
  width: 22px;
  height: 22px;
}

/* === Кнопка Telegram === */
.tg-button {
  display: inline-block;
  background: black;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  transition: var(--transition);
  margin-top: 16px;
}

.tg-button:hover {
  background: #222;
}

/* === Блок ссылки Telegram в строку с аватаром === */
.telegram-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

/* === Предупреждение === */
.warning {
  color: var(--danger-color);
  margin-top: 16px;
  font-weight: bold;
}

/* === Блок рекомендаций справа === */
.resource-recommendations {
  flex: 1;
  min-width: 260px;
}

/* === Обертка списка рекомендаций === */
.recommendation-side-wrapper {
  flex: 1;
  max-width: 420px;
}

/* === Список и элементы списка === */
.resource-recommendations ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.resource-recommendations li {
  margin-bottom: 20px;
}

/* === Список карточек рекомендаций === */
.recommendation-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* === Карточка рекомендации === */
.recommendation-card {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: 110px;
  gap: 10px;
  padding: 0;
}

.recommendation-card:hover {
  transform: translateY(-3px);
}

/* === Изображение в карточке === */
.recommendation-image-wrapper {
  flex: 0 0 110px;
  height: 100%;
}

.recommendation-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* === Контент карточки === */
.recommendation-content {
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

@media (max-width: 768px) {
  .resource-container {
    padding: 0 16px;
    gap: 20px;
  }

  .resource-main {
    flex-direction: column;
    padding: 16px;
    font-size: 13px;
	gap: 12px;
  }

  .resource-sidebar {
    max-width: 100%;
  }

  .resource-sidebar .photo {
    width: 100%;
    height: auto;
    max-width: 260px;
  }

  .resource-info h1 {
    font-size: 22px;
  }

  .resource-info .cat h2 {
    font-size: 14px;
  }

  .resource-info .desc {
    font-size: 12px;
  }

  .tg-button {
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
  }

  .telegram-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .recommendation-side-wrapper {
    max-width: 100%;
    width: 100%;
	padding-bottom: 0px;
  }

  .resource-recommendations {
    padding: 0 16px;
    min-width: unset;
  }

  .recommendation-list {
    gap: 12px;
  }

  .recommendation-card {
    display: flex;
    flex-direction: row;
    height: 100px;
    gap: 10px;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
  }

  .recommendation-image-wrapper {
    flex: 0 0 120px;
    height: 100%;
  }

  .recommendation-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .recommendation-content {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    font-size: 12px;
  }

  .titleprem {
    font-size: 14px;
    margin: 0;
  }

  .meta {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .catprem {
    font-size: 11px;
  }

  .type-pill {
    font-size: 9px;
    padding: 3px 6px;
  }
}






/* === Заголовок рекомендации === */
.recommendation-title {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
}

.recommendation-title a {
  text-decoration: none;
  color: #111;
}

.recommendation-title a:hover {
  text-decoration: underline;
}

/* === Подзаголовок блока рекомендаций === */
.dtitle.under-title {
  text-align: center;
  font-size: 10px;
  opacity: 0.4;
  margin-top: 20px;
}

/* === Метаданные (просмотры и т.д.) === */
.meta {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
}

.meta .views {
  margin-left: 12px;
}

/* === Бейдж категории === */
.category-badge {
  background-color: #ddfcdc;
  font-size: 12px;
  padding: 2px 6px;
  border-left: 4px solid #000000;
  border-radius: 4px;
  display: inline-block;
  font-weight: 600;
  margin: 4px 0;
  width: max-content;       /* ширина под контент */
  max-width: 100%;          /* защита от выхода за пределы */
}



/* === Элемент рекомендации (круглая аватарка) === */
.rec-item {
  display: flex;
  gap: 12px;
  background: #fff;
  padding: 12px;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.rec-item:hover {
  transform: translateY(-3px);
}

.rec-item img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

/* === Контент в блоке рекомендации === */
.rec-title {
  font-weight: 600;
}

.rec-cat {
  font-size: 13px;
  color: var(--text-muted);
}

.rec-desc {
  font-size: 12px;
  color: var(--text-light);
}

/* === Модальное окно 18+ === */
.age-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
  padding-top: 150px;
}

.modal-content {
  background: #222;
  padding: 30px;
  display: inline-block;
  border-radius: var(--card-radius);
}
/* === Заголовок блока похожих ресурсов === */
.dtitle-same {
  padding-top: 40px;
  text-align: center;
  font-size: 10px;
  opacity: 0.4;
}

/* === Сетка похожих карточек === */
.catalog-grid-same {
  padding: 0 60px 40px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}

/* === Карточка похожего ресурса === */
.resource-card.related {
  display: flex;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  align-items: stretch;
  height: 120px;
  gap: 10px;
}

.resource-card.related:hover {
  transform: translateY(-3px);
}

@media (max-width: 768px) {
	
  .dtitle-same {
	padding-top: 0px !important;
	text-align: center;
	font-size: 10px;
	opacity: 0.4;
  }
  .catalog-grid-same {
    padding: 0 16px 40px;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .resource-card.related {
    flex-direction: row;
    height: 100px;
    gap: 10px;
  }

  .related-wrapper .resource-image-wrapper {
    flex: 0 0 100px;
    height: 100%;
    width: auto;
  }

  .related-wrapper .image-container {
    height: 100%;
  }

  .related-wrapper .title {
    font-size: 14px;
  }

  .related-wrapper .meta {
    font-size: 11px;
    gap: 8px;
  }

  .related-wrapper .category-badge {
    font-size: 11px;
    padding: 1px 5px;
  }

  .related-wrapper .description {
    font-size: 11px;
    line-height: 1.4;
  }
}


/* === Изображение карточки === */
.related-wrapper .resource-image-wrapper {
  flex: 0 0 120px;
  height: 100%;
}

.related-wrapper .image-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.related-wrapper .resource-thumb-rect {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* === Оверлей рейтинга === */
.related-wrapper .rating-overlay {
  position: absolute;
  bottom: 6px;
  left: 6px;
  color: #fff;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 500;
}

/* === Контент карточки === */
.related-wrapper .resource-content {
  padding: 6px;
  flex-direction: column;
  display: flex;
  justify-content: space-between;
  flex: 1;
}

.related-wrapper .title {
  margin: 0;
  font-size: 16px;
}

.related-wrapper .meta {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 4px;
}

/* === Категория и описание === */
.related-wrapper .category-badge {
  background-color: #ddfcdc;
  font-size: 12px;
  padding: 2px 6px;
  border-left: 4px solid #000;
  border-radius: 4px;
  display: inline-block;
  font-weight: 600;
  margin: 4px 0;
  width: max-content;
}

.related-wrapper .cat {
  font-size: 12px;
  font-weight: 600;
}

/* === Описание ресурса === */
.description {
  margin: 0;
  font-size: 12px;
  color: #333;
  line-height: 1.4;
}

.related-wrapper .description {
  margin: 0;
  font-size: 12px;
  color: #333;
  line-height: 1.5;
}

/* === Общие стили для карточек === */
.cat {
  margin: 0;
}

.title {
  white-space: nowrap;         /* Запрещаем перенос строк */
  overflow: hidden;            /* Скрываем всё, что не помещается */
  text-overflow: ellipsis;     /* Добавляем многоточие */
  max-width: 50%;              /* Ограничиваем ширину */
}

/* === Ссылки на карточки === */
.resource-card-link,
.recommendation-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* === Отключенная кнопка Telegram === */
.tg-button.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: default;
}

/* === Tooltip: Всплывающая подсказка === */
.tooltip-header-center,
.dtitle-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip-circle {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 18px;
  border-radius: 50%;
  border: 1px solid black;
  background: white;
  color: black;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  cursor: help;
  opacity: 0.4;
}

.tooltip-text {
  visibility: hidden;
  background-color: #333;
  color: #fff;
  text-align: center;
  font-size: 12px;
  border-radius: 6px;
  padding: 5px 8px;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(calc(-50% - 200px)); /* кастомное смещение */
  white-space: nowrap;
  z-index: 9999;
}

.tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
}
