/* =============================================================
 * Bethplanet — Mods (module 11) design 2026
 * Карточка листинга (.bp-mod-card), страница мода (.bp-mod-page).
 * Использует токены --bp-g-* из game.css.
 * ============================================================= */

/* --- Layout --- */
.bp-mods-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
  margin: 18px 0 40px;
  font-family: var(--bp-g-font);
}
.bp-mods-main { min-width: 0; }
.bp-mods-side { min-width: 0; }
@media (max-width: 1024px) {
  .bp-mods-layout { grid-template-columns: 1fr; gap: 20px; }
}

/* =============================================================
 * LISTING — заголовок и поиск
 * ============================================================= */
.bp-mods-heading {
  margin: 0 0 14px;
  font-family: var(--bp-g-font);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--bp-g-text);
  line-height: 1.15;
}
@media (max-width: 600px) {
  .bp-mods-heading { font-size: 22px; }
}

.bp-mods-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0 14px;
}

.bp-mods-add-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  background: var(--bp-g-brand);
  color: #fff;
  font-family: var(--bp-g-font);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--bp-g-brand);
  border-radius: var(--bp-g-radius-pill);
  white-space: nowrap;
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    border-color var(--bp-g-dur) var(--bp-g-ease),
    transform var(--bp-g-dur) var(--bp-g-ease);
}
.bp-mods-add-cta:hover,
.bp-mods-add-cta:focus-visible {
  background: var(--bp-g-brand-hover);
  border-color: var(--bp-g-brand-hover);
  color: #fff;
  text-decoration: none;
  outline: none;
  transform: translateY(-1px);
}
.bp-mods-add-cta svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Поиск (template 11/1) */
.bp-mods-main #myInput {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0 0 18px;
  padding: 0 18px;
  background: var(--bp-g-bg);
  color: var(--bp-g-text);
  font-family: var(--bp-g-font);
  font-size: 15px;
  border: 1px solid var(--bp-g-line);
  border-radius: var(--bp-g-radius-md);
  box-shadow: var(--bp-g-shadow-card);
  outline: none;
  transition: border-color var(--bp-g-dur) var(--bp-g-ease),
    box-shadow var(--bp-g-dur) var(--bp-g-ease);
}
.bp-mods-main #myInput::placeholder {
  color: var(--bp-g-text-dim);
}
.bp-mods-main #myInput:focus {
  border-color: var(--bp-g-brand-line);
  box-shadow: var(--bp-g-shadow-hover);
}

/* =============================================================
 * LISTING — сетка карточек
 * uCoz рендерит entries как <div id="entryIDxxx"><article>...</article></div>.
 * Иногда оборачивает в #allEntries или table.catAllEntries.
 * ============================================================= */
.bp-mod-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.bp-mod-grid #allEntries,
.bp-mod-grid .catAllEntries,
.bp-mod-grid .catAllEntries tbody,
.bp-mod-grid .catAllEntries tr {
  display: block !important;
  width: 100% !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}
.bp-mod-grid .catAllEntries td.archiveEntries,
.bp-mod-grid #allEntries {
  display: flex !important;
  flex-direction: column;
  gap: 14px;
  width: 100% !important;
  padding: 0 !important;
}
.bp-mod-grid [id^="entryID"] {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

/* =============================================================
 * CARD — карточка одного мода
 * Горизонтальный layout: обложка 16:9 слева (~260px) + текст справа.
 * Тот же визуальный язык, что и .bp-news-card.
 * ============================================================= */
.bp-mod-card {
  position: relative;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  padding: 14px;
  background: var(--bp-g-bg);
  border: 1px solid var(--bp-g-line);
  border-radius: var(--bp-g-radius-md);
  box-shadow: var(--bp-g-shadow-card);
  font-family: var(--bp-g-font);
  transition: transform var(--bp-g-dur) var(--bp-g-ease),
    border-color var(--bp-g-dur) var(--bp-g-ease),
    box-shadow var(--bp-g-dur) var(--bp-g-ease);
}
.bp-mod-card:hover,
.bp-mod-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--bp-g-brand-line);
  box-shadow: var(--bp-g-shadow-hover);
}

