/* Before / after comparison: two images, a handle you drag (or move with the arrow keys). */
.compare {
  position: relative;
  overflow: hidden;
  border-radius: 0.2rem;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;  /* vertical swipes scroll the page; compare.js takes the sideways ones */
  cursor: ew-resize;
  line-height: 0;
  margin: 1em 0;
}
.compare > img,
.compare-after > img {
  display: block;
  width: 100%;
  height: auto;
}
.compare-after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 var(--compare-x, 50%));
}
.compare-after > img {
  height: 100%;
  object-fit: cover;
}
.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--compare-x, 50%);
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}
/* The knob: a small frosted disc with two crisp chevrons (an SVG, not font glyphs) */
.compare-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.5rem;
  height: 1.5rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 7.5 5 12l4.5 4.5M14.5 7.5 19 12l-4.5 4.5'/%3E%3C/svg%3E") center / 0.85rem no-repeat,
    rgba(20, 22, 26, 0.25);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  opacity: 0.75;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.compare:hover .compare-handle::after {
  transform: translate(-50%, -50%) scale(1.15);
  opacity: 1;
}
.compare:focus-within .compare-handle::after {
  opacity: 1;
}
.compare-label {
  position: absolute;
  top: 0.6rem;
  padding: 0.15rem 0.55rem;
  border-radius: 0.2rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: 500 0.7rem/1.6 var(--md-text-font-family, sans-serif);
  pointer-events: none;
  white-space: nowrap;
}
.compare-label--before { left: 0.6rem; }
.compare-label--after { right: 0.6rem; }
.compare > input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;  /* only for the keyboard: the box handles mouse and touch */
}
.compare:focus-within .compare-handle::after {
  border-color: var(--md-accent-fg-color, #ff6e40);
}

/* Several comparisons side by side on wide screens. */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 1rem 1.2rem;
  margin: 1em 0;
}
.compare-grid > figure {
  margin: 0;
}
/* Two up even in a narrow content column (the buy page, the drawn page); one up on phones */
.compare-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 40em) {
  .compare-grid.two-up {
    grid-template-columns: 1fr;
  }
}
.compare-grid .compare {
  margin: 0 0 0.4rem;
}
.compare-grid figcaption {
  font-size: 0.72rem;
  color: var(--md-default-fg-color--light);
  margin: 0;
  line-height: 1.4;
}

/* The buy button on the home page: full width, prominent */
.md-typeset .buy-cta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.9em 1em;
  margin: 1.2em 0 1.6em;
  border-radius: 0.4rem;
}

/* a YouTube embed at the page's width, 16:9 */
.video { position: relative; width: 100%; padding-top: 56.25%; margin: 1em 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 4px; }

/* The panel page: the sections' screenshots side by side */
.panel-grid { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.panel-grid img { display: block; max-width: 100%; height: auto; }

/* Draw's legend: each viewport marker as a small tile with a short label */
.legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.6rem;
  margin: 0.4em 0 1.2em;
}
.legend > figure {
  margin: 0;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.legend svg {
  width: 3.4rem;
  height: 3.4rem;
  background: #2b2b2b;  /* Blender's viewport gray in both themes: the colors are Draw's own */
  border-radius: 0.4rem;
}
.legend figcaption {
  font-style: normal;
  max-width: none;
  font-size: 0.68rem;
  line-height: 1.3;
  margin-top: 0.35rem;
  color: var(--md-default-fg-color--light);
}
