/* ==========================================================================
   lines.css — Linije (popis), Linija (detalj + vozni red), Planer putovanja
   Builder: lines-planner
   ========================================================================== */

/* ---------- Lokalni tokeni (svijetla tema) ---------- */
:root {
  --ln-surface: #ffffff;
  --ln-surface-2: #eef3f7;
  --ln-border: #d9e2ea;
  --ln-text: #001e33;
  --ln-muted: #51667a;
  --ln-route: var(--at-orange-600, #f2571e);
  --ln-terminus: var(--at-navy-700, #003c66);
  --ln-accent-text: #b53c0c;
  --ln-chip-bg: #fdece3;
  --ln-chip-soon-bg: #b53c0c;
  --ln-chip-soon-text: #ffffff;
  --ln-pill-bg: #eef3f7;
  --ln-pill-text: #002d4d;
  --ln-shadow: 0 10px 30px rgba(0, 30, 51, 0.08);
  --ln-map-bg: #dfe8ef;
}

/* ---------- Tamna tema ---------- */
[data-theme="dark"] {
  --ln-surface: #002d4d;
  --ln-surface-2: rgba(232, 240, 247, 0.07);
  --ln-border: #0d4a72;
  --ln-text: #e8f0f7;
  --ln-muted: #9fb6c9;
  --ln-route: var(--at-orange-500, #ff6d33);
  --ln-terminus: var(--at-sky-400, #33ccff);
  --ln-accent-text: #ffab84;
  --ln-chip-bg: rgba(255, 109, 51, 0.16);
  --ln-chip-soon-bg: var(--at-orange-500, #ff6d33);
  --ln-chip-soon-text: #001e33;
  --ln-pill-bg: rgba(232, 240, 247, 0.09);
  --ln-pill-text: #dbe7f0;
  --ln-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --ln-map-bg: #0b2438;
}

/* Sigurnosna mreža za [hidden] elemente kojima upravljamo iz JS-a. */
.page-linije [hidden],
.page-linija [hidden],
.page-planer [hidden] {
  display: none !important;
}

/* ==========================================================================
   /linije — popis linija
   ========================================================================== */

.lines-head {
  padding-block: 1.5rem 0.5rem;
  max-width: 46rem;
}

.lines-lead,
.planner-lead {
  color: var(--ln-muted);
  font-size: 1.06rem;
  line-height: 1.6;
  margin-top: 0.5rem;
}

.lines-filter {
  position: sticky;
  top: 72px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block: 1rem 0.25rem;
  padding: 0.4rem;
  border-radius: 999px;
  background: var(--ln-surface);
  background: color-mix(in srgb, var(--ln-surface) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--ln-border);
  box-shadow: var(--ln-shadow);
}

.lines-filter-icon {
  flex: 0 0 auto;
  margin-inline-start: 0.65rem;
  color: var(--ln-muted);
}

.lines-filter-input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  min-width: 0;
}

.lines-filter-input:focus {
  outline: none;
  box-shadow: none;
}

.lines-filter:focus-within {
  border-color: var(--ln-route);
  box-shadow: 0 0 0 3px rgba(242, 87, 30, 0.25);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ln-route) 25%, transparent);
}

.lines-intro {
  color: var(--ln-muted);
  max-width: 52rem;
  margin-block: 0.35rem 1.25rem;
  line-height: 1.55;
}

.lines-none {
  color: var(--ln-muted);
  font-style: italic;
}

.lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.line-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
}

.line-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.line-card .line-badge {
  font-size: 1.2rem;
  min-width: 2.9rem;
  text-align: center;
}

.line-card-cta {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ln-accent-text);
  white-space: nowrap;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.line-card:hover .line-card-cta,
.line-card:focus-visible .line-card-cta {
  opacity: 1;
  transform: translateX(3px);
}

.line-card-dir-a {
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: var(--ln-text);
}

.line-card-dir-b {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ln-muted);
}

