/* ============================================================
   Course Pathway Map
   ============================================================ */

@font-face {
  font-family: 'sewlib-map';
  src: url('../fonts/sewlib-map.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

/* the paper spans the section (div. outranks the block editor's constrained-layout max-width on group children);
   its height is the map's */
div.sl-course-map-wrap {
  width: 100%;
  max-width: none;
  background-image: url('../images/coursePathPaper.png');
  background-size: 100% 100%;
}

/* the map itself, with the watercolor under Style Isle */
.sl-course-map {
  position: relative;
  width: 100%;
  max-width: min(700px, 68vh); /* 68vh = 85vh × 0.8 keeps 4:5 image under 85vh tall */
  margin: 0 auto;
  container-type: inline-size;
  background-image: url('../images/coursePathLake.png');
  background-size: 100% 100%;
}

.sl-course-map img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Stop --- */
.sl-course-stop {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  cursor: pointer;
  width: 5.71cqi;
  aspect-ratio: 1;

  --stop-color:       var(--caramel,       #8b5920);
  --stop-color-hover: var(--khaki, #bca482);
  --stop-pulse:       rgba(139, 89, 32, 0.5);
}

.sl-course-stop[data-group="beginner"] {
  --stop-color:       var(--olive,       #63652D);
  --stop-color-hover: var(--fern, #949965);
  --stop-pulse:       rgba(99, 101, 45, 0.5);
}

.sl-course-stop[data-group="intermediate"] {
  --stop-color:       var(--ochre,       #c1912f);
  --stop-color-hover: var(--butter, #eacb8c);
  --stop-pulse:       rgba(193, 145, 47, 0.5);
}

.sl-course-stop[data-group="fit"] {
  --stop-color:       var(--clay,       #A34B27);
  --stop-color-hover: var(--copper, #cc755a);
  --stop-pulse:       rgba(163, 75, 39, 0.5);
}

.sl-course-stop[data-group="advanced"] {
  --stop-color:       var(--charcoal,       #3A3432);
  --stop-color-hover: var(--charcoal-light, #655b57);
  --stop-pulse:       rgba(101, 91, 87, 0.5);
}

.sl-course-stop__circle {
  position: relative;
  z-index: 2;
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: var(--stop-color);
  border: 0.43cqi solid var(--offwhite, #f2eadb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--offwhite, #f2eadb);
  font-style: italic;
  font-family: Georgia, serif;
  font-size: 2.43cqi;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, background 0.15s ease;
}

.sl-course-stop:hover .sl-course-stop__circle,
.sl-course-stop:focus .sl-course-stop__circle {
  transform: scale(1.15);
  background: var(--stop-color-hover);
}

.sl-course-stop:focus {
  outline: none;
}

/* Pulse ring */
.sl-course-stop__pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: var(--stop-pulse);
  animation: sl-pulse 4.4s ease-out infinite;
  z-index: 1;
}

@keyframes sl-pulse {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.7; }
  50%  { transform: translate(-50%, -50%) scale(2.6); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; }
}

/* --- Text label clickable regions --- */
.sl-course-label-region {
  position: absolute;
  z-index: 1;
  cursor: pointer;
  font-family: 'sewlib-map', serif;
  font-weight: 700;
  font-size: 3.43cqi;
  line-height: 1.2;
  color: #000;
  white-space: nowrap;
  user-select: none;
  transition: font-size 0.15s ease;
}

.sl-course-label-region:hover {
  font-size: 3.71cqi;
}

.sl-course-label-region:focus {
  outline: none;
}

/* --- Modal --- */
.sl-course-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: sl-backdrop-in 0.15s ease;
}

@keyframes sl-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.sl-course-modal {
  background: var(--offwhite, #f2eadb);
  border-radius: 12px;
  padding: 24px;
  max-width: 92vw;
  width: 100%;
  position: relative;
  max-height: 88vh;
  overflow-y: auto;
  /* zoom-from-stop animation is applied via JS inline styles */
}


/* not floated: Firefox clears floats against a sticky float's scrolled position */
.sl-course-modal__close-container {
  position: sticky;
  top: 5px;
  z-index: 10;
  height: 0;
}
.sl-course-modal__close {
  position: sticky;
  line-height: 1;
  color: var(--chocolate, #593818);
  cursor: pointer;
  margin-left: auto;
  margin-right: 0;
  display: block;
  width: 44px;
  height: 44px;
  padding: 0;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  font-size: 35px;
}

.sl-course-modal__close:hover,
.sl-course-modal__close:focus {
  color: white;
}

.sl-course-modal__body > * + * {
  margin-top: 0.85em;
}

.sl-course-modal__body ul,
.sl-course-modal__body ol {
  padding-left: 1.4em;
  margin: 0 0 0.85em;
}

/* --- Mobile: sticky, prominent close button --- */
@media (max-width: 781px) {
  .sl-course-modal {
    padding: 8px 16px 24px;
  }
  h1.sl-fit-mobile {
    font-size: 24px;
  }
}
