/* SH Review — Toplist (boxed, robust mot tema) */

/* Boxed container */
.sh-toplist-widget {
  --sh-card-bg: #fff;
  --sh-card-br: 14px;
  --sh-card-bd: 1px solid rgba(0,0,0,.08);
  --sh-card-shadow: 0 6px 18px rgba(0,0,0,.06);
  --sh-gap: 14px;
  --sh-pad: 18px;

  background: var(--sh-card-bg);
  border: var(--sh-card-bd);
  border-radius: var(--sh-card-br);
  box-shadow: var(--sh-card-shadow);
  padding: var(--sh-pad);
}

.sh-toplist__title { margin: 0 0 12px 0; font-size: clamp(1.05rem, 1.2vw, 1.15rem); font-weight: 700; }
/* Döda temats dekor på tittlar (t.ex. ett litet "\" via :after) */
.sh-toplist__title::after { content: none !important; }

/* Nollställ temats list-stilar */
ul.sh-toplist, ol.sh-toplist { list-style: none; margin: 0; padding: 0; }
.sh-toplist li::marker { content: '' }

/* Nollställ temats pilar/dekorer */
.sh-toplist-widget ul.sh-toplist > li:before,
.sh-toplist-widget ul.sh-toplist > li:after,
.sh-toplist-widget .sh-toplist__item:before,
.sh-toplist-widget .sh-toplist__item:after,
.sh-toplist-widget .sh-toplist__link:before,
.sh-toplist-widget .sh-toplist__link:after {
  content: none !important;
  background: none !important;
  border: 0 !important;
  display: none !important;
}

/* Grid + counter */
.sh-toplist { display: grid; gap: var(--sh-gap); counter-reset: sh-rank; }
.sh-toplist__item { position: relative; padding: 8px 0 8px 44px; border-bottom: 1px solid rgba(0,0,0,.06); counter-increment: sh-rank; }
.sh-toplist__item:last-child { border-bottom: 0; }

/* Rank-badge (egen span → oberoende av temats ::before) */
.sh-toplist__rank {
  position: absolute;
  left: 8px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  inline-size: 28px; block-size: 28px;
  border-radius: 999px;
  font-weight: 700; font-size: .85rem;
  background: rgba(0,0,0,.08); color: #222;
}
.sh-toplist__rank::before { content: counter(sh-rank); }

/* Innehåll */
.sh-toplist__link {
  display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 12px;
  text-decoration: none; color: inherit; min-width: 0;
}
.sh-toplist__link:focus { outline: 0; box-shadow: 0 0 0 3px rgba(59,130,246,.35); border-radius: 10px; }

.sh-toplist__thumb { position: relative; inline-size: 80px; block-size: 80px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.sh-toplist__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.sh-toplist__link:hover .sh-toplist__thumb img { transform: scale(1.03); }

.sh-toplist__badge {
  position: absolute; right: 8px; bottom: 8px;
  min-inline-size: 36px; block-size: 36px; padding: 0 .5rem;
  display: grid; place-items: center;
  border-radius: 999px; font-weight: 800; font-size: .9rem; color: #fff;
  background: #4f46e5; box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
/* Färgskala för betyg */
.sh-toplist__badge--great { background: #16a34a; } /* grön */
.sh-toplist__badge--good  { background: #2563eb; } /* blå */
.sh-toplist__badge--meh   { background: #f59e0b; } /* bärnsten */
.sh-toplist__badge--bad   { background: #dc2626; } /* röd */

.sh-toplist__meta { display: grid; gap: 4px; min-width: 0; }
.sh-toplist__name {
  font-weight: 700; line-height: 1.25;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  text-overflow: ellipsis;
}
.sh-toplist__score { font-weight: 800; opacity: .85; }

.sh-toplist__item:hover .sh-toplist__name { text-decoration: underline; }

/* Compact variant */
.sh-toplist--compact { --sh-gap: 10px; --sh-pad: 14px; }
.sh-toplist--compact .sh-toplist__item { padding: 6px 0 6px 40px; }
.sh-toplist--compact .sh-toplist__link { grid-template-columns: 56px 1fr; gap: 10px; }
.sh-toplist--compact .sh-toplist__thumb { inline-size: 56px; block-size: 56px; border-radius: 8px; }
.sh-toplist--compact .sh-toplist__badge { min-inline-size: 30px; block-size: 30px; font-size: .8rem; right: 6px; bottom: 6px; }
.sh-toplist--compact .sh-toplist__rank  { inline-size: 24px; block-size: 24px; font-size: .8rem; left: 6px; }

/* Mobiljusteringar */
@media (max-width: 420px) {
  .sh-toplist__link { grid-template-columns: 52px 1fr; gap: 10px; }
  .sh-toplist__thumb { inline-size: 52px; block-size: 52px; }
  .sh-toplist__badge { min-inline-size: 28px; block-size: 28px; font-size: .78rem; right: 6px; bottom: 6px; }
  .sh-toplist__rank  { inline-size: 22px; block-size: 22px; font-size: .75rem; left: 6px; }
}