.line-card-swap {
  color: var(--ln-route);
  font-weight: 700;
}

.lines-empty {
  margin-block: 2rem;
}

/* ==========================================================================
   /linije/:broj — detalj linije
   ========================================================================== */

.line-breadcrumb {
  padding-block: 1rem 0;
  font-size: 0.92rem;
}

.line-breadcrumb a {
  color: var(--ln-muted);
  text-decoration: none;
}

.line-breadcrumb a:hover {
  color: var(--ln-accent-text);
  text-decoration: underline;
}

.line-head {
  padding-block: 0.75rem 0.5rem;
}

.line-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

.line-badge--lg {
  font-size: 1.15rem;
  padding: 0.4em 0.7em;
  white-space: nowrap;
}

.line-naziv {
  font-size: clamp(1.15rem, 3.5vw, 1.6rem);
  line-height: 1.25;
}

.line-live-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block: 0.6rem 0;
  color: var(--ln-muted);
  font-size: 0.92rem;
}

/* ---------- Tabovi smjerova (animirani podcrtaj) ---------- */

.line-tabs-wrap {
  margin-block: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--ln-border);
}

.line-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.line-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  max-width: 21rem;
  padding: 0.65rem 0.9rem 0.8rem;
  border: none;
  background: transparent;
  color: var(--ln-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.line-tab:hover {
  color: var(--ln-text);
  background: var(--ln-surface-2);
}

.line-tab::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--ln-route);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.line-tab.is-active {
  color: var(--ln-text);
}

.line-tab.is-active::after {
  transform: scaleX(1);
}

.line-tab-dir {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--ln-surface-2);
  color: var(--ln-muted);
  font-size: 0.78rem;
  font-weight: 800;
  flex: 0 0 auto;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.line-tab.is-active .line-tab-dir {
  background: var(--ln-route);
  color: #fff;
}

[data-theme="dark"] .line-tab.is-active .line-tab-dir {
  color: #001e33;
}

.line-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Raspored: vozni red + karta ---------- */

.line-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 2rem;
  align-items: start;
  padding-bottom: 2.5rem;
}

.line-timeline-wrap,
.line-map-wrap {
  transition: opacity 0.25s ease;
}

.line-body.is-loading .line-timeline-wrap {
  opacity: 0.35;
  pointer-events: none;
}

.line-map-wrap {
  position: sticky;
  top: 84px;
}

.line-map {
  height: 440px;
  border-radius: 16px;
  border: 1px solid var(--ln-border);
  background: var(--ln-map-bg);
  box-shadow: var(--ln-shadow);
  overflow: hidden;
  z-index: 1;
}

.line-map-note {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--ln-muted);
  line-height: 1.45;
}

/* Tamna tema — filtar na pločicama karte (samo tile pane, ne markeri). */
[data-theme="dark"] .line-map .leaflet-tile-pane {
  filter: invert(1) hue-rotate(200deg) saturate(0.55) brightness(0.92) contrast(0.92);
}

[data-theme="dark"] .line-map .leaflet-popup-content-wrapper,
[data-theme="dark"] .line-map .leaflet-popup-tip {
  background: #002d4d;
  color: #e8f0f7;
}

[data-theme="dark"] .line-map .leaflet-control-attribution {
  background: rgba(0, 30, 51, 0.8);
  color: #9fb6c9;
}

[data-theme="dark"] .line-map .leaflet-control-zoom a {
  background: #002d4d;
  color: #e8f0f7;
  border-color: #0d4a72;
}

/* Marker autobusa (divIcon) */
.ln-bus-wrap {
  background: transparent;
  border: none;
}

.ln-bus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 24px;
  border-radius: 8px;
  background: var(--at-orange-600, #f2571e);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 15, 26, 0.4);
}

