/* AEYA comparison table, "the difference". Styles for snippets/aeya-comparison.liquid.

   Brand rules held here:
     - Everything left aligned, including the numeric looking columns.
     - Heading uppercase with eyebrow tracking, small, quiet.
     - Ground is the warm cloud wash, ink is navy. No pure white, no pure black.
     - The own brand column carries the sky wash across its whole height, so the
       emphasis is a surface, not a colour on the type.
     - Cell state is glyph plus screen reader text. Colour is never the signal,
       so the table survives greyscale printing and colour vision deficiency.
     - Interactive targets are 44px minimum with a visible focus ring.
   Mobile first: the table scrolls sideways in its own container below the
   first breakpoint, with the attribute column pinned. */

.aeya-cmp {
  font-family: var(--aeya-font);
  color: var(--aeya-ink);
  text-align: left;
  margin-block: var(--aeya-space-2xl, 1.5rem);
}

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

/* Screen reader only. Namespaced so the snippet is self contained and does not
   depend on a utility from another stylesheet surviving a theme change. */
.aeya-cmp__sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Heading and info note ---------- */

.aeya-cmp__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--aeya-space-2xs, 0.25rem);
  margin-block-end: var(--aeya-space-md, 0.8rem);
}

.aeya-cmp__heading {
  font-size: var(--aeya-size-2xs, 0.75rem);
  font-weight: var(--aeya-weight-subheading, 500);
  text-transform: uppercase;
  letter-spacing: var(--aeya-tracking-eyebrow, 0.13em);
  line-height: var(--aeya-leading-heading, 1.15);
  margin: 0;
}

/* The disclosure. details and summary means the note opens with no JavaScript. */
.aeya-cmp__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 44px;
  min-block-size: 44px;
  cursor: pointer;
  list-style: none;
  color: var(--aeya-ink);
}

.aeya-cmp__toggle::-webkit-details-marker {
  display: none;
}

.aeya-cmp__toggle:focus-visible {
  outline: var(--aeya-border-w-emphasis, 2px) solid var(--aeya-navy);
  outline-offset: 2px;
}

.aeya-cmp__toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  border: var(--aeya-border-w, 1px) solid var(--aeya-ink);
  border-radius: var(--aeya-radius-pill, 40px);
  font-size: var(--aeya-size-3xs, 0.625rem);
  font-style: italic;
  line-height: 1;
  opacity: 0.7;
}

.aeya-cmp__note[open] .aeya-cmp__toggle-icon {
  background: var(--aeya-navy);
  color: var(--aeya-ink-inverse);
  border-color: var(--aeya-navy);
  opacity: 1;
}

/* Left aligned under the heading, so it reads as a footnote to the heading and
   never shifts the table when it opens. */
