/* Reviews on investment and developer pages (css/single.css of the old theme, the same values and order). */

/* ---------- Distribution ---------- */

.review-summary {
    display: flex;
    gap: 44px;
    align-items: center;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}

.review-summary__average {
    text-align: center;
    flex: none;
}

.review-summary__number {
    font-family: var(--font-head);
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.review-summary__stars {
    color: #e8a013;
    letter-spacing: 2px;
    font-size: 15px;
    margin-top: 6px;
}

.review-summary__count {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 6px;
}

.review-summary__bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    font: 700 12.5px/1 var(--font-body);
    color: var(--muted);
}

.review-bar__label {
    width: 32px;
    color: var(--ink);
    font-weight: 700;
}

.review-bar__track {
    flex: 1;
    height: 9px;
    background: var(--band);
    border-radius: 99px;
    overflow: hidden;
}

.review-bar__fill {
    display: block;
    height: 100%;
    background: #e8a013;
    border-radius: 99px;
}

.review-bar__count {
    width: 30px;
    text-align: right;
    color: var(--muted-2);
    font-weight: 700;
}

/* ---------- Review rows ---------- */

.review-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-list__empty {
    padding: 32px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    text-align: left;
    color: var(--muted);
    font-weight: 600;
}

.review {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.review:hover {
    box-shadow: var(--shadow-hover);
    border-color: #dad9d4;
}

.review__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    font: 800 13px/1 var(--font-body);
    color: var(--muted);
}

.review__body {
    min-width: 0;
}

.review__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.review__author {
    font: 800 14px/1 var(--font-head);
    color: var(--ink);
}

.review__stars {
    color: #e8a013;
    font-size: 12.5px;
    letter-spacing: 1.5px;
}

/* The filled stars are spans too, so the global span colour of the old theme made them black. Owner's decision of
   2026-09-24: gold, like the stars above the distribution. */
.review__stars span {
    color: inherit;
}

.review__stars .is-off {
    color: #d8d8d3;
}

.review__subject {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    font: 700 12.5px/1.2 var(--font-body);
}

.review__tag {
    flex: none;
    display: inline-flex;
    align-items: center;
    font: 800 9.5px/1 var(--font-body);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 7px 4px;
    border-radius: 4px;
}

.review__tag--developer {
    color: #fff;
    background: var(--ink);
}

.review__tag--investment {
    color: var(--ink);
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--ink);
}

.review__source {
    color: var(--ink);
    font-weight: 800;
}

a.review__source:hover {
    color: var(--red);
}

/* Only the top margin is set here: the bottom one comes from the global paragraph rule. */
.review__text {
    margin-top: 8px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--ink-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review.is-open .review__text {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
}

.review__toggle {
    display: none;
    border: 0;
    background: none;
    padding: 0;
    font: 700 12.5px/1 var(--font-body);
    color: var(--red);
    cursor: pointer;
}

.review__toggle.is-visible {
    display: block;
    width: 100%;
    text-align: center;
    margin: 12px 0 2px;
}

.review__foot {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
}

.review__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    white-space: nowrap;
}

.review__date {
    font: 600 12px/1 var(--font-body);
    color: var(--muted-2);
}

.helpful-button {
    border: 0;
    background: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: 700 12.5px/1 var(--font-body);
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s ease;
}

.helpful-button svg {
    width: 14px;
    height: 14px;
}

.helpful-button:hover {
    color: var(--ink);
}

.helpful-button.is-active {
    color: var(--red);
}

.review-more {
    display: block;
    margin: 26px auto 0;
    border: 1.5px solid var(--line);
    background: var(--paper);
    border-radius: var(--radius);
    padding: 13px 28px;
    font: 800 12.5px/1 var(--font-body);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
    cursor: pointer;
}

.review-more:hover {
    border-color: var(--ink);
}

/* ---------- Form ---------- */

.review-form {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.review-form__card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px 26px;
}

