/* Barborská cesta – widget „Mapa celej trasy“ (mapa + výškový profil)
   Všetko je pod triedou .bcrw, takže nekoliduje so štýlmi hostiteľskej stránky.
   Farby a výšku si môžete prestaviť cez premenné nižšie. */
.bcrw {
  --bcrw-ink: #15232d;
  --bcrw-soft: #3a5171;
  --bcrw-bg: #ffffff;
  --bcrw-line: #cdd3c3;
  --bcrw-band: #eef1f6;
  --bcrw-green: #3a5171;
  --bcrw-yellow: #88a0bb;
  --bcrw-slate: #15232d;
  --bcrw-height: 600px;
  --bcrw-radius: 6px;
  --bcrw-font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bcrw-display: "Barlow Condensed", "Arial Narrow", var(--bcrw-font);
  container-type: inline-size;
  color: var(--bcrw-ink);
  font: 400 15px/1.45 var(--bcrw-font);
  text-align: left;
}
.bcrw *, .bcrw *::before, .bcrw *::after { box-sizing: border-box; }
.bcrw-loading { margin: 0; padding: 3rem 1rem; text-align: center; color: var(--bcrw-soft); background: var(--bcrw-band); border-radius: var(--bcrw-radius); }

.bcrw-grid {
  display: grid; grid-template-columns: 1fr; gap: 0;
  background: var(--bcrw-bg); border: 1px solid var(--bcrw-line); border-radius: var(--bcrw-radius); overflow: hidden;
  box-shadow: 0 6px 24px rgba(21, 35, 45, .08);
}
.bcrw-mapbox { position: relative; height: 360px; background: #dbe3ec; isolation: isolate; z-index: 0; }
.bcrw-map { position: absolute; inset: 0; }
.bcrw-side { display: flex; flex-direction: column; min-width: 0; padding: 16px 16px 14px; }

@container (min-width: 760px) {
  .bcrw-grid { grid-template-columns: 1fr 1fr; height: var(--bcrw-height); }
  .bcrw-mapbox { height: auto; }
  .bcrw-side { padding: 18px 20px 16px; border-left: 1px solid var(--bcrw-line); }
}

/* hlavička profilu */
.bcrw-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; min-height: 52px; }
.bcrw-head h3 { margin: 0; font: 600 1.4rem/1.1 var(--bcrw-display); color: var(--bcrw-ink); }
.bcrw-head h3 small { font: 500 1rem/1 var(--bcrw-font); color: var(--bcrw-soft); margin-left: .35rem; }
.bcrw-sum { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font: 500 .9rem/1.3 var(--bcrw-font); color: var(--bcrw-soft); }
.bcrw-sum span:first-child { color: var(--bcrw-ink); font-weight: 600; }
.bcrw-actions { display: flex; gap: 6px; }
.bcrw-btn {
  display: inline-block; padding: 5px 10px; border-radius: 4px; border: 1px solid var(--bcrw-line); background: var(--bcrw-bg);
  font: 600 .85rem/1.2 var(--bcrw-font); color: var(--bcrw-ink); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.bcrw-btn:hover { border-color: var(--bcrw-green); color: var(--bcrw-green); }
.bcrw-go { background: var(--bcrw-green); border-color: var(--bcrw-green); color: #fff; }
.bcrw-go:hover { background: #1a2f4f; color: #fff; }

/* graf */
.bcrw-plot { position: relative; flex: 1 1 auto; min-height: 130px; margin-top: 2px; touch-action: pan-y; cursor: crosshair; outline: none; border-radius: 4px; }
.bcrw-plot:focus-visible { box-shadow: 0 0 0 3px var(--bcrw-yellow); }
.bcrw-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; user-select: none; }
.bcrw-band { fill: transparent; transition: fill .15s; }
.bcrw-band.odd { fill: var(--bcrw-band); }
.bcrw-band.is-hot { fill: rgba(136, 160, 187, .22); }
.bcrw-band-lbl { font: 700 12px/1 var(--bcrw-font); fill: var(--bcrw-soft); text-anchor: middle; }
.bcrw-g { stroke: var(--bcrw-line); stroke-width: 1; stroke-dasharray: 2 3; }
.bcrw-ty { font: 500 11px/1 var(--bcrw-font); fill: var(--bcrw-soft); text-anchor: end; }
.bcrw-tx { font: 500 11px/1 var(--bcrw-font); fill: var(--bcrw-soft); text-anchor: middle; }
.bcrw-tx.end { text-anchor: end; font-weight: 700; fill: var(--bcrw-ink); }
.bcrw-ln { fill: none; stroke: var(--bcrw-green); stroke-width: 2; stroke-linejoin: round; }
.bcrw-peak circle { fill: var(--bcrw-green); }
.bcrw-peak text { font: 700 11px/1 var(--bcrw-font); fill: var(--bcrw-ink); paint-order: stroke; stroke: var(--bcrw-bg); stroke-width: 3px; }
.bcrw-pdot { fill: var(--bcrw-yellow); stroke: var(--bcrw-slate); stroke-width: 1.5; }
.bcrw-pstop line { stroke: var(--bcrw-slate); stroke-width: 1; stroke-dasharray: 2 2; opacity: .5; }
.bcrw-pstop circle { fill: var(--bcrw-yellow); stroke: var(--bcrw-slate); stroke-width: 1.5; }
.bcrw-pstop text { font: 700 11px/1 var(--bcrw-font); fill: var(--bcrw-slate); text-anchor: middle; }
.bcrw-cur line { stroke: var(--bcrw-slate); stroke-width: 1; }
.bcrw-cur circle { fill: #fff; stroke: var(--bcrw-slate); stroke-width: 2.5; }
.bcrw-tip {
  position: absolute; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  background: var(--bcrw-slate); color: #fff; padding: 4px 8px; border-radius: 4px; font: 500 12px/1.3 var(--bcrw-font);
}
.bcrw-tip b { color: var(--bcrw-yellow); font-weight: 700; }
.bcrw-note { margin: 6px 0 8px; font-size: .8rem; color: var(--bcrw-soft); }

/* zoznam etáp */
.bcrw-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px; }
.bcrw-stages button {
  width: 100%; display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 6px; padding: 4px 6px;
  border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer; text-align: left;
  font: 500 .8rem/1.2 var(--bcrw-font); color: var(--bcrw-ink);
}
.bcrw-stages button:hover, .bcrw-stages button.is-hot { background: rgba(136, 160, 187, .18); }
.bcrw-stages button[aria-pressed="true"] { border-color: var(--bcrw-green); background: rgba(58, 81, 113, .08); }
.bcrw-num {
  width: 22px; height: 22px; display: grid; place-items: center; background: var(--bcrw-yellow); color: #15232d;
  border: 2px solid var(--bcrw-slate); font: 700 .8rem/1 var(--bcrw-display);
}
.bcrw-st-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcrw-st-km { color: var(--bcrw-soft); font-size: .75rem; }

/* prvky na mape */
.bcrw .leaflet-container { font: 13px/1.4 var(--bcrw-font); }
.bcrw-stage-lbl {
  width: 26px !important; height: 26px !important; margin: -13px 0 0 -13px !important; display: grid; place-items: center;
  background: var(--bcrw-yellow); color: #15232d; border: 2px solid var(--bcrw-slate); font: 700 15px/1 var(--bcrw-display);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35); cursor: pointer;
}
.bcrw-stop {
  width: 20px !important; height: 20px !important; margin: -10px 0 0 -10px !important; display: grid; place-items: center;
  background: var(--bcrw-green); color: #fff; border: 2px solid #fff; border-radius: 50%; font: 700 10px/1 var(--bcrw-font);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.bcrw-tt { font: 600 12px/1.3 var(--bcrw-font); }
.bcrw-popup .leaflet-popup-content { margin: 10px 12px; }
.bcrw-pop img { display: block; width: 100%; height: 130px; object-fit: cover; border-radius: 4px; margin-bottom: 8px; }
.bcrw-pop small { display: block; color: var(--bcrw-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.bcrw-pop strong { display: block; font: 600 17px/1.15 var(--bcrw-display); margin: 2px 0 4px; }
.bcrw-pop p { margin: 0 0 6px; font-size: 12.5px; }
.bcrw-pop a { color: var(--bcrw-green); font-weight: 600; }

/* legenda a body na mape */
.bcrw .leaflet-control-layers-overlays label > span, .bcrw .leaflet-control-layers-base label > span { display: inline-flex; align-items: center; gap: 4px; }
.bcrw-lg { display: inline-block; vertical-align: middle; margin: 0 6px 0 2px; position: static !important; }
.bcrw-lg-hike, .bcrw-lg-bike { width: 18px; height: 5px; border-radius: 2px; background: #e0261b; box-shadow: 0 0 0 1.5px #15232d; }
.bcrw-lg-bike { background: #3d7fd9; }
.bcrw-lg.bcrw-stop { width: 12px !important; height: 12px !important; margin: 0 6px 0 2px !important; border-width: 1.5px; font-size: 0; }
.bcrw-lg.bcrw-stamp, .bcrw-lg.bcrw-stay { margin: 0 7px 0 3px !important; }
.bcrw-stamp {
  width: 12px !important; height: 12px !important; margin: -6px 0 0 -6px !important; background: var(--bcrw-yellow);
  border: 2px solid var(--bcrw-slate); transform: rotate(45deg); box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.bcrw-stay {
  width: 12px !important; height: 12px !important; margin: -6px 0 0 -6px !important; background: #fff;
  border: 2px solid var(--bcrw-slate); border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.bcrw-pop-c { font-size: 12.5px; }

.bcrw .leaflet-control-layers-expanded { padding: 6px 10px 6px 6px; font-size: 12.5px; line-height: 1.5; }
.bcrw .leaflet-control-layers-separator { margin: 4px -10px 4px -6px; }

/* výškové profily: 1 alebo 2 pod sebou podľa legendy */
.bcrw-profiles { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; margin-top: 6px; }
.bcrw-prof { flex: 1 1 0; display: flex; flex-direction: column; min-height: 150px; }
.bcrw-prof[hidden] { display: none; }
.bcrw-prof-head { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font: 500 .82rem/1.3 var(--bcrw-font); color: var(--bcrw-soft); }
.bcrw-prof-head .bcrw-lg { margin: 0 -4px 0 0; }
.bcrw-prof-head b { color: var(--bcrw-ink); font-weight: 700; }
.bcrw-prof-sum { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; }
.bcrw-prof-sum span:first-child { color: var(--bcrw-ink); font-weight: 600; }
.bcrw-empty { margin: auto 0; padding: 2rem 1rem; text-align: center; color: var(--bcrw-soft); background: var(--bcrw-band); border-radius: 4px; font-size: .9rem; }
.bcrw-head { min-height: 0; }
.bcrw-head h3 { font-size: 1.3rem; }

/* celá obrazovka */
.bcrw-fs { position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; background: #fff; }
.bcrw-fs-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; background: #15232d; color: #fff; font: 600 1rem/1.2 "Barlow", system-ui, sans-serif; }
.bcrw-fs-close { border: 1px solid rgba(255,255,255,.4); background: none; color: #fff; padding: 6px 12px; border-radius: 4px; cursor: pointer; font: 600 .9rem/1 "Barlow", system-ui, sans-serif; }
.bcrw-fs-close span { font-size: 1.2em; margin-left: 4px; }
.bcrw-fs-close:hover { background: rgba(255,255,255,.12); }
.bcrw-fs-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.bcrw-fs-body.bcrw { --bcrw-height: calc(100vh - 50px); --bcrw-height: calc(100dvh - 50px); }
.bcrw-fs-body .bcrw-grid { border: 0; border-radius: 0; box-shadow: none; min-height: 100%; }
@container (min-width: 760px) { .bcrw-fs-body .bcrw-grid { grid-template-columns: 3fr 2fr; } }
.bcrw-fs-body .bcrw-mapbox { height: 55vh; }
@container (min-width: 760px) { .bcrw-fs-body .bcrw-mapbox { height: auto; } }

/* tlačidlo „Otvoriť na celú obrazovku" */
.bcrw-open-fs { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.bcrw-open-fs svg { width: 16px; height: 16px; flex: none; }
