/* A1CMS shared table styles, one copy for every surface (the admin, the client area and the public pages), loaded
   before a1-sitewide.css; the behaviour is a1-table.js (Nov 7, 2026). */

/* Sortable tables (a1-table.js, table[data-a1-sortable]). */
table[data-a1-sort-ready] > thead > tr > th {
  vertical-align: top;
}

table[data-a1-sort-ready] > tbody > tr > td {
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}

.a1-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  min-width: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  white-space: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
}

.a1-sort-button:hover,
.a1-sort-button:focus-visible {
  color: var(--a1-purple-ink, #522f7a);
}

.a1-sort-button:focus-visible {
  outline: 2px solid var(--a1-lavender-deep, #a87fd6);
  outline-offset: 2px;
}

th[aria-sort="ascending"] > .a1-sort-button::after,
th[aria-sort="descending"] > .a1-sort-button::after {
  content: "\25B2";
  font-size: 0.7em;
  line-height: 1;
}

th[aria-sort="descending"] > .a1-sort-button::after {
  content: "\25BC";
}

table[data-a1-sort-ready] > tbody {
  transition: opacity 0.14s ease, transform 0.14s ease;
}

table[data-a1-sort-ready] > tbody.a1-sort-fading {
  opacity: 0;
  transform: translateY(3px);
}

@media (prefers-reduced-motion: reduce) {
  table[data-a1-sort-ready] > tbody,
  .a1-sort-button {
    transition: none;
  }
}

/* Tables: a column that holds written text is at least 26rem wide, and the table scrolls sideways
   instead of squeezing it. Every cell starts on the same line, so a tall cell never moves the others. */
th.wide {
  min-width: 26rem;
}

table:has(th.wide) > thead th:not(.wide),
table:has(th.wide) > tfoot :is(th, td) {
  white-space: nowrap;
}

table:has(th.wide) > tfoot th {
  min-width: 9rem;
}

/* The box a1-table.js puts round a table that had none: the table scrolls sideways inside it (Nov 4, 2026). */
.a1-scroll-x {
  max-width: 100%;
  overflow-x: auto;
}

/* A table or strip that scrolls sideways shows no bar; a soft fade at the edge that has more says it goes on
   (a1-table.js installEdgeFades sets the classes). */
.a1-fade-l {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32px);
  mask-image: linear-gradient(90deg, transparent 0, #000 32px);
}

.a1-fade-r {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent 100%);
}

.a1-fade-l.a1-fade-r {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
}

/* A column marked a1-pin-r (row actions) stays at the right edge of a table that scrolls sideways, so every row can be
   edited without scrolling across first. Its shadow shows that columns pass under it, so that edge has no fade. */
.a1-pin-r {
  position: sticky;
  right: 0;
  z-index: 2;
  box-shadow: -10px 0 12px -10px rgba(27, 42, 68, 0.22);
}
table td.a1-pin-r { background-color: var(--a1-surface, #fff); }
.a1-fade-r:has(> table .a1-pin-r) {
  -webkit-mask-image: none;
  mask-image: none;
}
.a1-fade-l.a1-fade-r:has(> table .a1-pin-r) {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32px);
  mask-image: linear-gradient(90deg, transparent 0, #000 32px);
}

/* A heading without a sort button (an actions column) sits on the same line as the sort buttons beside it. */
table:has(.a1-sort-button) > thead > tr > th { vertical-align: middle; }


/* The public table (.a1-table): the plan comparison, the industry packs and the cost tables on the marketing pages.
   A white table with lavender hairlines, a tinted heading row and tabular figures; the box round it scrolls sideways. */
.a1-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--a1-surface, #ffffff);
  color: var(--a1-ink, #24183a);
  font-size: var(--a1-table-font-size, 14.5px);
  font-variant-numeric: tabular-nums;
}

.a1-table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--a1-purple-ink, #551a7d);
  background: var(--a1-nav-surface, #e2dafa);
  border-bottom: 1px solid var(--a1-nav-edge, #bfaff0);
  white-space: nowrap;
}

.a1-table > tbody > tr > td {
  padding: 11px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--a1-border, #e6e0f1);
}

.a1-table > tbody > tr:last-child > td {
  border-bottom: 0;
}

.a1-table > tbody > tr:hover > td {
  background: var(--a1-surface-alt, #f3effd);
}

.a1-table .a1-table-center {
  text-align: center;
}

/* A plan's value is short ('$40 / user / month'), so it stays on one line; the box scrolls sideways when the plans do not fit. */
.a1-table > tbody > tr > td.a1-table-center {
  white-space: nowrap;
}

/* The first column names the row (a feature, an industry pack), so it keeps room for a short name on one or two lines. */
.a1-table > tbody > tr > td:first-child {
  min-width: 9rem;
}

/* A value in a plan column: a check (included), a cross (not included), or the words themselves. Never a chip. */
.a1-table .a1-yes,
.a1-table .a1-no,
.a1-table .a1-addon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.a1-table .a1-yes::before {
  content: "\2713";
  color: var(--a1-positive, #1f7a5c);
  font-size: 1.05em;
  line-height: 1;
}

.a1-table .a1-no {
  color: var(--a1-muted, #5d5574);
  font-weight: 500;
}

.a1-table .a1-no::before {
  content: "\00d7";
  font-size: 1.15em;
  line-height: 1;
}

.a1-table .a1-addon {
  color: var(--a1-gold-text, #725409);
}

.a1-table .a1-yes.a1-icon-only,
.a1-table .a1-no.a1-icon-only {
  font-size: 0;
}

.a1-table .a1-yes.a1-icon-only::before,
.a1-table .a1-no.a1-icon-only::before {
  font-size: 17px;
}

/* The box round a public table: a lavender hairline edge and a soft shadow, scrolling sideways with no bar. */
.a1-table-box {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--a1-section-edge, #c6b8ee);
  border-radius: 12px 4px;
  box-shadow: var(--a1-shadow-soft, 0 8px 20px rgba(36, 24, 58, 0.07));
  scrollbar-width: none;
}
