/*
 * Catalog style "demo28" — rating + comments add-on (loaded instead of _rate.css). Mirrors /demo28/
 * like demo28.css: the rating is a scorecard between 2px rules — a huge serif score and the scale as
 * square boxes; comments read like letters to the editor.
 */

/* cards: score and letters, small labels */
.post__stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin: 8px 0 0; color: var(--muted); font: 600 11.5px/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.post__rating { display: inline-flex; align-items: baseline; gap: 2px; color: var(--ink); }
.post__rating-avg { font: 400 24px/1 var(--serif); letter-spacing: 0; }
.post__rating-max { color: var(--muted); }
.post__comments { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.post__comments:hover { color: var(--rust); }

.post__flash { max-width: 760px; margin: 40px 0 0; }
.notice--ok { border-left-color: #2f6d4f; color: #24543d; }

/* rating: the scorecard */
.rating, .comments { max-width: 760px; margin-top: clamp(48px, 6vw, 72px); }
.rating { padding: 14px 0 26px; border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); }
.rating__title, .comments__title { margin: 0 0 14px; font: 400 clamp(34px, 3.4vw, 50px)/0.95 var(--serif); letter-spacing: -0.02em; }
.rating__score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--hair); }
.rating__avg { font: 400 clamp(96px, 11vw, 160px)/0.8 var(--serif); letter-spacing: -0.04em; }
.rating__max { font: italic 400 30px/1 var(--serif); color: var(--muted); }
.rating__count { margin-left: auto; color: var(--muted); font: 600 11.5px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.rating__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; }
.rating__scale { display: flex; flex-wrap: wrap; gap: 0; min-width: 0; margin: 0; padding: 0; border: 0; }
.rating__legend { width: 100%; margin-bottom: 12px; padding: 0; color: var(--muted); font: 600 11.5px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.rating__opt { position: relative; margin: 0 0 -1.5px -1.5px; }
.rating__opt:first-of-type { margin-left: 0; }
.rating__input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.rating__num {
    position: relative; display: grid; place-items: center; width: 52px; height: 52px; border: 1.5px solid var(--rule); background: transparent;
    font: 400 26px/1 var(--serif); cursor: pointer; user-select: none; transition: background 150ms ease, color 150ms ease;
}
.rating__opt:hover .rating__num { background: var(--paper-2); font-style: italic; }
.rating__input:checked + .rating__num { z-index: 1; background: var(--ink); color: var(--paper); font-style: italic; }
.rating__input:focus-visible + .rating__num { z-index: 2; outline: 3px solid var(--rust); outline-offset: 2px; }
.rating__submit { min-height: 52px; padding: 0 24px; border: 1.5px solid var(--rule); background: var(--ink); color: var(--paper); text-decoration: none; }
.rating__submit:hover { background: var(--rust); border-color: var(--rust); color: #fff; }
.rating__mine { margin: 0; font: italic 400 22px/1.35 var(--serif); }
.rating__mine-score { font-size: 1.8em; font-style: normal; color: var(--rust); }

/* comments: letters */
.comments__title { display: flex; align-items: baseline; gap: 12px; padding-top: 12px; border-top: 2px solid var(--rule); }
.comments__count { color: var(--rust); font: italic 400 0.7em/1 var(--serif); }
.comments__list { margin: 0 0 28px; padding: 0; list-style: none; counter-reset: letter; }
.comment { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 14px; padding: 18px 0; border-bottom: 1px solid var(--hair); counter-increment: letter; }
.comment::before { content: counter(letter, decimal-leading-zero); grid-row: 1 / 3; padding-top: 6px; color: var(--rust); font: 600 12px/1 var(--sans); }
.comment__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 6px; }
.comment__author { font: 400 24px/1.1 var(--serif); }
.comment__date { color: var(--muted); font: 600 11px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.comment__body { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.comments__empty { margin: 0 0 24px; font: italic 400 21px/1.3 var(--serif); color: var(--muted); }
.comment-form { display: grid; gap: 18px; padding: 22px 24px 24px; background: var(--paper-2); border-top: 2px solid var(--rule); }
.comment-form__field { display: grid; gap: 6px; margin: 0; }
.comment-form__label { font: 600 11.5px/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.comment-form__input, .comment-form__text {
    width: 100%; padding: 8px 2px; border: 0; border-bottom: 1.5px solid var(--rule); border-radius: 0; background: transparent; color: var(--ink);
    font: 400 22px/1.3 var(--serif); transition: border-color 150ms ease, box-shadow 150ms ease;
}
.comment-form__input { max-width: 380px; }
.comment-form__text { min-height: 120px; padding: 10px 12px; border: 1.5px solid var(--rule); background: #fbf9f4; font: 400 16px/1.55 var(--sans); resize: vertical; }
.comment-form__input:focus, .comment-form__text:focus { outline: none; border-color: var(--rust); box-shadow: 0 2px 0 0 var(--rust); }
.comment-form__text:focus { box-shadow: 0 0 0 2px var(--rust); }
.comment-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0; }
.comment-form__submit { min-height: 46px; }
.comment-form__note { color: var(--muted); font: italic 400 17px/1.3 var(--serif); }

@media (max-width: 600px) {
    .rating__num { width: 44px; height: 44px; font-size: 22px; }
    .rating__opt:nth-of-type(6) { margin-left: 0; }
    .rating__count { margin-left: 0; width: 100%; }
    .rating__submit { flex: 1 1 100%; justify-content: center; }
    .comment-form { padding: 18px 16px 20px; }
}
