/* עמוד "הובלות במודיעין עילית": פתיחה עם מסלול הובלה, ציר זמן, ומפת אזורי שירות.
   משתמש בטוקנים ובקומפוננטות של style.css (צבעים, גופנים, .btn, .wrap, .reveal). */

/* ===== Hero ===== */
.mi-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 420px at 15% 20%, rgba(31,99,214,.28), transparent 60%),
    radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.2px) 0 0 / 22px 22px,
    var(--charcoal);
  padding-block: 64px 80px;
}
.mi-hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) { .mi-hero-grid { grid-template-columns: 1.1fr .9fr; } }
.mi-hero-copy { display: grid; gap: 16px; max-width: 640px; min-width: 0; }
.mi-hero h1 { font-size: calc(clamp(40px, 6.6vw, 72px) * var(--fs, 1)); font-weight: 800; letter-spacing: -.01em; }
.mi-hero p { color: #d6dde1; font-size: calc(18px * var(--fs, 1)); line-height: 1.75; }
.mi-strong strong {
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: calc(19px * var(--fs, 1));
  background: linear-gradient(transparent 62%, rgba(31,99,214,.55) 62%);
}
.mi-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mi-chips li {
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 4px 14px;
  font-size: calc(14px * var(--fs, 1)); font-weight: 700; color: #cfd8de; background: rgba(255,255,255,.04);
}
.mi-chips li:first-child { border-color: #8fb6ff; color: #fff; }
.mi-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.mi-btn { padding: 16px 26px; font-size: calc(18px * var(--fs, 1)); }
.mi-arrow { transition: transform .25s ease; }
.btn.mi-btn:hover svg.mi-arrow { transform: translateX(-6px); }
.mi-hero-art { min-width: 0; }
.mi-route-svg { width: 100%; height: auto; max-width: 560px; display: block; margin-inline: auto; overflow: visible; }
@media (max-width: 959px) { .mi-route-svg { max-width: 440px; } }

/* route illustration */
.mi-road-base { fill: none; stroke: rgba(255,255,255,.10); stroke-width: 18; stroke-linecap: round; }
.mi-road-dash { fill: none; stroke: #8fb6ff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 14; }
.mi-stop circle { fill: var(--charcoal); stroke: #8fb6ff; stroke-width: 3; }
.mi-start circle { fill: var(--accent); stroke: #fff; stroke-width: 3; }
.mi-start .ring { fill: none; stroke: #8fb6ff; stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.mi-label { fill: #e3e8eb; font: 700 15px var(--font-display); }
.mi-finish path { stroke: #fff; stroke-width: 2.5; fill: none; }
.mi-finish .flag { fill: var(--star); stroke: none; transform-box: fill-box; transform-origin: left center; }
.mi-crate rect { fill: #b98b57; stroke: #8a6538; stroke-width: 2; }
.mi-crate path { stroke: #8a6538; stroke-width: 2; fill: none; }
.mi-van .body { fill: #fff; }
.mi-van .cab { fill: #e6ebee; }
.mi-van .win { fill: #8fb6ff; }
.mi-van .vanlogo { fill: var(--charcoal); font: 800 10px var(--font-display); letter-spacing: .04em; }
.mi-van .w circle { fill: #14181b; stroke: #8fb6ff; stroke-width: 2; }
.mi-van .w path { stroke: #8fb6ff; stroke-width: 1.4; }
.mi-van .w { transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: no-preference) {
  .mi-hero-copy > * { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .mi-hero-copy > :nth-child(2) { animation-delay: .08s; }
  .mi-hero-copy > :nth-child(3) { animation-delay: .16s; }
  .mi-hero-copy > :nth-child(4) { animation-delay: .22s; }
  .mi-hero-copy > :nth-child(5) { animation-delay: .28s; }
  .mi-hero-copy > :nth-child(6) { animation-delay: .34s; }
  .mi-hero-art { animation: artIn 1s .15s cubic-bezier(.2,.7,.2,1) both; }
  .mi-road-dash { animation: roadDash 1.6s linear infinite; }
  .mi-start .ring { animation: ringPulse 2.4s ease-out infinite; }
  .mi-finish .flag { animation: flagWave 2.2s ease-in-out infinite; }
  .mi-crate { animation: crateFloat 5s ease-in-out infinite; }
  .mi-crate.c2 { animation-delay: -1.6s; }
  .mi-crate.c3 { animation-delay: -3.1s; }
  .mi-van .w { animation: wheelSpin .9s linear infinite; }
}
@keyframes artIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes roadDash { to { stroke-dashoffset: -32; } }
@keyframes ringPulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes flagWave { 0%, 100% { transform: skewY(0); } 50% { transform: skewY(-6deg); } }
@keyframes crateFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes wheelSpin { to { transform: rotate(360deg); } }

/* ===== Timeline ===== */
.mi-story .sec-head { margin-bottom: 40px; }
.tl-wrap { position: relative; --node: 56px; }
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; position: relative; }
.tl-track {
  position: absolute; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--line);
  right: calc(var(--node) / 2 - 2px);
}
.tl-fill {
  position: absolute; top: 0; right: 0; left: 0; border-radius: 4px;
  height: calc(var(--p, 0) * 100%); background: linear-gradient(to bottom, var(--accent), #8fb6ff);
}
.tl-van {
  position: absolute; top: calc(var(--p, 0) * 100%); left: 50%; translate: -50% -50%;
  width: 46px; height: 46px; border-radius: 50%; background: var(--bg); color: var(--accent);
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(20,24,27,.18); z-index: 2;
}
.tl-van svg { width: 30px; height: 22px; rotate: 90deg; }
.tl-van .wheel { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .tl-wrap.moving .tl-van .wheel { animation: wheelSpin .6s linear infinite; }
}
.tl-item { display: grid; grid-template-columns: var(--node) 1fr; gap: 18px; align-items: start; position: relative; z-index: 1; }
.tl-node {
  width: var(--node); height: var(--node); border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 3px solid var(--line); color: var(--muted);
  transition: background-color .35s ease, border-color .35s ease, color .35s ease, transform .35s ease;
}
.tl-node svg { width: 28px; height: 28px; overflow: visible; }
.tl-truck .tl-node svg { width: 32px; height: 24px; }
.tl-item.reached .tl-node { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.06); }
.tl-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 24px; min-width: 0;
  display: grid; gap: 10px; position: relative;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.tl-card h3 { font-size: calc(22px * var(--fs, 1)); font-weight: 800; }
.tl-card p { color: var(--muted); font-size: calc(17px * var(--fs, 1)); line-height: 1.75; }
.tl-badge {
  justify-self: start; font: 800 calc(15px * var(--fs, 1)) var(--font-display); letter-spacing: .02em;
  color: var(--accent); background: #e9f0fc; border-radius: 999px; padding: 4px 14px;
}
.tl-box .tl-badge { font-size: calc(22px * var(--fs, 1)); padding: 2px 16px; color: #fff; background: var(--accent); }
.tl-item:hover .tl-card { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(20,24,27,.10); border-color: transparent; }
.tl-item:hover .tl-node { border-color: var(--accent); color: var(--accent); }
.tl-item.reached:hover .tl-node { color: #fff; }
/* hover motion tied to each station's icon */
.tl-node .lid-l, .tl-node .lid-r { transform-box: fill-box; transition: transform .35s ease; }
.tl-node .lid-l { transform-origin: 0% 100%; }
.tl-node .lid-r { transform-origin: 100% 100%; }
.tl-box:hover .lid-l { transform: rotate(-28deg); }
.tl-box:hover .lid-r { transform: rotate(28deg); }
.tl-key .tl-node svg { transition: transform .4s ease; }
.tl-key:hover .tl-node svg { transform: rotate(-35deg); }
.tl-route .tl-node path[stroke-dasharray] { transition: stroke-dashoffset .6s ease; }
.tl-route:hover .tl-node path[stroke-dasharray] { stroke-dashoffset: -9; }
.tl-truck .tl-node svg { transition: transform .4s ease; }
.tl-truck:hover .tl-node svg { transform: translateX(-4px); }
.tl-truck .wheel { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .tl-truck:hover .wheel { animation: wheelSpin .7s linear infinite; }
}

/* desktop: centered line, cards alternate sides */
@media (min-width: 900px) {
  .tl-wrap { --node: 64px; }
  .tl { gap: 8px; }
  .tl-track { right: 50%; translate: 50% 0; }
  .tl-item { grid-template-columns: 1fr var(--node) 1fr; gap: 28px; }
  .tl-item .tl-node { grid-column: 2; grid-row: 1; margin-top: 18px; }
  .tl-item .tl-card { grid-row: 1; }
  .tl-item:nth-child(odd) .tl-card { grid-column: 1; }
  .tl-item:nth-child(even) .tl-card { grid-column: 3; }
  .tl-item:nth-child(even) { margin-top: -40px; }
  .tl-item:nth-child(odd) .tl-card::after,
  .tl-item:nth-child(even) .tl-card::after {
    content: ""; position: absolute; top: 44px; width: 14px; height: 14px; background: var(--bg);
    border: 1px solid var(--line); rotate: 45deg;
  }
  .tl-item:nth-child(odd) .tl-card::after { left: -8px; border-right: 0; border-top: 0; }
  .tl-item:nth-child(even) .tl-card::after { right: -8px; border-left: 0; border-bottom: 0; }
  .tl-item:hover .tl-card::after { border-color: transparent; }
}
.js .tl-item.reveal:nth-child(odd) { transform: translateX(26px); }
.js .tl-item.reveal:nth-child(even) { transform: translateX(-26px); }
.js .tl-item.reveal.in { transform: none; }
@media (prefers-reduced-motion: reduce) { .js .tl-item.reveal { transform: none; } }
html.a11y-still .tl-item.reveal { transform: none !important; }

.tl-end {
  margin: 40px auto 0; max-width: 860px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start;
  background: var(--charcoal); color: #fff; border-radius: 20px; padding: 28px;
}
.tl-end p { color: #d6dde1; font-size: calc(18px * var(--fs, 1)); line-height: 1.75; }
.tl-end p + p { margin-top: 10px; }
.tl-end strong { color: #fff; }
.tl-end-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); display: grid; place-items: center; }
.tl-end-ico svg { width: 28px; height: 28px; color: #fff; }
@media (max-width: 560px) { .tl-end { grid-template-columns: 1fr; padding: 22px; } }

/* ===== Service areas + map ===== */
.mi-map-sec .sec-head { max-width: 760px; }
.mi-map-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 960px) { .mi-map-grid { grid-template-columns: 330px 1fr; } }
.mi-areas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mi-areas li {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.mi-areas li:hover { transform: translateX(-4px); border-color: var(--accent); box-shadow: 0 10px 22px rgba(31,99,214,.10); }
.mi-areas b { display: block; font-family: var(--font-display); font-size: calc(17px * var(--fs, 1)); }
.mi-areas span:not(.ar-dot) { color: var(--muted); font-size: calc(15px * var(--fs, 1)); }
.ar-dot { width: 14px; height: 14px; margin-top: 5px; border-radius: 50%; background: var(--accent); border: 3px solid #e9f0fc; box-sizing: content-box; }
.mi-areas li:first-child .ar-dot { background: var(--charcoal); border-color: #8fb6ff; }

.mi-map-frame {
  position: relative; height: calc(clamp(400px, 62vh, 580px)); min-width: 0;
  border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #e7ebee;
  box-shadow: 0 18px 40px rgba(20,24,27,.08); isolation: isolate;
}
@media (max-width: 959px) { .mi-map-frame { height: 440px; } }
@media (max-width: 420px) { .mi-map-frame { height: 400px; border-radius: 16px; } }
.mi-map { position: absolute; inset: 0; direction: ltr; background: #e7ebee; font-family: var(--font-body); }
.mi-map .leaflet-tile-pane { filter: grayscale(1) contrast(.92) brightness(1.04); }
.mi-map-tag {
  position: absolute; top: 14px; right: 14px; z-index: 900; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 28px);
  background: var(--charcoal); color: #fff; border-radius: 999px; padding: 9px 16px 9px 18px;
  font: 800 calc(16px * var(--fs, 1)) var(--font-display); box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.mi-map-tag svg { width: 20px; height: 20px; color: #8fb6ff; flex: none; }
.mi-legend {
  position: absolute; bottom: 28px; right: 12px; z-index: 900; pointer-events: none;
  display: grid; gap: 4px; background: rgba(255,255,255,.94); border-radius: 10px; padding: 8px 12px;
  font-size: 13px; font-weight: 700; color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.mi-legend span { display: flex; align-items: center; gap: 8px; }
.mi-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.lg-main { background: var(--charcoal); box-shadow: 0 0 0 3px var(--accent); }
.lg-pt { background: var(--accent); box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.2); }
.mi-map-hint {
  position: absolute; inset: 0; z-index: 950; display: grid; place-items: center; pointer-events: none;
  background: rgba(20,24,27,.55); color: #fff; font: 700 18px var(--font-display); text-align: center; padding: 20px;
  opacity: 0; transition: opacity .25s ease;
}
.mi-map-hint.show { opacity: 1; }
.mi-noscript { position: absolute; inset: auto 16px 16px; z-index: 950; background: #fff; padding: 10px 14px; border-radius: 10px; }
.js .mi-map-frame.reveal { transform: translateY(22px) scale(.985); }
.js .mi-map-frame.reveal.in { transform: none; }

/* Leaflet UI in the site's language */
.mi-map .leaflet-control-zoom { border: 0; box-shadow: 0 6px 16px rgba(0,0,0,.18); border-radius: 12px; overflow: hidden; margin: 0 0 14px 14px; }
.mi-map .leaflet-control-zoom a {
  width: 40px; height: 40px; line-height: 38px; font-size: 22px; color: var(--ink); background: #fff;
  transition: background-color .2s ease, color .2s ease;
}
.mi-map .leaflet-control-zoom a:hover { background: var(--accent); color: #fff; }
.mi-map .leaflet-control-attribution { font-size: 11px; background: rgba(255,255,255,.85); }
.mi-map .leaflet-container a { color: var(--accent); }
.mi-map .leaflet-tooltip.mtip {
  direction: rtl; background: var(--charcoal); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px;
  font: 700 14px var(--font-body); box-shadow: 0 6px 16px rgba(0,0,0,.25); white-space: nowrap;
}
.mi-map .leaflet-tooltip-top.mtip::before { border-top-color: var(--charcoal); }
.mi-map .leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 14px 30px rgba(0,0,0,.22); }
.mi-map .leaflet-popup-content { direction: rtl; text-align: right; margin: 14px 16px; font: 15px/1.5 var(--font-body); }
.mpop { display: grid; gap: 4px; min-width: 180px; }
.mpop b { font: 800 17px var(--font-display); color: var(--ink); }
.mpop span { color: var(--muted); }
.mpop a { font-weight: 700; margin-top: 4px; }

/* map points */
.mi-mk { background: none; border: 0; }
.mi-mk:focus { outline: none; }
.mpin {
  position: absolute; inset: 0; border-radius: 50%; background: var(--accent); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35); transition: transform .2s ease, translate .3s ease;
}
.mpin::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--accent);
  opacity: 0; transform: scale(.6); transition: opacity .25s ease, transform .25s ease;
}
.mi-mk:hover .mpin, .mi-mk:focus-visible .mpin { transform: scale(1.25); }
.mi-mk:hover .mpin::after, .mi-mk:focus-visible .mpin::after { opacity: 1; transform: scale(1); }
.mi-mk:focus-visible .mpin { outline: 3px solid var(--star); outline-offset: 3px; }
.mpin-main { background: var(--charcoal); border: 4px solid var(--accent); }
.mpin-main::before {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--accent); opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .mpin-main::before { animation: mainPulse 2.4s ease-out infinite; }
  .mi-hub { animation: hubDash 2.4s linear infinite; }
}
@keyframes mainPulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes hubDash { to { stroke-dashoffset: -24; } }
.mi-map .mi-hub { stroke: var(--accent); stroke-opacity: .45; stroke-width: 2; stroke-dasharray: 4 8; fill: none; }
/* controlled offset for points only a few km apart, at country-level zoom */
.mi-map.z-low .nudge-w .mpin { translate: -7px 3px; }
.mi-map.z-low .nudge-e .mpin { translate: 7px -3px; }
.mi-map.z-low .nudge-s .mpin { translate: -3px 7px; }

.mi-outside { margin-top: 32px; display: grid; gap: 12px; max-width: 860px; }
.mi-outside h3 { font-size: calc(26px * var(--fs, 1)); font-weight: 800; }
.mi-outside > p { color: var(--muted); font-size: calc(18px * var(--fs, 1)); line-height: 1.75; }
.mi-check {
  margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px;
}
.mi-check p { font-weight: 700; font-size: calc(17px * var(--fs, 1)); flex: 1 1 260px; }

html.a11y-still .mi-van animateMotion { display: none; }
html.a11y-contrast .mi-hero, html.a11y-contrast .tl-end { background: #000; }
html.a11y-contrast .tl-card, html.a11y-contrast .mi-areas li { border-width: 2px; }

/* entrance offsets of the timeline cards must never widen the page */
.mi-story, .mi-hero, .mi-map-sec { overflow-x: clip; }
