/**
 * Nintara Reviews — Public Stylesheet
 * @package NintaraReviews
 */

:root {
    --nr-gold:       #c9a84c;
    --nr-gold-empty: #d1d5db;
    --nr-cta:        #1a2e35;
    --nr-cta-h:      #243e48;
    --nr-blue:       #2563eb;
    --nr-red:        #dc2626;
    --nr-green:      #16a34a;
    --nr-text:       #111827;
    --nr-muted:      #6b7280;
    --nr-border:     #e5e7eb;
    --nr-bg:         #ffffff;
    --nr-bg2:        #f9fafb;
    --nr-r:          8px;
    --nr-sh:         0 1px 3px rgba(0,0,0,.08), 0 1px 2px -1px rgba(0,0,0,.06);
    --nr-shm:        0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.08);
}

.nr-wrapper {
    font-family: inherit;
    color: var(--nr-text);
    max-width: 900px;
    margin: 2.5rem auto;
}

/* =====================================================================
   Summary bar
===================================================================== */
.nr-summary-bar {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 2rem;
    align-items: center;
    padding: 1.75rem 2rem;
    background: var(--nr-bg);
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-r);
    box-shadow: var(--nr-sh);
}

/* Left: score */
.nr-summary-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .25rem;
}

.nr-big-score {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
}

.nr-out-of {
    font-size: .78rem;
    color: var(--nr-muted);
    margin-top: -.15rem;
}

.nr-score-stars { display: flex; gap: 2px; justify-content: center; }

.nr-based-on {
    font-size: .78rem;
    color: var(--nr-muted);
    margin-top: .1rem;
}

/* Centre: histogram */
.nr-histogram { display: flex; flex-direction: column; gap: .4rem; }

.nr-hrow { display: flex; align-items: center; gap: .5rem; }

.nr-hlabel {
    font-size: .8rem;
    color: var(--nr-muted);
    white-space: nowrap;
    width: 3rem;
    text-align: right;
    flex-shrink: 0;
}

.nr-htrack {
    flex: 1;
    height: 10px;
    background: var(--nr-border);
    border-radius: 99px;
    overflow: hidden;
}

.nr-hbar {
    height: 100%;
    background: var(--nr-gold);
    border-radius: 99px;
    transition: width .4s ease;
}

.nr-hcount {
    font-size: .8rem;
    color: var(--nr-muted);
    width: 1.5rem;
    text-align: left;
    flex-shrink: 0;
}

/* Right: CTA */
.nr-summary-cta { display: flex; align-items: center; }

.nr-write-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .75rem 1.75rem;
    background: var(--nr-cta);
    color: #fff;
    border: none;
    border-radius: 99px;
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s, transform .12s;
}

.nr-write-btn:hover { background: var(--nr-cta-h); transform: translateY(-1px); }
.nr-write-btn:active { transform: translateY(0); }

/* =====================================================================
   Form drawer
===================================================================== */
.nr-drawer {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height .4s ease, opacity .25s ease;
    border: 1px solid var(--nr-border);
    border-top: none;
    border-radius: 0 0 var(--nr-r) var(--nr-r);
}

.nr-drawer.nr-open {
    max-height: 1800px;
    opacity: 1;
}

.nr-drawer-inner {
    padding: 1.5rem 2rem;
    background: var(--nr-bg2);
}

.nr-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    color: var(--nr-text);
    margin-bottom: 1rem;
}

.nr-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--nr-muted);
    padding: 0 .2rem;
    transition: color .12s;
}
.nr-close-btn:hover { color: var(--nr-text); }

/* Flash */
.nr-flash {
    padding: .8rem 1rem;
    border-radius: var(--nr-r);
    margin-bottom: .9rem;
    font-size: .9375rem;
    line-height: 1.5;
    border-left: 4px solid;
}
.nr-flash--ok  { background: #dcfce7; color: #166534; border-color: var(--nr-green); }
.nr-flash--err { background: #fee2e2; color: #991b1b; border-color: var(--nr-red);   }

/* Form */
.nr-form { display: flex; flex-direction: column; gap: .65rem; }

.nr-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

.nr-field { display: flex; flex-direction: column; gap: .2rem; }

.nr-label {
    font-size: .875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
}

.nr-req  { color: var(--nr-red); }
.nr-hint { font-size: .73rem; font-weight: 400; color: var(--nr-muted); }

.nr-input,
.nr-textarea {
    width: 100%;
    padding: .45rem .7rem;
    border: 1.5px solid var(--nr-border);
    border-radius: calc(var(--nr-r) - 2px);
    font-size: .875rem;
    color: var(--nr-text);
    background: var(--nr-bg);
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}

.nr-input:focus,
.nr-textarea:focus {
    outline: none;
    border-color: var(--nr-blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.nr-input.nr-err { border-color: var(--nr-red) !important; }

.nr-textarea { resize: vertical; min-height: 85px; }

.nr-field-err {
    font-size: .75rem;
    color: var(--nr-red);
    min-height: 1em;
}

/* Star picker */
.nr-star-picker { display: flex; gap: .1rem; }

.nr-star-btn {
    background: none;
    border: none;
    font-size: 1.85rem;
    color: var(--nr-gold-empty);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color .1s, transform .1s;
}

.nr-star-btn:hover,
.nr-star-btn.nr-hover,
.nr-star-btn.nr-active { color: var(--nr-gold); transform: scale(1.15); }

/* Upload */
.nr-upload { position: relative; }

.nr-file-inp {
    position: absolute; width: 1px; height: 1px;
    opacity: 0; overflow: hidden; z-index: -1;
}

.nr-upload-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border: 2px dashed var(--nr-border);
    border-radius: var(--nr-r);
    cursor: pointer;
    font-size: .875rem;
    color: var(--nr-muted);
    background: var(--nr-bg);
    transition: border-color .15s, color .15s;
}

.nr-upload-label:hover,
.nr-upload.nr-dragging .nr-upload-label {
    border-color: var(--nr-blue);
    color: var(--nr-blue);
}

.nr-preview {
    position: relative;
    display: inline-block;
    margin-top: .5rem;
}

.nr-preview-img {
    width: 72px; height: 72px;
    border-radius: var(--nr-r);
    object-fit: cover;
    box-shadow: var(--nr-shm);
    display: block;
}

.nr-remove-img {
    position: absolute; top: -8px; right: -8px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--nr-red);
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.nr-remove-img:hover { background: #b91c1c; }

/* Submit */
.nr-submit-row { margin-top: .3rem; }

.nr-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem 1.6rem;
    background: var(--nr-cta);
    color: #fff;
    border: none;
    border-radius: 99px;
    font-size: .9375rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .04em;
    transition: background .15s, transform .1s;
}

.nr-submit-btn:hover:not(:disabled) { background: var(--nr-cta-h); }
.nr-submit-btn:active { transform: scale(.98); }
.nr-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

.nr-spin {
    display: inline-block;
    width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nr-spin .7s linear infinite;
}
@keyframes nr-spin { to { transform: rotate(360deg); } }

/* =====================================================================
   Review list
===================================================================== */
.nr-list-section { margin-top: 2rem; }

.nr-list-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1.1rem;
    padding-bottom: .45rem;
    border-bottom: 2px solid var(--nr-border);
    color: var(--nr-text);
}

.nr-no-reviews {
    color: var(--nr-muted);
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}

.nr-review-ol {
    list-style: none;
    margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 0;
}

/* Card */
.nr-review-item {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--nr-border);
}

.nr-review-item:first-child { border-top: 1px solid var(--nr-border); }

.nr-hidden { display: none !important; }

.nr-card-meta { display: flex; align-items: flex-start; gap: .875rem; }

.nr-avatar {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--nr-cta);
    color: #fff;
    font-size: .875rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-top: 2px;
    user-select: none;
}

