/* MEP (Locomotive Control Systems) page: builds on assets/about/about.css */

/* Flyer button: same markup as the original Mobirise page, restyled to its black-outline look */
.mbr-section-btn { display: inline-block; }
.btn.btn-black-outline { display: inline-flex; align-items: center; justify-content: center; padding: 10px 26px; border: 2px solid var(--ink); border-radius: 999px;
  color: var(--ink); background: transparent; font-weight: 500; font-size: .92rem; text-decoration: none; letter-spacing: .02em; transition: background .25s, color .25s; }
.btn.btn-black-outline:hover { background: var(--ink); color: #fff; }

/* hero */
.mp-title { font-size: clamp(1.8rem, 2.9vw, 2.6rem); line-height: 1.05; font-weight: 800; letter-spacing: -.03em; margin: 0 0 16px; }
.mp-title span { display: block; color: var(--red); font-weight: 900; }
.mp-lead { color: var(--body); line-height: 1.65; font-size: 1.02rem; margin: 0 0 22px; max-width: 56ch; }
.mp-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.mp-cta .mo-chip-link { padding: 11px 20px; font-size: .9rem; }
.mp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 12px; }
.mp-stats div { padding: 14px 14px 12px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(22,25,28,.05), 0 10px 24px rgba(22,25,28,.08);
  border-top: 3px solid var(--red); transition: transform .3s var(--ease); }
.mp-stats div:hover { transform: translateY(-3px); }
.mp-stats dt { font-size: 1.5rem; font-weight: 900; color: var(--red); line-height: 1; font-variant-numeric: tabular-nums; }
.mp-stats dd { margin: 6px 0 0; font-size: .86rem; color: var(--body); line-height: 1.3; }
.mp-note { font-size: .84rem; color: var(--muted); margin: 0; }

/* hero: header row + full-width system diagram */
.mp-hero { padding-top: 96px; }
.mp-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px 48px; align-items: end; margin-bottom: 18px; }
.mp-head .mp-lead { margin-bottom: 0; }
.mp-head-side .mp-cta { margin-bottom: 14px; }
.mp-diagram { margin: 0; position: relative; }
.mp-diagram-btn { display: block; width: 100%; padding: 0; border: 0; background: #fff; cursor: zoom-in; border-radius: 26px; overflow: hidden; position: relative;
  box-shadow: 0 1px 2px rgba(22,25,28,.05), 0 30px 80px rgba(22,25,28,.14); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.mp-diagram-btn:hover { transform: translateY(-4px); box-shadow: 0 40px 90px rgba(22,25,28,.18); }
.mp-diagram-btn img { width: 100%; height: auto; display: block; max-height: 58vh; object-fit: contain; }
/* one red light sweep across the data flow when the diagram arrives */
.mp-diagram-btn::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(227,30,36,.12) 45%, rgba(255,255,255,.5) 50%, transparent 60%); transform: translateX(-100%); }
.mp-diagram.is-in .mp-diagram-btn::after { animation: mp-sweep 2.2s var(--ease) .5s; }
@keyframes mp-sweep { to { transform: translateX(100%); } }
.mp-zoom-hint { position: absolute; right: 14px; bottom: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(22,25,28,.78); color: #fff; font-size: .74rem;
  opacity: 0; transform: translateY(6px); transition: all .3s var(--ease); }
.mp-diagram-btn:hover .mp-zoom-hint, .mp-diagram-btn:focus-visible .mp-zoom-hint { opacity: 1; transform: none; }
.mp-lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center; padding: 24px; cursor: zoom-out; animation: ab-in .35s var(--ease); }
.mp-lightbox[hidden] { display: none; }
.mp-lightbox img { max-width: min(1600px, 100%); max-height: 100%; border-radius: 18px; box-shadow: 0 40px 100px rgba(22,25,28,.25); }
.mp-lb-x { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 1.5rem; cursor: pointer; }
.mp-lb-x:hover { background: var(--red); }
.mp-sub { margin: 18px 0 10px; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--red); font-weight: 500; }
.mp-sub span { color: var(--muted); letter-spacing: .04em; text-transform: none; margin-left: 8px; }

/* functions */
.mp-funcs { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mp-funcs li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: .98rem; font-weight: 500; box-shadow: 0 4px 12px rgba(22,25,28,.04); transition: border-color .25s, transform .25s var(--ease); }
.mp-funcs li:hover { border-color: var(--red); transform: translateY(-2px); }
.mp-funcs span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; }
.mp-feat-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mp-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mp-feature { border-radius: 18px; padding: 16px 18px; position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.mp-feature::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); transform: scaleY(.3);
  transition: transform .35s var(--ease); }
