/*
 * BestProtein Reviews 0.1.0: score box, description panel and the shaded panels.
 * Loaded on single reviews only. Colours, radius and shadow come from PokaTheme's
 * own CSS variables, so the box follows the theme's look and any change made in
 * the Customizer. Selectors start with .wysiwyg-part where the theme's content
 * rules (lists with play icons, paragraph margins, h3 sizes) would otherwise win.
 */

/* ---------- Score box ---------- */
.bp-scorebox {
  background: var(--boxes-background-color);
  border-radius: var(--border-radius);
  padding: 1.75rem;
  margin: 0 0 2.5rem;
}

.bp-scorebox-top {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.bp-score {
  flex: 0 0 auto;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 16px 29px rgba(29, 39, 48, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.bp-score-line {
  display: block;
  line-height: 1;
  white-space: nowrap;
}
.bp-score-num {
  font-family: var(--headings-font-family);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
}
.bp-score-max {
  font-size: 1rem;
  font-weight: 700;
  color: var(--boxes-text-color);
  margin-left: 2px;
}
.bp-score-label {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--boxes-text-color);
}

.wysiwyg-part .bp-subscores,
.bp-subscores {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0;
}
.wysiwyg-part .bp-subscores > li::before {
  content: none;
  display: none;
}
.wysiwyg-part .bp-subscores > li,
.bp-subscore {
  display: grid;
  grid-template-columns: 12rem 1fr 2rem;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.625rem;
}
.wysiwyg-part .bp-subscores > li:last-child {
  margin-bottom: 0;
}
.bp-subscore-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--boxes-text-color);
}
.bp-bar {
  display: block;
  height: 0.625rem;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
}
.bp-bar-fill {
  display: block;
  height: 100%;
  background: var(--main-color);
  border-radius: 999px;
}
.bp-subscore-value {
  font-weight: 700;
  text-align: right;
  color: var(--text-color);
}

.wysiwyg-part .bp-scorebox p {
  margin: 0;
}
.wysiwyg-part .bp-scorebox .bp-score-history {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-color-alt);
}
.wysiwyg-part .bp-scorebox .bp-verdict {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid rgba(0, 0, 0, 0.06);
  line-height: 1.6;
}

.bp-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}
.bp-fact {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
}
.bp-fact dt {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--boxes-text-color);
}
.bp-fact dd {
  margin: 3px 0 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-color);
}

.wysiwyg-part .bp-scorebox .bp-method {
  margin-top: 1.25rem;
  font-size: 0.875rem;
}

/* ---------- Shaded panels (the three sections, and the description) ---------- */
.bp-panel {
  background: var(--boxes-background-color);
  border-radius: var(--border-radius);
  padding: 1.75rem;
  margin: 2rem 0;
}
.wysiwyg-part .bp-panel > h3:first-child,
.wysiwyg-part .bp-panel > :first-child {
  margin-top: 0;
}
.wysiwyg-part .bp-panel > :last-child {
  margin-bottom: 0;
}

.wysiwyg-part .bp-panel table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
}
.wysiwyg-part .bp-panel th,
.wysiwyg-part .bp-panel td {
  text-align: left;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--line-separator-color);
  font-size: 0.9375rem;
  line-height: 1.4;
}
.wysiwyg-part .bp-panel tr:last-child td {
  border-bottom: 0;
}
.wysiwyg-part .bp-panel th {
  font-weight: 700;
  color: var(--boxes-text-color);
}

/* Description panel */
.wysiwyg-part .bp-description .bp-panel-title {
  margin: 0 0 1rem;
  font-family: var(--headings-font-family);
  font-size: 1.3125rem;
  font-weight: 700;
  line-height: 1.3;
}
.bp-panel-note {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: #fff;
  font-family: var(--main-font-family);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--boxes-text-color);
  vertical-align: middle;
}
.bp-scales {
  margin: 0;
}
.bp-scale {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.625rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.bp-scale:first-child {
  border-top: 0;
  padding-top: 0;
}
.bp-scale dt {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--boxes-text-color);
}
.bp-scale dd {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.bp-dots {
  display: inline-flex;
  gap: 4px;
}
.bp-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.bp-dot.is-on {
  background: var(--main-color);
  border-color: var(--main-color);
}
.bp-scale-text {
  font-size: 0.9375rem;
  line-height: 1.4;
}
.bp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Photos in the review ---------- */
.wysiwyg-part .bp-figure {
  margin: 1.5rem 0;
}
.wysiwyg-part .bp-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 36rem;
  height: auto;
}
.wysiwyg-part .bp-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-color-alt);
}

/* ---------- Narrow screens ---------- */
@media screen and (max-width: 768px) {
  .bp-scorebox,
  .bp-panel {
    padding: 1.25rem;
  }
  .bp-scorebox-top {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }
  .bp-score {
    margin: 0 auto;
  }
  .wysiwyg-part .bp-subscores > li,
  .bp-subscore {
    grid-template-columns: 1fr 2rem;
    grid-template-areas: "label value" "bar bar";
    gap: 0.25rem 0.75rem;
  }
  .bp-subscore-label { grid-area: label; }
  .bp-subscore-value { grid-area: value; }
  .bp-bar { grid-area: bar; }
  .bp-facts {
    grid-template-columns: repeat(2, 1fr);
  }
  .bp-scale {
    grid-template-columns: 1fr;
    gap: 0.375rem;
  }
}
