/*
 * Catalog style "demo5" — rating + comments add-on (loaded instead of _rate.css when
 * index.php?style=demo5 is shown). Mirrors /demo5/ like demo5.css.
 */
/* rating + comments */
/* Card: a stats line right under the meta, before the huge title (flex order keeps it there). */
.post--card .post__stats { order: 1; }
.post__stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; margin: -4px 0 18px; color: var(--soft); font-size: 15px; }
.post__rating { display: inline-flex; align-items: baseline; gap: 2px; }
.post__rating-avg { font: 900 26px/1 var(--font); letter-spacing: -0.04em; color: var(--ink); }
.post__rating-max { font-weight: 500; color: var(--soft); }
.post__comments { font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.post__comments:hover { color: var(--green); }

/* Post: the rating is a deep green field like the style bar; comments are an editorial step with the green top rule. */
.post__flash { margin: 48px 0 0; }
.notice--ok { box-shadow: inset 6px 0 0 var(--green); color: #1f5a2f; font-weight: 500; }

.rating, .comments { margin-top: clamp(64px, 7vw, 112px); }
.rating { padding: clamp(24px, 3.6vw, 48px); border-radius: 6px; background: var(--deep); color: var(--on-deep); }
.rating__title, .comments__title { margin: 0 0 18px; font: 900 clamp(34px, 3.6vw, 56px)/0.95 var(--font); letter-spacing: -0.045em; }
.rating__score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 clamp(24px, 3vw, 36px); }
.rating__avg { font: 900 clamp(96px, 11vw, 180px)/0.82 var(--font); letter-spacing: -0.06em; color: var(--yellow); }
.rating__max { font: 700 clamp(22px, 2vw, 30px)/1 var(--font); letter-spacing: -0.02em; color: var(--on-deep); }
.rating__count { margin-left: 4px; color: var(--on-deep-soft); font-size: 16px; }
.rating__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 24px; }
.rating__scale { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.rating__legend { width: 100%; margin-bottom: 12px; padding: 0; font: 700 17px/1.3 var(--font); color: var(--on-deep); }
.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: 52px; height: 52px; border: 2px solid rgb(241 243 238 / 0.32); border-radius: 50%;
    color: var(--on-deep); font: 900 20px/1 var(--font); letter-spacing: -0.02em; cursor: pointer; user-select: none;
    transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 150ms ease;
}
.rating__opt:hover .rating__num { border-color: var(--on-deep); background: rgb(255 255 255 / 0.08); }
.rating__opt:active .rating__num { transform: scale(0.94); }
.rating__opt.is-mine .rating__num { border-color: var(--yellow); }
.rating__input:checked + .rating__num { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.rating__input:focus-visible + .rating__num { outline: 3px solid #fff; outline-offset: 3px; }
.rating__submit { min-height: 52px; padding: 0 30px; border: 0; border-radius: 999px; background: var(--yellow); color: var(--ink); text-decoration: none; cursor: pointer; transition: background 200ms ease, transform 150ms ease; }
.rating__submit:hover { background: #fff; color: var(--ink); }
.rating__submit:active { transform: scale(0.97); }
.rating :focus-visible { outline-color: #fff; }

.comments__title { display: flex; align-items: baseline; gap: 14px; padding-top: 18px; box-shadow: inset 0 6px 0 var(--green); }
.comments__count { color: var(--green); }
.comments__list { margin: 0 0 40px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.comment { padding: 22px 0; border-bottom: 1px solid var(--line); }
.comment__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0 0 8px; }
.comment__author { font: 900 22px/1.1 var(--font); letter-spacing: -0.03em; }
.comment__date { color: var(--soft); font-size: 15px; }
.comment__body { max-width: 60ch; font-size: clamp(18px, 1.4vw, 20px); line-height: 1.5; overflow-wrap: anywhere; }
.comments__empty { margin: 0 0 40px; font-size: clamp(18px, 1.4vw, 21px); color: var(--soft); }
.comment-form { display: grid; gap: 20px; padding: clamp(22px, 3vw, 36px); border-radius: 6px; background: var(--paper); }
.comment-form__field { display: grid; gap: 8px; margin: 0; }
.comment-form__label { font: 700 16px/1.2 var(--font); }
.comment-form__input, .comment-form__text {
    width: 100%; padding: 12px 16px; border: 2px solid #b9c1b6; border-radius: 6px; background: #fff; color: var(--ink);
    font: 400 17px/1.5 var(--font); transition: border-color 200ms ease, box-shadow 200ms ease;
}
.comment-form__input { max-width: 400px; min-height: 52px; }
.comment-form__text { min-height: 140px; resize: vertical; }
.comment-form__input:focus, .comment-form__text:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 4px rgb(47 125 67 / 0.25); }
.comment-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 4px 0 0; }
.comment-form__submit { border: 0; cursor: pointer; }
.comment-form__note { color: var(--soft); font-size: 15px; }

@media (max-width: 420px) {
    .rating__scale { gap: 8px 6px; max-width: 300px; }
    .rating__num { width: 50px; height: 50px; }
}

/* 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; }
