/* Hanetic Design System — components.css (Phase 1)
   ------------------------------------------------------------------
   Shared primitives used across modules: kicker labels, status pills,
   action buttons, section titles, module cards. Status vocabulary
   (pass/warn/fail/neutral) is defined once here for the whole site. */

/* ---- Kicker label ---- */
.section-kicker,
.portal-kicker,
.car-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: var(--hx-radius-pill);
  padding: 8px 12px;
  background: var(--hx-accent-soft);
  color: var(--hx-accent);
  font-size: var(--hx-text-micro);
  font-weight: 900;
  letter-spacing: 0;
}

/* ---- Status vocabulary ---- */
.pass { color: var(--hx-pass); }
.warn { color: var(--hx-warn); }
.fail { color: var(--hx-fail); }
.neutral { color: var(--hx-info); }

.status-pill,
.tag {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 27px;
  max-width: 100%;
  align-items: center;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: var(--hx-radius-pill);
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.7);
  font-size: var(--hx-text-micro);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* .status-pill.pulse + @keyframes hx-pulse moved to css/motion.css
   (Phase 3D): all keyframes live in the canonical motion layer. */

/* ---- Action buttons (portal + shared CTA) ---- */
.portal-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--hx-radius-pill);
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform var(--hx-dur-fast) ease, background var(--hx-dur-fast) ease;
}

.portal-action:active {
  transform: scale(0.98);
}

.portal-action.primary {
  background: rgba(255, 255, 255, 0.88);
  color: var(--hx-ink);
}

.portal-action.ghost {
  background: transparent;
}

/* Light-context pages (e.g. Promo section-actions) re-tint the button. */
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.section-actions .portal-action {
  border-color: var(--hx-line-strong);
  background: rgba(255, 255, 255, 0.8);
  color: var(--hx-ink);
}

.section-actions .portal-action.primary {
  border-color: transparent;
  background: var(--hx-ink);
  color: #fff;
}

