/**
 * SOVEREIGN SHIELD™ — Critical Visibility & IP Baseline
 * Estate of Hope™ | Crown Achievement Consulting, LLC
 *
 * Purpose: Minimal, forensic-critical CSS to prevent black screen and enforce IP baseline.
 * Replaces scattered Nuclear CSS blocks. Load early (before sovereign.css).
 * Canon: governor/IP_PROTECTION_CANON.md | governor/WEB_SURFACE_AUDIT_CANON.md
 *
 * Grounds Keeper™ Patch — 2026-03-06:
 *   Added :root variable defaults so layout is correct BEFORE JavaScript runs.
 *   Prevents content-push-below-viewport blank page bug on all Estate pages.
 */

/* ── Layout anchor variables ────────────────────────────────────────────────
   These are the conservative CSS-only defaults. The JS updateShieldSpacer()
   will override them precisely once the DOM is measured. Without these
   defaults, calc(var(--safety-banner-height, 60px) + ...) can combine with
   the header to push content 200-400px down — beyond the viewport — on
   first paint, causing the "blank page" appearance.
   ──────────────────────────────────────────────────────────────────────── */
:root {
    --safety-banner-height: 140px;
    --sovereign-header-height: 82px;
    --shield-total-height: 172px;
    /* banner + header combined safe value */
}

/* shield-spacer natural breathing room */
.shield-spacer {
    height: 40px;
    min-height: 40px;
    transition: height 0.15s ease, min-height 0.15s ease;
}

/* Content containers: padding-top is handled by #shield-spacer div in _safety_header_shield.html.
   DO NOT add padding-top here — the spacer + inline styles on containers cause a double-push
   that sends content 360-400px below viewport (blank page bug). Each template handles its own
   top padding if needed, and shield-spacer provides the primary clearance.
   ─ Grounds Keeper™ forensic fix 2026-03-06 ─ */

/* Critical visibility — prevents black screen (single source of truth) */
html,
body {
    background-color: #050505 !important;
    background: #050505 !important;
    color: #f5f5f5 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    min-height: 100vh !important;
    position: relative !important;
    margin: 0;
    padding: 0;
    /* Category of One: Anchor Offset & Smooth Scrolling */
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--safety-banner-height, 140px) + 120px) !important;
}

body,
body * {
    visibility: visible !important;
    opacity: 1 !important;
}

/* ⚠️ CRITICAL: Do NOT use position:relative !important on body > * — this overrides
   position:fixed on #safety-banner and #sovereign-header, breaking the fixed layout.
   The z-index is kept to prevent stacking issues, but position must not be overridden. */

/* ── LOGO CLEARANCE: Pre-JS initial position for sovereign-header.
   Prevents nav logo from rendering under safety banner on first paint.
   JS updateShieldSpacer() refines this precisely after load.
   --safety-banner-height is 140px (CSS custom property).
   ──────────────────────────────────────────────────────────────── */
#sovereign-header.sovereign-global-header {
    position: relative;
    top: auto;
    left: 0;
    right: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: transparent;
    transition: top 0.1s ease;
}

body>*:not(#safety-banner):not(#sovereign-header):not(.safety-banner):not(.sovereign-global-header):not([style*="fixed"]) {
    position: relative;
    z-index: 1;
}

/* IP baseline: user-select none (sovereign.css extends; this is fallback) */
body {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body input,
body textarea,
body [contenteditable="true"] {
    user-select: text !important;
    -webkit-user-select: text !important;
}

/* Desktop spacer adjustment omitted; 40px is sufficient universally */