/* =========================================================================
   Page — public pricing (U-702)
   -------------------------------------------------------------------------
   {en,de}/pricing.html only. Everything this page shares with the other public
   pages is already a component and is linked, not copied: the compact hero and
   the page frame come from pages/marketing.css, the cards from
   components/card.css, the comparison table from components/table.css, the
   four view states from components/state.css.

   What is left here is genuinely page-level: the shape of a tier card, the
   price typography, and the comparison table's two column roles.

   No literal colour. Every value comes from tokens.css (audit rule D-1), and
   nothing here sets `display` on a class that is ever hidden with the `hidden`
   attribute (L-FE-11).

   THE CARD GRID FOLLOWS THE COUNT THE CATALOGUE RETURNS. Three, four and
   five cards each have their rule (below), so none of them closes on a lone
   tile; any other count keeps the auto-fit, which can (six as 5+1) — a
   rule for it is a few lines the day the catalogue has one.
   ========================================================================= */

/* ---- The tier cards (U-2280, redesign R8d) ------------------------------ *
 * The canvas's values, confirmed by the redesign session (2026-12-03): 8 px
 * between the cards, each 20 px inside, radius 6, 12 px between its parts.
 *
 * Three cards are `.grid-auto`'s 3 or 1 (marketing.css, U-1954). Four are the
 * public 4 / 2+2 / 1. Five — today's catalogue — stand five across from
 * 1200 px, three and two from 768 px (the second row's two as wide as the
 * first row's three, left-aligned, not stretched), one below; below 1200 px
 * five never stand side by side, a card's name and its badge would break.
 * Any other count keeps the auto-fit at 240 px.
 * ------------------------------------------------------------------------- */

/* The gap at the public frame's weight, so it outranks `.grid-auto`'s there. */
:is(.marketing-page, .splash-page) .pricing-grid {
  gap: 8px;
}

.pricing-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  align-items: stretch;
}

.pricing-grid:has(> :nth-child(5):last-child),
.pricing-grid:has(> :nth-child(4):last-child) {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .pricing-grid:has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .pricing-grid:has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 768px) {
  .pricing-grid:has(> :nth-child(5):last-child) {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .pricing-grid:has(> :nth-child(5):last-child) {
    grid-template-columns: repeat(5, 1fr);
  }
}

:is(.marketing-page, .splash-page) .pricing-card {
  padding: 20px;
  gap: 12px;
}

/* The default tier: the card is outlined, as its column is tinted. The badge
   beside its name carries the meaning (E-4). */
:is(.marketing-page, .splash-page) .pricing-card.is-default {
  border-color: var(--border-selected);
}

.pricing-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 24px;
}

.pricing-name {
  margin: 0;
  font-size: var(--text-title-lg);
  line-height: var(--text-title-lg-lh);
  overflow-wrap: anywhere;
}

/* ---- Price --------------------------------------------------------------- */

.pricing-price {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pricing-amount {
  margin: 0;
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
  /* A long currency, a long amount and a narrow card meet here. Breaking is
     better than a card that pushes the page sideways (audit rule H-5). */
  overflow-wrap: anywhere;
}

/* "Price on request" is a sentence, not a number, and set at a number's size
   it reads as a headline the tier does not have. */
.pricing-amount-text {
  font-size: 20px;
  line-height: 28px;
}

.pricing-period,
.pricing-onboarding,
.pricing-note {
  margin: 0;
  font-size: var(--text-caption);
  line-height: var(--text-caption-lh);
  color: var(--doc-ink-soft);
}

.pricing-trial {
  margin: 0;
  font-size: var(--text-caption);
  line-height: var(--text-caption-lh);
  font-weight: 600;
  color: var(--sd-success);
}

/* The description takes what space is left, so the key features and the
   button line up across a row of cards. */
.pricing-description {
  flex: 1;
  margin: 0;
  font-size: var(--text-body);
  line-height: var(--text-body-lh);
  color: var(--doc-ink-soft);
}

/* ---- The key features ---------------------------------------------------- *
 * The first three included items in the catalogue's order, worded as the
 * table's cells (the head session, 2026-12-03). A line above them.
 * ------------------------------------------------------------------------- */

.pricing-keys {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 12px 0 0;
  border-top: var(--border-w) solid var(--doc-line);
  list-style: none;
}

.pricing-keys li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: var(--text-caption);
  line-height: var(--text-caption-lh);
}

.pricing-keys .pricing-mark {
  font-size: var(--text-caption);
}

