/* Site: the public page layout (header, main, footer). Partial API: website/templates/components/site.html.
   Contract: docs/ui/CONVENTIONS.md. */
@layer components {
  .site {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: var(--color-bg);
  }
  /* Header and footer content share one centred column. */
  .site-bar {
    width: 100%;
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: var(--space-6);
  }
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    > .site-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: 64px; }
  }
  .site-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text);
    font-size: var(--text-md);
    font-weight: var(--weight-semibold);
    &:hover { text-decoration: none; }
    > img { object-fit: contain; }
  }
  /* The header logo and name are 1.5 times the footer's. */
  .site-header .site-logo { font-size: calc(var(--text-md) * 1.5); line-height: 1; }
  .site-actions { display: flex; align-items: center; gap: var(--space-2); }

  /* Reading width for long text, as on most legal and docs pages. */
  .site-main {
    flex: 1;
    width: 100%;
    max-width: calc(680px + 2 * var(--space-6));
    margin-inline: auto;
    padding: var(--space-12) var(--space-6) 0;
  }

  .site-footer {
    margin-top: 150px; /* the only space between the content and the footer */
    padding-block: var(--space-10) var(--space-8);
    background: #000;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: var(--line-sm);
    ul { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
    a:not(.site-logo) { color: var(--color-text-muted); &:hover { color: var(--color-text); } }
  }
  .site-footer-grid { display: grid; grid-template-columns: 3fr 1fr; gap: var(--space-8); }
  .site-footer-title {
    margin-bottom: var(--space-3);
    color: var(--color-text);
    font-size: var(--text-sm);
    line-height: var(--line-sm);
    font-weight: var(--weight-semibold);
  }
  .site-copyright { margin-top: var(--space-8); }

  @media (max-width: 640px) {
    .site-bar { padding-inline: var(--space-4); }
    .site-main { padding: var(--space-8) var(--space-4) 0; }
    .site-footer-grid { grid-template-columns: 1fr; }
  }
}
