/* Cover image + full-screen magnifier. Shared by blog posts. */

.cover-zoom {
  margin: 0 0 28px;
}

.cover-zoom__open {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 0;
  cursor: zoom-in;
}

.cover-zoom__open img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(70vh, 640px);
  border: 1px solid var(--line, #d6d3cd);
}

.cover-zoom__glass {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper, #fffcf7);
  color: var(--accent, #0f3d4c);
  border: 1px solid var(--line, #d6d3cd);
  pointer-events: none;
}

.cover-zoom__glass svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cover-zoom__open:hover .cover-zoom__glass,
.cover-zoom__open:focus-visible .cover-zoom__glass {
  color: var(--ink, #1c1917);
}

.cover-zoom__open:focus-visible {
  outline: 1px solid var(--ink, #1c1917);
  outline-offset: 3px;
}

.cover-zoom__dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: rgba(12, 16, 18, 0.94);
  touch-action: none;
}

.cover-zoom__dialog[hidden] {
  display: none;
}

.cover-zoom__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: rgba(12, 16, 18, 0.55);
  color: #fffcf7;
  cursor: pointer;
}

.cover-zoom__close svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cover-zoom__close:hover,
.cover-zoom__close:focus-visible {
  color: #fff;
}

.cover-zoom__close:focus-visible {
  outline: 1px solid #fffcf7;
  outline-offset: 3px;
}

.cover-zoom__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 56px 40px 40px;
  box-sizing: border-box;
  touch-action: none;
  cursor: zoom-out;
}

.cover-zoom__full {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  cursor: default;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

html.cover-zoom-open,
body.cover-zoom-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .cover-zoom__stage {
    padding: 64px 16px 24px;
  }

  .cover-zoom__close {
    top: 8px;
    right: 8px;
  }
}