.pricing-key-quantity {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* The action sits at the bottom of every card. */
.pricing-action {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pricing-action .btn {
  width: 100%;
}

/* ---- A string the catalogue has not been given ---------------------------- *
 * A missing translation is a content gap and is shown as one. Italic and the
 * muted ink mark it as our text rather than the catalogue's; the word itself
 * carries the meaning, so nothing rests on the colour (audit rule E-4).
 * ------------------------------------------------------------------------- */

.pricing-untranslated {
  font-style: italic;
  font-weight: 400;
  color: var(--doc-ink-soft);
}

/* ---- The comparison table ------------------------------------------------ */

/* Data columns are equal and narrow; the capability column takes the rest. */
.pricing-table {
  table-layout: auto;
}

/* NO ROW HOVER TINT, and it is a contrast fix rather than a taste one.
   `components/table.css` tints a hovered row with --sd-row-hover (#E9E9E9 in
   light), which exists so the eye can track across a wide row of a long list.
   This table is four rows of three columns; nobody is tracking. What the tint
   costs is measurable: --sd-success on --doc-panel is 4.73:1, and on the
   hovered row it is **3.90:1** — under AA, on the one glyph that carries the
   answer, in the state a pointer is in whenever somebody is reading a cell.

   Found by the code-review gate, which measured the HOVER state. The page's
   own harness had measured only the resting one and reported all-green — the
   surface a token sits on is not one surface (L-FE-17), and an interaction
   state is one of the ones it is not.

   Removing the tint is the fix rather than re-inking the mark, because it
   makes the measured claim true instead of caveated: every cell on this table
   sits on --doc-panel, which is the surface the ratios above were taken
   against. */
.pricing-table tbody tr:hover {
  background: var(--doc-panel);
}

.pricing-th-capability {
  width: 30%;
  min-width: 200px;
}

/* The redesign's table (U-2280): cells centred, the row's label left. */
.pricing-table th,
.pricing-table td {
  text-align: center;
  vertical-align: top;
}

.pricing-table .pricing-th-capability,
.pricing-table .pricing-th-row {
  text-align: left;
}

/* The default tier's column, as its card is outlined. */
.pricing-table .is-default {
  background: var(--tier-default-tint);
}

/* A row header is a label, not a heading. `.table thead th` was upper-cased and
   letter-spaced until ADR-0167 and is not any more; the override stays harmless
   until U-2276 (R7) tidies the page stylesheets. */
.pricing-th-row {
  font-weight: 600;
  color: var(--doc-ink);
  text-transform: none;
  letter-spacing: normal;
}

.pricing-row-name {
  display: block;
}

.pricing-row-desc {
  display: block;
  margin-top: 2px;
  font-size: var(--text-caption);
  line-height: var(--text-caption-lh);
  font-weight: 400;
  color: var(--doc-ink-soft);
}

.pricing-cell {
  white-space: nowrap;
}

/* A quota limit is a figure a visitor compares across three tiers, which is
   the whole reason this table exists (DESIGN_TOKENS.md §9.5). The property goes
   on the component rule rather than on a table class: the number is rendered
   into a span that already has a name, and `.figure-col` would right-align a
   cell that also carries a unit word. */
.pricing-quantity {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* The two marks differ in GLYPH, not only in colour — a check and a dash are
   distinguishable in greyscale and to anyone who does not see the difference
   between green and grey (audit rule E-4). Each is `aria-hidden` and paired
   with a `.visually-hidden` label, so the cell is never announced as an empty
   one either. */
.pricing-mark {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.pricing-mark-yes {
  color: var(--sd-success);
}

/* NOT --sd-muted, and the number is the reason: #A8A8A8 on --doc-panel
   measures 2.38:1 in the light theme and 4.02:1 in the dark one. This glyph is
   16 px and bold, which is not "large text" (that starts at 18.66 px bold), so
   it needs 4.5:1 and fails both. It is the obvious token for "de-emphasised",
   and it is wrong for anything that is text.

   --doc-ink-soft measures 6.73:1 light and 6.17:1 dark on the same surface. A
   dash that says "not included" is information, so it is set at the same
   strength as the rest of the row rather than greyed toward invisibility. */
.pricing-mark-no {
  color: var(--doc-ink-soft);
}

/* ---- Notes under the table ------------------------------------------------ */

.pricing-meta {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pricing-meta-note {
  margin: 0;
  font-size: 13px;
  color: var(--doc-ink-soft);
}

/* ---- The no-JavaScript fallback ------------------------------------------- *
 * Plain markup that pricing.js replaces, not `<noscript>`: the common failure
 * is scripting enabled and the module never arriving, which `<noscript>` does
 * not cover (L-FE-10). It is styled as ordinary content, because for a visitor
 * without JavaScript it IS the content of this region — not an error.
 * ------------------------------------------------------------------------- */

.pricing-fallback p,
p.pricing-fallback {
  margin: 0 0 14px;
}

.pricing-fallback .cta-actions {
  margin-top: 20px;
}