@media (max-width: 600px) {
  .bp-mod-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
}

/* --------------- Cover --------------- */
.bp-mod-card__cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bp-g-surface);
  border-radius: var(--bp-g-radius-sm);
}
.bp-mod-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 360ms var(--bp-g-ease);
}
.bp-mod-card:hover .bp-mod-card__cover img {
  transform: scale(1.03);
}
.bp-mod-card__cover--placeholder {
  background: linear-gradient(135deg, var(--bp-g-surface) 0%, var(--bp-g-line) 100%);
  display: grid;
  place-items: center;
  color: var(--bp-g-text-dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bp-mod-card__cover--placeholder::before {
  content: "Mod";
}

/* --------------- Body --------------- */
.bp-mod-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bp-mod-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.bp-mod-card__title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--bp-g-text);
  text-decoration: none;
}
.bp-mod-card__title a:hover,
.bp-mod-card__title a:focus-visible {
  color: var(--bp-g-brand);
}
.bp-mod-card__moder {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}

/* --------------- Meta --------------- */
.bp-mod-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--bp-g-text-muted);
}
.bp-mod-card__meta a {
  color: inherit;
  text-decoration: none;
  transition: color var(--bp-g-dur) var(--bp-g-ease);
}
.bp-mod-card__meta a:hover,
.bp-mod-card__meta a:focus-visible {
  color: var(--bp-g-brand);
}
.bp-mod-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.bp-mod-card__meta-item + .bp-mod-card__meta-item::before {
  content: "·";
  color: var(--bp-g-text-dim);
  margin-right: 6px;
}
.bp-mod-card__meta-item svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  stroke: currentColor;
  opacity: 0.65;
  flex-shrink: 0;
}
/* Игра — выделена жирным/тёмным (первый meta-item) */
.bp-mod-card__meta-item--game a {
  font-weight: 600;
  color: var(--bp-g-text);
}
.bp-mod-card__meta-item--game a:hover {
  color: var(--bp-g-brand);
}

/* --------------- Excerpt --------------- */
.bp-mod-card__excerpt {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--bp-g-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bp-mod-card__excerpt p {
  margin: 0;
  display: inline;
}
.bp-mod-card__excerpt p + p::before { content: " "; }
.bp-mod-card__excerpt a {
  color: var(--bp-g-text-muted);
  text-decoration: none;
  pointer-events: none;
}
.bp-mod-card__excerpt img,
.bp-mod-card__excerpt br,
.bp-mod-card__excerpt iframe {
  display: none;
}

/* =============================================================
 * MOD PAGE (template 11/4) — hero + body + sidebar
 * ============================================================= */
body.bp-mod-page {
  background-color: var(--bp-g-page-bg) !important;
  background-image: none !important;
}

.bp-mod-hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 22px;
  border-radius: var(--bp-g-radius-xl);
  background: var(--bp-g-surface);
  box-shadow: var(--bp-g-shadow-hero);
  isolation: isolate;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  font-family: var(--bp-g-font);
}
.bp-mod-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: inherit;
}
.bp-mod-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.72) 22%,
    rgba(0, 0, 0, 0.5) 45%,
    rgba(0, 0, 0, 0.25) 65%,
    rgba(0, 0, 0, 0) 90%
  );
}
.bp-mod-hero__inner {
  width: 100%;
  padding: 32px 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bp-mod-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bp-mod-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--bp-g-radius-pill);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: background var(--bp-g-dur) var(--bp-g-ease);
}
.bp-mod-badge:link,
.bp-mod-badge:visited { color: #fff; }
.bp-mod-badge:hover,
.bp-mod-badge:focus-visible {
  background: #fff;
  color: var(--bp-g-brand);
  text-decoration: none;
  outline: none;
}
.bp-mod-hero__title {
  margin: 0;
  font-family: var(--bp-g-font);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #fff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7), 0 4px 24px rgba(0, 0, 0, 0.55);
}
.bp-mod-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}
.bp-mod-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bp-mod-hero__meta-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.85;
}
.bp-mod-hero__meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}
.bp-mod-hero__meta a:hover {
  border-bottom-color: #fff;
}
@media (max-width: 640px) {
  .bp-mod-hero { min-height: 240px; }
  .bp-mod-hero__inner { padding: 20px 18px 18px; }
}

