/* DP Image Hotspots (includes/hotspots.php, assets/hotspots/hotspots.js). Element defaults are written with :where()
 * so Divi's own Design settings win; tools/build-d4-reset.py raises them above Divi 4's reset. */

@property --dphs-sx { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --dphs-sy { syntax: '<percentage>'; inherits: true; initial-value: 50%; }

.dp-hs {
  --dphs-accent: #2c59fa;
  --dphs-on: #fff;
  --dphs-card: #fff;
  --dphs-ink: #060606;
  --dphs-line: rgba(6, 6, 6, .14);
  --dphs-shade: rgba(6, 6, 6, .62);
  --dphs-size: 34px;
  --dphs-card-w: 300px;
  --dphs-spot: 110px;
  --dphs-split: 62%;
  --dphs-radius: 16px;
  --dphs-ease: cubic-bezier(.22, 1, .36, 1);
  position: relative;
  color: var(--dphs-ink);
}
.dp-hs *, .dp-hs *::before, .dp-hs *::after { box-sizing: border-box; }

/* ---------------------------------------------------------------- the picture */
.dp-hs-layout { position: relative; }
.dp-hs-stage { position: relative; }
.dp-hs-image { display: block; width: 100%; max-width: 100%; height: auto; border-radius: var(--dphs-radius); }
.dp-hs-blank {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, rgba(6, 6, 6, .05) 25%, transparent 25%, transparent 50%, rgba(6, 6, 6, .05) 50%, rgba(6, 6, 6, .05) 75%, transparent 75%) 0 0 / 28px 28px,
    #f1f1f0;
}
.dp-hs-shade {
  position: absolute;
  inset: 0;
  border-radius: var(--dphs-radius);
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--dphs-sx) var(--dphs-sy), transparent calc(var(--dphs-spot) * .82), var(--dphs-shade) var(--dphs-spot));
  transition: opacity .45s ease, --dphs-sx .6s var(--dphs-ease), --dphs-sy .6s var(--dphs-ease);
}
.dp-hs[data-dphs-style="spotlight"].dphs-has-open .dp-hs-shade { opacity: 1; }

/* The hotspots: each one is a point on the picture; Divi's module wrappers around them stay out of the way. */
.dp-hs-spots { position: absolute; inset: 0; counter-reset: dphs; pointer-events: none; }
.dp-hs-spots > .dp-hs-item,
.et_pb_column .dp-hs-spots > .et_pb_module.dp-hs-item { position: static; margin: 0; padding: 0; }
/* Divi 4 wraps each module's output in .et_pb_module_inner { position: relative }, which has no height here. */
.dp-hs-spots > .dp-hs-item > .et_pb_module_inner { position: static; }
.dp-hs-spot { position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: 0; height: 0; z-index: 1; counter-increment: dphs; }
.dp-hs-spot.is-open { z-index: 4; }

