/* Page-specific media and icon sizing. Typography, cards, buttons and colors
   use the same shared theme classes as the Writings and About pages. */
.library-index,
.example-page {
  --link-color: var(--text-color);
  --bs-link-color: var(--text-color);
  --bs-link-hover-color: var(--signal);
}

.library-index a:hover,
.example-page a:hover {
  color: var(--signal);
}

.library-index a:focus-visible,
.example-page a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

.example-page .btn-brand:hover {
  background: var(--card-bg);
  border-color: var(--signal);
}

.library-name {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  max-width: 100%;
  vertical-align: middle;
}

.library-name > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.library-icon {
  flex: 0 0 auto;
  width: 1.5em;
  height: 1.5em;
  object-fit: contain;
}

.library-source {
  margin-left: 0.5em;
  font-size: 0.85em;
  color: var(--text-muted-color);
  vertical-align: middle;
}

.library-source:hover,
.library-source:focus-visible {
  color: var(--signal);
}

.library-section {
  padding: 1.5rem 0;
  scroll-margin-top: 6rem;
}

.atelier-components {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.atelier-component {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.component-icon {
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
}

.example-card .thumb {
  display: block;
  height: auto;
  aspect-ratio: 3 / 2;
  margin: 0;
}

.wcard .photo-thumb {
  padding: 0;
}

.wcard .photo-thumb img {
  object-fit: cover;
}

.photo-credit {
  margin: 0;
  padding: 0.5rem 1.2rem;
  font-size: 0.65rem;
  line-height: 1.5;
  color: var(--text-muted-color);
}

.simulation-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.sketch-preview {
  position: relative;
}

.sketch-preview .sketch {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.example-card:hover .sketch-preview .sketch,
.example-card:focus-within .sketch-preview .sketch {
  opacity: 0;
}

.simulation-preview video:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.example-cover {
  margin: 1.5rem 0 2rem;
}

.example-cover img,
.example-cover video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 520px;
  margin: 0 auto;
  border-radius: 0.75rem;
  object-fit: contain;
}

.example-cover figcaption,
.example-material figcaption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.example-page {
  counter-reset: figure;
}

.example-cover figcaption::before,
.example-material figcaption::before {
  counter-increment: figure;
  content: "Figure " counter(figure) ". ";
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 600;
}

.example-material {
  margin: 1.5rem 0;
}

.example-material > img {
  display: block;
  max-width: 100%;
  max-height: 760px;
  height: auto;
  margin: auto;
}

.example-material > video {
  height: auto;
  max-height: 640px;
}
