/* Homepage record photo: thumbnail and accessible full-size viewer. */
.record-photo {
  width: min(320px, 100%);
  margin: 20px 0 24px;
}

.record-photo-link {
  display: block;
  border-radius: var(--radius);
  cursor: zoom-in;
}

.record-photo-link img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.record-photo figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--fs-small);
}

.record-photo-link:focus-visible,
.record-photo-close:focus-visible {
  outline: 3px solid var(--accent2);
  outline-offset: 4px;
}

html.record-photo-open {
  overflow: hidden;
}

.record-photo-dialog {
  width: min(941px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.record-photo-dialog::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.record-photo-dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.record-photo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.record-photo-title {
  margin: 0;
  font-size: var(--fs-small);
  line-height: 1.4;
}

.record-photo-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.record-photo-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.record-photo-full {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
  margin-inline: auto;
  object-fit: contain;
  flex: 0 1 auto;
  min-height: 0;
}