/* ---------------------------------------------------------------- markers */
:where(.dp-hs) .dp-hs-marker {
  appearance: none;
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(calc(var(--dphs-size) / -2), -50%);
  -webkit-tap-highlight-color: transparent;
}
.dp-hs-marker:focus { outline: none; }
.dp-hs-marker:focus-visible .dp-hs-dot { outline: 2px solid var(--dphs-accent); outline-offset: 3px; }
.dp-hs-dot {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--dphs-size);
  height: var(--dphs-size);
  border-radius: 50%;
  background: var(--dphs-accent);
  color: var(--dphs-on);
  box-shadow: 0 4px 14px rgba(6, 6, 6, .22);
  transition: transform .35s var(--dphs-ease), box-shadow .35s ease;
}
.dp-hs-icon, .dp-hs-num { grid-area: 1 / 1; display: grid; place-items: center; }
.dp-hs-icon svg { display: block; width: 58%; height: 58%; margin: auto; transition: transform .35s var(--dphs-ease); }
.dp-hs-icon { width: 100%; height: 100%; }
.dp-hs-num { display: none; font-size: calc(var(--dphs-size) * .42); font-weight: 700; }
.dp-hs-num::before { content: counter(dphs); }
.dp-hs[data-dphs-marker="dot"] .dp-hs-icon svg { display: none; }
.dp-hs[data-dphs-marker="dot"] .dp-hs-icon::before { content: ''; width: 34%; height: 34%; border-radius: 50%; background: currentColor; }
.dp-hs[data-dphs-marker="number"] .dp-hs-icon,
.dp-hs[data-dphs-style="pins"] .dp-hs-icon { display: none; }
.dp-hs[data-dphs-marker="number"] .dp-hs-num,
.dp-hs[data-dphs-style="pins"] .dp-hs-num { display: grid; }
.dp-hs-spot.is-open .dp-hs-icon svg { transform: rotate(45deg); }
.dp-hs-marker:hover .dp-hs-dot, .dp-hs-spot.is-open .dp-hs-dot { transform: scale(1.12); }
.dp-hs-spot.is-open .dp-hs-dot { box-shadow: 0 0 0 6px rgba(255, 255, 255, .55), 0 6px 18px rgba(6, 6, 6, .25); }

/* The pulsing ring. */
.dp-hs[data-dphs-pulse] .dp-hs-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: var(--dphs-accent);
  animation: dphs-pulse 2.2s cubic-bezier(.2, .6, .4, 1) infinite;
}
.dp-hs[data-dphs-pulse] .dp-hs-spot.is-open .dp-hs-dot::before { animation: none; opacity: 0; }
@keyframes dphs-pulse {
  0% { transform: scale(1); opacity: .55; }
  80%, 100% { transform: scale(2.1); opacity: 0; }
}

/* Labels and tags: only Expanding Label and Product Tags show them on the picture. */
.dp-hs-tag { display: none; }
.dp-hs-label { font-weight: 600; }
.dp-hs-tagsub { opacity: .65; }

/* Expanding Label: the marker is a pill whose label slides out. */
.dp-hs[data-dphs-style="expand"] .dp-hs-marker {
  padding: 4px;
  border-radius: 999px;
  background: var(--dphs-card);
  color: var(--dphs-ink);
  box-shadow: 0 6px 22px rgba(6, 6, 6, .18);
  transform: translate(calc(var(--dphs-size) / -2 - 4px), -50%);
}
.dp-hs[data-dphs-style="expand"] .dp-hs-dot { box-shadow: none; }
.dp-hs[data-dphs-style="expand"] .dp-hs-tag {
  display: block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 14px;
  opacity: 0;
  transition: max-width .45s var(--dphs-ease), padding .45s var(--dphs-ease), opacity .3s ease;
}
.dp-hs[data-dphs-style="expand"] .dp-hs-tagsub { display: none; }
.dp-hs[data-dphs-style="expand"] .dp-hs-marker:hover .dp-hs-tag,
.dp-hs[data-dphs-style="expand"] .dp-hs-marker:focus-visible .dp-hs-tag,
.dp-hs[data-dphs-style="expand"] .dp-hs-spot.is-open .dp-hs-tag,
.dp-hs[data-dphs-style="expand"].dphs-touch .dp-hs-tag { max-width: 260px; padding: 0 14px 0 10px; opacity: 1; }
/* Touch screens show the labels open from the start (the engine measures them to keep them inside the picture). */
.dp-hs[data-dphs-style="expand"].dphs-touch .dp-hs-tag { transition: none; }
.dp-hs[data-dphs-style="expand"] .dp-hs-spot.is-end .dp-hs-marker { flex-direction: row-reverse; transform: translate(calc(-100% + var(--dphs-size) / 2 + 4px), -50%); }
.dp-hs[data-dphs-style="expand"] .dp-hs-spot.is-end .dp-hs-tag { padding-left: 0; }
.dp-hs[data-dphs-style="expand"] .dp-hs-spot.is-end .dp-hs-marker:hover .dp-hs-tag,
.dp-hs[data-dphs-style="expand"] .dp-hs-spot.is-end.is-open .dp-hs-tag,
.dp-hs[data-dphs-style="expand"].dphs-touch .dp-hs-spot.is-end .dp-hs-tag { padding: 0 10px 0 14px; }