/* ---- Section titles ---- */
.section-title {
  display: grid;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.section-title h2 {
  font-size: var(--hx-text-h2);
  line-height: 1.15;
}

.section-title small {
  color: var(--hx-ink-soft);
}

/* ---- Module card (portal.js fallback/loading card and dock cousins) ---- */
.module-card {
  display: grid;
  min-height: 170px;
  min-width: 0;
  align-content: space-between;
  gap: var(--hx-space-4);
  border: 1px solid var(--hx-line);
  border-radius: var(--hx-radius-md);
  padding: var(--hx-space-4);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(246, 251, 249, 0.7));
  box-shadow: var(--hx-shadow-card);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.module-card strong {
  display: block;
  margin-top: 8px;
  font-size: var(--hx-text-h3);
}

.module-card p {
  margin-top: 8px;
  color: var(--hx-ink-soft);
  font-size: var(--hx-text-small);
}

.module-card .status-pill {
  justify-self: start;
}

/* Shared child shell: accepted Travel/Dev material, document and internal scroll. */
body:has([data-child-shell]) { padding: 0; min-height: 100vh; min-height: 100dvh; overflow-x: clip; }
.hx-child-nav, .hx-child-header { -webkit-tap-highlight-color: transparent; }
.hx-child-header {
  position: sticky; top: var(--hx-child-top); z-index: 35; min-height: var(--hx-child-height-default);
  padding: calc(var(--hx-child-bar-pad) + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) var(--hx-child-bar-pad) calc(var(--hx-child-brand-left) + env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--hx-child-bg, var(--hx-theme-deep)); color: var(--hx-child-ink, var(--hx-theme-on-deep));
  font-family: var(--hx-font); letter-spacing: 0;
}
.hx-child-header .hx-child-brand { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; min-width: 0; min-height: 44px; align-content: center; padding-block: 8px; font-size: 17px; font-weight: 750; color: inherit; text-decoration: none; line-height: 1.5; }
.hx-child-brand span { font-size: 14px; font-weight: 400; color: var(--hx-child-brand-muted, var(--hx-theme-on-deep-muted)); }
.hx-child-header.is-menu-open .hx-child-brand { visibility: hidden; }
.hx-child-header [data-shell-actions] { min-width: 0; flex-shrink: 0; }
.hx-child-header [hidden] { display: none; }
.hx-child-header.is-reading { background: var(--hx-child-reading-bg, var(--hx-theme-paper)); color: var(--hx-theme-ink); --hx-child-brand-muted: var(--hx-theme-muted); }
.hx-child-icon { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hx-child-nav { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(330px, calc(100% - 24px - env(safe-area-inset-right, 0px))); pointer-events: none; font-family: var(--hx-font); letter-spacing: 0; }
.hx-child-nav .hx-child-toggle { position: absolute; z-index: 2; top: calc(var(--hx-child-bar-pad) + 4px + env(safe-area-inset-top, 0px)); left: calc(12px + env(safe-area-inset-left, 0px)); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #fff; cursor: pointer; pointer-events: auto; transition: color 180ms ease; }
.hx-child-toggle:hover > svg { opacity: .7; }
.hx-child-nav.is-reading:not(.is-open) .hx-child-toggle { color: var(--hx-theme-ink); }
.hx-child-drawer { position: absolute; inset: 0; padding: calc(16px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-left, 0px)); overflow-y: auto; }
.hx-child-nav::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,rgb(var(--hx-theme-deep-rgb) / .96),rgb(var(--hx-theme-deep-rgb) / .91) 72%,rgb(var(--hx-theme-deep-rgb) / .86)),linear-gradient(90deg,rgb(var(--hx-theme-deep-rgb) / .97),rgb(var(--hx-theme-deep-rgb) / .93) 76%,rgb(var(--hx-theme-deep-rgb) / .86) 88%,rgb(var(--hx-theme-deep-rgb) / .28)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); mask-image: linear-gradient(90deg,#000 88%,#000e 93%,#0009 97%,transparent); }
.hx-child-drawer,.hx-child-nav::before { opacity: 0; visibility: hidden; transform: translateX(-28px); transition: opacity var(--hx-child-drawer-duration) ease, transform var(--hx-child-drawer-duration) ease, visibility var(--hx-child-drawer-duration); pointer-events: none; }
.hx-child-nav.is-open .hx-child-drawer,.hx-child-nav.is-open::before { opacity: 1; visibility: visible; transform: none; }
.hx-child-nav.is-open .hx-child-drawer { pointer-events: auto; }
.hx-child-drawer nav { display: grid; gap: 6px; margin-top: 72px; }
.hx-child-drawer nav a { display: flex; align-items: center; gap: 18px; min-height: 56px; padding: 12px 10px; color: var(--hx-theme-on-deep); border-bottom: 1px solid #ffffff16; font-size: 20px; line-height: 1.5; text-decoration: none; transition: background 160ms, color 160ms; }
.hx-child-drawer nav a > span { min-width: 0; }
.hx-child-drawer nav a[aria-current] { font-weight: 600; }
.hx-child-drawer .hx-child-current { font-size: 12px; font-weight: 600; flex-shrink: 0; }
.hx-child-nav.is-reading:not(.is-open) :focus-visible, .hx-child-header.is-reading :focus-visible { outline-color: var(--hx-theme-link); }
.hx-child-drawer nav a > svg:last-child { margin-left: auto; opacity: .6; }
.hx-child-drawer nav a[aria-current],.hx-child-drawer nav a:hover { background: #ffffff0f; color: var(--hx-theme-on-deep-link); }
.hx-child-scrim { position: fixed; z-index: 39; inset: 0; background: #03080614; opacity: 0; visibility: hidden; transition: opacity var(--hx-child-drawer-duration), visibility var(--hx-child-drawer-duration); }
.hx-child-scrim.is-open { opacity: 1; visibility: visible; }
.hx-child-nav :focus-visible,.hx-child-header :focus-visible { outline: 2px solid var(--hx-theme-on-deep-link); outline-offset: 3px; }
@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) { .hx-child-nav::before { background: var(--hx-theme-deep); mask-image: none; } }
@media (max-width: 760px) { .hx-child-header .hx-child-brand { font-size: 16px; } }
@media (max-height: 560px) {
  .hx-child-nav .hx-child-toggle { top: calc(4px + env(safe-area-inset-top, 0px)); }
  .hx-child-drawer nav { margin-top: 44px; }
  .hx-child-drawer nav a { min-height: 44px; font-size: 17px; padding-block: 8px; }
}