.nr-card-right { flex: 1; min-width: 0; }

.nr-card-top {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    margin-bottom: .3rem;
}

.nr-card-name { font-weight: 700; font-size: .9375rem; }

.nr-card-stars { display: flex; gap: 2px; }

.nr-card-date {
    font-size: .8125rem;
    color: var(--nr-muted);
    margin-left: auto;
}

.nr-star-static { font-size: 1rem; line-height: 1; }
.nr-star-filled  { color: var(--nr-gold); }
.nr-star-empty   { color: var(--nr-gold-empty); }
.nr-star-half    { color: var(--nr-gold); }

.nr-card-title {
    display: block;
    font-size: .9375rem;
    font-weight: 700;
    color: var(--nr-text);
    margin-bottom: .2rem;
}

.nr-card-body {
    font-size: .9375rem;
    line-height: 1.65;
    color: var(--nr-text);
}
.nr-card-body p { margin: 0 0 .4em; }

.nr-card-img { margin-top: .5rem; }
.nr-img-wrap { display: inline-block; position: relative; }

.nr-img-wrap img {
    width: 60px; height: 60px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: var(--nr-sh);
    cursor: zoom-in;
    display: block;
    transition: opacity .15s;
}
.nr-img-wrap img:hover { opacity: .85; }

/* Load More */
.nr-load-more-wrap { text-align: center; margin-top: 1.5rem; }

.nr-load-more-btn {
    display: inline-flex;
    align-items: center;
    padding: .65rem 2rem;
    background: transparent;
    color: var(--nr-cta);
    border: 2px solid var(--nr-cta);
    border-radius: 99px;
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .18s, color .18s, transform .12s;
}

.nr-load-more-btn:hover { background: var(--nr-cta); color: #fff; transform: translateY(-1px); }
.nr-load-more-btn:active { transform: translateY(0); }

/* Badge */
.nr-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .9375rem; }
.nr-badge-score { font-weight: 700; color: var(--nr-gold); }
.nr-badge-count { color: var(--nr-muted); font-size: .875rem; }
.nr-badge--empty { color: var(--nr-muted); font-style: italic; }

/* Notices */
.nr-notice { padding: .75rem 1rem; border-radius: var(--nr-r); border-left: 4px solid; margin: 1rem 0; }
.nr-notice--error { background: #fee2e2; color: #991b1b; border-color: var(--nr-red); }

/* Lightbox */
.nr-lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.88);
    display: flex; align-items: center; justify-content: center;
    z-index: 99999;
    cursor: zoom-out;
    animation: nr-lbin .18s ease;
}
@keyframes nr-lbin { from { opacity: 0; } to { opacity: 1; } }

.nr-lightbox img {
    max-width: 92vw; max-height: 90vh;
    border-radius: 10px;
    object-fit: contain;
    pointer-events: none;
    box-shadow: 0 25px 60px rgba(0,0,0,.6);
}

.nr-lb-close {
    position: fixed; top: 16px; right: 20px;
    background: rgba(255,255,255,.15);
    border: none; color: #fff;
    font-size: 1.75rem; line-height: 1;
    width: 38px; height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.nr-lb-close:hover { background: rgba(255,255,255,.3); }

/* Responsive */
@media (max-width: 680px) {
    .nr-summary-bar {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.25rem 1rem;
        text-align: center;
    }
    .nr-summary-score { align-items: center; }
    .nr-summary-cta   { justify-content: center; }
    .nr-write-btn     { width: 100%; }
    .nr-row-2         { grid-template-columns: 1fr; }
    .nr-drawer-inner  { padding: 1rem; }
    .nr-submit-btn    { width: 100%; }
    .nr-load-more-btn { width: 100%; }
}
