/* Топ по просмотрам — стиль сайта (#111, #ccc, #fff, акцент #067c89), ровные постеры, адаптив */

.static-page .top-views-list {
  margin: 0 0 2rem 0;
  background: #12181e;
  border: 1px solid #252525;
  border-radius: 8px;
  overflow: hidden;
}

.top-views-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #252525;
  min-height: 0;
}

.top-views-row:last-child {
  border-bottom: none;
}

/* Ранг — акцент как в шаблоне (ссылки) */
.top-views-rank {
  flex-shrink: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #09757f;
  min-width: 2.25rem;
  text-align: center;
}

/* Постеры ровно: фиксированное соотношение 2:3, одна высота в ряду */
.top-views-thumb {
  flex-shrink: 0;
  width: 70px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #222;
  display: block;
}

.top-views-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: top;
}

.top-views-body {
  flex: 1;
  min-width: 0;
}

.top-views-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  line-height: 1.3;
}

.top-views-title a {
  color: #ccc;
  text-decoration: none;
}

.top-views-title a:hover {
  color: #fff;
}

.top-views-meta {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}

.top-views-genre {
  color: #057c8a;
  font-weight: 500;
}

.top-views-year {
  color: #888;
}

.top-views-badges {
  display: inline-flex;
  gap: 0.3rem;
}

.top-views-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.top-views-badge--new {
  background: #2d7a3e;
  color: #fff;
}

.top-views-badge--4k {
  background: #8b2a2a;
  color: #fff;
}

.top-views-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #888;
}

.top-views-comments {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.top-views-comment-icon {
  flex-shrink: 0;
  color: #666;
}

/* Рейтинг (топ по рейтингу) — лайки/дизлайки с иконками пальцев */
.top-views-rating-votes {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.top-views-likes {
  display: inline-flex;
  align-items: center;
  color: #2d7a3e;
  font-weight: 600;
}

.top-views-dislikes {
  display: inline-flex;
  align-items: center;
  color: #888;
  font-weight: 500;
}

.top-views-thumb-icon {
  flex-shrink: 0;
  vertical-align: -0.2em;
  margin-right: 0.15rem;
}

.top-views-fav {
  flex-shrink: 0;
}

.top-views-fav a {
  text-decoration: none;
  display: inline-block;
}

.top-views-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.top-views-fav-btn--add {
  background: transparent;
  border: 1px solid #067c89;
}

.top-views-fav-btn--add:hover {
  color: #fff;
  background: #067c89;
}

.top-views-fav-btn--in {
  color: #fff;
  background: #067c89;
  border: 1px solid #067c89;
}

.top-views-fav-btn--in:hover {
  background: #0052a3;
  border-color: #0052a3;
}

.top-views-fav-check {
  flex-shrink: 0;
}

/* ——— Планшеты ——— */
@media (max-width: 900px) {
  .top-views-row {
    padding: 0.8rem 1rem;
    gap: 0.85rem;
  }

  .top-views-rank {
    font-size: 1.25rem;
    min-width: 2rem;
  }

  .top-views-thumb {
    width: 62px;
  }

  .top-views-title {
    font-size: 0.95rem;
  }
}

/* ——— Мобильные: карточка в ряд, ровная сетка ——— */
@media (max-width: 640px) {
  .static-page .top-views-list {
    margin: 0 0 1.5rem 0;
    border-radius: 8px;
    border-color: #252525;
  }

  .top-views-row {
    display: grid;
    grid-template-columns: auto 72px 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.5rem 0.75rem;
    padding: 0.85rem 1rem;
    align-items: start;
  }

  .top-views-rank {
    grid-row: 1 / 3;
    align-self: center;
    font-size: 1.2rem;
    min-width: 1.75rem;
  }

  .top-views-thumb {
    grid-row: 1 / 3;
    width: 72px;
    align-self: center;
  }

  .top-views-body {
    grid-column: 3;
    grid-row: 1 / 3;
    min-width: 0;
  }

  .top-views-title {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
  }

  .top-views-meta {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }

  .top-views-extra {
    font-size: 0.75rem;
    grid-column: 2 / 4;
    grid-row: 3;
    gap: 0.6rem;
  }

  .top-views-fav {
    grid-column: 1 / 4;
    grid-row: 4;
    width: 100%;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid #252525;
  }

  .top-views-fav-btn {
    width: 100%;
    justify-content: center;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    min-height: 44px;
    box-sizing: border-box;
  }
}

/* ——— Узкие экраны ——— */
@media (max-width: 400px) {
  .top-views-row {
    grid-template-columns: auto 60px 1fr;
    gap: 0.45rem 0.6rem;
    padding: 0.75rem 0.85rem;
  }

  .top-views-thumb {
    width: 60px;
  }

  .top-views-rank {
    font-size: 1.1rem;
    min-width: 1.5rem;
  }

  .top-views-title {
    font-size: 0.88rem;
  }

  .top-views-fav-btn {
    min-height: 44px;
    padding: 0.55rem 0.85rem;
  }
}

/* ========== Вариант 2: сетка карточек (template="shortstory-top-views-grid") ========== */
.static-page .top-views-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.25rem;
  margin: 0 0 2rem 0;
}

.top-views-card {
  position: relative;
  background: #111;
  border: 1px solid #252525;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.top-views-card__rank {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  font-size: 1rem;
  font-weight: 700;
  color: #067c89;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  border-radius: 50%;
  border: 1px solid #067c89;
}

.top-views-card__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #222;
  position: relative;
}

