/*
 * Styles for the static examples gallery (/examples/, /nl/voorbeelden/,
 * /de/vorlagen/).
 *
 * A real stylesheet rather than an inline <style> block because the CSP is
 * `style-src 'self'` — inline styles would need 'unsafe-inline', which is
 * exactly the concession the Clarity integration went out of its way to avoid.
 * Same reason there is no style="" attribute anywhere in the generated markup.
 *
 * Tokens mirror src/index.css. The gallery ships no JS and no webfont: it is
 * content, and it should paint before the app bundle would even have parsed.
 */

:root {
  --bg: #fafaf8;
  --panel: #ffffff;
  --panel-2: #f5f2ee;
  --border: #e8e4de;
  --text: #1a1a1a;
  --text-dim: #6b6b6b;
  --accent: #ff5c3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- header ---- */

.top {
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  max-width: 1080px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand img {
  width: 28px;
  height: 28px;
  display: block;
}

.langs {
  display: flex;
  gap: 6px;
}

.langs a {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
}

.langs a:hover {
  background: var(--panel-2);
  color: var(--text);
}

.langs a[aria-current='true'] {
  background: var(--accent);
  color: #fff;
}

/* ---- intro ---- */

h1 {
  margin: 40px 0 12px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.intro {
  margin: 0 0 8px;
  color: var(--text-dim);
  font-size: 16px;
}

/* ---- grid ---- */

.grid {
  display: grid;
  /* Two columns by default so a mosaic is big enough to judge — these are the
     product, and a 280px thumbnail of a 46,000-peg parrot shows nothing. Falls
     to one column below ~760px. */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 20px;
  margin: 32px 0 48px;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}

/* A uniform box per card, whatever the mosaic's own proportions. Examples run
   from 1×1 plates (square) to 3×2 (wide), and letting each image set its own
   height leaves the grid rows ragged with the captions at different heights.
   `contain` letterboxes instead of cropping — a build plan must not be shown
   with its edges cut off. */
.card__link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.card img {
  display: block;
  width: 100%;
  /* An explicit height, NOT aspect-ratio: the <img> carries width/height
     attributes (in pegs, for layout stability), and their intrinsic ratio wins
     over aspect-ratio here — which collapsed every thumbnail to peg size. */
  height: 340px;
  object-fit: contain;
  padding: 10px;
  /* NOT `pixelated`. Exports are ~1400px on the long side and get scaled DOWN
     into the card; nearest-neighbour resampling of the per-brick bevels lays a
     moiré lattice over the picture that looks like a fault in the mosaic. The
     export is already high enough resolution for smooth downscaling to keep
     the bricks crisp. */
  image-rendering: auto;
  background: var(--panel-2);
}

.card__body {
  padding: 12px 14px 14px;
}

.card__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 650;
}

.card__stats {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ---- call to action ---- */

.cta {
  margin: 0 0 56px;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  text-align: center;
}

.cta a {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
}

.cta a:hover {
  filter: brightness(1.07);
}

.cta p {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 13px;
}

/* ---- footer ---- */

.foot {
  border-top: 1px solid var(--border);
  padding: 18px 20px 40px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

.foot a {
  color: inherit;
}

@media (prefers-reduced-motion: no-preference) {
  .card {
    transition: border-color 0.15s ease;
  }
  .card:hover {
    border-color: var(--text-dim);
  }
}

/* ---- example detail page ---- */

.back {
  display: inline-block;
  margin-top: 28px;
  color: var(--text-dim);
  font-size: 14px;
  text-decoration: none;
}
.back:hover {
  color: var(--text);
}

.detail h1 {
  margin-top: 10px;
}

.detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr);
  gap: 28px;
  align-items: start;
  margin: 24px 0 40px;
}

.detail__shot {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-2);
}

.detail__shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.detail__side .intro {
  font-size: 15px;
}

.specs {
  display: grid;
  gap: 0;
  margin: 18px 0 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.spec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}
.spec:last-child {
  border-bottom: 0;
}

.spec dt {
  color: var(--text-dim);
  font-size: 13px;
}

.spec dd {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.dl {
  display: block;
  margin-bottom: 8px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}
.dl:hover {
  border-color: var(--text-dim);
}

.dl--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.dl--primary:hover {
  border-color: var(--accent);
  filter: brightness(1.07);
}

@media (max-width: 760px) {
  .detail__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
