/*
 * TJ-228 — precision alignment overlay.
 * Additive and reversible: corrects shared axes without deleting inherited UI.
 */

/* Header rail: every title and subtitle owns the same centered column axis. */
body.tj-os-page .tj-os-primary-nav a {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

body.tj-os-page .tj-os-primary-nav .tj-nav-title,
body.tj-os-page .tj-os-primary-nav .tj-nav-subtitle {
  display: block !important;
  width: 100% !important;
  margin-inline: auto !important;
  text-align: center !important;
}

body.tj-os-page .tj-os-primary-nav a:first-child {
  padding-inline-start: 0 !important;
}

/* Hero system labels: only the outer item is a pill. Nested translation spans
   must never receive a second border, padding shell, or minimum height. */
body.tj-os-page .tj218-hero-system-labels {
  align-items: center;
}

body.tj-os-page .tj218-hero-system-labels > span {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

body.tj-os-page .tj218-hero-system-labels > span > span,
body.tj-os-page .tj218-hero-system-labels > span > i {
  display: inline !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

body.tj-os-page .tj218-hero-system-labels > span > i {
  font-style: normal;
  font-weight: 650;
}

/* Trust cards: the three headings and the three explanations share two rows. */
body.tj-os-page .tj-os-trust {
  align-items: stretch;
}

body.tj-os-page .tj-os-trust > span {
  grid-template-rows: minmax(1.45em, auto) 1fr;
  align-content: start;
  align-items: start;
  height: 100%;
}

body.tj-os-page .tj-os-trust > span > b {
  display: flex;
  min-height: 1.45em;
  align-items: flex-start;
  margin: 0;
  line-height: 1.35;
}

/* Demo cases: reserve the same heading and definition rows across all cards. */
body.tj-os-page .tj218-case-grid {
  align-items: stretch;
}

body.tj-os-page .tj218-case-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

body.tj-os-page .tj218-case-copy {
  display: grid;
  grid-template-rows: auto minmax(2.35em, auto) 1fr;
  align-content: start;
  height: 100%;
}

body.tj-os-page .tj218-case-copy > small {
  display: block;
  min-height: 1.35em;
}

body.tj-os-page .tj218-case-copy h3 {
  display: flex;
  min-height: 2.35em;
  align-items: flex-start;
}

body.tj-os-page .tj218-case-copy dl {
  grid-template-rows: repeat(3, minmax(3.1em, auto));
  align-content: start;
}

/* Status and operator rows are single-purpose messages, so their optical
   center is the content axis on both desktop and mobile. */
body.tj-os-page .siteos-status-row > p#flowToast {
  align-items: center;
  justify-content: center;
  text-align: center;
}

body.tj-os-page .integration-drawer summary {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

body.tj-os-page .integration-drawer .drawer-body {
  justify-items: center;
}

body.tj-os-page .integration-drawer pre {
  width: 100%;
  text-align: center;
}

body.tj-os-page .integration-drawer .drawer-actions {
  width: 100%;
  justify-content: center;
}

/* Two additional repeated-card groups contained one shorter title row. Keep
   subsequent copy on the same baseline without centering the copy itself. */
@media (min-width: 781px) {
  body.tj-os-page .usage-guide-grid > article {
    grid-template-rows: minmax(35px, auto) 1fr;
    align-content: start;
  }

  body.tj-os-page .pay-desk-grid > article {
    display: grid;
    grid-template-rows: auto minmax(3.3em, auto) 1fr;
    align-content: start;
  }

  body.tj-os-page .pay-desk-grid > article > h3 {
    min-height: 3.3em;
  }
}

@media (max-width: 760px) {
  body.tj-os-page .tj-os-primary-nav {
    align-items: stretch !important;
  }

  body.tj-os-page .tj-os-primary-nav a {
    display: grid !important;
    grid-template-rows: minmax(1.35em, auto) minmax(2.5em, auto);
    align-content: center !important;
    align-self: stretch !important;
    justify-items: center !important;
    min-height: 64px !important;
  }

  body.tj-os-page .tj-os-primary-nav a:first-child {
    padding-inline: 9px !important;
  }

  body.tj-os-page .tj-os-primary-nav .tj-nav-title,
  body.tj-os-page .tj-os-primary-nav .tj-nav-subtitle {
    align-self: start !important;
  }

  body.tj-os-page .tj218-hero-system-labels > span {
    white-space: normal;
  }

  body.tj-os-page .tj218-case-copy {
    grid-template-rows: auto auto 1fr;
  }

  body.tj-os-page .tj218-case-copy h3 {
    min-height: 0;
  }

  body.tj-os-page .tj218-case-copy dl {
    grid-template-rows: none;
  }

  body.tj-os-page .usage-guide-grid > article,
  body.tj-os-page .pay-desk-grid > article {
    grid-template-rows: none;
  }

  body.tj-os-page .pay-desk-grid > article > h3 {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.tj-os-page .tj-os-primary-nav a {
    transition: none !important;
  }
}
