/* Reset, accessibility floor, and the photo placeholder frame.
   Design-independent — copy this file unchanged into a new project. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 8px 14px; background: var(--surface); border: 1px solid var(--accent);
}
.skip:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Photo frame — always reserves space so layout is final before images arrive. */
.photo {
  position: relative; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r);
}
.photo > img { width: 100%; height: 100%; object-fit: cover; }
/* Figures are evidence, not decoration: fit the whole thing inside the frame
   and letterbox the leftover space. `cover` would crop axis labels and panels
   off the edges, which reads as the image spilling out of its card. */
.photo--fit > img { object-fit: contain; object-position: center; padding: 8px; }

.photo--portrait { aspect-ratio: 3 / 4; }
.photo--portrait > img { object-position: center 20%; }
.photo--group { aspect-ratio: 16 / 9; }
.photo--group > img { object-position: center 30%; }
.photo--wide { aspect-ratio: 4 / 3; }
.photo--square { aspect-ratio: 1 / 1; }

.photo:not(:has(img))::before {
  content: ''; position: absolute; inset: 0;
  background-repeat: no-repeat; background-position: center 45%; background-size: min(42%, 180px) auto;
  opacity: .3;
}
.photo--portrait:not(:has(img))::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23000'%3E%3Ccircle cx='32' cy='22' r='13'/%3E%3Cpath d='M6 64c0-16 12-25 26-25s26 9 26 25z'/%3E%3C/g%3E%3C/svg%3E");
}
.photo--group:not(:has(img))::before,
.photo--square:not(:has(img))::before {
  background-size: min(54%, 260px) auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 48'%3E%3Cg fill='%23000'%3E%3Ccircle cx='20' cy='14' r='9'/%3E%3Cpath d='M2 48c0-11 8-17 18-17s18 6 18 17z'/%3E%3Ccircle cx='60' cy='11' r='10'/%3E%3Cpath d='M40 48c0-12 9-19 20-19s20 7 20 19z'/%3E%3Ccircle cx='100' cy='14' r='9'/%3E%3Cpath d='M82 48c0-11 8-17 18-17s18 6 18 17z'/%3E%3C/g%3E%3C/svg%3E");
}
.photo:not(:has(img))::after {
  content: attr(data-label);
  position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* Figures and loose photos get a neutral frame glyph, not a row of people. */
.photo--wide:not(:has(img))::before {
  background-size: min(34%, 150px) auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 48'%3E%3Cg fill='none' stroke='%23000' stroke-width='3'%3E%3Crect x='2' y='2' width='60' height='44'/%3E%3Cpath d='M2 36l16-14 12 10 10-8 22 16'/%3E%3C/g%3E%3Ccircle cx='20' cy='14' r='5' fill='%23000'/%3E%3C/svg%3E");
}
