/*
 * Active-theme shell rules for Starless Edits.
 *
 * The companion plugin owns feature components and public data contracts.
 * This file owns the lightnovel shell around those components, including the
 * legacy parent-theme markup still used by compatibility routes.
 */

/* Full-page contract. */
body.full-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.full-page #sidebar,
body.full-page .shola-widget,
body.full-page .releases,
body.full-page #comments:not([data-account-section]),
body.full-page .comments-area {
  display: none !important;
}

body.full-page #content {
  flex: 1;
  width: 100% !important;
  max-width: none !important;
}

body.full-page .mainholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100% !important;
  max-width: none !important;
}

body.full-page .wrapper {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: calc(100% - 32px) !important;
  max-width: none !important;
  flex: 1;
  box-sizing: border-box;
}

body.full-page .postbody {
  float: none !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box;
}

body.full-page .bixbox {
  background: transparent;
  box-shadow: none;
}

/* Generic rankings shell. */
body.starless-rankings-page #sidebar,
body.starless-rankings-page .releases,
body.starless-rankings-page .shola-widget {
  display: none !important;
}

body.starless-rankings-page #content,
body.starless-rankings-page .mainholder,
body.starless-rankings-page .postbody {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
}

body.starless-rankings-page #content {
  margin: 0 !important;
  padding: 0 !important;
}

body.starless-rankings-page .wrapper {
  width: min(100% - 28px, 1120px) !important;
  max-width: 1120px !important;
  margin-inline: auto !important;
}

body.starless-rankings-page .postbody > .bixbox,
body.starless-rankings-page .postbody > div > .bixbox {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.starless-rankings-page .bixbox > .page {
  padding: 0 !important;
}

/* Translator rankings use the active palette and editorial page width. */
body.starless-translator-rankings-page .wrapper {
  width: min(100% - 32px, 1180px) !important;
  max-width: 1180px !important;
}

body.starless-translator-rankings-page,
body.starless-translator-rankings-page #content,
body.starless-translator-rankings-page #content > .wrapper {
  background: var(--background) !important;
  color: var(--foreground) !important;
}

body.starless-translator-rankings-page .kol-generic-page__article {
  row-gap: 0;
}

body.starless-translator-rankings-page .kol-generic-page__content {
  padding-block: clamp(20px, 2.5vw, 28px);
}

/* Signed-in account shell. */
body.kol-account-editorial-page #content {
  display: block !important;
  align-items: initial !important;
  justify-content: initial !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.kol-account-editorial-page .kol-generic-page__header {
  display: none;
}

body.kol-account-editorial-page .kol-generic-page__content {
  padding-block-start: 0;
}

body.kol-account-editorial-page .mainholder,
body.kol-account-editorial-page .postbody,
body.kol-account-editorial-page .bixbox,
body.kol-account-editorial-page .page {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Complete public profiles own their heading and the existing users measure. */
body.starless-profile-page.full-page #content > .wrapper {
  margin-inline: auto;
}

body.starless-profile-page .kol-feature-page {
  width: min(var(--starless-content-width, 980px), 100%);
  max-width: none;
  padding-block: clamp(24px, 4vw, 48px) 0;
}

/* Public account shell. */
body.kol-account-login #content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

body.kol-account-login #content > div > div.postbody > div.bixbox {
  background: transparent !important;
  box-shadow: none !important;
}

body.kol-account-login.darkmode .mainholder {
  background: var(--background) !important;
}

@media (max-width: 899px) {
  body.kol-account-login-page .page,
  body.kol-comments-profile-page .page {
    padding: 0 !important;
  }
}

/* Legacy shortcode library shell. Native theme routes use their own page. */
body.full-page .bixbox:has(.kol-saved-novels) {
  width: 100% !important;
  max-width: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

body.full-page .page:has(.kol-saved-novels),
body.full-page .bixbox:has(.kol-saved-novels) .page {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

body.full-page .entry-content:has(.kol-saved-novels),
body.full-page .post-content:has(.kol-saved-novels),
body.full-page .page-content:has(.kol-saved-novels),
body.full-page .content-area:has(.kol-saved-novels),
body.full-page article:has(.kol-saved-novels) .entry-content,
body.full-page .site-main:has(.kol-saved-novels) .entry-content,
body.full-page .c-page-content:has(.kol-saved-novels),
body.full-page .c-blog-post:has(.kol-saved-novels),
body.full-page .main-col:has(.kol-saved-novels) .entry-content {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  border-radius: 0 !important;
}

body.full-page .entry-header:has(+ .entry-content .kol-saved-novels),
body.full-page article:has(.kol-saved-novels) > .entry-header,
body.full-page article:has(.kol-saved-novels) .entry-title,
body.full-page article:has(.kol-saved-novels) .post-title,
body.full-page .c-blog__heading:has(+ * .kol-saved-novels),
body.full-page article:has(.kol-saved-novels) .item-title {
  display: none !important;
}

body.full-page article:has(.kol-saved-novels),
body.full-page .c-blog-post:has(.kol-saved-novels) {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

@media (max-width: 680px) {
  body.starless-rankings-page .wrapper {
    width: min(100% - 18px, 1120px) !important;
  }
}

@media (max-width: 720px) {
  body.starless-translator-rankings-page .wrapper {
    width: min(100% - 20px, 1180px) !important;
  }
}
