/*
 * Catalog style "demo6" — rating + comments add-on (loaded instead of _rate.css when
 * index.php?style=demo6 is shown). Mirrors /demo6/ like demo6.css.
 */
/* rating + comments: ledger sections under the doc — a 3px ink rule, the score as a huge 900 numeral, the scale as pills */
.post__stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin: 0 0 4px; color: var(--soft); font-size: 15px; }
.post--card .post__stats { grid-column: 2; margin-top: 2px; }
.post__rating { color: var(--ink); font-weight: 900; font-variant-numeric: tabular-nums; }
.post__rating-avg { font-size: 18px; letter-spacing: -0.02em; }
.post__rating-max { margin-left: 1px; color: var(--soft); font-weight: 500; }
.post__comments { color: var(--green); font-weight: 700; text-decoration: none; }
.post__comments:hover { text-decoration: underline; text-underline-offset: 4px; }

.post--full .post__flash { grid-column: 1; grid-row: 4; margin: 40px 0 0; }
.post--full .rating { grid-column: 1; grid-row: 5; }
.post--full .comments { grid-column: 1; grid-row: 6; }
.post--full .post__shot { grid-row: 1 / span 6; }
.post--full .post__nav { grid-row: 7; }
.notice--ok { border-left-color: var(--green); color: var(--ink); }
.post__flash { padding: 18px 24px; font-weight: 700; }

.rating, .comments { max-width: 70ch; margin-top: clamp(56px, 6vw, 88px); padding-top: 18px; border-top: 3px solid var(--ink); }
.rating__title, .comments__title { margin: 0 0 14px; font-size: clamp(30px, 3vw, 44px); font-weight: 900; line-height: 1; letter-spacing: -0.04em; }
.rating__score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 24px; }
.rating__avg { font-size: clamp(72px, 8vw, 128px); font-weight: 900; line-height: 0.85; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.rating__max { font-size: 22px; font-weight: 900; color: var(--soft); }
.rating__count { margin-left: 8px; color: var(--green); font-size: 15px; font-weight: 700; }
.rating__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 20px; }
.rating__scale { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.rating__legend { width: 100%; margin-bottom: 10px; padding: 0; color: var(--soft); font-size: 15px; font-weight: 500; }
.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: 48px; height: 48px; border-radius: 999px; background: var(--paper); color: var(--ink);
    font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; cursor: pointer; transition: background 200ms ease, color 200ms ease, transform 150ms ease;
}
.rating__opt:hover .rating__num { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); }
.rating__opt.is-mine .rating__num { box-shadow: inset 0 0 0 3px var(--yellow); }
.rating__input:checked + .rating__num { background: var(--ink); color: var(--paper); box-shadow: inset 0 -4px 0 var(--yellow); }
.rating__input:focus-visible + .rating__num { outline: 3px solid var(--green); outline-offset: 3px; }
.rating__opt:active .rating__num { transform: scale(0.94); }
.rating__submit {
    padding: 0 28px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none; cursor: pointer;
}
.rating__submit:hover { background: var(--green); color: #fff; }

.comments__count { margin-left: 4px; color: var(--green); font-variant-numeric: tabular-nums; }
.comments__list { margin: 0 0 40px; padding: 0; list-style: none; counter-reset: c; }
.comment { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 16px; padding: 20px 0; border-bottom: 1px solid var(--line); counter-increment: c; }
.comment::before { content: counter(c, decimal-leading-zero); grid-row: 1 / span 2; font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: -0.05em; }
.comment__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin: 0 0 6px; color: var(--soft); font-size: 14px; }
.comment__author { color: var(--ink); font-size: 18px; font-weight: 900; letter-spacing: -0.02em; }
.comment__body { overflow-wrap: anywhere; font-size: 17px; white-space: pre-line; }
.comments__empty { margin: 0 0 32px; color: var(--soft); font-size: 18px; }
.comment-form { display: grid; gap: 18px; padding: clamp(20px, 3vw, 32px); background: var(--paper); border-radius: 6px; }
.comment-form__field { display: grid; gap: 6px; margin: 0; }
.comment-form__label { font-size: 15px; font-weight: 700; }
.comment-form__input, .comment-form__text {
    width: 100%; padding: 12px 16px; border: 2px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
    font: 400 17px/1.45 var(--font); transition: border-color 200ms ease;
}
.comment-form__input { max-width: 380px; min-height: 50px; border-radius: 999px; }
.comment-form__text { min-height: 130px; resize: vertical; }
.comment-form__input:hover, .comment-form__text:hover { border-color: var(--soft); }
.comment-form__input:focus, .comment-form__text:focus { outline: 3px solid var(--green); outline-offset: 2px; border-color: var(--ink); }
.comment-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0; }
.comment-form__submit { border: 0; cursor: pointer; }
.comment-form__note { color: var(--soft); font-size: 14px; }
@media (max-width: 1000px) {
    .post--full .post__flash, .post--full .rating, .post--full .comments, .post--full .post__shot, .post--full .post__nav { grid-column: 1; grid-row: auto; }
}
@media (max-width: 760px) {
    .post--card .post__stats { grid-column: 1 / -1; margin-top: 10px; }
}
@media (max-width: 520px) {
    .comment { grid-template-columns: minmax(0, 1fr); }
    .comment::before { grid-row: auto; font-size: 22px; margin-bottom: 6px; }
    .rating__num { width: 44px; height: 44px; }
    .rating__submit, .comment-form__submit { flex: 1 0 100%; justify-content: center; }
}

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