/* ==========================================================================
   Bewertungen und Bewertungsformular.

   Gehoert zu assets/js/reviews.js. Die Gestaltung folgt der uebrigen Seite:
   schwarzer Grund, Gold als Akzent, weiche Rundungen, duenne Linien.
   ========================================================================== */

/* ---------- Gemeinsame Bausteine ---------- */

.rev-wrap {
  max-width: 1180px;
  margin: 0 auto;
}

.rev-wrap--narrow {
  max-width: 820px;
}

/* Nur fuer Screenreader. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Sterne ---------- */

.rev__stars {
  display: inline-flex;
  gap: 4px;
  vertical-align: middle;
}

.rev__star {
  width: 26px;
  height: 26px;
  fill: rgba(255, 255, 255, .18);
  flex: 0 0 auto;
}

.rev__star.is-on {
  fill: #d9b85c;
  filter: drop-shadow(0 0 6px rgba(217, 184, 92, .45));
}

.rev__stars--sm .rev__star {
  width: 18px;
  height: 18px;
}

/* ---------- Zusammenfassung ---------- */

.rev__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 34px;
  padding: 30px 34px;
  border: 1px solid rgba(217, 184, 92, .45);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(217, 184, 92, .14), rgba(255, 255, 255, .03));
}

.rev__score {
  display: flex;
  align-items: center;
  gap: 20px;
}

.rev__avg {
  font-family: "Recoleta", Georgia, serif;
  font-size: 58px;
  line-height: 1;
  letter-spacing: -.04em;
  margin: 0;
  color: #fff;
}

.rev__count {
  font-size: 14px;
  letter-spacing: .04em;
  opacity: .72;
  margin: 8px 0 0;
}

.rev__seal {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  color: #d9b85c;
  border: 1px solid rgba(217, 184, 92, .5);
  border-radius: 999px;
  padding: 8px 16px;
  margin: 0;
}

/* Kurze Sternezeile, etwa neben dem Buchcover. */
.rev__badge {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 26px;
}

.rev__inline {
  font-size: 14px;
  letter-spacing: .04em;
  opacity: .78;
}

/* ---------- Einzelne Stimmen ---------- */

.rev__list {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.rev {
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 24px;
  padding: 28px;
  background: rgba(255, 255, 255, .035);
}

.rev__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.rev__meta {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .6;
  text-align: right;
}

.rev__text {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.6;
  opacity: .86;
}

.rev__who {
  margin: 0;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #d9b85c;
}

.rev__more {
  margin-top: 28px;
}

.rev__note {
  margin: 22px 0 0;
  font-size: 13px;
  opacity: .55;
}

/* ---------- Formular ---------- */

.rev-form {
  display: grid;
  gap: 22px;
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

.rev-form fieldset {
  border: 1px solid rgba(217, 184, 92, .45);
  border-radius: 24px;
  padding: 24px 28px 20px;
  margin: 0;
  background: linear-gradient(135deg, rgba(217, 184, 92, .1), rgba(255, 255, 255, .02));
}

.rev-form legend {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  color: #d9b85c;
  padding: 0 10px;
}

/* Die Sterne stehen im Markup von 5 nach 1. So kann rein mit CSS auch der
   Stern links vom angeklickten mitgefaerbt werden. */
.rating {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 6px;
}

.rating input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.rating label {
  cursor: pointer;
  line-height: 0;
  padding: 2px;
  border-radius: 8px;
}

.rating svg {
  width: 38px;
  height: 38px;
  fill: rgba(255, 255, 255, .18);
  transition: fill .18s ease, transform .18s ease;
}

.rating label:hover svg,
.rating label:hover ~ label svg,
.rating input:checked ~ label svg {
  fill: #d9b85c;
  filter: drop-shadow(0 0 8px rgba(217, 184, 92, .5));
}

.rating label:hover svg {
  transform: scale(1.08);
}

/* Tastaturbedienung muss sichtbar bleiben, das Feld selbst ist versteckt. */
.rating input:focus-visible ~ label svg,
.rating input:focus-visible + label svg {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 4px;
}

.rating__out {
  margin: 14px 0 0;
  font-size: 14px;
  letter-spacing: .04em;
  min-height: 1.2em;
  opacity: .8;
}

.rev-form .field {
  display: grid;
  gap: 8px;
}

.rev-form .field--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.rev-form label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  opacity: .75;
}

.rev-form input[type="text"],
.rev-form textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: #fff;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 16px;
  padding: 14px 16px;
  transition: border-color .2s ease, background .2s ease;
}

.rev-form textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.55;
}

.rev-form input[type="text"]::placeholder,
.rev-form textarea::placeholder {
  color: rgba(255, 255, 255, .4);
}

.rev-form input[type="text"]:focus,
.rev-form textarea:focus {
  outline: none;
  border-color: #d9b85c;
  background: rgba(255, 255, 255, .08);
}

.rev-form .check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  opacity: .82;
  cursor: pointer;
}

.rev-form .check input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: #d9b85c;
  flex: 0 0 auto;
}

.rev-form__hint {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #ff90ab;
  border-left: 2px solid #e60039;
  padding-left: 14px;
}

.rev-form .kb-btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
}

.rev-form .kb-btn[aria-disabled="true"]:hover {
  transform: none;
  background: #fff;
}

.rev-form__note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  opacity: .6;
}

.rev-form__note svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
}

/* ---------- Schmale Fenster ---------- */

@media (max-width: 800px) {

  .rev__list {
    grid-template-columns: 1fr;
  }

  .rev__summary {
    padding: 24px;
    gap: 16px;
  }

  .rev__avg {
    font-size: 46px;
  }

  .rev-form fieldset {
    padding: 20px 18px 16px;
  }

  .rev-form .field--row {
    grid-template-columns: 1fr;
  }

  .rating svg {
    width: 32px;
    height: 32px;
  }

  .rev {
    padding: 22px;
  }
}

@media (max-width: 420px) {

  .rating svg {
    width: 27px;
    height: 27px;
  }

  .rev__text {
    font-size: 15px;
  }
}
