/* Styles for an in-document (de-iframed) package theme.
 *
 * When the theme renders in-document, the shell's main styles.css must NOT be
 * loaded — its unlayered `*{margin:0;padding:0}` reset overrides the theme's
 * @layer-ed Tailwind rules (unlayered always beats layered), which strips
 * spacing/bullets from blog article content. renderPackageThemeInline() removes
 * the styles.css <link> and loads this instead: just the loading overlay + the
 * document-scroll behaviour the theme needs, nothing that touches theme markup.
 */

html.package-theme-active,
html.package-theme-active body {
  margin: 0;
  padding: 0;
}

/* The theme's own bundle renders into #siteBody > #root and owns layout +
   scrolling, so the document must scroll normally. */
html.package-theme-inline,
html.package-theme-inline body {
  height: auto;
  overflow: visible;
  margin: 0;
  padding: 0;
}
html.package-theme-inline #siteBody {
  min-height: 100vh;
}

/* White overlay + spinner until the theme bundle has loaded. */
html.package-theme-loading {
  overflow-y: hidden;
  background: #fff;
}
html.package-theme-loading body,
html.package-theme-loading #siteBody {
  background: #fff;
}
html.package-theme-loading::before {
  content: '';
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 999998;
}
html.package-theme-loading::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  margin-top: -25px;
  margin-left: -25px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid #1b5c8b;
  border-radius: 50%;
  animation: icore-theme-spin 1s linear infinite;
  z-index: 999999;
}
@keyframes icore-theme-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
