/* ─────────────────────────────────────────────────────────────────────────────
   DΛREΛKT_ STYLESHEET — daBase.css
   Classification: Absolute Base (NEUTRAL, NON-OVERRIDING)
   Version: 1.6.0
   File: /styles/daBase.css
   Maintainer: DΛREΛKT_ Core UI Team

   Changes (1.6.0):
   - Safety reset now targets pages with NO data-site only to prevent white flick
     during boot→runtime transition.
   ─────────────────────────────────────────────────────────────────────────── */

/* GLOBAL RESET — foundation only */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  background-color: var(--background-color, #ffffff);
  color: var(--text-color, #111111);
  font-family: var(--font-family-base, 'Inter', 'Roboto', sans-serif);
  min-height: 100vh;
  width: 100% !important;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* LAYOUT ROOTS — NEVER CLAMP OR CENTER AUTOMATICALLY */
#app,
#layout-wrapper,
main,
section,
header,
footer {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Layout structure */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#layout-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

/* ZONES */
#layout-wrapper > header,
#layout-wrapper > nav,
#layout-wrapper > main,
#layout-wrapper > footer,
#header-zone,
#nav-zone,
#layout-zones,
#content-zone,
#footer-zone {
  align-self: stretch;
  width: 100% !important;
  max-width: none !important;
}

/* FLEX UTILITIES */
.flex { display: flex; align-items: stretch; }
.flex-center { display: flex; align-items: center; justify-content: center; }

.flex > button,
.flex > [role="button"],
.flex > input,
.flex > select,
.flex > textarea {
  flex: 0 0 auto;
  min-width: max-content;
}

.grow    { flex: 1 1 auto !important; min-width: 0 !important; }
.no-grow { flex: 0 0 auto !important; min-width: max-content !important; }

:where([flex],[data-flex]) {
  flex: 0 0 auto !important;
  align-self: auto !important;
  min-width: max-content;
}

/* GRID UTILITIES */
.grid  { display: grid; gap: var(--spacing-sm, 8px); }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-4{ grid-template-columns: repeat(4, 1fr); }

/* CONTAINERS — no auto max-width or centering EVER */
.container,
.section {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Optional helper for explicit centering (only when asked) */
.container.center,
.section.center {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: var(--container-max, 1200px) !important;
  padding-left: var(--spacing-sm, 8px);
  padding-right: var(--spacing-sm, 8px);
}

/* BOX + SPACERS */
.box {
  background: var(--background-color, #fff);
  padding: var(--spacing-md, 16px);
  border-radius: 0.5rem;
  box-shadow: 0 0 8px rgba(0,0,0,.2);
  transition: box-shadow .3s ease;
}
.box:hover { box-shadow: 0 0 12px rgba(0,0,0,.3); }

.spacer    { display: block; width: 100%; }
.spacer-xs { height: var(--spacing-xs, 4px); }
.spacer-sm { height: var(--spacing-sm, 8px); }
.spacer-md { height: var(--spacing-md, 16px); }
.spacer-lg { height: var(--spacing-lg, 24px); }

/* BACKGROUND + BORDERS */
[data-background] {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

[data-border-shadow] {
  border-style: solid;
  border-width: 0px;
  border-color: var(--color-border, #cccccc);
  box-shadow: none;
}

/* ANIMATIONS (safe defaults) */
[data-animation] {
  opacity: 0;
  transform: translateY(20px);
  transition-property: opacity, transform;
  transition-timing-function: ease-out;
}
[data-animation].active { opacity: 1; transform: translateY(0); }
[data-animation="fade-in"].active    { opacity: 1; }
[data-animation="slide-up"].active   { transform: translateY(0); }
[data-animation="slide-left"].active { transform: translateX(0); }
[data-animation="slide-right"].active{ transform: translateX(0); }
[data-animation="zoom-in"].active    { transform: scale(1); }
[data-animation="rotate-in"].active  { transform: rotate(0deg); }

/* ─────────────────────────────────────────────────────────────
   BOOT MODE — Scoped: only triggers when engine is booting
   ───────────────────────────────────────────────────────────── */
body[data-engine="boot"],
#boot-center {
  background: var(--boot-bg, #000);
  color: var(--boot-fg, #0f0);
  font-family: var(--font-family-base, monospace);
  min-height: 100vh;
}

#boot-center {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

/* Safety reset when NO site is mounted (prevents white flick on site pages) */
html:not([data-site]) body:not([data-site]) {
  background: var(--background-color, #ffffff);
  color: var(--text-color, #111111);
}