/* --------------- Body / message --------------- */
.bp-mod-body {
  background: var(--bp-g-bg);
  border: 1px solid var(--bp-g-line);
  border-radius: var(--bp-g-radius-lg);
  box-shadow: var(--bp-g-shadow-card);
  padding: 24px 28px;
  margin: 0 0 22px;
  font-family: var(--bp-g-font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--bp-g-text);
}
.bp-mod-body h2,
.bp-mod-body h3 { margin-top: 1.4em; }
.bp-mod-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--bp-g-radius-md);
}
.bp-mod-body iframe { width: 100%; border: 0; }
.bp-mod-body a {
  color: var(--bp-g-brand);
  text-decoration: none;
  border-bottom: 1px solid var(--bp-g-brand-line);
}
.bp-mod-body a:hover {
  border-bottom-color: var(--bp-g-brand);
}

/* --------------- Download CTA --------------- */
.bp-mod-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 22px 0;
  padding: 22px 24px;
  background: var(--bp-g-brand-soft);
  border: 1px solid var(--bp-g-brand-line);
  border-radius: var(--bp-g-radius-md);
  font-family: var(--bp-g-font);
}
.bp-mod-cta__updated {
  font-size: 13px;
  font-weight: 500;
  color: var(--bp-g-text-muted);
}
.bp-mod-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  background: var(--bp-g-brand);
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border-radius: var(--bp-g-radius-md);
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    transform var(--bp-g-dur) var(--bp-g-ease);
}
.bp-mod-cta__btn:hover {
  background: var(--bp-g-brand-hover);
  transform: translateY(-1px);
  color: #fff !important;
  text-decoration: none;
}
.bp-mod-cta__btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.bp-mod-cta__rating { margin-top: 6px; }

/* --------------- Gallery --------------- */
.bp-mod-gallery__title {
  margin: 22px 0 12px;
  font-family: var(--bp-g-font);
  font-size: 20px;
  font-weight: 700;
  color: var(--bp-g-text);
}
.bp-mod-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}
.bp-mod-gallery a {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bp-g-surface);
  border-radius: var(--bp-g-radius-md);
  transition: transform var(--bp-g-dur) var(--bp-g-ease),
    box-shadow var(--bp-g-dur) var(--bp-g-ease);
}
.bp-mod-gallery a:hover {
  transform: translateY(-2px);
  box-shadow: var(--bp-g-shadow-hover);
}
.bp-mod-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 640px) {
  .bp-mod-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------------- Info tables --------------- */
.bp-mod-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 22px 0;
  font-family: var(--bp-g-font);
}
.bp-mod-info__table {
  background: var(--bp-g-bg);
  border: 1px solid var(--bp-g-line);
  border-radius: var(--bp-g-radius-md);
  box-shadow: var(--bp-g-shadow-card);
  padding: 6px 18px;
}
.bp-mod-info__row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bp-g-line);
  font-size: 14px;
  line-height: 1.45;
}
.bp-mod-info__row:last-child { border-bottom: 0; }
.bp-mod-info__row dt {
  margin: 0;
  color: var(--bp-g-text-muted);
  font-weight: 500;
}
.bp-mod-info__row dd {
  margin: 0;
  color: var(--bp-g-text);
  word-wrap: break-word;
}
.bp-mod-info__row a {
  color: var(--bp-g-brand);
  text-decoration: none;
}
.bp-mod-info__row a:hover { text-decoration: underline; }
@media (max-width: 768px) {
  .bp-mod-info { grid-template-columns: 1fr; }
  .bp-mod-info__row { grid-template-columns: 100px 1fr; }
}