/* The rest of the heading (margin, line height, colour) comes from the global h4 rules. */
.review-form__title {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.review-form__hint {
    font-size: 12.5px;
    color: var(--muted);
    margin: 0 0 16px;
}

.review-form__label {
    font: 700 12.5px/1 var(--font-body);
    color: var(--ink);
    margin-bottom: 8px;
    display: block;
}

/* Radios from 5 to 1 shown in reverse, so hovering a star lights it and the ones before it. */
.star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

.star-input input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.star-input label {
    font-size: 27px;
    line-height: 1;
    color: #d8d8d3;
    cursor: pointer;
    transition: color 0.1s ease;
}

.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label {
    color: #e8a013;
}

.review-form__input {
    box-sizing: border-box;
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    padding: 11px 14px;
    font: 500 14px/1.4 var(--font-body);
    color: var(--ink);
    margin-bottom: 12px;
}

.review-form__input:focus {
    outline: none;
    border-color: var(--red);
    background: var(--paper);
    box-shadow: 0 0 0 3px var(--red-soft);
}

.review-form__textarea {
    box-sizing: border-box;
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    padding: 12px 14px;
    font: 500 14px/1.5 var(--font-body);
    color: var(--ink);
    min-height: 90px;
    resize: vertical;
    margin: 6px 0 14px;
}

.review-form__textarea:focus {
    outline: none;
    border-color: var(--red);
    background: var(--paper);
    box-shadow: 0 0 0 3px var(--red-soft);
}

.review-form__consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 14px;
    font: 500 12px/1.55 var(--font-body);
    color: var(--muted);
}

.review-form__consent input {
    margin-top: 3px;
    flex: none;
    accent-color: var(--red);
}

.review-form__consent a {
    color: var(--ink);
    text-decoration: underline;
}

/* A trap field for bots, out of sight. */
.review-form__trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.review-form__submit {
    background: var(--red);
    color: #fff;
    border: 0;
    border-radius: var(--radius);
    padding: 13px 24px;
    font: 700 14px/1 var(--font-body);
    cursor: pointer;
}

.review-form__submit:hover {
    background: var(--red-dark);
}

.review-form__submit[disabled] {
    opacity: 0.6;
    cursor: default;
}

.review-form__message {
    margin-top: 12px;
    font: 600 13px/1.5 var(--font-body);
}

.review-form__message.is-error {
    color: var(--red);
}

.review-form__message.is-success {
    color: #1f8a4c;
}

/* ---------- Photos in the form ---------- */

.photo-picker {
    margin: 2px 0 16px;
}

.photo-picker__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.photo-picker__thumb {
    position: relative;
    width: 74px;
    height: 74px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.photo-picker__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-picker__thumb button {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(13, 14, 17, 0.72);
    color: #fff;
    border: 0;
    cursor: pointer;
    font: 700 13px/1 var(--font-body);
    display: grid;
    place-items: center;
}

.photo-picker__thumb button:hover {
    background: var(--red);
}

.photo-picker__add {
    width: 74px;
    height: 74px;
    border: 1.5px dashed var(--line);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--muted);
    cursor: pointer;
    font: 700 10.5px/1 var(--font-body);
    background: var(--bg);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.photo-picker__add:hover {
    border-color: var(--muted-2);
    color: var(--ink);
}

.photo-picker__add svg {
    width: 18px;
    height: 18px;
}

.photo-picker__add.is-hidden {
    display: none;
}

.photo-picker__error {
    display: block;
    margin-top: 8px;
    font: 600 12px/1.4 var(--font-body);
    color: var(--red);
}

/* ---------- Photos of a review ---------- */

.review__photos {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.review.is-open .review__photos {
    display: flex;
}

.review__photos img {
    width: 104px;
    height: 78px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.review__photos img:hover {
    transform: scale(1.03);
}

.review-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(13, 14, 17, 0.86);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
}

.review-lightbox.is-open {
    display: flex;
}

.review-lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

@media (max-width: 720px) {
    .review-summary {
        gap: 24px;
    }

    .review-list__empty {
        padding: 18px 24px;
    }

    .review {
        grid-template-columns: 40px 1fr;
    }

    .review__side {
        grid-column: 2;
        flex-direction: row;
        align-items: center;
    }

    .review__toggle.is-visible {
        text-align: left;
    }
}
