/* Treatment map on the Saypha landing page: a face with points, each opening a card about the product for that
   area (Views/Home/Saypha.cshtml, assets/js/treatment-map.js). Written for both directions; no rtl/ copy. */

/* Its own stacking layer: the points and cards stay inside the section and never show above the sections
   around it (the video band before it is pinned and slides over its neighbours while scrolling). */
.treatment-map {
  position: relative;
  isolation: isolate;
}

.treatment-map__head {
  max-width: 640px;
  margin: 0 auto 50px;
  text-align: center;
}

.treatment-map__subtitle {
  margin-bottom: 20px;
  color: var(--font-color);
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.treatment-map__title {
  margin-bottom: 20px;
  color: var(--heading-color);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.treatment-map__title em {
  font-style: italic;
  font-weight: 300;
  opacity: 0.6;
}

.treatment-map__text {
  font-size: 17px;
  font-weight: 300;
  line-height: 1.7;
}

/* The image and its points; points are placed in percent of the image's size. */
.treatment-map__stage,
.treatment-map__figure {
  position: relative;
}

.treatment-map__stage {
  max-width: 760px;
  margin: 0 auto;
}

.treatment-map__image {
  display: block;
  width: 100%;
  height: auto;
}

.treatment-map__spot {
  position: absolute;
  z-index: 2;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

.treatment-map__pulse {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background-color: var(--spot-color);
  opacity: 0.2;
  animation: treatment-map-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

.treatment-map__dot {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid var(--spot-color);
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  transition: transform 0.3s, background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.treatment-map__spot:hover .treatment-map__dot,
.treatment-map__spot:focus-visible .treatment-map__dot {
  transform: scale(1.1);
}

.treatment-map__spot:focus-visible {
  outline: none;
}

.treatment-map__spot:focus-visible .treatment-map__dot {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 0 5px var(--spot-color);
}

.treatment-map__spot[aria-expanded="true"] {
  z-index: 3;
}

.treatment-map__spot[aria-expanded="true"] .treatment-map__dot {
  border-color: #fff;
  background-color: var(--spot-color);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: scale(1.3);
}

@keyframes treatment-map-pulse {
  0%, 100% { transform: scale(1); opacity: 0.2; }
  50% { transform: scale(2.2); opacity: 0.08; }
}

/* The card; on wide screens the script puts it beside its point. */
.treatment-map__card {
  position: absolute;
  z-index: 4;
  width: 290px;
  padding: 20px;
  border-radius: 12px;
  background-color: #fff;
  box-shadow: 0 25px 50px -12px rgba(20, 30, 51, 0.18);
  color: #5d6577;
  animation: treatment-map-card 0.3s ease-out;
}

.treatment-map__card[hidden] {
  display: none;
}

@keyframes treatment-map-card {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.treatment-map__close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: #f1f2f4;
  color: #5d6577;
  font-size: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.treatment-map__card[dir="rtl"] .treatment-map__close {
  right: auto;
  left: 12px;
}

.treatment-map__close:hover {
  background-color: #e3e5e9;
}

.treatment-map__product {
  margin-bottom: 4px;
  padding-inline-end: 30px;
  color: var(--spot-color);
  filter: brightness(0.8);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.6;
  text-transform: uppercase;
}

.treatment-map__zone {
  margin-bottom: 8px;
  padding-inline-end: 30px;
  color: #141e33;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.treatment-map__desc {
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
}

.treatment-map__picture {
  position: relative;
  height: 130px;
  overflow: hidden;
  border-radius: 8px;
  background-color: #f4f5f7;
}

.treatment-map__picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.treatment-map__link {
  display: inline-flex;
  gap: 6px;
  margin-top: 14px;
  color: #141e33;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.treatment-map__link:hover {
  color: var(--spot-color);
}

/* Narrow screens: the card opens under the image, so the other points stay free to tap. */
@media only screen and (max-width: 767px) {
  .treatment-map__spot {
    width: 20px;
    height: 20px;
  }

  .treatment-map__card {
    position: relative;
    width: auto;
    margin-top: 16px;
  }
}

.treatment-map__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 32px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.treatment-map__legend li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.treatment-map__swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

@media (prefers-reduced-motion: reduce) {
  .treatment-map__pulse,
  .treatment-map__card {
    animation: none;
  }
}
