.pkhc-widget {
  --pkhc-accent: #0071e3;
  --pkhc-accent-dark: #0059ad;
  --pkhc-accent-soft: #eaf4ff;
  --pkhc-border: #d8dadd;
  --pkhc-muted: #6f7479;
  --pkhc-surface: #ffffff;
  color: inherit;
  font: inherit;
}

.pkhc-heading {
  position: relative;
  margin: 0 0 16px;
  padding: 0 0 10px;
  border-bottom: 1px solid #d8dadd;
  font-size: 1.25rem;
}

.pkhc-heading::after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--pkhc-accent);
  content: "";
}

.pkhc-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 10px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #bfc3c7;
  border-radius: 3px;
  background: linear-gradient(180deg, #fafafa 0%, #e9eaec 100%);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
}

.pkhc-tab {
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 7px 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #3f454b;
  font: inherit;
  font-size: 0.79rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

.pkhc-tab + .pkhc-tab {
  border-left: 1px solid #c8cbce;
}

.pkhc-tab:hover,
.pkhc-tab:focus-visible {
  color: var(--pkhc-accent-dark);
}

.pkhc-tab.is-active,
.pkhc-tab.is-active:hover,
.pkhc-tab.is-active:focus-visible {
  background: var(--pkhc-accent);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.pkhc-tab:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--pkhc-accent-dark);
  outline-offset: -2px;
}

.pkhc-panel:focus {
  outline: none;
}

.pkhc-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pkhc-item {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--pkhc-border);
  border-radius: 5px;
  background: var(--pkhc-surface);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.pkhc-item:hover {
  border-color: rgba(0, 113, 227, 0.5);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
}

.pkhc-link {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  box-sizing: border-box;
  height: 100px;
  min-height: 100px;
  padding: 8px 9px;
  color: inherit;
  text-decoration: none !important;
}

.pkhc-link.has-thumb {
  grid-template-columns: 30px 58px minmax(0, 1fr);
}

.pkhc-link:focus-visible {
  outline: 2px solid var(--pkhc-accent);
  outline-offset: -2px;
}

.pkhc-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, #258cf2, var(--pkhc-accent-dark));
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(0, 89, 173, 0.22);
}

.pkhc-item:nth-child(n+4) .pkhc-rank {
  background: #e7eaed;
  color: #46515c;
  box-shadow: none;
}

.pkhc-thumb {
  display: block;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 5px;
  background: #f3f4f6;
}

.pkhc-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.pkhc-content {
  display: block;
  min-width: 0;
}

.pkhc-title {
  display: -webkit-box;
  max-height: 3.6em;
  margin-bottom: 4px;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  transition: color 160ms ease;
}

.pkhc-link:hover .pkhc-title {
  color: var(--pkhc-accent-dark);
}

.pkhc-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  color: var(--pkhc-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.pkhc-hot {
  color: var(--pkhc-accent-dark);
  font-size: 0.82rem;
  font-weight: 850;
}

.pkhc-meter {
  display: block;
  height: 3px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f2;
}

.pkhc-meter > span {
  display: block;
  min-width: 6%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58aaf5, var(--pkhc-accent), var(--pkhc-accent-dark));
}

.pkhc-empty {
  margin: 8px 0 0;
  padding: 14px;
  border: 1px dashed var(--pkhc-border);
  border-radius: 5px;
  color: var(--pkhc-muted);
  font-size: 0.88rem;
  text-align: center;
}

@media (max-width: 360px) {
  .pkhc-link,
  .pkhc-link.has-thumb {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .pkhc-thumb {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pkhc-item,
  .pkhc-title {
    transition: none;
  }
}

/*
 * Gleicht den Ranking-Inhalt an den seitlichen Abstand der Widget-Überschrift
 * im Preis-King-Theme an. Shortcode-Ausgaben bleiben davon unberührt.
 */
.widget_pk_hot_ranking_widget .pkhc-widget,
[id^="pk_hot_ranking_widget-"] .pkhc-widget {
  box-sizing: border-box;
  margin-right: 22px;
  margin-left: 22px;
}

@media (max-width: 480px) {
  .widget_pk_hot_ranking_widget .pkhc-widget,
  [id^="pk_hot_ranking_widget-"] .pkhc-widget {
    margin-right: 12px;
    margin-left: 12px;
  }
}
