/* ======================================================================
   ✅ Moon-Host — Orbit / Constellation Milestones (mh-orbit-milestones.css)
   FIX v4:
   - cards are BIG + readable by default (no clamp)
   - auto "pull outward" based on quadrant (left/right/top/bottom)
   - click = enlarge card + background blur overlay (open card stays sharp)
   - no white outline / tap ring
   ====================================================================== */

.mh-orbit{
  margin-top: clamp(38px, 7vh, 86px);
  padding: 0;
}

.mh-orbit__head{
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 14px;
}
.mh-orbit__head h2{ margin: 0; }
.mh-orbit__head p{ margin: 10px 0 0; opacity: .82; }

/* =========================
   STAGE (MORE SPACE TOP/BOTTOM)
========================= */
.mh-orbit__stage{
  margin-top: 22px;
  position: relative;

  /* ✅ more room */
  padding-top: clamp(70px, 10vh, 170px);
  padding-bottom: clamp(320px, 34vh, 560px);

  --shiftY: 150;

  /* ✅ DO NOT shrink too much (freer layout) */
  --orbitScale: .98;

  min-height: clamp(1100px, 130vh, 1600px);

  border-radius: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;

  isolation: isolate;
}

/* ✅ real overlay element (created by JS) */
.mh-orbit__overlay{
  position:absolute;
  inset: -40px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;

  /* dim + blur */
  background: radial-gradient(circle at 50% 50%, rgba(0,0,0,.18), rgba(0,0,0,.64) 72%);
  backdrop-filter: blur(10px);

  transition: opacity .18s ease;
}

.mh-orbit__overlay.is-active{
  opacity: 1;
  pointer-events: auto; /* click/tap to close */
}

/* 3D field */
.mh-orbit__field{
  position:absolute;
  inset: 0;
  transform-style: preserve-3d;
  perspective: 900px;
  z-index: 1;
}

/* Moon */
.mh-orbit__moon{
  position:absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%) translateY(calc(var(--shiftY) * 1px)) translateZ(40px);
  border-radius: 999px;

  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.85), rgba(255,255,255,.15) 55%, rgba(0,0,0,.35) 100%),
    radial-gradient(circle at 60% 70%, rgba(255,255,255,.12), transparent 55%);

  box-shadow:
    0 25px 90px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.10),
    0 0 60px rgba(255,74,74,.12);

  filter: saturate(1.05);
  pointer-events: none;
  z-index: 2;
}

.mh-orbit__moon::after{
  content:"";
  position:absolute; inset: 10px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 20% 40%, rgba(0,0,0,.18), transparent 45%),
    radial-gradient(circle at 65% 55%, rgba(0,0,0,.14), transparent 48%),
    radial-gradient(circle at 45% 75%, rgba(0,0,0,.10), transparent 52%);
  opacity: .9;
  mix-blend-mode: multiply;
}

.mh-orbit__moonGlow{
  position:absolute;
  inset:-80px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,74,74,.16), transparent 70%);
  filter: blur(18px);
  opacity: .8;
  pointer-events:none;
  z-index: 1;
}

/* SVG lines */
.mh-orbit__lines{
  position:absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events:none;
  z-index: 3;
}

/* =========================
   NODE (100% clickable)
========================= */
.mh-orbit__node{
  position:absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;

  --dx: 0;
  --dy: 0;

  transform:
    translate(-50%, -50%)
    translate3d(
      calc((var(--x) + var(--dx)) * var(--orbitScale) * 1px),
      calc((var(--y) + var(--dy) + var(--shiftY)) * var(--orbitScale) * 1px),
      calc(var(--z) * 1px)
    );

  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: rgba(255,255,255,.92);

  animation: mhOrbitFloat 6.5s ease-in-out infinite;

  z-index: 10; /* base above field */
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  outline: none !important;
  box-shadow: none !important;
}

.mh-orbit__node:focus,
.mh-orbit__node:active{
  outline: none !important;
  box-shadow: none !important;
}

.mh-orbit__node:nth-child(odd){ animation-duration: 7.2s; }
.mh-orbit__node:nth-child(3n){ animation-duration: 8.2s; }

@keyframes mhOrbitFloat{
  0%,100%{
    transform:
      translate(-50%, -50%)
      translate3d(
        calc((var(--x) + var(--dx)) * var(--orbitScale) * 1px),
        calc((var(--y) + var(--dy) + var(--shiftY)) * var(--orbitScale) * 1px),
        calc(var(--z) * 1px)
      )
      translateY(0px);
  }
  50%{
    transform:
      translate(-50%, -50%)
      translate3d(
        calc((var(--x) + var(--dx)) * var(--orbitScale) * 1px),
        calc((var(--y) + var(--dy) + var(--shiftY)) * var(--orbitScale) * 1px),
        calc(var(--z) * 1px)
      )
      translateY(-8px);
  }
}

