/*
 * Catalog style "demo12" — rating + comments add-on (loaded instead of _rate.css when
 * index.php?style=demo12 is shown). Mirrors /demo12/ like demo12.css.
 */
/* rating + comments: the score is an aperture ring, the scale a row of f-stop circles */
.post__stats { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 16px; margin: -2px 0 12px; color: var(--soft); font-size: 14px; }
.post__rating { display: inline-flex; align-items: baseline; gap: 2px; padding: 3px 12px; border-radius: 999px; border: 1.5px solid var(--yellow); color: var(--ink); }
.post__rating-avg { font-weight: 800; font-stretch: 112%; font-size: 15px; }
.post__rating-max { color: var(--soft); font-size: 12px; }
.post__comments { text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 4px; }
.post__comments:hover { color: var(--ink); text-decoration-color: var(--yellow); }

.post__flash { max-width: 760px; margin: 56px auto 0; }
.notice--ok { border-color: var(--green); }
.notice--ok::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgb(70 154 88 / 0.3); vertical-align: 1px; }

.rating, .comments { max-width: 760px; margin: clamp(64px, 7vw, 96px) auto 0; }
.rating { text-align: center; }
.rating__title, .comments__title { margin: 0 0 22px; font: 800 clamp(34px, 3.6vw, 56px)/0.95 var(--font); font-stretch: 112%; letter-spacing: -0.035em; }
.rating__title::before, .comments__title::before { content: ""; display: block; width: 18px; height: 18px; margin: 0 auto 18px; border-radius: 50%; border: 2px solid var(--yellow); }
.comments__title::before { margin-left: 0; }
.rating__score { position: relative; display: inline-grid; place-content: center; justify-items: center; width: 168px; height: 168px; margin: 18px auto 34px; border-radius: 50%; border: 3px solid var(--yellow); background: var(--field); }
.rating__score::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1px solid rgb(238 240 234 / 0.22); pointer-events: none; }
.rating__avg { font: 900 54px/0.9 var(--font); font-stretch: 118%; letter-spacing: -0.04em; }
.rating__max { margin-top: 2px; color: var(--soft); font-size: 15px; font-weight: 700; }
.rating__count { position: absolute; top: calc(100% + 22px); left: 50%; transform: translateX(-50%); white-space: nowrap; color: var(--soft); font-size: 14px; }
.rating__form { display: flex; flex-direction: column; align-items: center; gap: 36px; margin-top: 30px; }
.rating__scale { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.rating__legend { width: 100%; margin: 0 0 16px; padding: 0; color: var(--soft); font-size: 15px; text-align: center; }
.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: 58px; height: 58px; border-radius: 50%;
    border: 1px solid rgb(238 240 234 / 0.28); background: var(--field); color: var(--ink);
    font-size: 19px; font-weight: 800; font-stretch: 112%; cursor: pointer;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 400ms var(--ease);
}
/* the aperture: an inner ring that closes as the number grows */
.rating__num::before { content: ""; position: absolute; inset: var(--ap, 6px); border-radius: 50%; border: 1px dashed rgb(238 240 234 / 0.16); transition: inset 400ms var(--ease); pointer-events: none; }
.rating__opt:nth-of-type(1) { --ap: 4px; } .rating__opt:nth-of-type(2) { --ap: 6px; } .rating__opt:nth-of-type(3) { --ap: 8px; }
.rating__opt:nth-of-type(4) { --ap: 10px; } .rating__opt:nth-of-type(5) { --ap: 12px; } .rating__opt:nth-of-type(6) { --ap: 14px; }
.rating__opt:nth-of-type(7) { --ap: 16px; } .rating__opt:nth-of-type(8) { --ap: 18px; } .rating__opt:nth-of-type(9) { --ap: 20px; } .rating__opt:nth-of-type(10) { --ap: 22px; }
.rating__opt:hover .rating__num { border-color: var(--yellow); }
.rating__input:checked + .rating__num { background: var(--yellow); border-color: var(--yellow); color: var(--dark); box-shadow: 0 0 0 6px var(--ground), 0 0 0 7px var(--yellow); }
.rating__input:checked + .rating__num::before { border-color: rgb(20 19 15 / 0.25); }
.rating__input:focus-visible + .rating__num { outline: 3px solid var(--ink); outline-offset: 10px; }
.rating__opt.is-mine::after { content: "yours"; position: absolute; top: calc(100% + 10px); left: 0; right: 0; color: var(--yellow); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-align: center; text-transform: uppercase; }
.rating__submit { min-height: 48px; padding: 0 22px; border: 1px solid var(--moss); border-radius: 999px; background: var(--field); color: var(--ink); text-decoration: none; cursor: pointer; font-stretch: 105%; }
.rating__submit:hover { border-color: var(--yellow); color: var(--ink); }

.comments__count { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; margin-left: 6px; padding: 0 0.3em; border-radius: 999px; border: 2px solid var(--yellow); font-size: 0.5em; font-weight: 800; letter-spacing: 0; vertical-align: 0.35em; }
.comments__list { display: grid; gap: 14px; margin: 0 0 40px; padding: 0; list-style: none; }
.comment { padding: 22px 28px 24px; border-radius: 28px; background: var(--field); border: 1px solid var(--moss); }
.comment__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 8px; color: var(--soft); font-size: 14px; }
.comment__author { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; font-weight: 800; font-stretch: 108%; }
.comment__author::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--yellow); }
.comment__body { color: #dfe4dd; font-size: 17px; overflow-wrap: anywhere; }
.comments__empty { margin: 0 0 32px; color: var(--soft); }
.comment-form { display: grid; gap: 18px; padding: clamp(22px, 3vw, 34px); border-radius: 32px; border: 1px solid var(--moss); }
.comment-form__field { display: grid; gap: 8px; margin: 0; }
.comment-form__label { padding-left: 6px; color: var(--soft); font-size: 14px; font-weight: 700; }
.comment-form__input, .comment-form__text {
    width: 100%; padding: 13px 20px; border: 1px solid rgb(238 240 234 / 0.28); border-radius: 999px;
    background: var(--ground); color: var(--ink); font: 400 17px/1.45 var(--font); transition: border-color 200ms ease, box-shadow 200ms ease;
}
.comment-form__input { max-width: 400px; }
.comment-form__text { min-height: 130px; border-radius: 24px; resize: vertical; }
.comment-form__input:hover, .comment-form__text:hover { border-color: var(--soft); }
.comment-form__input:focus, .comment-form__text:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 4px rgb(255 181 0 / 0.35); }
.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: 640px) {
    .rating__scale { gap: 28px 10px; max-width: 330px; }
    .rating__num { width: 56px; height: 56px; }
    .comment { padding: 18px 20px 20px; border-radius: 22px; }
    .comment-form { border-radius: 24px; padding: 18px; }
}

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