/*
 * Catalog style "demo13" — rating + comments add-on (loaded instead of _rate.css when
 * index.php?style=demo13 is shown). Mirrors /demo13/ like demo13.css.
 */
/* rating + comments: two more index rows — the heading in the left column, the work in the right */
.post__body { grid-template-areas: "title meta" "title stats" "excerpt actions"; }
.post__stats { grid-area: stats; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 2px 14px; margin: 0; color: var(--soft); font-size: 14px; text-align: right; }
.post__rating { color: var(--ink); }
.post__rating-avg { font: italic 500 22px/1 var(--serif); }
.post__rating-max { margin-left: 1px; color: var(--soft); font-size: 13px; }
.post__comments { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.post__comments:hover { color: var(--ink); text-decoration-color: var(--ink); }

.post__flash { margin: 48px 0 0; }
.notice--ok { border-top-color: var(--green); color: var(--deep); }

.rating, .comments {
    display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); column-gap: clamp(24px, 5vw, 96px); align-items: start;
    margin-top: clamp(48px, 5vw, 80px); padding-top: clamp(22px, 2.4vw, 36px); border-top: 1px solid var(--ink);
}
.rating > *, .comments > * { grid-column: 2; min-width: 0; }
.rating__title, .comments__title { grid-column: 1; grid-row: 1; margin: 0; font: 400 clamp(44px, 5vw, 92px)/0.95 var(--serif); font-optical-sizing: auto; letter-spacing: -0.03em; }
.rating__title { font-style: italic; }
.rating__score { grid-column: 1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 18px 0 0; }
.rating__avg { font: 400 clamp(72px, 7vw, 128px)/0.9 var(--serif); letter-spacing: -0.04em; }
.rating__max { color: var(--soft); font: italic 400 24px/1 var(--serif); }
.rating__count { flex-basis: 100%; color: var(--soft); font-size: 14px; }
.rating__form { grid-row: 1 / span 2; display: grid; gap: 22px; justify-items: start; }
.rating__scale { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.rating__legend { width: 100%; margin: 0 0 14px; padding: 0; color: var(--soft); font-size: 15px; }
.rating__opt { position: relative; display: block; }
.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: 56px; height: 56px; border-radius: 999px; border: 1px solid var(--rule);
    color: var(--ink); font: 400 28px/1 var(--serif); font-variant-numeric: lining-nums; cursor: pointer;
    transition: background 250ms ease, color 250ms ease, border-color 250ms ease;
}
.rating__opt:hover .rating__num { background: var(--paper); border-color: var(--ink); font-style: italic; }
.rating__input:checked + .rating__num { background: var(--ink); border-color: var(--ink); color: #fff; font-style: italic; }
.rating__input:focus-visible + .rating__num { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 3px var(--yellow); }
.rating__opt.is-mine .rating__num::after { content: ""; position: absolute; bottom: -9px; left: 50%; width: 18px; height: 2px; margin-left: -9px; background: var(--yellow); }
.rating__submit { padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }

.comments__title { grid-row: 1 / span 3; }
.comments__count { margin-left: 6px; color: var(--soft); font: 500 0.26em/1 var(--sans); font-variant-numeric: tabular-nums; vertical-align: super; }
.comments__list { margin: 0 0 32px; padding: 0; list-style: none; border-bottom: 1px solid var(--rule); }
.comment { display: grid; grid-template-columns: minmax(130px, 0.32fr) minmax(0, 1fr); gap: 6px clamp(16px, 2.4vw, 36px); padding: 18px 0 20px; border-top: 1px solid var(--rule); }
.comment:first-child { border-top: 0; padding-top: 4px; }
.comment__meta { display: flex; flex-direction: column; gap: 2px; margin: 0; color: var(--soft); font-size: 13px; }
.comment__author { color: var(--ink); font: italic 500 22px/1.15 var(--serif); overflow-wrap: anywhere; }
.comment__body { font-size: 17px; line-height: 1.55; overflow-wrap: anywhere; }
.comments__empty { margin: 0 0 28px; color: var(--soft); font: italic 400 24px/1.3 var(--serif); }
.comment-form { display: grid; gap: 18px; }
.comment-form__field { display: grid; gap: 6px; margin: 0; }
.comment-form__label { color: var(--soft); font-size: 13px; font-weight: 500; letter-spacing: 0.04em; }
.comment-form__input, .comment-form__text {
    width: 100%; padding: 12px 14px; border: 1px solid var(--rule); border-bottom-color: var(--ink); border-radius: 2px;
    background: var(--paper); color: var(--ink); font: 400 17px/1.5 var(--sans); transition: background 250ms ease;
}
.comment-form__input { max-width: 420px; }
.comment-form__text { min-height: 130px; resize: vertical; }
.comment-form__input:focus, .comment-form__text:focus { outline: 2px solid var(--ink); outline-offset: 2px; background: #fff; }
.comment-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0; }
.comment-form__submit { border: 0; cursor: pointer; }
.comment-form__note { color: var(--soft); font-size: 14px; }
@media (max-width: 1100px) {
    .post__body { grid-template-areas: "meta" "stats" "title" "excerpt" "actions"; }
    .post__stats { justify-content: flex-start; text-align: left; }
}
@media (max-width: 800px) {
    .rating, .comments { grid-template-columns: minmax(0, 1fr); }
    .rating > *, .comments > *, .rating__title, .rating__score, .comments__title { grid-column: 1; grid-row: auto; }
    .rating__score { margin: 12px 0 24px; }
    .comments__title { margin-bottom: 20px; }
}
@media (max-width: 520px) {
    .rating__scale { max-width: 320px; }
    .rating__num { width: 54px; height: 54px; font-size: 26px; }
    .comment { grid-template-columns: minmax(0, 1fr); }
    .comment__meta { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
}

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