/* =========================================
   OFFBRAND — FILM REVIEWS
   Used on the film page. Uses the film page's colour variables,
   so it follows light/dark mode and the settings panel.
========================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- rating in the hero ---------- */

.film-rating-line {
    margin-top: 14px;
}

.film-rating-line:empty {
    display: none;
}

.film-rating-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #f2f0ec;
    font-size: 13px;
    letter-spacing: calc(1px * var(--ob-label-tracking, 1));
}

.film-rating-link:hover span:last-child {
    text-decoration: underline;
}

/* ---------- stars ---------- */

.stars {
    display: inline-flex;
    gap: 2px;
    line-height: 1;
}

.star {
    color: rgba(150, 150, 150, 0.45);
}

.star.on {
    color: #e6b34a;
}


/* ---------- layout ---------- */

.reviews-section {
    padding: 110px 10% 110px;
    background: var(--background, #111216);
    border-top: 1px solid var(--border, #303139);
}

.related-films-section {
    border-top: 1px solid var(--border, #303139);
}

.reviews-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 70px;
    align-items: start;
}

/* ---------- summary card ---------- */

.reviews-summary {
    position: sticky;
    top: 110px;
    padding: 34px 30px;
    background: var(--surface, #1c1d23);
    border: 1px solid var(--border, #303139);
}

.reviews-summary-label {
    margin-bottom: 18px;
    color: var(--muted, #a5a3a0);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: calc(3px * var(--ob-label-tracking, 1));
}

.reviews-score {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.reviews-score-number {
    font-family: var(--font-serif);
    font-size: 72px;
    line-height: 1;
}

.reviews-score-max {
    color: var(--muted, #a5a3a0);
    font-size: 16px;
}

.reviews-summary .stars {
    font-size: 20px;
}

.reviews-summary-sub {
    margin-top: 12px;
    color: var(--muted, #a5a3a0);
    font-size: 13px;
}

.reviews-empty-score {
    font-family: var(--font-serif);
    font-size: 30px;
    line-height: 1.2;
}

.reviews-bars {
    list-style: none;
    margin-top: 26px;
    display: grid;
    gap: 9px;
}

.reviews-bars li {
    display: grid;
    grid-template-columns: 30px 1fr 22px;
    align-items: center;
    gap: 10px;
    color: var(--muted, #a5a3a0);
    font-size: 12px;
}

.reviews-bar {
    height: 6px;
    background: var(--surface-light, #24252c);
    overflow: hidden;
}

.reviews-bar-fill {
    display: block;
    height: 100%;
    background: var(--accent-light, #d27b72);
    transition: width 0.6s ease;
}

.reviews-bar-count {
    text-align: right;
}


/* ---------- form ---------- */

.review-form {
    display: grid;
    gap: 22px;
    padding: 34px;
    background: var(--surface, #1c1d23);
    border: 1px solid var(--border, #303139);
}

.review-form h3 {
    font-size: 13px;
    letter-spacing: calc(3px * var(--ob-label-tracking, 1));
}

.review-rating {
    border: 0;
    min-width: 0;
}

.review-rating legend,
.review-field > span {
    display: block;
    margin-bottom: 10px;
    padding: 0;
    color: var(--muted, #a5a3a0);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: calc(2.5px * var(--ob-label-tracking, 1));
}

/* stars light up from the left as you hover or pick */
.star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.star-input input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.star-input label {
    padding: 0 3px;
    color: rgba(150, 150, 150, 0.45);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

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

.star-input label:hover {
    transform: scale(1.12);
}

.star-input input:focus-visible + label {
    outline: 2px solid var(--accent-light, #d27b72);
    outline-offset: 3px;
}

.review-field {
    display: block;
    position: relative;
}

.review-field input,
.review-field textarea,
.reviews-toolbar select {
    width: 100%;
    padding: 14px 16px;
    background: var(--background, #111216);
    border: 1px solid var(--border, #303139);
    border-radius: 0;
    color: var(--text, #f2f0ec);
    font-family: inherit;
    font-size: 15px;
}

.review-field textarea {
    resize: vertical;
    min-height: 110px;
}

.review-field input:focus,
.review-field textarea:focus,
.reviews-toolbar select:focus {
    outline: none;
    border-color: var(--accent, #b65b55);
}

.review-field input:focus-visible,
.review-field textarea:focus-visible,
.reviews-toolbar select:focus-visible {
    outline: 2px solid var(--accent-light, #d27b72);
    outline-offset: 2px;
}

.review-field [aria-invalid="true"] {
    border-color: var(--accent-light, #d27b72);
}

.review-field small {
    display: block;
    margin-top: 6px;
    color: var(--muted, #a5a3a0);
    font-size: 11px;
    text-align: right;
}

.review-status {
    min-height: 18px;
    font-size: 13px;
    line-height: 1.5;
}

.review-status.is-error {
    color: var(--accent-light, #d27b72);
}

.review-status.is-success {
    color: var(--muted, #a5a3a0);
}

.review-submit {
    justify-self: start;
    padding: 15px 30px;
    background: var(--accent, #b65b55);
    border: 0;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: calc(2px * var(--ob-label-tracking, 1));
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.review-submit:hover {
    background: var(--accent-light, #d27b72);
    transform: translateY(-2px);
}

.review-submit:focus-visible {
    outline: 2px solid var(--accent-light, #d27b72);
    outline-offset: 3px;
}

.reviews-note {
    color: var(--muted, #a5a3a0);
    font-size: 12px;
    line-height: 1.6;
}

.reviews-note[hidden] {
    display: none;
}


/* ---------- list ---------- */

.reviews-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 50px 0 20px;
    color: var(--muted, #a5a3a0);
    font-size: 12px;
    letter-spacing: calc(2px * var(--ob-label-tracking, 1));
    text-transform: uppercase;
}

.reviews-toolbar select {
    width: auto;
    padding: 10px 14px;
    font-size: 13px;
}

.reviews-list {
    list-style: none;
    display: grid;
    gap: 18px;
}

.review-card {
    padding: 28px 30px;
    background: var(--surface, #1c1d23);
    border: 1px solid var(--border, #303139);
}

.review-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 18px;
    margin-bottom: 14px;
}

.review-head .stars {
    font-size: 16px;
}

.review-who {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.review-who strong {
    font-size: 14px;
}

.review-date {
    color: var(--muted, #a5a3a0);
    font-size: 12px;
}

.review-tag {
    padding: 3px 8px;
    border: 1px solid var(--border, #303139);
    color: var(--muted, #a5a3a0);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: calc(2px * var(--ob-label-tracking, 1));
}

.review-tag.is-mine {
    border-color: var(--accent, #b65b55);
    color: var(--accent-light, #d27b72);
}

.review-text {
    color: var(--muted, #a5a3a0);
    font-size: 15px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.review-delete {
    margin-top: 16px;
    padding: 0;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--border, #303139);
    color: var(--muted, #a5a3a0);
    font-size: 11px;
    letter-spacing: calc(1.5px * var(--ob-label-tracking, 1));
    text-transform: uppercase;
    cursor: pointer;
}

.review-delete:hover {
    color: var(--text, #f2f0ec);
}

.reviews-none {
    padding: 40px 0;
    color: var(--muted, #a5a3a0);
    font-size: 14px;
}


/* ---------- smaller screens ---------- */

@media (max-width: 1000px) {

    .reviews-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .reviews-summary {
        position: static;
    }

}

@media (max-width: 700px) {

    .reviews-section {
        padding: 80px 7% 80px;
    }

    .review-form,
    .review-card {
        padding: 24px 20px;
    }

}

@media (prefers-reduced-motion: reduce) {

    .reviews-bar-fill,
    .star-input label,
    .review-submit {
        transition: none;
    }

}


/* =========================================
   ACCOUNTS ADDITIONS (sign-in box, edit/delete, avatars)
========================================= */

.review-form[hidden],
.review-gate[hidden] {
    display: none;
}

.review-gate {
    display: grid;
    gap: 16px;
    padding: 34px;
    background: var(--surface, #1c1d23);
    border: 1px solid var(--border, #303139);
}

.review-gate h3 {
    font-size: 13px;
    letter-spacing: calc(3px * var(--ob-label-tracking, 1));
}

.review-gate p {
    color: var(--muted, #a5a3a0);
    font-size: 14px;
    line-height: 1.7;
}

.review-gate-actions,
.review-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.review-gate .review-submit,
.review-secondary {
    display: inline-block;
    text-align: center;
}

.review-secondary {
    padding: 14px 28px;
    background: none;
    border: 1px solid var(--border, #303139);
    color: var(--text, #f2f0ec);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: calc(2px * var(--ob-label-tracking, 1));
    cursor: pointer;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.review-secondary:hover {
    border-color: var(--accent, #b65b55);
    transform: translateY(-2px);
}

.review-secondary:focus-visible {
    outline: 2px solid var(--accent-light, #d27b72);
    outline-offset: 3px;
}

.review-submit:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.reviews-note {
    margin-top: 14px;
}

.review-head .review-avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
}

.review-actions {
    display: flex;
    gap: 22px;
    margin-top: 16px;
}

.review-action {
    padding: 0;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--border, #303139);
    color: var(--muted, #a5a3a0);
    font-family: inherit;
    font-size: 11px;
    letter-spacing: calc(1.5px * var(--ob-label-tracking, 1));
    text-transform: uppercase;
    cursor: pointer;
}

.review-action:hover {
    color: var(--text, #f2f0ec);
}

.review-action:disabled {
    opacity: 0.6;
    cursor: wait;
}

.review-delete {
    margin-top: 0;
}


/* =========================================
   REPORT A REVIEW (pop-up)
========================================= */

body.report-open {
    overflow: hidden;
}

.review-report {
    margin-left: 0;
}

.report-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.report-dialog {
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 34px;
    background: var(--surface, #1c1d23);
    border: 1px solid var(--border, #303139);
    color: var(--text, #f2f0ec);
}

.report-dialog h3 {
    margin-bottom: 18px;
    font-size: 13px;
    letter-spacing: calc(3px * var(--ob-label-tracking, 1));
}

.report-quote {
    margin: 0 0 22px;
    padding: 14px 16px;
    background: var(--surface-light, #24252c);
    border-left: 3px solid var(--accent, #b65b55);
    font-size: 13px;
    line-height: 1.6;
}

.report-quote strong {
    display: block;
    margin-bottom: 4px;
}

.report-quote p {
    color: var(--muted, #a5a3a0);
    overflow-wrap: anywhere;
}

.report-ask {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
}

.report-form {
    display: grid;
    gap: 4px;
}

.report-reason {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 4px;
    font-size: 14px;
    cursor: pointer;
}

.report-reason input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--accent, #b65b55);
}

.report-details {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    color: var(--muted, #a5a3a0);
    font-size: 12px;
}

.report-details textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--background, #111216);
    border: 1px solid var(--border, #303139);
    color: var(--text, #f2f0ec);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.report-details textarea:focus-visible {
    outline: 2px solid var(--accent-light, #d27b72);
    outline-offset: 2px;
}

.report-warning {
    margin-top: 18px;
    padding: 14px 16px;
    background: rgba(var(--accent-rgb, 182, 91, 85), 0.12);
    border: 1px solid var(--accent, #b65b55);
    font-size: 13px;
    line-height: 1.6;
}

.report-warning strong {
    color: var(--text, #f2f0ec);
}

.report-status {
    min-height: 20px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted, #a5a3a0);
}

.report-status.is-error {
    color: #e0706a;
}

.report-actions,
.report-done {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.report-done {
    display: grid;
    gap: 14px;
    font-size: 14px;
    line-height: 1.7;
}

.report-done .review-submit {
    justify-self: start;
}

@media (max-width: 520px) {

    .report-dialog {
        padding: 26px 20px;
    }

}


/* report pop-up: the warning and SEND / CANCEL stay visible */

.report-reason {
    padding: 9px 4px;
}

.report-form .report-footer {
    position: sticky;
    bottom: 0;
    margin: 12px -34px -34px;
    padding: 4px 34px 24px;
    background: var(--surface, #1c1d23);
    border-top: 1px solid var(--border, #303139);
}

.report-footer .report-warning {
    margin-top: 14px;
    padding: 11px 14px;
    font-size: 12px;
    line-height: 1.5;
}

.report-footer .report-status {
    min-height: 0;
    margin-top: 8px;
}

.report-footer .report-status:empty {
    display: none;
}

.report-footer .report-actions {
    margin-top: 12px;
}

@media (max-width: 520px) {

    .report-form .report-footer {
        margin: 12px -20px -26px;
        padding: 4px 20px 20px;
    }

}

/* very short screens (phone on its side): don't pin, just scroll */
@media (max-height: 560px) {

    .report-form .report-footer {
        position: static;
        border-top: 0;
    }

}
