/*
 * Catalog style "demo15" — rating + comments add-on (loaded instead of _rate.css when
 * index.php?style=demo15 is shown). Mirrors /demo15/ like demo15.css.
 */
/* rating + comments: paper sheets on the stone wall — the scale is a row of small tilted covers that settle flat when picked */
.post__stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: -2px 0 8px; color: var(--soft); font-size: 13px; font-weight: 500; }
.post__rating { color: var(--ink); }
.post__rating-avg { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.post__rating-max { margin-left: 1px; color: var(--soft); }
.post__comments { text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 3px; }
.post__comments:hover { color: var(--green); }
.post--card:first-child .post__stats { color: #c3d0c6; }
.post--card:first-child .post__rating { color: var(--on-deep); }
.post--card:first-child .post__rating-max { color: #c3d0c6; }
.post--card:first-child .post__comments:hover { color: #fff; }

.post__flash { max-width: 880px; margin: 40px auto 0; }
.notice--ok { background: var(--deep); color: var(--on-deep); }

.rating, .comments { max-width: 880px; margin: clamp(32px, 4vw, 56px) auto 0; padding: clamp(24px, 4vw, 56px); border-radius: 8px; background: var(--paper); }
.rating { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px clamp(20px, 4vw, 48px); align-items: end; }
.rating__title, .comments__title { margin: 0 0 18px; font: 800 clamp(34px, 3.6vw, 60px)/0.94 var(--font); letter-spacing: -0.045em; }
.rating__title { grid-column: 1 / -1; }
.rating__score { display: flex; flex-direction: column; margin: 0; }
.rating__avg { color: var(--deep); font: 800 clamp(80px, 9vw, 136px)/0.82 var(--font); letter-spacing: -0.06em; }
.rating__max { margin-top: 6px; color: var(--soft); font-size: 18px; font-weight: 700; }
.rating__count { color: var(--soft); font-size: 14px; }
.rating__form { display: grid; gap: 18px; justify-items: start; min-width: 0; }
.rating__scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; perspective: 600px; }
.rating__legend { width: 100%; margin: 0 0 12px; padding: 0; color: var(--soft); font-size: 15px; font-weight: 500; }
.rating__opt { position: relative; display: block; 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; min-height: 58px; border-radius: 6px; background: var(--ground); color: var(--ink);
    font-size: 24px; font-weight: 800; letter-spacing: -0.03em; cursor: pointer;
    box-shadow: 0 14px 20px -16px rgb(27 28 24 / 0.6);
    transform: rotateX(8deg) rotateY(-6deg); transform-origin: 50% 100%;
    transition: transform 500ms var(--ease), background 220ms ease, color 220ms ease;
}
.rating__opt:nth-of-type(even) .rating__num { transform: rotateX(8deg) rotateY(6deg); }
.rating__opt:hover .rating__num { background: var(--stone); transform: none; }
.rating__input:checked + .rating__num { background: var(--deep); color: var(--on-deep); transform: none; box-shadow: 0 18px 26px -16px rgb(19 50 31 / 0.8); }
.rating__input:focus-visible + .rating__num { outline: 3px solid var(--deep); outline-offset: 3px; transform: none; }
.rating__opt.is-mine .rating__num { box-shadow: inset 0 -4px 0 var(--yellow), 0 14px 20px -16px rgb(27 28 24 / 0.6); }
.rating__submit { padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }

.comments__count { margin-left: 4px; color: var(--green); }
.comments__list { display: grid; gap: 10px; margin: 0 0 32px; padding: 0; list-style: none; }
.comment { padding: 18px 20px 20px; border-radius: 6px; background: var(--ground); }
.comment__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0 0 6px; color: var(--soft); font-size: 13px; font-weight: 500; }
.comment__author { color: var(--deep); font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.comment__body { color: #26271f; font-size: 17px; overflow-wrap: anywhere; }
.comments__empty { margin: 0 0 28px; color: var(--soft); font-size: 18px; }
.comment-form { display: grid; gap: 16px; padding-top: 26px; border-top: 2px solid var(--stone); }
.comment-form__field { display: grid; gap: 6px; margin: 0; }
.comment-form__label { color: var(--ink); font-size: 14px; font-weight: 700; }
.comment-form__input, .comment-form__text {
    width: 100%; padding: 12px 16px; border: 2px solid var(--stone); border-radius: 8px;
    background: #f6f4f0; color: var(--ink); font: 400 17px/1.5 var(--font); transition: border-color 200ms ease;
}
.comment-form__input { max-width: 400px; }
.comment-form__text { min-height: 130px; resize: vertical; }
.comment-form__input:hover, .comment-form__text:hover { border-color: #8f8b82; }
.comment-form__input:focus, .comment-form__text:focus { outline: 3px solid var(--deep); outline-offset: 2px; border-color: var(--deep); }
.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: 640px) {
    .rating { grid-template-columns: minmax(0, 1fr); }
    .rating__score { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 18px; }
    .rating__max { margin: 0; }
    .comment-form__input { max-width: none; }
}
@media (max-width: 560px) {
    .rating__num { transform: none; }
    .rating__opt:nth-of-type(even) .rating__num { transform: none; }
}

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