html,
body.tesla-canvas-gallery {
  width: 100%;
  min-height: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: var(--page-bg, #fff);
  overscroll-behavior: none;
}

body.tesla-canvas-gallery {
  color: var(--surface-ink, #242424);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tesla-gallery-main,
#teslaGalleryCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tesla-gallery-main { background: var(--page-bg, #fff); }

#teslaGalleryCanvas {
  display: block;
  cursor: grab;
  touch-action: none;
  outline: 0;
}

#teslaGalleryCanvas.is-dragging { cursor: grabbing; }
#teslaGalleryCanvas:focus,
#teslaGalleryCanvas:focus-visible { outline: 0; }

body.tesla-canvas-gallery .asset-lightbox,
body.tesla-canvas-gallery .asset-lightbox:focus,
body.tesla-canvas-gallery .asset-lightbox:focus-visible { outline: 0; }

.tesla-gallery-footer {
  --gallery-footer-height: clamp(64px, 10vh, 94px);
  box-sizing: border-box;
  position: fixed;
  z-index: 20;
  inset: auto 0 0;
  height: var(--gallery-footer-height);
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  padding: 0 40px clamp(16px, 2.8vh, 26px);
  pointer-events: none;
  isolation: isolate;
}

.tesla-gallery-footer::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--page-bg, #fff) 0%, transparent) 0%,
    color-mix(in srgb, var(--page-bg, #fff) 60%, transparent) 38%,
    color-mix(in srgb, var(--page-bg, #fff) 94%, transparent) 76%,
    var(--page-bg, #fff) 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 29%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 29%);
}

.tesla-gallery-footer-content {
  grid-column: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-width: 0;
  pointer-events: auto;
}

.tesla-gallery-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--surface-ink, #232323);
  font-size: 15px;
  line-height: 1;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.tesla-gallery-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: #e82127;
}

.tesla-gallery-mark img { width: 16px; height: auto; filter: brightness(0) invert(1); }
.tesla-gallery-name { font-weight: 600; }
.tesla-gallery-meta { color: var(--surface-muted, #777); font-style: italic; font-weight: 500; }

.tesla-gallery-home {
  display: inline-flex;
  grid-column: auto;
  justify-self: start;
  align-items: center;
  gap: 6px;
  color: var(--surface-muted, #706c63);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  text-decoration: none;
}

.tesla-gallery-home:hover { color: var(--surface-ink, #242424); }
.tesla-gallery-home i { font-size: 15px; }

.tesla-gallery-title { grid-column: 2; }

.tesla-gallery-expanded-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: none;
  transform-origin: top left;
  will-change: transform;
}

.tesla-gallery-expanded-caption {
  margin-top: 12px;
  color: var(--surface-muted);
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 500;
  line-height: 1.45;
}

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

@media (max-width: 520px) {
  .tesla-gallery-footer { --gallery-footer-height: clamp(58px, 9vh, 82px); padding: 0 20px clamp(12px, 2vh, 18px); }
  .tesla-gallery-footer-content { grid-template-columns: 1fr auto 1fr; }
  .tesla-gallery-title { gap: 7px; font-size: 13px; }
  .tesla-gallery-mark { width: 24px; height: 24px; border-radius: 7px; }
  .tesla-gallery-home { font-size: 11px; }
}
