/* ==========================================================================
   Blok „Powiązane usługi jako drzewo” (.mo-sect.mo-rel + .mo-tree).
   Źródło (prototyp): assets/css/podstrony/monitoring.css (bez .p-monitoring).
   Spoczynkowy CSS to stan końcowy; view.js tylko uzbraja rysowanie (.is-armed → .is-on).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Klocki strony Monitoringu (monitoring.css: .p-monitoring → .mo-sect): sekcja,
   separator z kropką, nagłówek w dwóch kolumnach, kafelek ikony. Te same reguły
   mają wszystkie bloki monitoring-* (każdy blok działa sam, bez innych).
   -------------------------------------------------------------------------- */

.mo-sect { --mo-y: clamp(3.75rem, 7vw, 6.5rem); --mo-gap: clamp(.75rem, 1.6vw, 1.25rem); position: relative; padding: var(--mo-y) 0; }
.mo-sect--tint { background: var(--paper-2); }

/* between two sections on the same ground: a hairline fading out at both ends with an
   orange dot in a white gap (the home page's .stairs separator), centred on the seam */
.mo-sep { position: relative; border-top: 0; }
.mo-sep::before {
  content: ""; position: absolute; left: 50%; top: 0; z-index: 1;
  width: min(100% - 2 * var(--gutter), var(--container)); height: 26px; transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, var(--orange) 0 4px, var(--orange-50) 4.5px 7px, #fff 7.5px 12px, transparent 12.5px) center / 26px 26px no-repeat,
    linear-gradient(90deg, rgba(203, 213, 224, 0), var(--line-strong) 28%, var(--line-strong) 72%, rgba(203, 213, 224, 0)) center / 100% 1px no-repeat;
}

/* two-column head: the prefix on its own row, then the title left and the lead right,
   both top-aligned so the lead never starts above the title */
.mo-head {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 1.25rem clamp(2rem, 6vw, 6rem); align-items: start; margin-bottom: clamp(2rem, 4vw, 3rem);
}
.mo-head > .eyebrow.eyebrow { grid-column: 1 / -1; margin: 0; }
.mo-head h2 { margin: 0; max-width: 21ch; }
.mo-head__lead { margin: 0; padding-top: .4rem; color: var(--muted); font-size: 1.0625rem; max-width: 56ch; }

.mo-ico {
  flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--navy-50); color: var(--navy);
}
.mo-ico .icon { width: 1.15rem; height: 1.15rem; }

@media (max-width: 900px) {
  .mo-head { grid-template-columns: minmax(0, 1fr); }
  .mo-head__lead { padding-top: 0; }
}

/* two SVG layers in one box: the pale track and the orange draw; the draw is revealed
   with a clip-path on its own box, so non-scaling strokes stay crisp at any size */
.mo-wires { position: relative; }
.mo-wires svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mo-wires path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.mo-wires__track path { stroke: var(--orange-100); stroke-width: 2; }
.mo-wires__draw path { stroke: var(--orange); stroke-width: 2.5; }


/* --------------------------------------------------------------------------
   Powiązane usługi: dane z monitoringu rozchodzą się do kart usług
   -------------------------------------------------------------------------- */

.mo-sect.mo-rel { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.mo-tree { display: grid; justify-items: center; }
.mo-tree__root {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .7rem; margin: 0;
  padding: .4rem 1.2rem .4rem .4rem; border-radius: var(--radius-pill); background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-float);
  font-family: var(--font-ui); font-size: .9375rem; font-weight: 500; color: var(--navy-900);
}
.mo-tree__dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #fff; box-shadow: 0 0 0 4px var(--orange-50); }
.mo-tree__dot .icon { width: 1rem; height: 1rem; stroke-width: 2.2; }
/* the outer wires end at the centres of the outer cards: inset by half a card (--n: liczba kart) */
.mo-tree__wires { width: calc(100% - (100% - (var(--n, 3) - 1) * var(--mo-gap)) / var(--n, 3)); height: clamp(44px, 5vw, 64px); }
.mo-tree__list { width: 100%; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: var(--mo-gap); }
.mo-tree__list li { display: grid; }
.mo-tree__card {
  position: relative; display: flex; flex-direction: column; gap: .55rem; min-width: 0;
  padding: 1.6rem clamp(1.25rem, 2.2vw, 1.6rem) 1.4rem; border-radius: var(--radius-lg); background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px -32px rgba(22, 42, 67, .4);
  color: inherit; text-decoration: none;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.mo-tree__card::before {
  content: ""; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 4px var(--orange-50);
}
.mo-tree__card:hover, .mo-tree__card:focus-visible { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-float); }
.mo-tree__feed {
  display: inline-flex; align-items: center; gap: .45rem; width: fit-content; padding: .45em .8em .45em .6em;
  border-radius: var(--radius-pill); background: var(--navy-50);
  font-family: var(--font-ui); font-size: .8125rem; font-weight: 500; line-height: 1; color: var(--navy-900);
}
.mo-tree__feed .icon { width: .95rem; height: .95rem; color: var(--navy); }
.mo-tree__card h3 { margin: .45rem 0 0; font-size: clamp(1.125rem, 1rem + .4vw, 1.3125rem); font-weight: 600; line-height: 1.2; letter-spacing: -.015em; color: var(--navy-900); text-wrap: balance; }
.mo-tree__card p { margin: 0 0 .75rem; font-size: .9375rem; line-height: 1.55; color: var(--muted); }
.mo-tree__go {
  display: inline-flex; align-items: center; gap: .6rem; margin-top: auto;
  font-family: var(--font-ui); font-size: .9375rem; font-weight: 500; color: var(--navy-900);
}
.mo-tree__arrow {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--navy-900);
  box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: background-color .3s, box-shadow .3s, color .3s, transform .35s var(--ease);
}
.mo-tree__arrow .icon { width: 1rem; height: 1rem; }
.mo-tree__card:hover .mo-tree__arrow, .mo-tree__card:focus-visible .mo-tree__arrow { background: var(--orange); color: #fff; box-shadow: none; transform: translateX(4px); }

/* --------------------------------------------------------------------------
   Rysowanie nitek: uzbrojone przez view.js, tylko bez ograniczenia ruchu
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .mo-tree.is-armed .mo-tree__wires .mo-wires__draw { clip-path: inset(0 0 100% 0); }
  .mo-tree.is-armed .mo-tree__card { opacity: 0; transform: translateY(16px); }
  .mo-tree.is-on .mo-tree__wires .mo-wires__draw { clip-path: inset(0 0 0 0); transition: clip-path .9s var(--ease) .1s; }
  .mo-tree.is-on .mo-tree__card { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .8s var(--ease), box-shadow .45s var(--ease); transition-delay: calc(.55s + var(--i) * .09s); }
  .mo-tree.is-on .mo-tree__card:hover { transition-delay: 0s; }
}

/* --------------------------------------------------------------------------
   Układ na mniejszych ekranach
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .mo-tree__wires { display: none; }
  .mo-tree__root { margin-bottom: 1.25rem; }
  .mo-tree__list { grid-template-columns: minmax(0, 1fr); }
  .mo-tree__card::before { display: none; }
}
