/* Additions to the original HUGELOL stylesheet for the rebuilt frontend. */

.hidden {
  display: none !important;
}

/* comment text is inserted as plain text; keep the author's line breaks */
.comment-body,
.user-description {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.comment .text .comment-body {
  margin-bottom: 3px;
}
.comment.deleted > .text > .comment-body {
  color: #999;
  font-style: italic;
}
.comment .info-right a {
  margin-left: 6px;
}
.comment .comment-footer a.reply-link {
  line-height: 16px;
}

/* the original floats comment videos; without text below one, the vote
   and reply links slid up beside the video. Stack it like a picture */
.comment .text video {
  float: none;
}

/* Comment videos are sized by their first frame (see lockVideoSize), so a
   WebM that changes size while playing keeps its place: as wide as that
   frame, but at most 200px wide and high. Post videos already have a
   fixed width. */
.comment .text video.size-locked {
  width: min(var(--video-width), 200px, calc(200px * var(--video-ratio)));
  height: auto;
}
/* the original put a <br clear="all"> after this hint to undo its negative
   bottom margin; without it the first comment slides up over the hint */
.single-comment-hint.small {
  margin-bottom: 5px;
}

/* rename, delete and report links under a post */
.post-tools {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e1e1e1;
  font-size: 12px;
  text-align: right;
}
.post-tools:empty {
  display: none;
}

/* the original script sized this column with JS */
.next-posts {
  height: auto !important;
  overflow: visible;
}
.next-posts .next_box img {
  width: 130px;
}

/* notices at the top of the page */
.hl-notice {
  padding: 14px;
  margin-bottom: 20px;
  border-radius: 3px;
  background-color: #fff8dc;
  border: 1px solid #e8d48b;
  color: #333;
  font-size: 13px;
  line-height: 1.5;
}
.hl-notice.red {
  background-color: #fdecea;
  border-color: #f1a9a0;
}
.hl-notice code {
  font-weight: bold;
  font-size: 15px;
  background: #fff;
  padding: 1px 5px;
  border-radius: 3px;
}

/* user page tabs: "23 Posts · 3,449 Likes · ..." */
#content .content-center .box.user-tabs {
  width: 510px;
  text-align: center;
}
.user-tabs a {
  font-weight: bold;
}
.user-tabs a.active {
  text-decoration: underline;
}
.user-tabs .sep {
  margin: 0 20px;
}

.hl-stats span {
  display: inline-block;
  margin-right: 18px;
  font-size: 13px;
}
.hl-stats b {
  font-size: 18px;
}
#header .flr a.header-link {
  color: #fff;
  font-weight: bold;
  margin-left: 12px;
  line-height: 50px;
}

/* On pages using the post layout (#content.post), the original rule
   ".post .title { float: left }" also floats ordinary box titles. */
#content.post .box:not(.post) .title {
  float: none;
  font-size: 14px;
  color: #363636;
  margin-bottom: 12px;
}
#content.post .content-side .box:not(.post) .title {
  font-size: 12px;
}
#content.post .box.profile .title {
  margin-bottom: 0;
}

/* "next posts" list inside a sidebar box */
.box .next-posts {
  float: none;
  width: auto;
}
.box .next-posts .next_box {
  width: auto;
  padding: 8px 0;
}
.box .next-posts .next_box .left {
  width: 120px;
}
.box .next-posts .next_box .left img {
  width: 120px;
}
.box .next-posts .next_box .right {
  width: 130px;
}
/* messages */
.message-container .message.message-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
  width: auto;
  max-width: 454px;
}
.message-list {
  overflow: hidden;
}
.message-form {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid #e1e1e1;
}
.message-form textarea {
  width: 100%;
  height: 60px;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.message-form .message-form-hint {
  font-size: 11px;
  color: #999;
  line-height: 28px;
}
.messages-empty {
  color: #999;
  font-size: 13px;
  text-align: center;
}
.messages-unread {
  color: #3098dc;
  font-weight: bold;
}
#content .content-side .box .message-partner .message-partner-content .message-partner-content-message {
  margin-top: -14px;
}

/* the conversation fills the window between the header and the footer
   (fitThread() in messages.js sets the exact height); only the messages
   scroll, so the message form is always at the bottom of the screen */
#content .content-center .box.message-thread {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 600px;
  height: calc(100vh - 90px);
  min-height: 320px;
  margin-bottom: 0;
}
.message-thread .title {
  flex: none;
}
.message-thread .message-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -14px;
  padding: 0 14px;
}
.message-thread .message-form,
.message-thread > .messages-empty {
  flex: none;
}

/* notifications (sizes from the original page, which set them inline) */
.notification .comment {
  width: 570px;
}
.notification .comment .text {
  width: 509px;
  background-color: #fff;
}
.notification .comment .create-reply {
  width: 519px;
}
.notification .comment .create-reply .text {
  width: 470px;
}
.notification .comment .create-reply .text textarea {
  width: 456px;
}

/* profile comments: the same layout in the narrower feed column, so the box
   and the comments are shrunk to fit its 540px */
#content .content-center .box.user-comments {
  width: 510px;
}
.user-comments .notification .comment {
  width: 510px;
  float: none;
}
.user-comments .notification .comment .text {
  width: 449px;
}
.user-comments .notification .comment .create-reply {
  width: 459px;
}
.user-comments .notification .comment .create-reply .text {
  width: 410px;
}
.user-comments .notification .comment .create-reply .text textarea {
  width: 396px;
}

