/*
 * Catalog style "demo21" — rating + comments add-on (loaded instead of _rate.css when
 * index.php?style=demo21 is shown). The rating is a ruled week row of ten light Fraunces numerals —
 * your pick turns into the green "today" pill; comments are entries in a ruled ledger with
 * underlined fields like the demo's event editor. Mirrors /demo21/ like demo21.css.
 */

/* cards: a dotted line of figures under the excerpt */
.post--card .post__stats { order: 5; }
.post__stats { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; margin: 0 0 12px; font-size: 0.82rem; color: var(--muted); }
.post__rating { display: inline-flex; align-items: baseline; gap: 2px; }
.post__rating-avg { font: 400 1.25rem/1 var(--serif); color: var(--ink); }
.post__rating-max { font: italic 400 0.9rem/1 var(--serif); color: var(--muted); }
.post__comments { font: italic 400 0.95rem/1.2 var(--serif); color: var(--green); text-underline-offset: 3px; }
.post__comments:hover { color: var(--ink); }

.post__flash { max-width: 720px; margin: 40px 0 0; }
.notice--ok { border-top: 3px solid var(--green); color: var(--green); }

/* ── rating ─────────────────────────────────────────────────────────────────────────── */
.rating {
    display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); column-gap: clamp(20px, 3vw, 44px); align-items: start;
    max-width: 980px; margin-top: 56px; padding-top: 14px; border-top: 1px solid var(--ink);
}
.rating__title, .comments__title { margin: 0 0 14px; font: 400 clamp(28px, 2.6vw, 36px)/1.1 var(--serif); letter-spacing: -0.015em; }
.rating__title { grid-column: 1 / -1; }
.rating__score { grid-column: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; }
.rating__avg { font: 300 clamp(4.6rem, 7vw, 6.6rem)/0.9 var(--serif); font-variation-settings: "opsz" 144; letter-spacing: -0.05em; }
.rating__max { font: italic 400 1.3rem/1 var(--serif); color: var(--muted); }
.rating__count { width: 100%; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-2); font: 600 0.7rem/1.4 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.rating__form, .rating__mine { grid-column: 2; }
.rating__form { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; min-width: 0; }
.rating__scale { display: flex; flex-wrap: wrap; width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
.rating__legend { width: 100%; margin: 0 0 10px; padding: 0; font: italic 400 1.05rem/1.35 var(--serif); color: var(--muted); }
.rating__opt { position: relative; flex: 1 1 10%; min-width: 0; border-top: 1px solid var(--ink); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rating__opt:first-of-type { border-left: 1px solid var(--line); }
.rating__input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.rating__num {
    display: grid; place-items: center; min-height: 64px; cursor: pointer; user-select: none;
    font: 300 1.7rem/1 var(--serif); font-variation-settings: "opsz" 144; transition: background-color 0.15s, color 0.15s;
}
.rating__opt:hover .rating__num { background: rgb(255 255 255 / 0.6); color: var(--green); }
.rating__input:checked + .rating__num { background: var(--green); color: var(--paper); font-weight: 600; }
.rating__input:focus-visible + .rating__num { outline: 2px solid var(--green); outline-offset: -5px; box-shadow: inset 0 0 0 6px var(--paper); }
.rating__input:checked:focus-visible + .rating__num { outline-color: var(--paper); box-shadow: none; }
.rating__submit {
    min-height: 44px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--green); color: var(--paper); text-decoration: none; cursor: pointer;
    font: 600 0.8rem/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase;
}
.rating__submit:hover { background: var(--green-2); color: var(--paper); }

/* the visitor's own (final) vote, shown instead of the scale */
.rating__mine { margin: 0; padding: 14px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line-2); font: italic 400 1.15rem/1.5 var(--serif); }
.rating__mine-score { display: inline-grid; place-items: center; min-width: 2em; height: 2em; margin: 0 4px; padding: 0 0.4em; border-radius: 999px; background: var(--green); color: var(--paper); font-style: normal; font-weight: 600; }

/* ── comments: a ruled ledger ──────────────────────────────────────────────────────── */
.comments { max-width: 820px; margin-top: 56px; padding-top: 14px; border-top: 1px solid var(--ink); }
.comments__title { display: flex; align-items: baseline; gap: 12px; }
.comments__count { font: italic 400 1.1rem/1 var(--serif); color: var(--green); }
.comments__list { margin: 0 0 32px; padding: 0; list-style: none; border-top: 1px solid var(--line-2); }
.comment { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 4px 24px; padding: 16px 0; border-bottom: 1px dotted var(--line-2); }
.comment__meta { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.comment__author { font: 400 1.15rem/1.2 var(--serif); }
.comment__date { font: italic 400 0.9rem/1.2 var(--serif); color: var(--muted); }
.comment__body { overflow-wrap: anywhere; }
.comments__empty { margin: 0 0 28px; font: italic 400 1.15rem/1.4 var(--serif); color: var(--muted); }

.comment-form { display: grid; gap: 22px; padding: 22px 24px 24px; border: 1px solid var(--ink); border-top-width: 4px; border-top-color: var(--green); background: rgb(255 255 255 / 0.4); }
.comment-form__field { display: grid; gap: 4px; margin: 0; }
.comment-form__label { font: 600 0.7rem/1.3 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: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink);
    font: 400 1.05rem/1.5 var(--sans); transition: background-color 0.15s, border-color 0.15s;
}
.comment-form__input { max-width: 380px; font: 400 1.3rem/1.3 var(--serif); }
.comment-form__text { min-height: 110px; resize: vertical; }
.comment-form__input:focus, .comment-form__text:focus { outline: none; border-bottom: 2px solid var(--green); background: rgb(31 77 58 / 0.06); }
.comment-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0; }
.comment-form__submit { min-height: 44px; padding: 0 24px; cursor: pointer; border: 0; }
.comment-form__note { font: italic 400 0.95rem/1.35 var(--serif); color: var(--muted); }

@media (max-width: 640px) {
    .rating { grid-template-columns: minmax(0, 1fr); }
    .rating__score, .rating__form, .rating__mine { grid-column: 1; }
    .rating__score { margin-bottom: 18px; }
    .rating__opt { flex-basis: 20%; }
    .rating__opt:nth-of-type(5n+1) { border-left: 1px solid var(--line); }
    .rating__opt:nth-of-type(n+6) { border-top: 0; }
    .rating__num { min-height: 56px; }
    .comment { grid-template-columns: minmax(0, 1fr); }
    .comment__meta { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
    .comment-form { padding: 18px 16px 20px; }
}
