/*
 * Docs site layout. Priorities: readability and accessibility first, then a calm, modern look.
 * Colours, buttons, panels, focus and reduced motion come from packages/theme/theme.css, which
 * is loaded first.
 */

:root {
  --measure: 70ch;
}

html {
  font-size: 112.5%; /* 18px, relative to the user's own browser font size */
  text-size-adjust: 100%;
}

body {
  line-height: 1.65;
}

/* Accessibility helpers */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

main:focus {
  outline: none;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner,
.site-footer-inner,
.page {
  max-width: 64rem;
  margin: 0 auto;
  padding-inline: 1.25rem;
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg);
  font-weight: 650;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-header nav a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--fg-muted);
  font-size: 0.92rem;
  font-weight: 550;
  text-decoration: none;
}

.site-header nav a:hover {
  background: var(--surface-2);
  color: var(--fg);
}

/* Content */

.page {
  padding-block: 2.5rem 4rem;
}

.page > :is(p, ul, ol, blockquote, pre, h1, h2, h3) {
  max-width: var(--measure);
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.45rem;
  margin: 2.6rem 0 0.8rem;
}

h3 {
  font-size: 1.12rem;
  margin: 0 0 0.4rem;
}

p,
li {
  text-wrap: pretty;
}

li + li {
  margin-top: 0.3rem;
}

code,
pre {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
}

code {
  background: var(--surface-2);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}

pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
}

blockquote {
  margin: 1.4rem 0;
  padding: 0.9rem 1.2rem;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
}

blockquote p {
  margin: 0.3rem 0;
}

.table-scroll {
  margin: 1.2rem 0;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--fg-muted);
  font-weight: 600;
}

/* Hero (front page) */

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem 2rem;
  align-items: center;
  margin: 0.5rem 0 1rem;
  padding: 2rem;
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(60rem 20rem at 0% 0%, var(--accent-soft), transparent 70%), var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin-bottom: 0.4rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--fg-muted);
  margin: 0 0 1.3rem;
  max-width: 60ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 40rem) {
  .hero {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .hero img {
    width: 72px;
    height: 72px;
  }
}

/* Gallery */

.gallery-entry {
  margin: 2rem 0 3rem;
  padding: 1.5rem;
}

.gallery-entry h3 {
  margin: 0;
  font-size: 1.25rem;
}

.gallery-subtitle {
  margin: 0.2rem 0 0;
  color: var(--fg-muted);
}

.shot-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
  margin: 1rem 0 1.2rem;
}

.shot-pair figure {
  margin: 0;
  flex: 1 1 16rem;
}

.shot-pair img {
  display: block;
  max-width: min(100%, 20rem);
  height: auto;
  margin-inline: auto;
}

.shot-pair figcaption {
  margin-top: 0.6rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
  font-weight: 550;
}

/* Contributor section, footer */

.dev-banner {
  max-width: var(--measure);
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.site-footer-inner {
  padding-block: 1.5rem 2rem;
  color: var(--fg-muted);
  font-size: 0.88rem;
}
