/* ══ Right-edge section minimap (thumbnail-style) ══ */

.minimap {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 6px;
  z-index: 90;
  background: rgba(13, 13, 13, 0.28);
  transition: width .32s cubic-bezier(.22, 1, .36, 1), background .2s ease;
  pointer-events: auto;
  overflow: hidden;
  font-family: var(--body-font, 'Montserrat', sans-serif);
}

.minimap::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .20) 0%,
    rgba(255, 255, 255, .40) 50%,
    rgba(255, 255, 255, .20) 100%);
  opacity: .7;
  transition: opacity .2s;
  z-index: 2;
  pointer-events: none;
}

.minimap:hover::before,
.minimap.is-open::before { opacity: 0; }

@media (min-width: 1024px) {
  .minimap.is-open {
    width: 260px;
    background: rgba(13, 13, 13, 0.55);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
  }
  .minimap.is-open .minimap__section { min-height: 64px; }
  .minimap.is-open .minimap__content,
  .minimap.is-open .minimap__viewport { opacity: 1; }
  .minimap.is-open .minimap__viewport { background: rgba(255, 255, 255, 0.14); }
}

.minimap.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity .2s, transform .2s;
}

.minimap__track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Individual section thumbnail ── */

.minimap__section {
  position: relative;
  flex-basis: 0;
  flex-grow: 1;
  min-height: 6px;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #111;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  transition: transform .25s ease, filter .2s ease;
  outline: none;
}

.minimap__section + .minimap__section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.minimap__section:hover,
.minimap__section:focus-visible {
  filter: brightness(1.15);
  transform: scale(1.02);
  z-index: 3;
}

.minimap__section.is-current {
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.7);
}

/* Image overlay for contrast */
.minimap__section.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

/* Light-bg sections: darker text */
.minimap__section.is-light {
  color: inherit;
}
.minimap__section.is-light .minimap__text {
  color: rgba(0, 0, 0, 0.55);
}

/* ── Content (heading + text) ── */

.minimap__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  width: 100%;
  max-width: 100%;
  text-align: center;
  opacity: 0;
  transition: opacity .18s ease .08s;
  pointer-events: none;
}

.minimap.is-mobile-open .minimap__content { opacity: 1; }

.minimap__heading {
  font-weight: 900;
  font-size: clamp(16px, 2.2vw, 28px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  max-width: 100%;
}

.minimap__section.is-light .minimap__heading {
  text-shadow: none;
}

.minimap__text {
  font-weight: 500;
  font-size: 7px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.82);
  max-width: 190px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Very short blocks — hide text, keep heading only */
.minimap__section[style*="flex-grow: 0.0"] .minimap__text,
.minimap__section[style*="flex-grow: 0.02"] .minimap__text,
.minimap__section[style*="flex-grow: 0.03"] .minimap__text {
  display: none;
}

/* ── Viewport indicator ── */

.minimap__viewport {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.10);
  border-top: 2px solid rgba(255, 255, 255, 0.65);
  border-bottom: 2px solid rgba(255, 255, 255, 0.65);
  pointer-events: none;
  z-index: 4;
  transition: opacity .2s;
  opacity: 0;
}

.minimap.is-mobile-open .minimap__viewport {
  opacity: 1;
  background: rgba(255, 255, 255, 0.14);
}

/* ── Mobile: drawer on swipe from right edge (50vw) ── */

@media (max-width: 1023px) {
  .minimap {
    width: 0;
    background: transparent;
  }
  .minimap::before {
    width: 4px;
    right: 0;
    background: rgba(255, 255, 255, 0.25);
    opacity: 0;
  }
  .minimap.is-mobile-open {
    width: 50vw;
    background: rgba(13, 13, 13, 0.55);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
  }
  .minimap.is-mobile-open .minimap__section { min-height: 72px; }
  .minimap__heading { font-size: clamp(18px, 4.5vw, 26px); }
  .minimap__text { font-size: 8px; }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  .minimap,
  .minimap__section,
  .minimap__content,
  .minimap__viewport { transition: none; }
}

/* ── Print ── */

@media print {
  .minimap { display: none !important; }
}