/* settings: ignore list */
.ignore-user {
  padding: 6px 0;
  line-height: 30px;
  font-size: 13px;
}
.ignore-user img.avatar {
  width: 30px;
  height: 30px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 8px;
}
.ignore-user .username {
  font-weight: bold;
}

/* karma, claim and achievement badges under the name in the profile box;
   when they wrap, the rows get space between them instead of overlapping */
.box.profile .profile-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 5px;
  margin-top: 10px;
}
.box.profile .profile-badges .badge.achievement {
  margin-left: 0;
}

/* achievements */
.badge.achievement {
  margin-left: 5px;
  font-size: 11px;
  white-space: nowrap;
}
.user-achievements .badge {
  display: inline-block;
  margin-bottom: 8px;
}
.user-achievements a.badge:hover {
  text-decoration: none;
}
/* the posts or comments that won an award, opened by clicking it */
.user-achievements .achievement-wins {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin: -4px 0 8px;
  font-size: 12px;
}
.user-achievements .achievement-date {
  margin-left: 5px;
  font-size: 12px;
}
.achievement-text {
  font-style: italic;
  margin-left: 5px;
}

/* Long titles without spaces would otherwise run out of the post. */
.post .title {
  overflow-wrap: anywhere;
  max-width: 100%;
}


/* instead of a mature post, for visitors who are not logged in */
.mature-notice {
  padding: 60px 20px;
  text-align: center;
  font-size: 15px;
  color: #666;
}
.mature-notice .mature-button {
  display: inline;
  float: none;
}

/* Unread counts sit inside their header icon and are placed against it, so
   they move along when the header changes. The moderation and admin icons
   get the same in staff/css. */
#header .flr a.notifications-icon,
#header .flr a.messages-icon {
  position: relative;
}
#header a .header-count {
  position: absolute;
  top: -8px;
  opacity: 1;
  white-space: nowrap;
  color: #fff;
}

/* comment and message boxes that grow while typing (see autoGrow) */
textarea.autogrow {
  /* the stylesheet animates height, which would make the box measure its
     old height while it fits itself */
  transition: border-color 0.2s linear;
  resize: none;
  max-height: 320px;
}
.message-form textarea.autogrow {
  max-height: 160px;
}

/* the search bar under the header (see searchBar in app.js): the field
   and its Enter, Close and Advanced Search buttons on one line */
#header-search-container #header-search #header-search-q {
  box-sizing: border-box;
  height: 40px;
  width: calc(100% - 345px);
}

/* the heading of a search (see renderSearchTitle in app.js): as wide as the
   feed's posts below it, not the fixed width of other boxes */
#feed #search-title {
  width: auto;
}

/* the advanced search popup (see advancedSearchShow in app.js), laid out
   like the login popup it shares its frame with in hugelol.css */
#advanced-search-popup {
  color: #333;
}
#advanced-search-popup h2 {
  color: #000;
}
#advanced-search-popup .advanced-search-intro {
  clear: both;
  margin-top: -10px;
  margin-bottom: 14px;
  font-size: 13px;
}
#advanced-search-popup .advanced-search-field {
  display: block;
  margin-bottom: 10px;
  cursor: default;
}
#advanced-search-popup .advanced-search-field span {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: bold;
}
#advanced-search-popup input[type="text"],
#advanced-search-popup input[type="number"] {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 8px;
}
#advanced-search-popup .advanced-search-row {
  display: flex;
  gap: 12px;
}
#advanced-search-popup .advanced-search-row > * {
  flex: 1;
}
#advanced-search-popup .advanced-search-check {
  margin-bottom: 8px;
}
#advanced-search-popup .advanced-search-check input {
  margin: 0 4px 0 0;
  padding: 0;
  vertical-align: middle;
}
/* the question whether a search may show mature posts (see
   matureSearchConfirm in app.js), over the advanced search popup */
#mature-search-confirm-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  opacity: 0.5;
  z-index: 9992;
}
#mature-search-confirm {
  position: fixed;
  top: 25%;
  left: 50%;
  z-index: 9993;
  box-sizing: border-box;
  width: 360px;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  padding: 24px;
  border-radius: 3px;
  background-color: #fff;
  color: #333;
  font-size: 14px;
}
#mature-search-confirm h3 {
  margin: 0 0 10px;
  color: #000;
  font-size: 18px;
}
#mature-search-confirm p {
  margin: 0 0 12px;
}
html.dark #mature-search-confirm {
  background-color: #e5f3fa;
}
#advanced-search-popup .advanced-search-error {
  min-height: 16px;
  margin: 0 0 8px;
  font-size: 13px;
  color: #e74c3c;
}
#advanced-search-popup .advanced-search-buttons,
#mature-search-confirm .advanced-search-buttons {
  text-align: right;
}
#advanced-search-popup .advanced-search-buttons .button,
#mature-search-confirm .advanced-search-buttons .button {
  display: inline-block;
  margin: 0 0 0 8px;
  min-width: 50px;
}
#header-search-buttons {
  float: right;
  margin-top: 5px;
}
#header-search-buttons .button {
  display: inline-block;
  margin-bottom: 0;
  margin-left: 8px;
  min-width: 50px;
}
