/*
 * Catalog style "demo17" — rating + comments add-on (loaded instead of _rate.css when
 * index.php?style=demo17 is shown). Mirrors /demo17/ like demo17.css.
 */
/* rating + comments ──────────────────────────────────────────────────────────────────────────
   cards: a glowing score pill; post: the average is a planet with its orbit and moon, the scale
   a row of small planets, comments drift as rounded panels each with its own green moon */
.post__stats { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px; margin: 0 0 12px; font-size: 14px; color: var(--mute); }
.post__rating { display: inline-flex; align-items: baseline; gap: 2px; padding: 5px 12px; border-radius: 999px; background: var(--ground-3); color: var(--yellow); font: 800 15px/1.2 var(--display); }
.post__rating::before { content: ""; align-self: center; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 10px rgb(255 181 0 / 0.6); }
.post__rating-max { color: var(--soft); font-size: 13px; font-weight: 700; }
.post__comments { color: var(--soft); text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.post__comments:hover { color: var(--ink); text-decoration-color: var(--green-hi); }

.post__flash { max-width: 820px; margin: 48px auto 0; }
.notice--ok { box-shadow: inset 0 0 0 2px var(--green-hi); color: var(--ink); }

.rating {
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "score title" "score form"; align-items: center; gap: 14px 48px;
    max-width: 980px; margin: 64px auto 0; padding: clamp(28px, 4vw, 48px) clamp(20px, 4vw, 48px);
    border-radius: 32px; background: var(--ground-2); box-shadow: inset 0 0 0 1px rgb(238 238 228 / 0.07);
}
.rating__title { grid-area: title; align-self: end; margin: 0; font: 800 clamp(30px, 3vw, 44px)/1 var(--display); letter-spacing: -0.03em; }
.rating__score {
    grid-area: score; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 184px; aspect-ratio: 1; margin: 18px; border-radius: 50%; text-align: center;
    background: radial-gradient(circle at 34% 28%, #24472f, var(--ground) 74%); box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.75);
}
.rating__score::before { content: ""; position: absolute; inset: -16px; border: 1px dashed rgb(124 197 138 / 0.4); border-radius: 50%; }
.rating__score::after { /* its moon on the orbit */
    content: ""; position: absolute; top: calc(14.6% - 17px); right: calc(14.6% - 17px); width: 12px; height: 12px; border-radius: 50%;
    background: var(--yellow); box-shadow: 0 0 16px rgb(255 181 0 / 0.65);
}
.rating__avg { font: 900 60px/0.9 var(--display); letter-spacing: -0.05em; color: var(--yellow); }
.rating__max { font: 700 15px/1.3 var(--display); color: var(--soft); }
.rating__count { margin-top: 4px; font-size: 13px; color: var(--mute); }
.rating__form { grid-area: form; align-self: start; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.rating__scale { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.rating__legend { margin: 0 0 10px; padding: 0; color: var(--soft); font-size: 15px; }
.rating__opt { position: relative; }
.rating__input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.rating__num {
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--ground-3);
    font: 800 17px/1 var(--display); color: var(--ink); cursor: pointer; transition: background 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.rating__opt:hover .rating__num { background: #1f3d2c; box-shadow: inset 0 0 0 1px var(--green-hi); }
.rating__opt.is-mine .rating__num { box-shadow: inset 0 0 0 2px var(--green-hi); }
.rating__input:checked + .rating__num { background: var(--yellow); color: var(--ground); box-shadow: 0 0 24px rgb(255 181 0 / 0.55); }
.rating__input:focus-visible + .rating__num { outline: 3px solid var(--ink); outline-offset: 4px; }
.rating__submit { border: 0; cursor: pointer; background: var(--green); color: #fff; }
.rating__submit:hover { background: var(--green-hi); color: var(--ground); }

.comments { max-width: 980px; margin: 72px auto 0; }
.comments__title { display: flex; align-items: center; gap: 14px; margin: 0 0 24px; font: 800 clamp(30px, 3vw, 46px)/1 var(--display); letter-spacing: -0.03em; }
.comments__count { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px; background: var(--yellow); color: var(--ground); font: 800 17px/1 var(--display); letter-spacing: 0; }
.comments__list { display: grid; gap: 12px; margin: 0 0 32px; padding: 0; list-style: none; }
.comment { position: relative; padding: 20px 24px 20px 66px; border-radius: 22px; background: var(--ground-2); box-shadow: inset 0 0 0 1px rgb(238 238 228 / 0.06); }
.comment::before { /* a small planet per voice */
    content: ""; position: absolute; left: 24px; top: 24px; width: 22px; height: 22px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--green-hi), var(--green) 70%); box-shadow: 0 0 0 6px rgb(124 197 138 / 0.12);
}
.comment__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0 0 6px; font-size: 13px; color: var(--mute); }
.comment__author { font: 800 17px/1.3 var(--display); color: var(--ink); }
.comment__body { color: var(--soft); overflow-wrap: anywhere; }
.comments__empty { margin: 0 0 28px; padding: 20px 24px; border-radius: 22px; background: var(--ground-2); color: var(--soft); }
.comment-form { display: grid; gap: 16px; padding: clamp(22px, 4vw, 32px); border-radius: 26px; background: var(--ground-2); box-shadow: inset 0 0 0 1px rgb(238 238 228 / 0.07); }
.comment-form__field { display: grid; gap: 8px; margin: 0; }
.comment-form__label { font: 700 14px/1.2 var(--display); color: var(--green-hi); }
.comment-form__input, .comment-form__text {
    width: 100%; padding: 12px 18px; border: 0; border-radius: 16px; background: var(--ground);
    box-shadow: inset 0 0 0 1px rgb(238 238 228 / 0.18); color: var(--ink); font: 400 16px/1.5 var(--text); transition: box-shadow 200ms ease;
}
.comment-form__input { max-width: 380px; border-radius: 999px; }
.comment-form__text { min-height: 130px; resize: vertical; }
.comment-form__input:hover, .comment-form__text:hover { box-shadow: inset 0 0 0 1px rgb(124 197 138 / 0.55); }
.comment-form__input:focus, .comment-form__text:focus { outline: none; box-shadow: inset 0 0 0 2px var(--yellow), 0 0 0 5px rgb(255 181 0 / 0.2); }
.comment-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 0; }
.comment-form__submit { border: 0; cursor: pointer; }
.comment-form__note { color: var(--mute); font-size: 14px; }
@media (max-width: 1080px) {
    .rating { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "score" "form"; justify-items: center; text-align: center; }
    .rating__title { align-self: auto; }
    .rating__form { flex-direction: column; align-items: center; }
    .rating__scale { justify-content: center; max-width: 310px; }
    .rating__legend { width: 100%; text-align: center; }
}
@media (max-width: 620px) {
    .rating__score { width: 160px; }
    .rating__avg { font-size: 52px; }
    .comment { padding: 18px 18px 18px 54px; }
    .comment::before { left: 18px; top: 22px; width: 18px; height: 18px; }
}

/* the visitor's own (final) vote, shown instead of the scale */
.rating__mine { margin: 0; line-height: 1.5; }
.rating__mine-score { font-size: 1.6em; font-weight: 700; }
