/* Fruity Reviews for WordPress. The same rules as the Shopify theme blocks
   (fruity-reviews-dev/extensions/bewertungen/assets/fruity-reviews.css).
   As little as possible: font, sizes, colours, spacing and page margins all
   come from the theme. This file only draws what a theme cannot know about:
   the stars, the bars of the distribution, and the line between two
   reviews. The one colour of its own is the star colour; a theme can set it
   with --fruity-reviews-star. */
.fruity-reviews { --fruity-reviews-star: #b7791f; }

.fruity-reviews__stars {
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
  /* Not `color: transparent`: the empty stars are mixed from currentColor,
     which would then be transparent as well. */
  -webkit-text-fill-color: transparent;
  background: linear-gradient(
    90deg,
    var(--fruity-reviews-star) calc(var(--fruity-reviews-rating) / 5 * 100%),
    color-mix(in srgb, currentColor 30%, transparent) 0
  );
  -webkit-background-clip: text;
  background-clip: text;
}

.fruity-reviews__jump { color: inherit; text-decoration: none; }

.fruity-reviews__head { display: flex; flex-wrap: wrap; align-items: start; gap: 1em 3em; }
/* The authenticity notice is part of the summary, under the figures: its
   core always visible, the whole under a heading that says what it holds.
   Themes often hide the marker of <summary>, so the arrow is drawn here. */
.fruity-reviews__summary { flex: 1 1 18em; max-width: 30em; }
.fruity-reviews__notice { font-size: 0.9em; }
.fruity-reviews__notice p { margin: 0.5em 0 0; }
.fruity-reviews__notice details { margin-top: 0.35em; }
.fruity-reviews__notice summary { display: inline; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.fruity-reviews__notice summary::after { content: " \25B8"; }
.fruity-reviews__notice details[open] summary::after { content: " \25BE"; }
.fruity-reviews__notice ul { margin-block: 0.4em 0; }
.fruity-reviews__distribution, .fruity-reviews__reviews { list-style: none; margin: 0; padding: 0; }
/* These two lists are drawn here, not prose: a theme's indent for lists
   (Flatsome: 1.3em per item, some shops `ul { margin-left: … !important }`)
   would push the reviews and bars off the heading. */
.fruity-reviews .fruity-reviews__distribution, .fruity-reviews .fruity-reviews__reviews { margin-left: 0 !important; padding-left: 0 !important; }
.fruity-reviews .fruity-reviews__distribution > li, .fruity-reviews .fruity-reviews__reviews > li { margin-left: 0 !important; }
.fruity-reviews__distribution li { display: grid; grid-template-columns: 5em 10em 2em; align-items: center; gap: 0.75em; }
.fruity-reviews__bar { height: 0.4em; background: color-mix(in srgb, currentColor 12%, transparent); }
.fruity-reviews__bar span { display: block; height: 100%; background: var(--fruity-reviews-star); }

.fruity-reviews__review { padding-block: 1em; border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent); }
.fruity-reviews__date, .fruity-reviews__badges { font-size: 0.85em; opacity: 0.7; }
.fruity-reviews__badges span + span::before { content: " · "; }
.fruity-reviews__reply { margin-inline-start: 1.5em; }
.fruity-reviews__more > summary { cursor: pointer; }

/* "Melden" and "Mehr anzeigen": buttons that look like the theme's links, the form in the theme's own controls. */
.fruity-reviews__report, .fruity-reviews__load { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.fruity-reviews__report { font-size: 0.85em; opacity: 0.7; }
/* The report under the DSA (Art. 16), on the service's page. */
.fruity-reviews__legal { font-size: 0.85em; opacity: 0.7; color: inherit; }
.fruity-reviews__report-form label, .fruity-reviews__report-form textarea { display: block; width: 100%; max-width: 30em; }

.fruity-reviews__check { display: inline-block; font-size: 0.85em; margin-left: 0.5em; vertical-align: middle; }
.fruity-reviews__check summary { cursor: pointer; }
.fruity-reviews__check p { margin: 0.25em 0 0; max-width: 40em; }
.fruity-reviews__list-note { display: block; font-size: 0.8em; }
.fruity-reviews--loop { margin: 0.25em 0; font-size: 0.9em; }
/* In Gratis (docs/tarifmodell.md § 6.1): font and colour of the theme, only some room above. */
.fruity-reviews__credit { margin-block-start: 1.5em; }
/* The preview with sample reviews (class-preview.php), only for administrators: framed in the theme's text colour. */
.fruity-reviews__preview { border: 1px dashed currentColor; padding: 0.5em 0.75em; }