[data-theme="dark"] .ln-bus {
  background: var(--at-orange-500, #ff6d33);
  color: #001e33;
  border-color: #001e33;
}

/* ---------- Vremenska crta (timeline) ---------- */

.timeline {
  margin-top: 0.5rem;
}

.tl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.tl-stop {
  position: relative;
  padding: 0 0 0.5rem 46px;
}

/* Okomita linija trase */
.tl-stop::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--ln-route);
  background: linear-gradient(
    180deg,
    var(--ln-route),
    color-mix(in srgb, var(--ln-route) 72%, var(--ln-terminus))
  );
  opacity: 0.85;
}

.tl-stop.is-first::before {
  top: 14px;
}

.tl-stop.is-last::before {
  bottom: auto;
  height: 14px;
}

.tl-dot {
  position: absolute;
  left: 10px;
  top: 7px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ln-surface);
  border: 3px solid var(--ln-route);
  box-shadow: 0 0 0 3px var(--ln-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ln-surface) 80%, transparent);
  z-index: 1;
}

.tl-stop.is-first .tl-dot,
.tl-stop.is-last .tl-dot {
  width: 19px;
  height: 19px;
  left: 8px;
  top: 4px;
  background: var(--ln-route);
  border-color: var(--ln-terminus);
}

/* Pulsirajuća točka — stanica sa sljedećim polaskom */
.tl-stop.is-next .tl-dot {
  background: var(--ln-route);
}

.tl-stop.is-next .tl-dot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid var(--ln-route);
  animation: tl-pulse 1.8s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}

@keyframes tl-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.tl-stop-body {
  padding: 0.15rem 0 0.6rem;
  border-bottom: 1px dashed var(--ln-border);
  border-bottom: 1px dashed color-mix(in srgb, var(--ln-border) 75%, transparent);
}

.tl-stop.is-last .tl-stop-body {
  border-bottom: none;
}

.tl-stop-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.tl-stop-name {
  font-weight: 700;
  color: var(--ln-text);
  text-decoration: none;
  line-height: 1.35;
}

.tl-stop-name:hover {
  color: var(--ln-accent-text);
  text-decoration: underline;
}

.tl-stop.is-first .tl-stop-name,
.tl-stop.is-last .tl-stop-name {
  font-size: 1.05rem;
}

.tl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--ln-chip-bg);
  color: var(--ln-accent-text);
  white-space: nowrap;
}

.tl-chip--soon {
  background: var(--ln-chip-soon-bg);
  color: var(--ln-chip-soon-text);
}

.tl-chip--none {
  background: var(--ln-surface-2);
  color: var(--ln-muted);
  font-weight: 600;
}

/* prvi polazak idućeg dana — prigušeno, da se ne čita kao skori polazak */
.tl-chip--next {
  background: var(--ln-surface-2);
  color: var(--ln-muted);
}

/* „Sva vremena” — sklopivi vozni red po satima */
.tl-times {
  margin-top: 0.45rem;
}

.tl-times summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ln-muted);
  border-radius: 8px;
  padding: 0.15rem 0.4rem;
  margin-inline-start: -0.4rem;
  list-style: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.tl-times summary::-webkit-details-marker {
  display: none;
}

.tl-times summary::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}

.tl-times[open] summary::before {
  transform: rotate(45deg);
}

.tl-times summary:hover {
  color: var(--ln-accent-text);
  background: var(--ln-surface-2);
}

.tl-times-count {
  color: var(--ln-muted);
  font-weight: 500;
}

.tl-hours {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.3rem;
}

