/*
 * T3 Route + T4 Routes hub (BUILD-SPEC §4, wireframes T03-Route / T04-Routes-hub / LaneMap).
 * Visual layer over the JM Suite routes module (modules/routes/routes.css stays structural).
 * Page markup is generated by `wp jm-suite routes generate --update` (modules/routes/cli.php).
 * Every rule is scoped to .jm-route-*-section / .jm-routes-hub-*-section. Tokens only.
 */

/* ---------- Shared: section rhythm, headings ---------- */
.jm-route-hero-section,
.jm-route-facts-section,
.jm-route-unique-section,
.jm-route-price-section,
.jm-route-duration-section,
.jm-route-faq-section,
.jm-route-other-section,
.jm-routes-hub-hero-section,
.jm-routes-hub-list-section,
.jm-routes-hub-body-section,
.jm-routes-hub-faq-section { padding-top: var(--space-8) !important; padding-bottom: var(--space-8) !important; }
.jm-route-hero-section { padding-top: var(--space-6) !important; }
.jm-routes-hub-hero-section { padding-top: var(--space-7) !important; }
.jm-route-other-section { padding-top: 0 !important; }
.jm-route-duration-section { padding-top: 0 !important; }
.jm-routes-hub-body-section { padding-top: 0 !important; }

.jm-route-facts-section,
.jm-route-price-section,
.jm-route-duration-section,
.jm-routes-hub-hero-section { background-color: var(--surface-alt) !important; }

:is(.jm-route-facts-section, .jm-route-unique-section, .jm-route-price-section, .jm-route-duration-section, .jm-route-faq-section, .jm-route-other-section, .jm-routes-hub-faq-section) h2 {
  margin: 0 0 var(--space-5);
  font-size: var(--type-h2-size); line-height: var(--type-h2-lh); font-weight: 700;
}
:is(.jm-route-facts-section, .jm-route-unique-section) h3 { font-size: var(--type-h3-size); line-height: var(--type-h3-lh); font-weight: 700; }

/* Flatsome gives every column 30 px bottom padding; keep it as the stacking gap, drop it after the last column. */
:is(.jm-route-hero-section, .jm-route-facts-section, .jm-route-unique-section, .jm-route-price-section, .jm-route-duration-section, .jm-route-faq-section, .jm-route-other-section, .jm-routes-hub-hero-section, .jm-routes-hub-list-section, .jm-routes-hub-body-section, .jm-routes-hub-faq-section) .row > .col:last-child { padding-bottom: 0; }
:is(.jm-route-facts-section, .jm-route-unique-section, .jm-routes-hub-hero-section) .col-inner ul li { margin-left: 0; }

/* ---------- Breadcrumb + eyebrow (both templates) ---------- */
:is(.jm-route-hero-section, .jm-routes-hub-hero-section) .jm-route-breadcrumb { margin: 0 0 var(--space-4); }
:is(.jm-route-hero-section, .jm-routes-hub-hero-section) .jm-route-breadcrumb a { text-decoration: underline; text-underline-offset: 2px; }
:is(.jm-route-hero-section, .jm-routes-hub-hero-section) .jm-route-breadcrumb a:hover { color: var(--orange-text); }
.jm-route-hero-section .row + .row { margin-top: 0; }
.jm-route-hero-section .col { padding-bottom: 0; }