/* --------------- Tags row --------------- */
.bp-mod-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  padding: 14px 18px;
  background: var(--bp-g-bg);
  border: 1px solid var(--bp-g-line);
  border-radius: var(--bp-g-radius-md);
  box-shadow: var(--bp-g-shadow-card);
  font-family: var(--bp-g-font);
}
.bp-mod-tags__label {
  margin-right: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--bp-g-text-muted);
}
.bp-mod-tags a {
  display: inline-flex;
  padding: 4px 10px;
  background: var(--bp-g-surface);
  color: var(--bp-g-text-muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--bp-g-radius-pill);
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    color var(--bp-g-dur) var(--bp-g-ease);
}
.bp-mod-tags a:hover {
  background: var(--bp-g-brand-soft);
  color: var(--bp-g-brand);
}

/* --------------- Comments wrap --------------- */
.bp-mod-comments {
  margin-top: 22px;
  padding: 22px 26px;
  background: var(--bp-g-bg);
  border: 1px solid var(--bp-g-line);
  border-radius: var(--bp-g-radius-lg);
  box-shadow: var(--bp-g-shadow-card);
  font-family: var(--bp-g-font);
}
.bp-mod-comments__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 700;
  color: var(--bp-g-text);
  letter-spacing: -0.01em;
}
.bp-mod-comments__heading::before {
  content: "";
  width: 6px;
  height: 22px;
  background: var(--bp-g-brand);
  border-radius: 3px;
  flex-shrink: 0;
}

/* =============================================================
 * SIDEBAR — нормализация $GLOBAL_DRIGHTER$ (col-lg-4 wrapper)
 * ============================================================= */
.bp-mods-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--bp-g-font);
}
.bp-mods-side .col-lg-4,
.bp-mods-side .col-md-4,
.bp-mods-side .col-sm-4 {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  float: none !important;
}
.bp-mods-side > div,
.bp-mods-side > aside { min-width: 0; }
.bp-mods-side .sideblock { margin-bottom: 0; }

/* =============================================================
 * CATEGORIES — список разделов на /mods/ + /<game>/mods/
 * legacy uCoz table → flex grid
 * ============================================================= */
.bp-mods-categories {
  margin: 0 0 18px;
  font-family: var(--bp-g-font);
}
.bp-mods-categories .catsTd { display: none; }
.bp-mods-categories table.catsTable,
.bp-mods-categories .catsTable tbody,
.bp-mods-categories .catsTable tr {
  display: block;
  width: 100% !important;
  margin: 0;
  border: 0;
}
.bp-mods-categories .catsTable .catName {
  color: var(--bp-g-text);
}

/* =============================================================
 * PAGINATION — wrapping в .bp-pagination делает site.js initPagination().
 * Реюзаем визуальный паттерн из game.css.
 * ============================================================= */
.bp-mods-main #pagesBlock1,
.bp-mods-main .pagesBlockuz1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

/* =============================================================
 * Heading row CTA — компактная кнопка для рядом с h1
 * ============================================================= */
.bp-mods-heading-row .bp-mod-cta__btn {
  padding: 9px 18px;
  font-size: 14px;
}

/* =============================================================
 * Reduced motion
 * ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .bp-mod-card,
  .bp-mod-card__cover img,
  .bp-mod-cta__btn,
  .bp-mod-gallery a,
  .bp-mods-add-cta {
    transition: none;
  }
  .bp-mod-card:hover,
  .bp-mod-gallery a:hover,
  .bp-mods-add-cta:hover {
    transform: none;
  }
  .bp-mod-card:hover .bp-mod-card__cover img {
    transform: none;
  }
}