.tl-hour-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.tl-hour {
  flex: 0 0 auto;
  min-width: 2rem;
  text-align: center;
  padding: 0.18rem 0.3rem;
  border-radius: 7px;
  background: var(--ln-terminus);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .tl-hour {
  color: #001e33;
}

.tl-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.time-pill {
  display: inline-block;
  min-width: 2rem;
  text-align: center;
  padding: 0.18rem 0.35rem;
  border-radius: 7px;
  background: var(--ln-pill-bg);
  color: var(--ln-pill-text);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Kosturno stanje voznog reda */
.tl-skeleton {
  display: grid;
  gap: 0.9rem;
  padding-top: 0.5rem;
}

.tl-skel-row {
  height: 2.6rem;
  border-radius: 12px;
}

/* ==========================================================================
   /planer — planer putovanja
   ========================================================================== */

.planner-container {
  max-width: 56rem;
}

.planner-head {
  padding-block: 1.5rem 1rem;
}

.planner-form {
  padding: 1.25rem;
  overflow: visible; /* dropdown mora izaći iz kartice */
  position: relative;
  z-index: 30;
}

.planner-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: end;
}

.planner-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ln-muted);
  margin-bottom: 0.35rem;
}

.combo {
  position: relative;
}

.combo-input {
  width: 100%;
  padding-inline-start: 2.1rem;
}

.combo-marker {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  translate: 0 -50%;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

.combo-marker--from {
  border: 3px solid var(--ln-route);
  background: transparent;
}

.combo-marker--to {
  background: var(--ln-terminus);
}

.combo-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--ln-surface);
  border: 1px solid var(--ln-border);
  border-radius: 12px;
  box-shadow: var(--ln-shadow);
  max-height: 310px;
  overflow-y: auto;
}

.combo-opt {
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--ln-text);
  transition: background-color 0.15s ease;
}

.combo-opt:hover {
  background: var(--ln-surface-2);
}

.combo-opt.is-active {
  background: var(--ln-chip-bg);
  background: color-mix(in srgb, var(--ln-route) 14%, transparent);
  color: var(--ln-accent-text);
  font-weight: 600;
}

.combo-opt--empty {
  color: var(--ln-muted);
  cursor: default;
  font-style: italic;
}

.combo-opt--empty:hover {
  background: transparent;
}

/* Gumb za zamjenu smjera */
.swap-btn {
  align-self: end;
  margin-bottom: 0.2rem;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
}

.swap-btn.is-flipped {
  transform: rotate(180deg);
}

.swap-btn:hover {
  color: var(--ln-accent-text);
}

.planner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

.planner-when {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ln-muted);
  font-size: 0.9rem;
}

.planner-when strong {
  color: var(--ln-text);
}

/* ---------- Rezultati ---------- */

.planner-results {
  margin-block: 1.75rem 3rem;
}

.planner-results-title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.planner-route-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ln-muted);
}

.trip-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.trip-card {
  display: grid;
  gap: 0.8rem;
  animation: trip-in 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes trip-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.trip-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.trip-line-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ln-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  flex: 1 1 auto;
  min-width: 0;
}

.trip-times {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
}

.trip-time {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.trip-time--arr {
  text-align: right;
  justify-items: end;
}

.trip-time-big {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--ln-text);
  font-variant-numeric: tabular-nums;
}

.trip-stop {
  font-size: 0.85rem;
  color: var(--ln-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.trip-arrow {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  min-width: 4.5rem;
}

.trip-duration {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ln-accent-text);
  white-space: nowrap;
}

.trip-arrow-line {
  position: relative;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ln-border);
  background: color-mix(in srgb, var(--ln-route) 55%, var(--ln-border));
}

.trip-arrow-line::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  translate: 0 -50%;
  border-left: 7px solid var(--ln-route);
  border-block: 5px solid transparent;
}

.trip-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.trip-countdown {
  font-weight: 700;
  color: var(--ln-accent-text);
}

.planner-note {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--ln-muted);
  line-height: 1.5;
}

.planner-empty,
.planner-hint {
  margin-top: 1rem;
}

.planner-empty .btn {
  margin-top: 0.75rem;
}

/* Kosturi rezultata */
.trip-card--skeleton {
  animation: none;
}

.trip-skel-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sk-badge {
  width: 3rem;
  height: 2rem;
  border-radius: 10px;
}

.sk-name {
  width: 55%;
  height: 1rem;
  border-radius: 6px;
}

.sk-times {
  height: 3rem;
  border-radius: 10px;
}