/* ---------- T3 hero ---------- */
.jm-route-hero-section .jm-route-hero { gap: var(--space-5); }
.jm-route-hero-section .jm-route-h1 { font-size: var(--type-h1-size); line-height: var(--type-h1-lh); font-weight: 800; }
.jm-route-hero-section .jm-route-line { max-width: 420px; gap: var(--space-2); font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 700; font-size: 16px; color: var(--ink); }
.jm-route-hero-section .jm-route-line-track { max-width: none; }
.jm-route-hero-section .jm-route-line-track i { width: 10px; height: 10px; }
.jm-route-hero-section .jm-route-summary { border-left: 0; padding: var(--space-5) var(--space-5); background: var(--navy-soft); border-radius: var(--radius-sm); }
.jm-route-hero-section .jm-route-summary p { font-size: var(--type-lead-size); line-height: var(--type-lead-lh); }
.jm-route-hero-section .jm-route-cities { font-weight: 700; color: var(--navy); }
.jm-route-hero-section .jm-route-cta { min-height: 52px; padding: var(--space-3) var(--space-5); border-radius: var(--radius-sm); transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.jm-route-hero-section .jm-route-cta-quote:hover { background: var(--orange-hover); border-color: var(--orange-hover); color: var(--on-orange); }
.jm-route-hero-section .jm-route-cta-call { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.jm-route-hero-section .jm-route-cta-call:hover { background: var(--band); border-color: var(--band); color: var(--on-band); }
.jm-route-hero-section .jm-route-cta-mail { background: var(--surface); border-color: var(--line-strong); color: var(--navy); }
.jm-route-hero-section .jm-route-cta-mail:hover { border-color: var(--navy); }

/* ---------- Lane map (both templates) ---------- */
:is(.jm-route-hero-section, .jm-routes-hub-hero-section) .jm-lane-map-box { border-radius: var(--radius-sm); background: var(--surface-alt); }
.jm-routes-hub-hero-section .jm-lane-map-box { background: var(--surface); }
:is(.jm-route-hero-section, .jm-routes-hub-hero-section) .jm-lane-map-info strong { font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: 16px; }

/* ---------- T3 facts + "Ce include oferta" ---------- */
.jm-route-facts-section .jm-route-facts {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0; margin: 0 0 var(--space-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
.jm-route-facts-section .jm-route-facts dt,
.jm-route-facts-section .jm-route-facts dd {
  margin: 0; padding: 14px var(--space-4); border-top: 1px solid var(--line);
  font-size: 15px; line-height: 22px; text-transform: none; letter-spacing: 0;
}
.jm-route-facts-section .jm-route-fact:first-child dt,
.jm-route-facts-section .jm-route-fact:first-child dd { border-top: 0; }
.jm-route-facts-section .jm-route-facts dt { background: var(--surface-sunken); font-weight: 600; color: var(--ink); }
.jm-route-facts-section .jm-route-facts dd { color: var(--ink); }
.jm-route-facts-section .jm-route-fact-cities dd { font-family: var(--font-body); }
.jm-route-facts-section .jm-route-facts-note { margin: 0; font-size: 15px; line-height: 22px; }

.jm-route-facts-section .jm-route-includes { padding: var(--space-5); background: var(--surface); border-top: 4px solid var(--orange); border-radius: var(--radius-sm); }
.jm-route-facts-section .jm-route-includes h3 { margin: 0 0 var(--space-4); font-size: 22px; line-height: 28px; }
.jm-route-facts-section .jm-route-includes li { padding-left: 34px; font-size: 15px; line-height: 22px; }
.jm-route-facts-section .jm-route-includes li::before { top: 0; width: 22px; height: 22px; border-radius: 0; background: center / contain no-repeat; }
.jm-route-facts-section .jm-route-includes li.jm-route-include-1::before { background-image: url("../../icons/users.svg"); }
.jm-route-facts-section .jm-route-includes li.jm-route-include-2::before { background-image: url("../../icons/doc.svg"); }
.jm-route-facts-section .jm-route-includes li.jm-route-include-3::before { background-image: url("../../icons/shield.svg"); }
.jm-route-facts-section .jm-route-includes li.jm-route-include-4::before { background-image: url("../../icons/route.svg"); }
.jm-route-facts-section .jm-route-includes li.jm-route-include-5::before { background-image: url("../../icons/clock.svg"); }

/* ---------- T3 "Ce este specific…" + anchored services ---------- */
.jm-route-unique-section .jm-route-unique-copy { max-width: 68ch; }
.jm-route-unique-section .jm-route-unique-copy h3 { margin-top: var(--space-5); }
.jm-route-unique-section .jm-route-docs { max-width: 68ch; margin: var(--space-5) 0 0; padding: var(--space-5); border: 0; border-left: 4px solid var(--orange); border-radius: var(--radius-sm); background: var(--orange-soft); font-size: 15px; line-height: 22px; }
.jm-route-unique-section .jm-route-photo { margin-top: var(--space-5); max-width: 68ch; }
.jm-route-unique-section .jm-route-photo img { width: auto; max-width: 100%; height: auto; border-radius: var(--radius-sm); } /* never upscale: some lane photos are only ~360 px wide */

.jm-route-unique-section .jm-route-services { position: sticky; top: calc(var(--header-sticky, 64px) + var(--topbar-h, 40px) + var(--space-4)); }
.jm-route-unique-section .jm-route-services h3 { margin: 0 0 var(--space-1); font-size: 22px; line-height: 28px; }
.jm-route-unique-section .jm-route-service {
  grid-template-columns: 36px 1fr; gap: var(--space-1) var(--space-3);
  padding: var(--space-5); border: 0; border-radius: var(--radius-sm); background: var(--surface-alt);
  transition: background-color var(--dur-fast) var(--ease);
}
.jm-route-unique-section .jm-route-service::before { content: ""; grid-row: span 2; width: 32px; height: 32px; background: center / contain no-repeat; }
.jm-route-unique-section .jm-route-service-utilaje::before { background-image: url("../../icons/machinery.svg"); }
.jm-route-unique-section .jm-route-service-agabaritic::before { background-image: url("../../icons/oversize.svg"); }
.jm-route-unique-section .jm-route-service-grupaj::before { background-image: url("../../icons/boxes.svg"); }
.jm-route-unique-section a.jm-route-service:hover { background: var(--navy-soft); }
.jm-route-unique-section .jm-route-service-title { font-size: 17px; }
.jm-route-unique-section .jm-route-service-text { font-size: 15px; line-height: 22px; }

/* ---------- T3 price factors ---------- */
.jm-route-price-section .jm-route-factor { padding: var(--space-5); border: 0; border-radius: var(--radius-sm); background: var(--surface); }
.jm-route-price-section .jm-route-factor-n { font-size: 14px; line-height: 24px; }
.jm-route-price-section .jm-route-factor-t { font-size: 16px; line-height: 24px; }

/* ---------- T3 duration factors (factors only, no figures; optional section) ---------- */
.jm-route-duration-section .jm-route-factor { padding: var(--space-5); border: 0; border-radius: var(--radius-sm); background: var(--surface); }
.jm-route-duration-section .jm-route-factor-n { font-size: 14px; line-height: 24px; }
.jm-route-duration-section .jm-route-factor-t { font-size: 16px; line-height: 24px; }
.jm-route-duration-section .jm-route-duration-note { margin: var(--space-4) 0 0; color: var(--ink-muted); font-size: 15px; line-height: 22px; }
.jm-route-unique-section .jm-route-non-eu { display: block; margin-bottom: var(--space-2); font-weight: 600; color: var(--ink); }

/* ---------- FAQ (both templates) ---------- */
:is(.jm-route-faq-section, .jm-routes-hub-faq-section) h2 { margin-bottom: var(--space-3); }
:is(.jm-route-faq-section, .jm-routes-hub-faq-section) [class$="faq-section__sub"] { margin: 0; color: var(--ink-muted); }
:is(.jm-route-faq-section, .jm-routes-hub-faq-section) .jm-route-faq { display: grid; gap: var(--space-2); }
:is(.jm-route-faq-section, .jm-routes-hub-faq-section) .jm-route-faq details { padding: 0; border: 0; border-radius: var(--radius-sm); background: var(--surface-alt); }
:is(.jm-route-faq-section, .jm-routes-hub-faq-section) .jm-route-faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--tap); padding: var(--space-3) var(--space-5); list-style: none; }
:is(.jm-route-faq-section, .jm-routes-hub-faq-section) .jm-route-faq summary::-webkit-details-marker { display: none; }
:is(.jm-route-faq-section, .jm-routes-hub-faq-section) .jm-route-faq summary::after { content: "+"; flex: none; font-family: var(--font-mono); font-size: 20px; color: var(--orange-text); }
:is(.jm-route-faq-section, .jm-routes-hub-faq-section) .jm-route-faq details[open] summary::after { content: "–"; }
:is(.jm-route-faq-section, .jm-routes-hub-faq-section) .jm-route-faq-a { margin: 0; padding: 0 var(--space-5) var(--space-4); color: var(--ink-muted); max-width: 68ch; }

/* ---------- T3 "Alte rute" ---------- */
.jm-route-other-section .jm-route-other a { gap: 14px; padding: var(--space-5); border-radius: var(--radius-sm); transition: border-color var(--dur-fast) var(--ease); }
.jm-route-other-section .jm-route-other a:hover { border-color: var(--navy); }
.jm-route-other-section .jm-route-other-name { font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 700; font-size: 18px; line-height: 24px; }
.jm-route-other-section .jm-route-other-meta { font-family: var(--font-mono); font-size: 14px; }
.jm-route-other-section .jm-route-other-cta { font-size: 15px; }

/* ---------- T4 hub hero ---------- */
.jm-routes-hub-hero-section .row { align-items: center; }
.jm-routes-hub-hero-section .jm-route-eyebrow { margin: 0 0 var(--space-3); }
.jm-routes-hub-hero-section__title { margin: 0 0 var(--space-4); font-size: var(--type-h1-size); line-height: var(--type-h1-lh); font-weight: 800; }
.jm-routes-hub-hero-section .jm-route-answer { margin: 0 0 var(--space-5); padding: 0; border: 0; background: none; }
.jm-routes-hub-hero-section .jm-route-answer p { font-size: var(--type-lead-size); line-height: var(--type-lead-lh); color: var(--ink-muted); }
.jm-routes-hub-hero-section .jm-routes-counters { margin: 0; }
.jm-routes-hub-hero-section .jm-routes-counter { padding: 14px; border: 0; border-radius: var(--radius-sm); }
.jm-routes-hub-hero-section .jm-routes-counter-n { font-stretch: var(--display-stretch); }

/* ---------- T4 list ---------- */
.jm-routes-hub-list-section .jm-routes-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.jm-routes-hub-list-section .jm-route-card { padding: var(--space-5); border-radius: var(--radius-sm); }
.jm-routes-hub-list-section .jm-route-card-title { font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: 20px; line-height: 26px; }
.jm-routes-hub-list-section .jm-route-card-title .jm-route-line-track { max-width: none; }
.jm-routes-hub-list-section .jm-routes-search input { padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: none; }
.jm-routes-hub-list-section .jm-routes-filter:hover { border-color: var(--navy); }
.jm-routes-hub-list-section .jm-route-card-actions a { font-size: 15px; border-radius: var(--radius-sm); }
.jm-routes-hub-list-section .jm-route-card-quote:hover { background: var(--band); color: var(--on-band); }
.jm-routes-hub-list-section .jm-routes-not-listed { border-radius: var(--radius-sm); }
.jm-routes-hub-list-section .jm-routes-not-listed p { font-size: 18px; line-height: 28px; }
.jm-routes-not-listed-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 22px;
  background: var(--orange); color: var(--on-orange); border-radius: var(--radius-sm); font-weight: 700; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease);
}
.jm-routes-not-listed-btn:hover, .jm-routes-not-listed-btn:focus-visible { background: var(--orange-hover); color: var(--on-orange); }
.jm-routes-hub-body-section .jm-route-unique-copy { max-width: var(--measure); }
/* Hub body: 2 balanced columns from 850 px (groups = intro, then each h3 with its text; a heading never ends a column, lists never split, paragraphs keep ≥ 3 lines per column). */
.jm-routes-hub-body-section .jm-route-unique-group > :first-child { margin-top: 0; }
.jm-routes-hub-body-section .jm-route-unique-group > :last-child { margin-bottom: 0; }
.jm-routes-hub-body-section .jm-route-unique-group + .jm-route-unique-group { margin-top: var(--space-5); }
.jm-routes-hub-body-section .jm-route-unique-group h3 { margin-bottom: var(--space-3); font-size: var(--type-h3-size); line-height: var(--type-h3-lh); font-weight: 700; }
@media (min-width: 850px) {
  .jm-routes-hub-body-section .jm-route-unique-copy-cols { max-width: none; column-count: 2; column-gap: var(--space-8); column-fill: balance; }
  .jm-routes-hub-body-section .jm-route-unique-group h3 { break-after: avoid; page-break-after: avoid; }
  .jm-routes-hub-body-section .jm-route-unique-group :is(ul, ol, li) { break-inside: avoid; page-break-inside: avoid; }
  .jm-routes-hub-body-section .jm-route-unique-group p { orphans: 3; widows: 3; }
}

