/* Home layout; load after site.css */

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  letter-spacing: var(--letter-spacing);
  line-height: 1.6;
  margin: 0 auto;
  max-width: 60em;
  padding-left: 30px;
  padding-right: 30px;
}

main {
  padding-bottom: 3rem;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 2;
  margin: 1em 0 0;
}

img {
  max-width: 100%;
}

h1.title {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

h1.title:has(.title-logo) {
  line-height: 1;
  padding-top: clamp(2.5rem, 8vw, 5rem);
}

.title-logo {
  display: block;
  height: auto;
  max-width: min(240px, 100%);
  width: auto;
}

button {
  overflow: visible;
}

.canvas {
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: -1;
}

.full-width-image,
.full-width-video,
.no-control-video {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 1em;
  margin-top: 1em;
  width: 100%;
}

.full-width-video video {
  width: 100%;
  height: auto;
}

.no-control-video video {
  width: 100%;
  height: auto;
  pointer-events: none;
}

.caption {
  align-self: flex-start;
  font-size: 12px;
  font-style: italic;
  margin-top: 1em;
}

.image-fullview-trigger {
  background: none;
  border: 0;
  cursor: zoom-in;
  display: block;
  font: inherit;
  margin: 0;
  padding: 0;
  width: 100%;
}

.image-fullview-trigger:focus-visible {
  outline: 2px solid var(--color-link-active);
  outline-offset: 4px;
}

.image-fullview-trigger .image {
  vertical-align: middle;
}

/* Only lay out when open — a bare `display: flex` overrides UA `display: none` on closed <dialog>. */
.image-fullview-dialog {
  background: transparent;
  border: none;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.image-fullview-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 100vh;
  max-width: 100vw;
  overflow: hidden;
  position: relative;
  width: 100vw;
  height: 100vh;
}

.image-fullview-hitarea {
  cursor: pointer;
  inset: 0;
  position: absolute;
  z-index: 0;
}

.image-fullview-dialog::backdrop {
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.image-fullview-dialog img {
  box-sizing: border-box;
  display: block;
  max-height: 100vh;
  max-width: 100vw;
  height: auto;
  width: auto;
  object-fit: contain;
  padding: 2.5rem 1rem 1rem;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.image-fullview-close {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.2rem 0.55rem;
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 2;
}

.image-fullview-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.image-fullview-close:focus-visible {
  outline: 2px solid var(--color-link-active);
  outline-offset: 2px;
}