.mp-feature:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(22,25,28,.1); }
.mp-feature:hover::before { transform: none; }
.mp-feature h3 { margin: 0 0 6px; font-size: 1.08rem; font-weight: 700; }
.mp-feature p { margin: 0; font-size: .95rem; color: var(--body); line-height: 1.5; }
.mp-benefits { position: sticky; top: 90px; border-radius: 22px; padding: 20px 20px 14px; background: var(--ink); color: #fff;
  box-shadow: 0 30px 60px rgba(22,25,28,.25); }
.mp-benefits h3 { margin: 0 0 10px; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: #ff6b70; font-weight: 500; }
.mp-benefits ul { list-style: none; margin: 0; padding: 0; }
.mp-benefits li { position: relative; padding: 8px 0 8px 24px; font-size: .95rem; line-height: 1.35; border-top: 1px solid rgba(255,255,255,.1); color: #e8eaec; }
.mp-benefits li:first-child { border-top: 0; }
.mp-benefits li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 12px; height: 7px; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red);
  transform: rotate(-45deg); }

/* cubicle */
.mp-cubicle { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: clamp(24px, 4vw, 60px); align-items: center; }
.mp-cub-img { margin: 0; position: relative; display: flex; justify-content: center; }
.mp-cub-img::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -10px; height: 24px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(22,25,28,.3), transparent); filter: blur(4px); z-index: -1; }
.mp-cub-img img { max-height: min(72vh, 620px); width: auto; filter: drop-shadow(0 30px 40px rgba(22,25,28,.2)); }
.mp-tests { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; counter-reset: t; }
.mp-tests li { counter-increment: t; border-radius: 18px; padding: 14px 16px; transition: transform .3s var(--ease), box-shadow .3s; }
.mp-tests li:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(22,25,28,.1); }
.mp-tests li::before { content: counter(t, decimal-leading-zero); display: block; font-size: 1.4rem; font-weight: 900; color: var(--red); line-height: 1; margin-bottom: 8px; }
.mp-tests b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.mp-tests span { font-size: .93rem; color: var(--body); line-height: 1.45; }

/* before / after compare */
.mp-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.mp-compare { position: relative; border-radius: 20px; overflow: hidden; height: min(calc(100vh - 150px), 820px); min-height: 420px; width: 100%; justify-self: center;
  box-shadow: 0 30px 70px rgba(22,25,28,.16); user-select: none; background: #ddd; }
.mp-compare > img, .mp-after img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mp-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); transition: clip-path .05s linear; }
.mp-compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; z-index: 3; }
.mp-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; z-index: 2; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.mp-handle::after { content: "\2039  \203A"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%;
  background: var(--red); color: #fff; display: grid; place-items: center; font-size: 1.1rem; font-weight: 700; box-shadow: 0 8px 20px rgba(227,30,36,.4); white-space: pre; }
.mp-compare:hover .mp-handle::after { transform: translate(-50%, -50%) scale(1.08); }
.mp-tag { position: absolute; top: 14px; z-index: 2; padding: 6px 12px; border-radius: 999px; font-size: .74rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(22,25,28,.75); color: #fff; backdrop-filter: blur(6px); pointer-events: none; }
.mp-tag-l { left: 14px; } .mp-tag-r { right: 14px; background: var(--red); }

/* fleet */
.mp-countries { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mp-countries li { padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 500; font-size: .9rem;
  box-shadow: 0 4px 12px rgba(22,25,28,.04); transition: all .25s; }
.mp-countries li:hover { background: var(--red); border-color: var(--red); color: #fff; transform: translateY(-2px); }
.mp-countries li.is-more { background: transparent; border-style: dashed; color: var(--muted); }
.mp-marquee { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; cursor: grab; overscroll-behavior-x: contain; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.mp-marquee::-webkit-scrollbar { display: none; }
.mp-marquee.is-dragging { cursor: grabbing; }
.mp-track { display: flex; gap: 18px; width: max-content; padding: 10px 24px 30px; }
.mp-track img { pointer-events: none; }
.mp-track figure { margin: 0; width: 320px; height: 210px; border-radius: 22px; overflow: hidden; background: #fff; flex: none;
  box-shadow: 0 18px 40px rgba(22,25,28,.14); transition: transform .4s var(--ease); }
.mp-track figure:hover { transform: translateY(-6px) scale(1.03); }
.mp-track img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 991px) {
  .mp-head, .mp-cubicle, .mp-feat-grid { grid-template-columns: 1fr; }
  .mp-features { grid-template-columns: 1fr 1fr; }
  .mp-compare { height: min(80vh, 720px); }
  .mp-tests { grid-template-columns: 1fr 1fr; }
  .mp-benefits { position: static; }
  .mp-cub-img img { max-height: 420px; }
}
@media (max-width: 767px) {
  .mp-stats { grid-template-columns: 1fr 1fr; }
  .mp-features, .mp-tests, .mp-compare-grid { grid-template-columns: 1fr; }
  .mp-track figure { width: 250px; height: 165px; }
}
@media (prefers-reduced-motion: reduce) {
  .mp-diagram-btn::after { display: none; }
}

/* assembly background gets its own lane: content left, drawing right (wide screens) */
.mp-page .ab-veil { display: none; }
@media (min-width: 1200px) {
  .mp-page main .ab-wrap { max-width: none; width: 62vw; margin: 0; padding-left: max(48px, 6vw); padding-right: 28px; }
  .mp-page .mp-head { grid-template-columns: 1fr; gap: 14px; }
  .mp-page .mp-head-side { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; align-items: center; }
  .mp-page .mp-head-side .mp-cta { margin: 0; }
  .mp-page .mp-head-side .mp-note { grid-column: 1 / -1; }
  .mp-page .mp-feat-grid { grid-template-columns: 1fr; }
  .mp-page .mp-features { grid-template-columns: repeat(3, 1fr); }
  .mp-page .mp-benefits { position: static; }
  .mp-page .mp-benefits ul { columns: 2; column-gap: 24px; }
  .mp-page .mp-benefits li { break-inside: avoid; }
  .mp-page .mp-cubicle { grid-template-columns: 1fr; }
  .mp-page .mp-cub-img { display: none; } /* the background assembles the cubicle */
  .mp-page .mp-diagram-btn img { max-height: 46vh; }
}

/* text runs the full content lane, up to the background drawing */
.mp-page .mp-lead, .mp-page .ab-h2 { max-width: none; }

/* MEG page additions (shares the MEP layout) */
.mg-features { grid-template-columns: repeat(3, 1fr); }
.mp-feature-solo { display: flex; align-items: center; min-height: 92px; }
.mp-feature-solo h3 { margin: 0; }
.mg-ben-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mg-ben-grid .mp-benefits { position: static; }
.mg-ben-grid .mp-benefits ul { columns: 1; }
.mg-ben-grid .mp-benefits h3 { margin: 14px 0 6px; }
.mg-elim li::before { border: 0; width: 10px; height: 2px; top: 16px; transform: none; background: var(--red); }
.mg-ben-grid .mp-sub { margin-top: 0; }
.mg-safety { grid-template-columns: 1fr 1fr; }
.mg-safety li:last-child { grid-column: 1 / -1; }
.mg-loco { position: relative; }
.mg-loco figcaption { position: absolute; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.92); font-size: .82rem; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); border-left: 3px solid var(--red); }
@media (min-width: 1200px) { .mp-page .mg-ben-grid .mp-benefits ul { columns: 1; } }
@media (max-width: 991px) { .mg-ben-grid { grid-template-columns: 1fr; } .mg-features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) { .mg-features, .mg-safety { grid-template-columns: 1fr; } }

/* point icons (MEP "What MEP controls", MEG "Why MEG") */
.mx-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--red); background: var(--red-soft); flex: none;
  margin-bottom: 10px; transition: background .3s, color .3s, transform .4s var(--ease); }
