/* Owl Web CMS 4.8 / Owlet CMS 2.3: the built-in form puzzle (assets/js/puzzle.js). Self-contained, so it suits any template. */
.owl-puzzle {
  --pz-c: var(--c-primary, #1f5f8b);
  --pz-ink: var(--c-ink, #1b2430);
  margin: 1.2rem 0; padding: 1rem 1rem .85rem; max-width: 22rem;
  border: 1px solid color-mix(in srgb, var(--pz-ink) 18%, transparent); border-radius: 12px;
  background: color-mix(in srgb, var(--pz-ink) 3%, #fff); color: var(--pz-ink);
  font-size: 1rem; line-height: 1.4; text-align: left;
}
.owl-puzzle.has-error { border-color: #b42318; box-shadow: 0 0 0 1px #b42318; }
.owl-puzzle.is-solved { border-color: #1a7f37; }
.owl-puzzle__title { margin: 0 0 .6rem; font-weight: 700; font-size: .95rem; }
.owl-puzzle__wait { margin: .3rem 0; font-size: .9rem; color: color-mix(in srgb, var(--pz-ink) 78%, white); }
.owl-puzzle__note { margin: .5rem 0 0; font-size: .875rem; color: color-mix(in srgb, var(--pz-ink) 78%, white); }
.owl-puzzle__note:empty { margin: 0; }
.owl-puzzle.has-error .owl-puzzle__note { color: #b42318; font-weight: 600; }
.owl-puzzle.is-solved .owl-puzzle__note { color: #1a7f37; font-weight: 600; }
.owl-puzzle.is-solved .owl-puzzle__note::before { content: "\2713\00a0"; }
.owl-puzzle__alt, .owl-puzzle__link {
  margin: .45rem 0 0; padding: .2rem 0; border: 0; background: none; color: var(--pz-c); font: inherit; font-size: .85rem;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.owl-puzzle__alt[hidden] { display: none; }
.owl-puzzle button:focus-visible, .owl-puzzle input:focus-visible, .owl-puzzle [tabindex]:focus-visible { outline: 3px solid var(--pz-c); outline-offset: 2px; }
.owl-puzzle .pz-help { margin: .45rem 0 0; font-size: .8rem; color: color-mix(in srgb, var(--pz-ink) 78%, white); }
.owl-puzzle.is-solved .pz-help, .owl-puzzle.is-solved .owl-puzzle__alt { display: none; }
.owl-puzzle.is-checking .owl-puzzle__body { opacity: .65; }

/* a simple sum */
.pz-maths { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pz-maths__q { font-weight: 600; margin: 0; }
.owl-puzzle .pz-maths__a {
  width: 5.5rem; min-height: 44px; padding: .4rem .6rem; font: inherit; font-size: 1.05rem; color: var(--pz-ink); background: #fff;
  border: 1px solid color-mix(in srgb, var(--pz-ink) 45%, white); border-radius: 8px; box-sizing: border-box; margin: 0;
}

/* pick the pictures */
.pz-pics__q { margin: 0 0 .5rem; font-weight: 600; }
.pz-pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 19rem; }
.owl-puzzle .pz-pics__tile {
  position: relative; padding: 0; margin: 0; border: 3px solid transparent; border-radius: 10px; background: none; cursor: pointer; line-height: 0;
  overflow: hidden; aspect-ratio: 1; min-width: 0;
}
.pz-pics__tile img { width: 100%; height: 100%; display: block; object-fit: cover; }
.owl-puzzle .pz-pics__tile[aria-pressed="true"] { border-color: var(--pz-c); }
.pz-pics__tile[aria-pressed="true"]::after {
  content: "\2713"; position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; line-height: 22px; text-align: center;
  border-radius: 50%; background: var(--pz-c); color: #fff; font-size: 14px; font-weight: 700;
}

/* slide the piece into the gap */
.pz-slide { max-width: 300px; user-select: none; -webkit-user-select: none; }
.pz-slide__pic { position: relative; border-radius: 8px; overflow: hidden; line-height: 0; }
.pz-slide__bg { width: 100%; height: auto; display: block; }
.pz-slide__piece { position: absolute; left: 0; height: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); pointer-events: none; }
.pz-slide__track {
  position: relative; height: 44px; margin-top: 8px; border-radius: 22px; touch-action: none; cursor: pointer;
  background: color-mix(in srgb, var(--pz-ink) 10%, #fff); border: 1px solid color-mix(in srgb, var(--pz-ink) 30%, white);
}
.pz-slide__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 22px; background: color-mix(in srgb, var(--pz-c) 22%, #fff); }
.pz-slide__knob {
  position: absolute; top: -1px; left: 0; width: 44px; height: 44px; border-radius: 50%; box-sizing: border-box;
  display: grid; place-items: center; background: var(--pz-c); color: #fff; cursor: grab; box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.pz-slide.is-dragging .pz-slide__knob { cursor: grabbing; }
.owl-puzzle.is-solved .pz-slide__knob { background: #1a7f37; cursor: default; }
.owl-puzzle.is-solved .pz-slide__track { cursor: default; }