.aeya-cmp__note-body {
  position: absolute;
  inset-block-start: 100%;
  inset-inline-start: 0;
  z-index: 2;
  inline-size: min(100%, var(--aeya-measure-body-narrow, 22.75em));
  margin: 0;
  padding: var(--aeya-space-md, 0.8rem);
  background: var(--aeya-bg, #fffbf4);
  border: var(--aeya-border-w, 1px) solid var(--aeya-border);
  border-radius: var(--aeya-radius-card, 4px);
  font-size: var(--aeya-size-2xs, 0.75rem);
  line-height: var(--aeya-leading-body, 1.6);
  text-align: left;
}

/* ---------- Scroll container ---------- */

.aeya-cmp__scroll {
  overflow-x: auto;
  background: var(--aeya-bg);
  border: var(--aeya-border-w, 1px) solid var(--aeya-border);
  border-radius: var(--aeya-radius-card, 4px);
  scrollbar-width: thin;
}

.aeya-cmp__scroll:focus-visible {
  outline: var(--aeya-border-w-emphasis, 2px) solid var(--aeya-navy);
  outline-offset: 2px;
}

/* ---------- Table ---------- */

.aeya-cmp__table {
  inline-size: 100%;
  min-inline-size: 30rem;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: var(--aeya-size-2xs, 0.75rem);
}

.aeya-cmp__table th,
.aeya-cmp__table td {
  text-align: left;
  vertical-align: middle;
  padding: var(--aeya-space-sm, 0.7rem) var(--aeya-space-md, 0.8rem);
  border-block-end: var(--aeya-border-w, 1px) solid var(--aeya-border);
}

.aeya-cmp__table tbody tr:last-child th,
.aeya-cmp__table tbody tr:last-child td {
  border-block-end: 0;
}

/* Column headers: the brand names. */
.aeya-cmp__colhead {
  font-size: var(--aeya-size-3xs, 0.625rem);
  font-weight: var(--aeya-weight-subheading, 500);
  text-transform: uppercase;
  letter-spacing: var(--aeya-tracking-eyebrow, 0.13em);
  white-space: nowrap;
  opacity: 0.75;
}

.aeya-cmp__colhead--own {
  opacity: 1;
  font-weight: var(--aeya-weight-heading, 700);
}

/* The attribute column, pinned so the row label stays readable while the brand
   columns scroll under it. */
.aeya-cmp__corner,
.aeya-cmp__rowlabel {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  min-inline-size: 9rem;
  background: var(--aeya-bg);
  border-inline-end: var(--aeya-border-w, 1px) solid var(--aeya-border);
  font-size: var(--aeya-size-3xs, 0.625rem);
  font-weight: var(--aeya-weight-subheading, 500);
  text-transform: uppercase;
  letter-spacing: var(--aeya-tracking-eyebrow, 0.13em);
  line-height: var(--aeya-leading-heading, 1.15);
}

/* The own brand column: a wash running the full height of the column. */
.aeya-cmp__colhead--own,
.aeya-cmp__cell--own {
  background: var(--aeya-sky);
}

/* ---------- Cell states ---------- */

.aeya-cmp__mark {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-block-size: 1.25rem;
  line-height: 1;
  color: var(--aeya-ink);
}

.aeya-cmp__glyph {
  font-size: var(--aeya-size-md, 1rem);
  line-height: 1;
}

/* Each state is a different shape, at a different weight. Read in greyscale the
   three are still distinct, and every one carries its word for a screen reader. */
.aeya-cmp__mark--yes .aeya-cmp__glyph {
  font-weight: var(--aeya-weight-heading, 700);
}

.aeya-cmp__mark--no .aeya-cmp__glyph {
  font-size: var(--aeya-size-sm, 0.875rem);
  opacity: 0.45;
}

.aeya-cmp__mark--partial .aeya-cmp__glyph {
  font-size: var(--aeya-size-sm, 0.875rem);
  opacity: 0.75;
}

.aeya-cmp__mark--blank .aeya-cmp__glyph {
  font-size: var(--aeya-size-sm, 0.875rem);
  opacity: 0.3;
}

/* Free text cells, for a figure or a short phrase. */
.aeya-cmp__text {
  font-size: var(--aeya-size-2xs, 0.75rem);
  letter-spacing: var(--aeya-tracking-micro, 0.06em);
  line-height: var(--aeya-leading-body, 1.6);
}

/* ---------- Above the fold of a tablet ---------- */

@media screen and (min-width: 750px) {
  .aeya-cmp__table {
    font-size: var(--aeya-size-xs, 0.8125rem);
  }

  .aeya-cmp__table th,
  .aeya-cmp__table td {
    padding: var(--aeya-space-md, 0.8rem) var(--aeya-space-xl, 1.25rem);
  }

  .aeya-cmp__corner,
  .aeya-cmp__rowlabel {
    min-inline-size: 12rem;
    font-size: var(--aeya-size-2xs, 0.75rem);
  }

  .aeya-cmp__colhead {
    font-size: var(--aeya-size-2xs, 0.75rem);
  }

  .aeya-cmp__text {
    font-size: var(--aeya-size-xs, 0.8125rem);
  }
}