.mp-feature:hover .mx-ico, .mx-safe:hover .mx-ico, .mx-li:hover .mx-ico { background: var(--red); color: #fff; transform: rotate(-8deg) scale(1.06); }
.mx-ico svg * { stroke-dasharray: 80; stroke-dashoffset: 80; }
.is-in .mx-ico svg *, .is-in.mx-ico svg *, .mp-benefits.is-in .mx-ico svg * { animation: mx-draw 1.2s var(--ease) .2s forwards; }
@keyframes mx-draw { to { stroke-dashoffset: 0; } }
.mp-funcs li { display: inline-flex; align-items: center; gap: 8px; }
.mx-ico-sm { width: 28px; height: 28px; border-radius: 9px; margin: 0; }
.mp-funcs li > span:first-child { order: 0; }
.mx-li { display: flex; align-items: center; gap: 12px; padding-left: 0 !important; }
.mx-li::before { display: none !important; }
.mx-ico-dk { width: 36px; height: 36px; border-radius: 11px; margin: 0; background: rgba(227,30,36,.18); color: #ff6b70; }
.mx-safe { display: flex; flex-direction: column; align-items: flex-start; }
.mx-safe .mx-ico { margin-bottom: 8px; }
@media (prefers-reduced-motion: reduce) { .mx-ico svg * { stroke-dasharray: none; stroke-dashoffset: 0; animation: none !important; } }

/* retrofit before/after: complete images side by side (no slider), each pair Existing | With MEP */
.mp-ba { display: grid; gap: 14px; margin-top: 4px; }
.mp-ba-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mp-ba figure { position: relative; margin: 0; border-radius: 20px; overflow: hidden; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(22,25,28,.05), 0 20px 50px rgba(22,25,28,.1); display: grid; place-items: center; align-content: center; padding: 44px 14px 14px; }
.mp-ba img { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; }
.mp-ba .mp-tag { position: absolute; top: 12px; }
@media (max-width: 560px) { .mp-ba figure { padding: 38px 8px 8px; } }
.mp-retrofit { margin-top: 28px; }
