/* Sacralib V2.8 — owner-only HOME corrections, after V2.7.
   This file intentionally does not alter articles, editor, database or public UI.
   Separate the decoration from the parchment: no full-page cover images or tiled seams. */
body.codex-site-v2-home.codex-site-v2-current {
  --sv28-paper: #f3eadc;
  --sv28-panel: #f5eddf;
  --sv28-icon-bed: #eee4d5;
  --sv28-frame: #d5bea0;
  background-color: #f4ecdf !important;
  background-image: linear-gradient(180deg, #f7f0e5 0%, #f4ecdf 55%, #f4ecdf 100%) !important;
  background-position: center top !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}
/* Old preview styles paint independent parchment blocks; let the single background show through. */
body.codex-site-v2-home :is(.page-shell,.content-stage,#homeView,#codexSiteHome) {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}
body.owner-home-v26-enabled.codex-site-v2-home:has(#homeView.active) :is(.page-shell,.content-stage) {
  background: transparent !important;
  background-image: none !important;
}
/* Attach the side artwork to HOME content, NOT viewport edges. On ultrawide screens
   the castles therefore stay beside the site instead of drifting to screen corners. */
body.codex-site-v2-home #homeView {
  position: relative !important;
  isolation: isolate !important;
  overflow: visible !important;
}
body.codex-site-v2-home #homeView::before,
body.codex-site-v2-home #homeView::after {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  top: -90px !important;
  width: clamp(60px, calc(var(--sv27-gutter) - 12px), 138px) !important;
  height: auto !important;
  aspect-ratio: 160 / 2048;
  max-height: none !important;
  border: 0 !important;
  pointer-events: none !important;
  opacity: .88 !important;
  background-repeat: no-repeat !important;
  background-position: top center !important;
  background-size: 100% 100% !important;
  z-index: -1 !important;
  filter: saturate(.85) !important;
}
body.codex-site-v2-home #homeView::before {
  left: calc(4px - var(--sv27-gutter)) !important;
  right: auto !important;
  background-image: url('/assets/codex-v27-figma/side-left.webp') !important;
}
body.codex-site-v2-home #homeView::after {
  right: calc(4px - var(--sv27-gutter)) !important;
  left: auto !important;
  background-image: url('/assets/codex-v27-figma/side-right.webp') !important;
}
body.codex-site-v2-home #codexSiteHome {position: relative !important;z-index: 1 !important;}
/* Decorative art is intentionally hidden when it could overlap cards or cause overflow. */
@media(max-width:1550px) {
  body.codex-site-v2-home #homeView::before,
  body.codex-site-v2-home #homeView::after {display:none !important;content:none !important;}
}
/* Unify pale parchment across all HTML panels. Previously gradients differed across
   versions V2.3/24/25/26/27, exposing horizontal bands and disconnected beige slabs. */
body.codex-site-v2-home .sv2-quick-strip,
body.codex-site-v2-home .sv2-live-card,
body.codex-site-v2-home .sv2-category,
body.codex-site-v2-home .sv2-panel,
body.codex-site-v2-home .sv2-community {
  background-color: var(--sv28-panel) !important;
  background-image: none !important;
  border-color: var(--sv28-frame) !important;
}
body.codex-site-v2-home .sv2-quick-item {
  background: var(--sv28-icon-bed) !important;
  border-color: var(--sv28-frame) !important;
}
body.codex-site-v2-home .sv2-quick-item:hover,
body.codex-site-v2-home .sv2-quick-item:focus-visible {
  background: #e8dac6 !important;
}
body.codex-site-v2-home .sv2-category-header {
  background-color: transparent !important;
}
/* The 2x PNG/WebP pictograms have a baked-in parchment backing. Keep their natural
   appearance while making the adjacent surfaces the SAME parchment hue. The original
   pictograms are supplied separately for manual alpha cleanup; do not pretend CSS can
   erase their raster backgrounds. */
body.codex-site-v2-home :is(.sv2-quick-item>.sv23-art-icon,.sv2-category-header>.sv23-art-icon) {
  background: transparent !important;
  border: 0 !important;
  mix-blend-mode: multiply !important;
  object-fit: contain !important;
  box-shadow: none !important;
}
/* No poster above category headers. Categories come from the real site menu. */
body.codex-site-v2-home .sv2-category-header::before,
body.codex-site-v2-home .sv2-category[data-sv27-category] .sv2-category-header::before {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
body.codex-site-v2-home .sv2-category {
  padding: 11px 13px 12px !important;
  min-height: 248px !important;
  display: flex !important;
  flex-direction: column !important;
}
body.codex-site-v2-home .sv2-category-header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 9px !important;
  min-height: 55px !important;
  padding: 0 0 8px !important;
  margin: 0 !important;
  border-bottom: 1px solid #decab0 !important;
}
body.codex-site-v2-home .sv2-category-header>.sv23-art-icon {
  width: 44px !important;
  height: 44px !important;
  flex: 0 0 44px !important;
}
body.codex-site-v2-home .sv2-category h3 {
  font: 700 clamp(14px,1.1vw,19px)/1.14 Georgia,serif !important;
  text-transform: uppercase !important;
  letter-spacing: -.012em !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}
body.codex-site-v2-home .sv2-category-links {padding-top: 8px !important;}
body.codex-site-v2-home .sv2-category-all {margin-top: auto !important;}
/* Header illustrations use background-free SVGs from the supplied design kit.
   Unlike the old WebP squares, these have truly transparent backgrounds. */
body.codex-site-v2-home .sv2-section-header h2::before {
  width: 32px !important;
  height: 32px !important;
  margin-right: 8px !important;
  background: transparent url('/assets/codex-v28-icons/book.svg') center/contain no-repeat !important;
  mix-blend-mode: normal !important;
}
body.codex-site-v2-home .sv2-home-feeds>.sv2-panel:nth-child(2) .sv2-section-header h2::before {
  background-image: url('/assets/codex-v28-icons/scroll.svg') !important;
}
body.codex-site-v2-home .sv2-panel::before,
body.codex-site-v2-home .sv2-panel::after {
  background-color: transparent !important;
  pointer-events: none !important;
}
body.codex-site-v2-home .sv2-feed-image.sv2-image-fallback {
  background-color: var(--sv28-icon-bed) !important;
}
/* Header and footer have the same parchment palette as the main site. */
body.codex-site-v2-home .codex-navbar {
  background: #f5eddf !important;
  border-bottom-color: #d5bea0 !important;
}
body.codex-site-v2-home #siteFooter {
  background: #f5eddf !important;
  border-top-color: #d5bea0 !important;
}
/* Mobile: keep cards and labels readable after removing the large banners. */
@media(max-width:1199px) {
  body.codex-site-v2-home .sv2-category {min-height: 225px !important;}
  body.codex-site-v2-home .sv2-category-header {min-height: 60px !important;}
  body.codex-site-v2-home .sv2-category h3 {font-size: 17px !important;}
}
@media(max-width:600px) {
  body.codex-site-v2-home .sv2-category {min-height: 0 !important;padding: 10px 12px 11px !important;}
  body.codex-site-v2-home .sv2-category-header {min-height: 57px !important;}
  body.codex-site-v2-home .sv2-category h3 {font-size: 17px !important;}
  body.codex-site-v2-home .sv2-category-grid {gap:10px !important;}
  body.codex-site-v2-home .sv2-section-header h2::before {width:25px !important;height:25px !important;}
}
