/* BomWidgets — Reviews */

*:has(> .bwr) {
  container-type: inline-size;
}

.bwr {
  --bwr-star: #f59e0b;
  --bwr-star-empty: #d1d5db;
  --bwr-bg: #ffffff;
  --bwr-border: #e5e7eb;
  --bwr-text: #374151;
  --bwr-muted: #6b7280;
  --bwr-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* === Layout === */
.bwr--side {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.bwr--stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bwr--single.bwr--side {
  grid-template-columns: 1fr;
}

/* === Alignment === */
.bwr--align-center          { justify-content: center; justify-items: center; }
.bwr--align-center.bwr--badge { display: flex; }
.bwr--align-right           { justify-content: flex-end; justify-items: end; }
.bwr--align-right.bwr--badge  { display: flex; }

/* === Card === */
.bwr__card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--bwr-bg);
  border: 1px solid var(--bwr-border);
  border-radius: var(--bwr-radius);
}

.bwr__link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.bwr__link:hover .bwr__card {
  border-color: #9ca3af;
}

/* === Logo === */
.bwr__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bwr__svg {
  width: 40px;
  height: 40px;
}

/* === Content === */
.bwr__content {
  flex: 1;
  min-width: 0;
}

/* === Score row === */
.bwr__score-row {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.bwr__score {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--bwr-text);
}

.bwr__max {
  font-size: 14px;
  font-weight: 400;
  color: var(--bwr-muted);
  line-height: 1;
  margin-left: 2px;
  align-self: baseline;
}

.bwr__sep {
  margin-right: 2px;
}

/* === Stars === */
.bwr__stars {
  display: inline-flex;
  gap: 1px;
  margin-left: 12px;
}

.bwr__star {
  font-size: 18px;
  line-height: 1;
}

.bwr__star--full {
  color: var(--bwr-star);
}

.bwr__star--half {
  background: linear-gradient(90deg, var(--bwr-star) 50%, var(--bwr-star-empty) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bwr__star--empty {
  color: var(--bwr-star-empty);
}

/* === Text === */
.bwr__text {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--bwr-text);
}

.bwr__text strong {
  font-weight: 600;
}

.bwr__count {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--bwr-muted);
}

/* ══════════════════════════════════
   Compact style
   ══════════════════════════════════ */
.bwr--compact .bwr__card {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  gap: 8px;
}

.bwr--compact .bwr__score-row {
  justify-content: center;
}

.bwr--compact .bwr__score {
  font-size: 24px;
}

.bwr--compact .bwr__stars {
  margin-left: 0;
  display: flex;
  justify-content: center;
}

/* ══════════════════════════════════
   Badge style (inline)
   ══════════════════════════════════ */
.bwr--badge {
  display: inline-flex;
  gap: 40px;
}

.bwr--badge .bwr__card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

.bwr--badge .bwr__count {
  width: 100%;
  text-align: center;
}

@media (max-width: 768px) {
  .bwr--badge .bwr__card {
    justify-content: flex-start;
  }

  .bwr--badge .bwr__count {
    text-align: left;
  }
}

.bwr--badge .bwr__logo {
  display: inline-flex;
  margin-right: 8px;
}

.bwr--badge .bwr__stars {
  margin-left: 12px;
}

.bwr--badge .bwr__svg {
  width: 24px;
  height: 24px;
}

.bwr--badge .bwr__score {
  font-size: 16px;
  font-weight: 600;
}

.bwr--badge .bwr__star {
  font-size: 14px;
}

/* ══════════════════════════════════
   Dark theme
   ══════════════════════════════════ */
.bwr--dark {
  --bwr-bg: #1f2937;
  --bwr-border: #374151;
  --bwr-text: #f9fafb;
  --bwr-muted: #9ca3af;
}

/* ══════════════════════════════════
   Responsive
   ══════════════════════════════════ */
@container (max-width: 480px) {
  .bwr--side {
    grid-template-columns: 1fr;
  }

  .bwr--extended .bwr__card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .bwr--extended .bwr__score-row {
    justify-content: center;
  }

  .bwr--extended .bwr__stars {
    margin-left: 0;
  }

  .bwr--badge {
    flex-direction: column;
    gap: 20px;
  }
}