.top-views-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.top-views-card__badges {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.top-views-card__badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.top-views-card__badge--new {
  background: #2d7a3e;
  color: #fff;
}

.top-views-card__badge--4k {
  background: #8b2a2a;
  color: #fff;
}

.top-views-card__body {
  padding: 0.6rem 0.65rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-views-card__title {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  line-height: 1.25;
}

.top-views-card__title a {
  color: #ccc;
  text-decoration: none;
}

.top-views-card__title a:hover {
  color: #fff;
}

.top-views-card__meta {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  color: #888;
}

.top-views-card__genre {
  color: #067c89;
  font-weight: 500;
}

.top-views-card__year {
  margin-left: 0.25rem;
}

.top-views-card__extra {
  font-size: 0.72rem;
  color: #666;
  margin-bottom: 0.35rem;
}

.top-views-card__comments {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.top-views-card__comments svg {
  flex-shrink: 0;
  color: #555;
}

.top-views-card__thumb-icon {
  flex-shrink: 0;
  vertical-align: -0.15em;
  margin-right: 0.1rem;
}

.top-views-card__votes {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.top-views-card__likes {
  display: inline-flex;
  align-items: center;
  color: #2d7a3e;
  font-weight: 600;
  font-size: 0.7rem;
}

.top-views-card__dislikes {
  display: inline-flex;
  align-items: center;
  color: #666;
  font-weight: 500;
  font-size: 0.7rem;
}

.top-views-card__fav {
  margin-top: auto;
}

.top-views-card__fav a {
  text-decoration: none;
  display: inline-block;
}

.top-views-card__fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.top-views-card__fav-btn--add {
  color: #067c89;
  background: transparent;
  border: 1px solid #067c89;
}

.top-views-card__fav-btn--add:hover {
  color: #fff;
  background: #067c89;
}

.top-views-card__fav-btn--in {
  color: #fff;
  background: #067c89;
  border: 1px solid #067c89;
}

.top-views-card__fav-btn--in:hover {
  background: #0052a3;
  border-color: #0052a3;
}

@media (max-width: 640px) {
  .static-page .top-views-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .top-views-card__body {
    padding: 0.5rem 0.55rem;
  }

  .top-views-card__title {
    font-size: 0.82rem;
  }

  .top-views-card__fav-btn {
    padding: 0.45rem 0.5rem;
    font-size: 0.68rem;
    min-height: 40px;
  }
}

@media (max-width: 380px) {
  .static-page .top-views-grid {
    gap: 0.75rem;
  }
}