/* Product Tags: a small dot with a tag beside it, always shown. */
.dp-hs[data-dphs-style="tags"] .dp-hs-marker { gap: 10px; }
.dp-hs[data-dphs-style="tags"] .dp-hs-dot { width: calc(var(--dphs-size) * .55); height: calc(var(--dphs-size) * .55); box-shadow: 0 0 0 4px rgba(255, 255, 255, .7); }
.dp-hs[data-dphs-style="tags"] .dp-hs-marker { transform: translate(calc(var(--dphs-size) * -.275), -50%); }
.dp-hs[data-dphs-style="tags"] .dp-hs-icon svg { display: none; }
.dp-hs[data-dphs-style="tags"] .dp-hs-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--dphs-card);
  color: var(--dphs-ink);
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 6px 22px rgba(6, 6, 6, .16);
  transition: transform .35s var(--dphs-ease), background-color .25s ease, color .25s ease;
}
.dp-hs[data-dphs-style="tags"] .dp-hs-marker:hover .dp-hs-tag { transform: translateY(-2px); }
.dp-hs[data-dphs-style="tags"] .dp-hs-spot.is-open .dp-hs-tag { background: var(--dphs-accent); color: var(--dphs-on); }
.dp-hs[data-dphs-style="tags"] .dp-hs-spot.is-end .dp-hs-marker { flex-direction: row-reverse; transform: translate(calc(-100% + var(--dphs-size) * .275), -50%); }

/* Spotlight: the other markers fade while one is open. */
.dp-hs[data-dphs-style="spotlight"].dphs-has-open .dp-hs-spot:not(.is-open) .dp-hs-marker { opacity: .45; }
.dp-hs-marker { transition: opacity .35s ease; }

/* ---------------------------------------------------------------- cards */
:where(.dp-hs) .dp-hs-card {
  position: absolute;
  left: 20px;
  top: -20px;
  display: none;
  width: var(--dphs-card-w);
  max-width: calc(100vw - 32px);
  overflow: hidden;
  border-radius: var(--dphs-radius);
  background: var(--dphs-card);
  color: var(--dphs-ink);
  text-align: left;
  box-shadow: 0 22px 60px rgba(6, 6, 6, .2);
  pointer-events: auto;
}
.dp-hs-spot.is-open > .dp-hs-card { display: block; opacity: 0; transform: scale(.94); transition: opacity .28s ease, transform .45s var(--dphs-ease); }
.dp-hs[data-dphs-style="expand"] .dp-hs-spot.is-open > .dp-hs-card { transform: scale(.45); }
.dp-hs-spot.is-open.is-in > .dp-hs-card,
.dp-hs[data-dphs-style="expand"] .dp-hs-spot.is-open.is-in > .dp-hs-card { opacity: 1; transform: none; }

/* Without the engine: the card shows while the pointer or the keyboard focus is on the hotspot. */
.dp-hs:not(.dphs-ready) .dp-hs-spot:hover > .dp-hs-card,
.dp-hs:not(.dphs-ready) .dp-hs-spot:focus-within > .dp-hs-card { display: block; }