/* your fine-tunes */
.mh-orbit__node:nth-of-type(2){ --dy: 38; --dx: 18; }
.mh-orbit__node:nth-of-type(4){ --dy: -22; }

/* Dot */
.mh-orbit__dot{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display:inline-block;

  background: var(--mh-red, #ff4a4a);
  box-shadow:
    0 0 0 7px rgba(255,74,74,.10),
    0 0 34px rgba(255,74,74,.28);

  position: relative;
}

.mh-orbit__dot::after{
  content:"";
  position:absolute; inset:-9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  opacity: .9;
}

/* =========================
   ✅ BIG CARDS (DEFAULT)
========================= */
.mh-orbit__label{
  display:block;
  margin-top: 12px;

  /* ✅ BIGGER by default */
  width: min(520px, 40vw);
  max-width: 520px;

  line-height: 1.45;
  padding: 16px 16px;
  border-radius: 18px;

  background: rgba(0,0,0,.40);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(10px);

  box-shadow: 0 22px 70px rgba(0,0,0,.40);

  position: relative;
  z-index: 11;

  /* ✅ IMPORTANT: label itself doesn't block clicks */
  pointer-events: none;

  /* default "pull out" (overridden by quadrant classes below) */
  transform: translateX(-10px);
}

.mh-orbit__date{
  display:block;
  font-weight: 900;
  letter-spacing: .2px;
  opacity: .96;
  font-size: 18px;
}

.mh-orbit__title{
  display:block;
  margin-top: 4px;
  font-weight: 900;
  opacity: .94;
  font-size: 18px;
}

.mh-orbit__text{
  display:block;
  margin-top: 10px;
  opacity: .86;

  /* ✅ SHOW EVERYTHING (no clamp) */
  overflow: visible;
  font-size: 15px;
}

/* ✅ Pull cards OUTWARDS based on quadrant (JS adds is-left/is-right/is-top/is-bottom always) */
.mh-orbit__node.is-left  .mh-orbit__label{ transform: translateX(-34px); }
.mh-orbit__node.is-right .mh-orbit__label{ transform: translateX( 34px); }
.mh-orbit__node.is-top   .mh-orbit__label{ margin-top: 16px; }
.mh-orbit__node.is-bottom .mh-orbit__label{ margin-top: 12px; }

/* Hover/focus feel */
.mh-orbit__node:hover .mh-orbit__dot,
.mh-orbit__node:focus-visible .mh-orbit__dot{
  box-shadow:
    0 0 0 9px rgba(255,74,74,.16),
    0 0 54px rgba(255,74,74,.40);
  transform: scale(1.06);
}

.mh-orbit__node:hover .mh-orbit__label{
  border-color: rgba(255,74,74,.18);
  box-shadow:
    0 26px 90px rgba(0,0,0,.50),
    0 20px 90px rgba(255,74,74,.10);
}

/* =========================
   ✅ OPEN = ENLARGE CARD (sharp) above blur overlay
========================= */
.mh-orbit__node.is-open{
  z-index: 80; /* above overlay */
}

.mh-orbit__node.is-open .mh-orbit__label{
  pointer-events: auto;

  position: absolute;
  top: 100%;
  left: 0;

  width: min(720px, 88vw);
  max-width: 720px;

  padding: 22px 22px;
  border-radius: 20px;

  background: rgba(0,0,0,.68);
  border: 1px solid rgba(255,74,74,.28);

  box-shadow:
    0 34px 120px rgba(0,0,0,.65),
    0 26px 110px rgba(255,74,74,.12);

  transform: translateX(-12px) scale(1.06);
  animation: mhPanelIn .16s ease-out both;
}

@keyframes mhPanelIn{
  from{ opacity: 0; transform: translateX(-12px) translateY(10px) scale(1.02); }
  to  { opacity: 1; transform: translateX(-12px) translateY(0) scale(1.06); }
}

/* open placement helpers (JS sets these too) */
.mh-orbit__node.is-open.is-right .mh-orbit__label{
  left: auto;
  right: 0;
  transform: translateX(12px) scale(1.06);
}
.mh-orbit__node.is-open.is-top .mh-orbit__label{
  top: auto;
  bottom: 100%;
}

/* Mobile */
@media (max-width: 820px){
  .mh-orbit__stage{
    padding-top: clamp(70px, 12vh, 180px);
    padding-bottom: clamp(360px, 38vh, 640px);
    min-height: 1200px;

    --orbitScale: .90;
    --shiftY: 170;
  }

  .mh-orbit__label{
    width: min(560px, 84vw);
    max-width: 84vw;
  }

  .mh-orbit__node.is-open .mh-orbit__label{
    width: min(760px, 92vw);
    max-width: 92vw;
    transform: translateX(-10px) scale(1.04);
  }
}

@media (max-width: 520px){
  .mh-orbit__stage{
    min-height: 1280px;
    --orbitScale: .86;
  }

  .mh-orbit__date, .mh-orbit__title{ font-size: 16px; }
  .mh-orbit__text{ font-size: 14px; }
}
