/* ==========================================================================
   WP-KORE NOTIFICATION BAR — Sovereign Custom Element CSS
   CLEANED: Applied Cube CSS Deep Cleanup – tokens, single declarations, unlayered sovereignty.
   Class-First CUBE CSS Architecture | Pure Oxygen Compatible
   ========================================================================== */

/* ── 1. ROOT BASE DECLARATION (Single Property Declaration Law) ── */
.notification-bar {
  /* ── 1. CONTROL PANEL — SINGLE SOURCE OF TRUTH ── */
  --local-bg: var(--brand);
  --local-text: var(--brand-on);
  --local-border: var(--border-width) solid var(--brand-border);
  --local-badge-bg: var(--surface-elevated);
  --local-badge-text: currentColor;
  --local-cta-bg: var(--surface);
  --local-cta-text: var(--brand);
  --local-cta-sec-bg: transparent;
  --local-cta-sec-border: currentColor;
  --local-close-hover-bg: var(--surface-elevated);
  --local-padding-y: var(--space-xs);
  --local-padding-x: var(--space-md);
  --local-font-size: var(--font-size-sm);
  --local-radius: calc(var(--radius-brand) * 0.5);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
  box-sizing: border-box;
  background: var(--local-bg);
  color: var(--local-text);
  border: var(--local-border);
  border-radius: var(--local-radius);
  padding: var(--local-padding-y) var(--local-padding-x);
  box-shadow: inset 0 1px 0 0 oklch(100% 0 0 / 15%), var(--shadow-sm);
  font-size: var(--local-font-size);
  line-height: 1.375;
  position: relative;
  animation: kore-bar-in 0.25s var(--ease-standard) both;
}

@media (prefers-reduced-motion: reduce) {
  .notification-bar {
    animation: none;
  }
}

@keyframes kore-bar-in {
  from { opacity: 0; transform: translateY(-0.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hidden state */
.notification-bar[data-dismissed="true"],
.notification-bar.is-dismissed {
  display: none;
}

/* ── 2. INNER WRAPPER & SUB-ELEMENTS ── */
.notification-bar__inner {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.notification-bar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: currentColor;
}

.notification-bar__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.notification-bar__badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  padding: var(--space-3xs) var(--space-xs);
  border-radius: calc(var(--radius-brand) * 0.5);
  background: var(--local-badge-bg);
  color: var(--local-badge-text);
  flex-shrink: 0;
  white-space: nowrap;
}

.notification-bar__content {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.notification-bar__title {
  font-weight: var(--font-weight-bold);
  color: currentColor;
  white-space: nowrap;
}

.notification-bar__message {
  margin: 0;
  font-weight: var(--font-weight-regular);
  color: currentColor;
}

/* ── 3. ACTIONS CONTAINER & CTAS ── */
.notification-bar__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.notification-bar__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3xs);
  flex-shrink: 0;
  padding: var(--space-3xs) var(--space-sm);
  min-height: 2rem;
  border-radius: calc(var(--radius-brand) * 0.5);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  transition: transform var(--ease-standard), filter var(--motion);
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}

.notification-bar__cta:focus-visible {
  outline: 1px solid var(--focus-ring);
  outline-offset: 2px;
}

.notification-bar__cta:active {
  transform: scale(0.96);
}

.notification-bar__cta--primary {
  background: var(--local-cta-bg);
  color: var(--local-cta-text);
  box-shadow: var(--shadow-sm);
}

.notification-bar__cta--primary:hover {
  filter: brightness(1.08);
}

.notification-bar__cta--secondary {
  background: var(--local-cta-sec-bg);
  color: currentColor;
  border: var(--border-width) solid var(--local-cta-sec-border);
}

.notification-bar__cta--secondary:hover {
  background: var(--local-close-hover-bg);
}

/* ── 4. CLOSE BUTTON ── */
.notification-bar__close {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
  border: none;
  border-radius: calc(var(--radius-brand) * 0.5);
  background: transparent;
  color: currentColor;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity var(--motion), background-color var(--motion), transform var(--ease-standard);
  box-sizing: border-box;
}

.notification-bar__close:hover {
  opacity: 1;
  background-color: var(--local-close-hover-bg);
  transform: scale(1.08);
}

.notification-bar__close:active {
  transform: scale(0.92);
}

.notification-bar__close:focus-visible {
  outline: 1px solid var(--focus-ring);
  outline-offset: 2px;
}

.notification-bar__close svg {
  pointer-events: none;
  width: 1rem;
  height: 1rem;
}

/* ── 5. CANONICAL INTENTS (VARIABLE MUTATIONS ONLY) ── */
.notification-bar.notification-bar-brand {
  --local-bg: var(--brand);
  --local-text: var(--brand-on);
  --local-border: var(--border-width) solid var(--brand-border);
  --local-badge-bg: var(--surface-elevated);
  --local-badge-text: var(--brand-on);
  --local-cta-bg: var(--surface);
  --local-cta-text: var(--brand);
  --local-close-hover-bg: var(--surface-elevated);
}

.notification-bar.notification-bar-accent {
  --local-bg: var(--brand-accent);
  --local-text: var(--brand-accent-on);
  --local-border: var(--border-width) solid var(--surface-border);
  --local-badge-bg: var(--surface-elevated);
  --local-badge-text: var(--brand-accent-on);
  --local-cta-bg: var(--text-main);
  --local-cta-text: var(--canvas);
  --local-close-hover-bg: var(--surface-elevated);
}

.notification-bar.notification-bar-surface {
  --local-bg: var(--surface);
  --local-text: var(--text-main);
  --local-border: var(--border-width) solid var(--surface-border);
  --local-badge-bg: var(--surface-elevated);
  --local-badge-text: var(--brand);
  --local-cta-bg: var(--brand);
  --local-cta-text: var(--brand-on);
  --local-close-hover-bg: var(--surface-elevated);
}

.notification-bar.notification-bar-canvas {
  --local-bg: var(--surface-elevated);
  --local-text: var(--text-main);
  --local-border: var(--border-width) solid var(--surface-border);
  --local-badge-bg: var(--surface);
  --local-badge-text: var(--brand);
  --local-cta-bg: var(--brand);
  --local-cta-text: var(--brand-on);
  --local-close-hover-bg: var(--surface-elevated);
}

.notification-bar.notification-bar-inverse {
  --local-bg: var(--text-main);
  --local-text: var(--text-main);
  --local-border: var(--border-width) solid var(--surface-border);
  --local-badge-bg: var(--surface-elevated);
  --local-badge-text: var(--text-main);
  --local-cta-bg: var(--brand);
  --local-cta-text: var(--brand-on);
  --local-close-hover-bg: var(--surface-elevated);
}

/* ── 6. SIZES & PRESETS ── */
.notification-bar.notification-bar-sm {
  --local-padding-y: var(--space-2xs);
  --local-font-size: var(--font-size-sm);
}

.notification-bar.notification-bar-md {
  --local-padding-y: var(--space-xs);
  --local-font-size: var(--font-size-sm);
}

.notification-bar.notification-bar-minimal {
  --local-bg: transparent;
  --local-border: var(--border-width) solid var(--surface-border);
  --local-text: var(--text-main);
  --local-badge-bg: var(--surface-elevated);
  --local-badge-text: currentColor;
  --local-cta-bg: var(--brand);
  --local-cta-text: var(--brand-on);
  --local-close-hover-bg: var(--surface-elevated);
}

.notification-bar.notification-bar-announcement,
.notification-bar.notification-bar-warning {
  --local-border: var(--border-width) solid var(--surface-border);
}