:where(.dp-hs) .dp-hs-media { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: #f1f1f0; }
:where(.dp-hs) .dp-hs-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
:where(.dp-hs) .dp-hs-body { padding: 18px 20px 20px; }
:where(.dp-hs) .dp-hs-title { margin: 0; padding: 0; color: inherit; font-size: 18px; line-height: 1.25; font-weight: 600; }
:where(.dp-hs) .dp-hs-sub { margin: 4px 0 0; padding: 0; font-size: 14px; line-height: 1.4; opacity: .65; }
:where(.dp-hs) .dp-hs-text { margin-top: 10px; font-size: 14px; line-height: 1.6; }
:where(.dp-hs) .dp-hs-text p { margin: 0 0 .7em; padding: 0; }
:where(.dp-hs) .dp-hs-text p:last-child { margin-bottom: 0; }
:where(.dp-hs) .dp-hs-text a { color: var(--dphs-accent); }
:where(.dp-hs) .dp-hs-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--dphs-accent);
  color: var(--dphs-on);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  transition: opacity .25s ease;
}
:where(.dp-hs) .dp-hs-btn:hover { opacity: .88; }
.dp-hs-btn:focus-visible { outline: 2px solid var(--dphs-accent); outline-offset: 3px; }

/* ---------------------------------------------------------------- the panel and list beside the picture */
.dp-hs-aside[hidden] { display: none; }
.dp-hs[data-dphs-style="panel"] .dp-hs-layout,
.dp-hs[data-dphs-style="pins"] .dp-hs-layout {
  display: grid;
  grid-template-columns: var(--dphs-split) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.dp-hs[data-dphs-side="left"][data-dphs-style="panel"] .dp-hs-stage,
.dp-hs[data-dphs-side="left"][data-dphs-style="pins"] .dp-hs-stage { order: 2; }
.dp-hs[data-dphs-style="panel"] .dp-hs-spots .dp-hs-card,
.dp-hs[data-dphs-style="pins"] .dp-hs-spots .dp-hs-card { display: none !important; }

/* Copies of a card in the panel, the list and the phone sheet. */
.dp-hs-aside .dp-hs-card {
  position: static;
  display: block;
  width: auto;
  max-width: none;
  opacity: 1;
  transform: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}
:where(.dp-hs) .dp-hs-panel {
  overflow: hidden;
  border: 1px solid var(--dphs-line);
  border-radius: var(--dphs-radius);
  background: var(--dphs-card);
}
.dp-hs-panel.is-swap .dp-hs-card { animation: dphs-in .55s var(--dphs-ease); }
.dp-hs-panel .dp-hs-body { padding: 24px 26px 26px; }
.dp-hs-panel .dp-hs-title { font-size: 22px; }
@keyframes dphs-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.dp-hs-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
:where(.dp-hs) .dp-hs-prev, :where(.dp-hs) .dp-hs-next, :where(.dp-hs) .dp-hs-close {
  appearance: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--dphs-line);
  border-radius: 50%;
  background: var(--dphs-card);
  color: var(--dphs-ink);
  cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease;
}
.dp-hs-prev svg, .dp-hs-next svg, .dp-hs-close svg { width: 18px; height: 18px; }
.dp-hs-next svg { transform: scaleX(-1); }
:where(.dp-hs) .dp-hs-prev:hover, :where(.dp-hs) .dp-hs-next:hover, :where(.dp-hs) .dp-hs-close:hover { border-color: var(--dphs-ink); }
.dp-hs-prev:focus-visible, .dp-hs-next:focus-visible, .dp-hs-close:focus-visible, .dp-hs-lbtn:focus-visible { outline: 2px solid var(--dphs-accent); outline-offset: 2px; }
.dp-hs-count { font-size: 14px; opacity: .7; font-variant-numeric: tabular-nums; }

/* Numbered Pins: the list. */
:where(.dp-hs) .dp-hs-list { border-top: 1px solid var(--dphs-line); }
/* The engine builds this list and no Divi setting styles it, so it overrides the themes' list rules, including
 * id-level ones (Divi 4: #left-area ol { list-style-type: decimal; padding-bottom: 23px }). */
