/*
 * Catalog style "demo3" — rating + comments add-on (loaded instead of _rate.css when
 * index.php?style=demo3 is shown). Mirrors /demo3/ like demo3.css.
 */
/* rating + comments */
/* Card: the stats become a read-out cell of the index row (right column, under the date). */
.post--card { grid-template-areas: "num thumb title cat" "num thumb excerpt date" "num thumb actions stats"; }
.post__stats { grid-area: stats; justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 4px 12px; margin: 0; font: 400 12px/1.4 var(--mono); color: var(--dim); text-align: right; }
.post__rating { white-space: nowrap; }
.post__rating::before { content: "score "; color: var(--dim); }
.post__rating-avg { color: var(--accent); font-size: 14px; text-shadow: 0 0 10px rgb(108 140 255 / 0.5); }
.post__rating-max { color: var(--dim); }
.post__comments { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-hot); text-underline-offset: 3px; white-space: nowrap; }
.post__comments:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Post: rating and comments continue the spec sheet in the right column; the screenshot stays pinned beside them. */
.post__shot { grid-row: 2 / span 6; }
.post__flash, .rating, .comments { grid-column: 2; }
.post__flash { margin: 32px 0 0; }
.notice--ok { border-color: rgb(108 140 255 / 0.5); color: #c9d4ff; }
.notice--ok::before { content: "ok: "; color: var(--accent); }

.rating, .comments { margin-top: 40px; }
.rating { padding: 20px 22px 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.rating__title, .comments__title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font: 900 24px/1.2 var(--sans); color: var(--text); }
.rating__title::before, .comments__title::before { content: "▸"; font: 400 14px/1 var(--mono); color: var(--accent); }
.rating__score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 20px; font-family: var(--mono); }
.rating__avg { font: 400 clamp(52px, 5vw, 72px)/1 var(--mono); letter-spacing: -0.04em; color: var(--accent); text-shadow: 0 0 24px rgb(108 140 255 / 0.55); }
.rating__max { font: 400 18px/1 var(--mono); color: var(--dim); }
.rating__count { margin-left: auto; padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px; font: 400 12px/1.4 var(--mono); color: var(--dim); }
.rating__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.rating__scale { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; flex: 1 1 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
.rating__legend { width: 100%; margin-bottom: 10px; padding: 0; font: 400 12px/1.4 var(--mono); letter-spacing: 0.12em; color: var(--accent); }
.rating__legend::before { content: "> "; }
.rating__opt { position: relative; min-width: 0; }
.rating__input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.rating__num {
    display: grid; place-items: center; height: 48px; border: 1px solid var(--border); border-radius: 6px; background: rgb(0 0 0 / 0.3);
    color: var(--text); font: 400 16px/1 var(--mono); cursor: pointer; user-select: none; transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.rating__opt:hover .rating__num { border-color: var(--border-hot); box-shadow: 0 0 12px rgb(108 140 255 / 0.25); }
.rating__opt.is-mine .rating__num { border-color: var(--accent-2); }
.rating__input:checked + .rating__num { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 700; box-shadow: 0 0 20px rgb(108 140 255 / 0.6); }
.rating__input:focus-visible + .rating__num { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px rgb(108 140 255 / 0.45); }
.rating__submit { min-height: 40px; padding: 9px 16px; background: transparent; font-size: 13px; cursor: pointer; }
.rating__submit::before { content: "$ "; color: var(--accent); }

.comments__count { padding: 2px 8px; border: 1px solid var(--accent); border-radius: 4px; font: 400 13px/1.3 var(--mono); color: var(--accent); align-self: center; }
.comments__list { margin: 0 0 24px; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.comment { padding: 14px 18px; border-bottom: 1px solid var(--border); background: rgb(18 19 30 / 0.5); }
.comment:last-child { border-bottom: 0; }
.comment__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 6px; font: 400 12px/1.4 var(--mono); }
.comment__author { color: var(--accent); font-size: 13px; }
.comment__author::before { content: "@"; color: var(--dim); }
.comment__date { color: var(--dim); }
.comment__body { color: #d2d5e2; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.comments__empty { margin: 0 0 24px; padding: 14px 18px; border: 1px dashed var(--border); border-radius: 10px; font: 400 13px/1.5 var(--mono); color: var(--dim); }
.comments__empty::before { content: "// "; color: var(--accent); }
.comment-form { display: grid; gap: 14px; padding: 20px 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--glass); }
.comment-form__field { display: grid; gap: 6px; margin: 0; }
.comment-form__label { font: 400 12px/1.3 var(--mono); letter-spacing: 0.12em; color: var(--accent); }
.comment-form__input, .comment-form__text {
    width: 100%; padding: 11px 12px; border: 1px solid var(--border-hot); border-radius: 6px; background: rgb(0 0 0 / 0.4); color: var(--text);
    font: 400 15px/1.5 var(--sans); caret-color: var(--accent); transition: border-color 200ms ease, box-shadow 200ms ease;
}
.comment-form__input { max-width: 360px; min-height: 44px; font-family: var(--mono); }
.comment-form__text { min-height: 120px; resize: vertical; }
.comment-form__input:focus, .comment-form__text:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgb(108 140 255 / 0.3), 0 0 18px rgb(108 140 255 / 0.25); }
.comment-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0; }
.comment-form__submit { min-height: 40px; padding: 9px 18px; font-size: 13px; cursor: pointer; }
.comment-form__note { font: 400 12px/1.5 var(--mono); color: var(--dim); }

@media (max-width: 1020px) {
    .post--card { grid-template-areas: "num thumb title" "num thumb excerpt" "num thumb actions" "num thumb meta" "num thumb stats"; }
    .post__stats { justify-self: start; justify-content: flex-start; text-align: left; }
    .post__shot { grid-row: auto; }
    .post__flash, .rating, .comments { grid-column: 1; }
}
@media (max-width: 720px) {
    .post--card { grid-template-areas: "thumb" "meta" "stats" "title" "excerpt" "actions"; }
    .rating__scale { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .rating__count { margin-left: 0; }
}

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