/*
 * Global application styles: page frame, type roles and a few layout helpers.
 * Component-specific styles live in the scoped *.razor.css files next to the components.
 * Only tokens from ace-tokens.css are used here.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
}

/* ---------- Focus ---------- */

:focus-visible {
  outline: 2px solid var(--ace-blue);
  outline-offset: 2px;
}

.ace-on-navy :focus-visible {
  outline-color: var(--ace-orange-soft);
}

h1:focus {
  outline: none;
}

/* ---------- Page frame ---------- */

.ace-page {
  padding: 2rem var(--ace-page-pad) 3rem;
  max-width: 96rem;
}

.ace-page > * + * {
  margin-top: var(--ace-section-gap);
}

.ace-footer {
  padding: 1rem var(--ace-page-pad) 1.5rem;
  color: var(--ace-muted);
  font-size: .8125rem;
}

@media (max-width: 1100px) {
  :root {
    --ace-page-pad: 2rem;
  }
}

@media (max-width: 640px) {
  :root {
    --ace-page-pad: 1rem;
  }
}

/* ---------- Type roles ---------- */

.ace-eyebrow {
  margin: 0;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ace-orange-text);
}

.ace-page-title {
  margin: .25rem 0 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ace-navy);
}

.ace-hero-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ace-page);
}

.ace-lead {
  margin: 0;
  font-size: 1.25rem;
  color: var(--ace-blue-pale);
}

.ace-panel-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ace-navy);
}

.ace-subheading {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ace-blue);
}

.ace-body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ace-ink);
}

.ace-label {
  margin: 0;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ace-muted);
}

.ace-caption {
  margin: 0;
  font-size: .8125rem;
  color: var(--ace-muted);
}

.ace-note {
  margin: 0;
  font-size: .875rem;
  font-style: italic;
  color: var(--ace-muted-2);
}

.ace-value {
  color: var(--ace-navy);
}

.ace-value--accent {
  color: var(--ace-orange-text);
  font-weight: 700;
}

.ace-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .8125rem;
  color: var(--ace-navy);
}

/* ---------- Layout helpers ---------- */

/* Cards in a grid: equal columns, the standard gap between cards. */
.ace-grid {
  display: grid;
  gap: var(--ace-gap);
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

.ace-grid--narrow {
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}

.ace-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr));
}

.ace-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ace-gap);
}

.ace-stack {
  display: flex;
  flex-direction: column;
  gap: var(--ace-gap);
}

.ace-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ace-gap);
}

.ace-toolbar__spacer {
  flex: 1 1 auto;
}

/* A navy surface inside a page, used to demonstrate elements that sit on navy. */
.ace-on-navy {
  background: var(--ace-navy);
  color: var(--ace-page);
  border-radius: var(--ace-radius);
  padding: 1rem 1.25rem;
}

/* ---------- Blazor reconnect / error banner ---------- */

#blazor-error-ui {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1000;
  padding: .75rem 1.25rem;
  background: var(--ace-navy);
  color: var(--ace-page);
}

#blazor-error-ui .reload {
  color: var(--ace-orange-soft);
  font-weight: 700;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  float: right;
}

/* ---------- Static table ----------
 * For small, fixed tables written as plain markup. Data that is sorted, filtered or paged
 * goes into a RadzenDataGrid, which the Radzen mapping styles the same way.
 */

.ace-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--ace-surface);
  border-radius: 3px;
  font-size: 1rem;
  color: var(--ace-ink);
}

.ace-table th,
.ace-table td {
  border: 1px solid var(--ace-line-strong);
  padding: .375rem .5rem;
  text-align: left;
  vertical-align: top;
}

.ace-table thead th {
  background: var(--ace-navy);
  border-color: var(--ace-navy-deep);
  color: var(--ace-page);
  font-weight: 700;
}

/* Header of the key column. */
.ace-table thead th.ace-table__key {
  color: var(--ace-orange-soft);
}

.ace-table tbody tr:nth-child(even) td {
  background: var(--ace-blue-wash);
}

/* A table that stands on the page background rather than inside a white stage. */
.ace-table--card {
  box-shadow: var(--ace-shadow);
}