.dp-hs ol.dp-hs-list { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.dp-hs ol.dp-hs-list > li.dp-hs-li { display: block; margin: 0 !important; padding: 0 !important; list-style: none !important; }
:where(.dp-hs) .dp-hs-li { border-bottom: 1px solid var(--dphs-line); }
:where(.dp-hs) .dp-hs-lbtn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 16px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dp-hs-lnum {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--dphs-line);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}
.dp-hs-li.is-open .dp-hs-lnum, .dp-hs-lbtn:hover .dp-hs-lnum { background: var(--dphs-accent); border-color: var(--dphs-accent); color: var(--dphs-on); }
.dp-hs-lname { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; flex: 1 1 auto; min-width: 0; }
.dp-hs-lname .dp-hs-label { font-size: 17px; }
.dp-hs-lname .dp-hs-tagsub { margin-left: auto; font-size: 14px; }
.dp-hs-ldetail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--dphs-ease); }
.dp-hs-li.is-open .dp-hs-ldetail { grid-template-rows: 1fr; }
.dp-hs-ldetail-in { min-height: 0; overflow: hidden; }
.dp-hs-ldetail .dp-hs-body { padding: 0 0 18px 44px; }
.dp-hs-ldetail .dp-hs-title, .dp-hs-ldetail .dp-hs-sub { display: none; }
.dp-hs-ldetail .dp-hs-text { margin-top: 0; }
.dp-hs-ldetail .dp-hs-media { width: calc(100% - 44px); margin: 0 0 14px 44px; border-radius: calc(var(--dphs-radius) * .6); }

/* Phones: the open card under the picture. */
.dp-hs-aside.is-sheet { position: relative; margin-top: 16px; }
.dp-hs-aside.is-sheet .dp-hs-close { position: absolute; top: 10px; right: 10px; z-index: 1; }
.dp-hs-aside.is-sheet .dp-hs-panel { box-shadow: 0 14px 40px rgba(6, 6, 6, .12); }
.dp-hs-aside.is-sheet .dp-hs-panel .dp-hs-body { padding-right: 60px; }
.dp-hs-aside.is-sheet .dp-hs-media + .dp-hs-body { padding-right: 20px; }
.dp-hs.dphs-sheet .dp-hs-spots .dp-hs-card { display: none !important; }

/* A narrow module (a column beside a sidebar, a small Divi column) stacks the panel or list too. */
.dp-hs[data-dphs-style="panel"], .dp-hs[data-dphs-style="pins"] { container-type: inline-size; }
@container (max-width: 680px) {
  .dp-hs-layout { grid-template-columns: minmax(0, 1fr) !important; gap: 24px !important; }
  .dp-hs-stage { order: 0 !important; }
}
@media (max-width: 980px) {
  .dp-hs[data-dphs-style="panel"] .dp-hs-layout,
  .dp-hs[data-dphs-style="pins"] .dp-hs-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .dp-hs[data-dphs-side="left"][data-dphs-style="panel"] .dp-hs-stage,
  .dp-hs[data-dphs-side="left"][data-dphs-style="pins"] .dp-hs-stage { order: 0; }
}
@media (max-width: 767px) {
  .dp-hs[data-dphs-style="tags"] .dp-hs-tag { padding: 6px 11px; font-size: 13px; }
  .dp-hs[data-dphs-style="tags"] .dp-hs-tagsub { display: none; }
  .dp-hs-panel .dp-hs-body { padding: 20px; }
}

/* ---------------------------------------------------------------- reduced motion */
.dp-hs.dphs-reduced .dp-hs-dot::before { animation: none; opacity: 0; }
.dp-hs.dphs-reduced *, .dp-hs.dphs-reduced .dp-hs-shade { transition-duration: .01s !important; animation-duration: .01s !important; }
@media (prefers-reduced-motion: reduce) {
  .dp-hs .dp-hs-dot::before { animation: none; opacity: 0; }
}

/* ---------------------------------------------------------------- builders */
.dp-hs-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #060606;
  font-size: 13px;
  pointer-events: none;
}