/* ---------- Responsive ---------- */
@media (max-width: 849px) {
  .jm-route-unique-section .jm-route-services { position: static; margin-top: var(--space-6); }
  .jm-route-hero-section .jm-lane-map { margin-top: var(--space-5); }
  .jm-routes-hub-hero-section .jm-lane-map { margin-top: var(--space-5); }
}
@media (max-width: 549px) {
  .jm-route-hero-section,
  .jm-route-facts-section,
  .jm-route-unique-section,
  .jm-route-price-section,
  .jm-route-duration-section,
  .jm-route-faq-section,
  .jm-route-other-section,
  .jm-routes-hub-hero-section,
  .jm-routes-hub-list-section,
  .jm-routes-hub-body-section,
  .jm-routes-hub-faq-section { padding-top: var(--space-7) !important; padding-bottom: var(--space-7) !important; }
  .jm-route-hero-section, .jm-routes-hub-hero-section { padding-top: var(--space-5) !important; }
  .jm-route-other-section, .jm-route-duration-section, .jm-routes-hub-body-section { padding-top: 0 !important; }
  .jm-route-hero-section .jm-route-cta { flex: 1 1 100%; }
  .jm-route-facts-section .jm-route-facts { grid-template-columns: 1fr; }
  .jm-route-facts-section .jm-route-facts dd { margin: 0; border-top: 0; padding-top: 0; }
  .jm-routes-hub-list-section .jm-routes-search { flex: 1 1 100%; }
  .jm-routes-not-listed-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .jm-route-hero-section .jm-route-cta, .jm-route-unique-section .jm-route-service, .jm-route-other-section .jm-route-other a, .jm-routes-not-listed-btn { transition: none; }
}
