/* Paragraph spacing follows the author card's existing flex gap. */
.card-info .description > p {
  margin: 0;
}

/* One shared card surrounds the heading, editor, comments and footer on every page. */
#body-wrap #post-comment {
  box-sizing: border-box;
  width: 100%;
  margin: 24px 0 0;
  padding: 24px;
  border: var(--style-border-always);
  border-radius: var(--radius, 12px);
  background: var(--efu-card-bg);
  box-shadow: var(--efu-shadow-border);
  overflow: visible;
}

#body-wrap #post-comment > .comment-head {
  margin: 0 0 16px;
}

@media (max-width: 768px) {
  #body-wrap #post-comment {
    margin-top: 16px;
    padding: 16px;
  }
}

/* Local jigsaw texture, matching the repeating background at https://xkbk.cn/. */
body {
  background-color: var(--efu-background);
  background-image: url('/img/backgrounds/jigsaw-light.svg');
  background-repeat: repeat;
  background-size: 192px 192px;
  background-position: left top;
}

[data-theme='dark'] body {
  background-image: url('/img/backgrounds/jigsaw-dark.svg');
}

/* Continue the texture through the logo/link area; the copyright bar keeps its theme background. */
#footer {
  background: transparent;
}

/* Match the home banner's 1400px container and its 30px side padding. */
#home_top > #bbTimeList {
  box-sizing: border-box;
  width: calc(100% - 60px);
  max-width: 1340px;
  min-width: 0;
  margin-inline: auto;
}

/* Keep long notes inside the card without shrinking either icon. */
#bbTimeList #bbtalk {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

#bbTimeList > i {
  flex: 0 0 auto;
}

/* The expansion trigger uses the supplied SVG and inherits hover/theme colors. */
#nav .back-home-button > .back-home-button-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: currentColor;
  pointer-events: none;
}

@media (max-width: 768px) {
  #home_top > #bbTimeList {
    width: calc(100% - 32px);
    margin-inline: auto;
  }
}

/* Use bounded local logo images in the navigation and article footer. */
#nav #site-name > img {
  display: block;
  width: 34px;
  height: 34px;
  max-height: none;
  padding: 0;
  object-fit: contain;
}

#st-footer-bar .footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

#st-footer-bar .footer-logo > img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

/* Keep filings together below copyright, with the theme at right. */
#footer #footer-bar .footer-bar-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  justify-items: start;
  gap: 8px 24px;
}

#footer #footer-bar .footer-bar-left,
#footer #footer-bar .beian-group {
  display: contents;
}

#footer #footer-bar .beian-group > div {
  display: flex;
  grid-column: 1;
  grid-row: 2;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
}

#footer #footer-bar .copyright {
  grid-column: 1;
  grid-row: 1;
}

#footer #footer-bar .beian-group .footer-bar-link {
  grid-column: 1;
  justify-self: start;
}

#footer #footer-bar .beian-group > a[href="https://hexo.io/"],
#footer #footer-bar .footer-bar-right:empty,
#footer #footer-bar .footer-bar-links > div:has(> .footer-bar-right:empty) {
  display: none;
}

#footer #footer-bar .beian-group > a[href="https://github.com/everfu/hexo-theme-solitude"] {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: end;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
}

/* The theme shares one tooltip element; expand it for footer link hints only. */
body:has(#footer-bar .beian-group a[heotip]:hover) > .custom-tooltip {
  width: max-content;
  max-width: calc(100vw - 40px);
  white-space: nowrap;
  overflow-wrap: normal;
}

@media (max-width: 600px) {
  #footer #footer-bar .footer-bar-links {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 12px;
  }

  #footer #footer-bar .beian-group > div {
    gap: 8px;
  }

  #footer #footer-bar .beian-group > div > .footer-bar-link {
    font-size: clamp(9.5px, 3vw, 12px);
  }

  #footer #footer-bar .beian-group > a[href="https://github.com/everfu/hexo-theme-solitude"] {
    grid-column: 1;
    grid-row: auto;
  }
}
