/* Comments, favorites, search and the 404 page */

/* Comments under posts and MNodes */
.comments { margin: 56px 0 0; padding: 32px 0 0; background: var(--divider-mark) center top / 16px 13px no-repeat, var(--divider-line) center 6px / 100% 2px no-repeat; text-align: left; }
.comments h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; font-size: 26px; letter-spacing: -.03em; }
.comments-count { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 99px; background: #f1edff; color: var(--purple); font-size: 14px; font-weight: 800; letter-spacing: 0; }
.comments-empty, .comments-login { margin: 0 0 18px; color: var(--muted); }
.comments-login a { color: var(--purple); font-weight: 700; }
.comments .account-message { margin: 0 0 18px; padding: 13px 16px; border-radius: 9px; font-size: 14px; }
.comments .account-message p { margin: 0; }
.comments .account-message.success { background: #e8f7ef; color: #087443; }
.comments .account-message.error { background: #fff0ef; color: #b42318; }

.comments-list { display: grid; gap: 14px; margin: 0 0 26px; padding: 0; list-style: none; }
.comment { display: flex; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; scroll-margin-top: 100px; }
.comment:target { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(116, 27, 255, .10); }
.comment-avatar { flex: none; display: flex; width: 44px; height: 44px; overflow: hidden; border-radius: 50%; background: #f1edff; }
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-avatar span { display: flex; align-items: center; justify-content: center; width: 100%; color: var(--purple); font-size: 18px; font-weight: 800; }
.comment-main { flex: 1; min-width: 0; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px; font-size: 14px; }
.comment-meta a { color: var(--ink); font-weight: 800; overflow-wrap: anywhere; }
.comment-meta a:hover { color: var(--purple); }
.comment-meta time { color: var(--muted); font-size: 13px; }
.comment-body { line-height: 1.65; overflow-wrap: anywhere; }
.comment-delete { margin: 8px 0 0; }
.comment-delete button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.comment-delete button:hover { color: #b42318; }

.comment-form { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #faf9ff; }
.comment-form label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.comment-form textarea { display: block; width: 100%; min-height: 110px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.6; resize: vertical; outline: none; }
.comment-form textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(116, 27, 255, .12); }
.comment-hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.comment-form button { margin-top: 14px; padding: 12px 18px; border: 1px solid var(--purple); border-radius: 7px; background: var(--purple); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.comment-form button:hover { opacity: .92; }

/* On the MNode page the comments follow the detail box */
.mnode-detail .comments { margin-top: 36px; }

/* Favorite button on the MNode detail page */
.favorite { margin-top: 14px; }
.favorite form { margin: 0; }
.favorite-button { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.favorite-button span { color: var(--purple); font-size: 18px; line-height: 1; }
.favorite-button:hover { border-color: var(--purple); color: var(--purple); }
.favorite-button.is-favorite { border-color: #d8caff; background: #f6f2ff; color: var(--purple); }
.favorite-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.favorite-note a { color: var(--purple); font-weight: 700; }

/* "My MNodes" list on the account page and public profile */
.favorite-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; text-align: left; }
.favorite-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; background: #faf9ff; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.favorite-list a:hover { border-color: var(--purple); color: var(--purple); }
.favorite-list small { flex: none; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* Site search: /search */
.search-page { max-width: 820px; margin: 0 auto; padding: 72px 0 90px; }
.search-heading { margin: 0 0 30px; text-align: center; }
.search-heading h1 { margin: 0 auto; font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -.045em; }
.search-form { display: flex; gap: 8px; max-width: 620px; margin: 26px auto 0; }
.search-form input { flex: 1; min-width: 0; padding: 13px 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; outline: none; }
.search-form input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(116, 27, 255, .12); }
.search-form button { padding: 13px 20px; border: 1px solid var(--purple); border-radius: 7px; background: var(--purple); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.search-summary { margin: 0 0 18px; color: var(--muted); text-align: center; }
/* Buttons above the results to show only one kind (site.js) */
.search-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 20px; }
.search-filters[hidden] { display: none; }
.search-filters button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: border-color .15s ease, color .15s ease, background-color .15s ease; }
.search-filters button:hover { border-color: rgba(124, 92, 255, .45); color: var(--purple); }
.search-filters button[aria-pressed="true"] { border-color: var(--purple); background: var(--purple); color: #fff; }
.search-filters button span { font-weight: 400; opacity: .75; }
.search-filters .type-icon { width: 14px; height: 14px; }
.search-results { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.search-result a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 4px 18px rgba(20, 17, 30, .035); transition: border-color .2s ease, transform .2s ease; }
.search-result a:hover { border-color: #d8caff; transform: translateY(-2px); }
.search-result-type { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; color: var(--purple); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.search-result strong { display: block; font-size: 20px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.search-result p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }

/* Page not found */
.notfound-page { max-width: 620px; margin: 0 auto; padding: 96px 0 110px; text-align: center; }
.notfound-code { margin: 0; color: var(--purple); font-size: clamp(72px, 14vw, 140px); font-weight: 800; line-height: 1; letter-spacing: -.06em; }
.notfound-page h1 { margin: 12px auto 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.04em; }
.notfound-page p { margin: 16px auto 0; color: var(--muted); line-height: 1.7; }
.notfound-page .notfound-code { margin: 0; color: var(--purple); }
.notfound-page .search-form { margin-top: 28px; }
.notfound-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 28px 0 0; }
.notfound-links a { padding: 11px 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--purple); font-weight: 700; }
.notfound-links a:hover { border-color: var(--purple); }

@media (max-width: 760px) {
    .comment { padding: 14px; gap: 12px; }
    .comment-avatar { width: 36px; height: 36px; }
    .search-page { padding: 42px 0 60px; }
    .search-form { flex-direction: column; }
    .notfound-page { padding: 60px 0 70px; }
}

/* Own comment that waits for approval */
.comment-pending { border-style: dashed; background: #fffdf5; }
.comment-badge { display: inline-block; padding: 1px 8px; border-radius: 99px; background: #fff3d1; color: #7a4b00; font-size: 12px; font-weight: 700; }

/* Star rating on the MNode detail page */
.rating { margin-top: 20px; padding-top: 26px; background: var(--divider-mark) center top / 16px 13px no-repeat, var(--divider-line) center 6px / 100% 2px no-repeat; }
.rating-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rating-stars span { color: #d9d4e6; font-size: 22px; line-height: 1; }
.rating-stars span.on { color: #f5a623; }
.rating-stars span.half { background: linear-gradient(90deg, #f5a623 50%, #d9d4e6 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rating-summary strong { font-size: 18px; }
.rating-count { color: var(--muted); font-size: 14px; }
.rating-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 0; }
.rating-label { color: var(--muted); font-size: 14px; font-weight: 700; }
.rating-buttons { display: inline-flex; flex-direction: row-reverse; }
.rating-buttons button { padding: 0 2px; border: 0; background: none; color: #d9d4e6; font-size: 26px; line-height: 1; cursor: pointer; transition: color .12s ease, transform .12s ease; }
.rating-buttons button.on { color: #f5a623; }
/* Hover: light up the star under the mouse and all stars before it */
.rating-buttons:hover button { color: #d9d4e6; }
.rating-buttons button:hover, .rating-buttons button:hover ~ button { color: #f5a623; transform: scale(1.08); }
.rating-remove { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.rating-note { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.rating-note a { color: var(--purple); font-weight: 700; }

/* Rating on MNode cards */
.mnode-meta .mnode-rating-chip { color: #b26a00; border-color: #f3d38b; background: #fff8e6; }
.favorite-updated { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #e6f6ee; color: #087443; font-size: 11px; font-style: normal; font-weight: 700; letter-spacing: .04em; vertical-align: middle; }

/* Emoticons in comments */
.comment-body .emoji { display: inline-block; width: 32px; height: 32px; margin: -4px 1px; vertical-align: middle; }
.emoji-picker { margin: 10px 0 0; }
.comment-form .emoji-toggle { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; }
.comment-form .emoji-toggle:hover, .comment-form .emoji-toggle[aria-expanded="true"] { border-color: var(--purple); color: var(--purple); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; max-width: 480px; margin: 8px 0 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.emoji-grid[hidden] { display: none; }
.comment-form .emoji-grid button { display: flex; align-items: center; justify-content: center; margin: 0; padding: 4px; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.comment-form .emoji-grid button:hover, .comment-form .emoji-grid button:focus-visible { background: #f1edff; }
.emoji-grid img { width: 40px; height: 40px; }

/* Bold / italic / underline buttons above the comment box */
.comment-toolbar { display: flex; gap: 4px; margin: 0 0 6px; }
.comment-toolbar[hidden] { display: none; }
.comment-form .comment-toolbar button { width: 36px; height: 34px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; cursor: pointer; }
.comment-form .comment-toolbar button:hover, .comment-form .comment-toolbar button:focus-visible { border-color: var(--purple); color: var(--purple); }
.comment-body u { text-underline-offset: 3px; }
.comment-editor { display: block; width: 100%; min-height: 110px; max-height: 420px; overflow-y: auto; padding: 13px 15px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font-size: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; outline: none; cursor: text; }
.comment-editor:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(116, 27, 255, .12); }
.comment-editor .emoji { display: inline-block; width: 32px; height: 32px; margin: -4px 1px; vertical-align: middle; }
.comment-editor u { text-underline-offset: 3px; }
.comment-form .comment-toolbar button[aria-pressed="true"] { border-color: var(--purple); background: #f1edff; color: var(--purple); }
.comment-editor-message { margin: 8px 0 0; color: #b42318; font-size: 14px; }
.comment-editor-message[hidden] { display: none; }