.sk-meta {
  width: 40%;
  height: 1.4rem;
  border-radius: 999px;
}

/* ==========================================================================
   Responzivnost
   ========================================================================== */

@media (max-width: 960px) {
  .line-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .line-map-wrap {
    position: static;
    order: 2;
  }

  .line-timeline-wrap {
    order: 1;
  }

  .line-map {
    height: 320px;
  }
}

@media (max-width: 768px) {
  .lines-filter {
    top: 8px;
  }

  .planner-fields {
    grid-template-columns: 1fr;
  }

  .swap-btn {
    justify-self: center;
    margin-block: -0.2rem;
    transform: rotate(90deg);
  }

  .swap-btn.is-flipped {
    transform: rotate(270deg);
  }

  .trip-times {
    gap: 0.6rem;
  }

  .trip-arrow {
    min-width: 3.2rem;
  }
}

@media (max-width: 480px) {
  .lines-grid {
    grid-template-columns: 1fr;
  }

  .tl-stop {
    padding-left: 38px;
  }

  .tl-stop::before {
    left: 12px;
  }

  .tl-dot {
    left: 6px;
  }

  .tl-stop.is-first .tl-dot,
  .tl-stop.is-last .tl-dot {
    left: 4px;
  }

  .tl-stop-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
}

/* ==========================================================================
   Smanjeno kretanje
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .trip-card,
  .tl-stop.is-next .tl-dot::after {
    animation: none !important;
  }

  .line-tab::after,
  .swap-btn,
  .line-timeline-wrap,
  .line-map-wrap,
  .line-card-cta {
    transition: none !important;
  }
}

/* ==== Planer: putovanja s presjedanjem (etape) ============================ */
.trip-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.trip-badge-sep {
  color: var(--ln-muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.trip-transfers {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trip-transfers--direct {
  color: var(--at-sky-600, #0e7fae);
  border-color: currentColor;
}

.jstart-walk {
  margin: -0.2rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--ln-muted);
}

.jlegs {
  list-style: none;
  margin: 0;
  padding: 0.65rem 0.8rem;
  display: grid;
  gap: 0.55rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--at-navy-700, #003c66) 5%, transparent);
  position: relative;
}

[data-theme="dark"] .jlegs {
  background: color-mix(in srgb, #ffffff 5%, transparent);
}

.jleg {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ln-text);
}

.jleg strong {
  font-variant-numeric: tabular-nums;
}

.jleg--walk {
  color: var(--ln-muted);
  align-items: center;
}

.jleg--transfer {
  color: var(--ln-text);
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-radius: 9px;
  background: color-mix(in srgb, var(--at-orange-600, #f2571e) 8%, transparent);
}

.jleg--transfer .jleg-icon {
  color: var(--at-orange-ink, #c2410c);
}

[data-theme="dark"] .jleg--transfer {
  background: color-mix(in srgb, var(--at-orange-500, #ff6d33) 12%, transparent);
}

[data-theme="dark"] .jleg--transfer .jleg-icon {
  color: var(--at-orange-500, #ff6d33);
}

.jleg-icon {
  display: inline-flex;
  flex: none;
  width: 22px;
  justify-content: center;
  color: var(--at-orange-600, #f2571e);
}

.jleg-arrow {
  color: var(--ln-muted);
  margin: 0 0.15rem;
}

.jleg-dur {
  color: var(--ln-muted);
  font-size: 0.82rem;
}

.line-badge--sm {
  min-width: 30px;
  height: 22px;
  font-size: 0.78rem;
  border-radius: 7px;
  flex: none;
}

/* Poveznica na skupni PDF vozni red (samo prigradske linije) */
.line-pdf {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.line-pdf a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--ln-accent-text);
  text-decoration: none;
}

.line-pdf a:hover,
.line-pdf a:focus-visible { text-decoration: underline; }

.line-pdf-note { color: var(--ln-muted); font-size: 0.85rem; }
