/* Rules every theme shares: resets, the image viewer, the contact-form
   honeypot, the skip link and the draft-preview flag. Themes style the rest. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, h4, p, figure, dl, dd, ul, ol, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
[hidden] { display: none !important; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 50; background: #fff; color: #141414; padding: 10px 14px; border-radius: 6px; font-weight: 600; }
.skip:focus { top: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.preload *, .preload *::before, .preload *::after { transition: none !important; }

.preview-flag {
  position: fixed; left: 50%; bottom: 14px; translate: -50% 0; z-index: 40;
  background: #141414; color: #fff; border: 1px solid #444; border-radius: 999px;
  padding: 8px 14px; font: 500 12px/1.2 system-ui, sans-serif; white-space: nowrap;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.25);
}

.sample-bar a { color: #fff; font-weight: 600; text-underline-offset: 3px; }
.sample-bar a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
@media (max-width: 420px) { .sample-bar > span:nth-of-type(2), .sample-bar > span:nth-of-type(3) { display: none; } }
body:has(.preview-flag) { padding-bottom: 64px; }

.made-with { font: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Image viewer, created by the script in each page. */
.lb { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgb(15 15 15 / 0.97); color: #fff; }
.lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.lb::backdrop { background: rgb(0 0 0 / 0.6); }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 14px clamp(16px, 3vw, 40px); font: 400 12px/1 var(--f-label, ui-monospace), monospace; letter-spacing: 0.08em; }
.lb-close { border: 1.5px solid #fff; background: transparent; color: #fff; border-radius: 999px; padding: 10px 16px; font: 500 14px/1 system-ui, sans-serif; cursor: pointer; }
.lb-close:hover { background: #fff; color: #141414; }
.lb figure { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 12px; padding: 0 clamp(16px, 5vw, 80px) 18px; }
.lb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; min-height: 0; background: #fff; }
.lb figcaption { font: 400 12px/1.5 var(--f-label, ui-monospace), monospace; color: #a6a6a6; text-align: center; max-width: 80ch; min-height: 1.5em; }
.lb-nav { position: absolute; top: 50%; translate: 0 -50%; border: 0; background: transparent; color: #fff; font: 400 28px/1 system-ui, sans-serif; padding: 18px 12px; cursor: pointer; }
.lb-nav:hover { background: rgb(255 255 255 / 0.12); }
.lb-prev { left: 4px; }
.lb-next { right: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
