/* dealaria.pt on the A · Ledger language (condo-web docs/design-language.md):
   the landing page's header, bands, section titles, badge and footer, taken
   from condo-web's app.css, plus the product cards and the company details.
   Tokens only (tokens.css): no raw colour, length, radius, font or weight;
   a missing token is added to tokens.css. Layer order is declared by
   reset.css. */
@layer components {
  /* Base: the type, link colour and focus mark every page inherits. */
  body {
    display: flex;
    flex-direction: column;
    min-block-size: var(--size-viewport);
    font-family: var(--font-sans);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    color: var(--color-ink);
    background: var(--color-surface);
  }
  a {
    color: var(--color-accent);
    &:hover {
      color: var(--color-accent-hover);
    }
  }
  :focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
  }

  /* Header and footer, each over or under a hairline, padded as the top bar. */
  .landing-header, .landing-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--pad-page);
  }
  .landing-header {
    min-block-size: var(--size-header);
    border-block-end: var(--border-hairline);
  }
  /* The brand: the dealaria lockup; on a dark ground the white mark, then
     the word in ink, since the lockup's wordmark is ink-on-light. */
  .landing-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    color: var(--color-ink);
    font-size: var(--text-title);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-title);
    text-decoration: none;
    &:hover {
      color: var(--color-ink);
    }
    & img {
      display: block;
    }
  }
  .landing-brand-word {
    display: none;
  }
  @media (prefers-color-scheme: dark) {
    .landing-brand-word {
      display: inline;
    }
  }
  /* The language switch: the current language in ink, the other a link. */
  .landing-lang {
    display: flex;
    gap: var(--space-4);
    font-size: var(--text-meta);
    color: var(--color-ink-muted);
    & [aria-current] {
      color: var(--color-ink);
      font-weight: var(--weight-semibold);
      text-decoration: none;
    }
  }
  .landing-footer {
    border-block-start: var(--border-hairline);
    font-size: var(--text-meta);
    color: var(--color-ink-muted);
    justify-content: flex-start;
    gap: var(--space-4) var(--space-9);
  }

  /* Main: full width on the landing page, its hero and sections bands on
     alternating grounds that keep the --size-content column; a plain
     column on the other pages. */
  .landing-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
  }
  .landing-hero, .landing-section, .page {
    padding-block: var(--pad-band);
    padding-inline: max(var(--pad-page), calc((100% - var(--size-content)) / 2));
  }
  .landing-hero, .landing-band-warm {
    background: var(--color-landing-warm-soft);
  }
  .landing-band-cool {
    background: var(--color-landing-cool-soft);
  }
  .landing-hero {
    display: flex;
    flex-direction: column;
    gap: var(--space-7);
    & p {
      max-inline-size: var(--size-measure);
      font-size: var(--text-lead);
      color: var(--color-ink-muted);
    }
  }
  .landing-hero h1, .page h1 {
    font-size: var(--text-display);
    line-height: var(--leading-display);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-title);
  }
  .landing-section, .page {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    & h2 {
      font-size: var(--text-title);
      line-height: var(--leading-heading);
      font-weight: var(--weight-semibold);
      letter-spacing: var(--tracking-title);
    }
    & > p {
      max-inline-size: var(--size-measure);
    }
  }
  .page > h2 {
    margin-block-start: var(--space-9);
  }
  .page > p {
    color: var(--color-ink-muted);
  }
  /* A section title opens with a short warm rule. */
  .landing-section > h2::before, .page > h2::before {
    content: "";
    display: block;
    inline-size: var(--size-rule);
    block-size: var(--size-rule-weight);
    margin-block-end: var(--space-4);
    border-radius: var(--radius-mark);
    background: var(--color-landing-warm);
  }
  @media (width < 720px) {
    .landing-header, .landing-footer, .landing-hero, .landing-section, .page {
      padding-inline: var(--space-7);
    }
    .landing-hero, .landing-section, .page {
      padding-block: var(--space-10);
    }
  }

  /* Products: a grid of cards, one column on a phone; the live one spans
     the row and is a link, the coming ones are greyed out on the alt
     ground, unlinked, with the badge. */
  .products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(var(--size-feature), 100%), 1fr));
    gap: var(--space-7);
  }
  .product {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-9);
    border: var(--border-hairline);
    border-radius: var(--radius-dialog);
    background: var(--color-surface);
    color: var(--color-ink-muted);
    & h3 {
      color: var(--color-ink);
      font-size: var(--text-option);
      font-weight: var(--weight-semibold);
    }
    & p {
      max-inline-size: var(--size-measure);
    }
  }
  .products-wide {
    grid-column: 1 / -1;
  }
  .product-live {
    text-decoration: none;
    &:hover {
      border-color: var(--color-accent);
      color: var(--color-ink-muted);
    }
    & img {
      display: block;
    }
  }
  .product-link {
    color: var(--color-accent);
    font-weight: var(--weight-medium);
    text-decoration: underline;
  }
  .product[aria-disabled="true"] {
    background: var(--color-surface-alt);
    & h3 {
      color: var(--color-ink-muted);
    }
  }

  /* Badge: a short label, meta-sized at 500, in the landing's warm colour on
     its tint, --size-badge high. */
  .badge {
    display: inline-flex;
    align-items: center;
    min-block-size: var(--size-badge);
    padding: 0 var(--pad-badge);
    border-radius: var(--radius-tag);
    background: var(--color-landing-warm-soft);
    color: var(--color-landing-warm);
    font-size: var(--text-meta);
    font-weight: var(--weight-medium);
    white-space: nowrap;
  }

  /* Company details: label beside value, stacked on a phone; ids in mono. */
  .details {
    display: grid;
    grid-template-columns: minmax(0, var(--size-sidebar)) minmax(0, 1fr);
    gap: var(--space-4) var(--space-9);
    & dt {
      color: var(--color-ink-muted);
    }
  }
  @media (width < 720px) {
    .details {
      grid-template-columns: minmax(0, 1fr);
      gap: var(--space-1);
      & dd + dt {
        margin-block-start: var(--space-6);
      }
    }
  }
  .id {
    font-family: var(--font-mono);
    font-variant-numeric: var(--font-figures);
  }
}
