/* postezce.cz — full-bleed map with a floating information panel.
 *
 * The visual identity comes from the KČT turistická značka: the white / colour
 * / white blaze painted along Czech hiking trails. Red is the colour reserved
 * for main long-distance routes, so it marks both the panel and the track.
 */

:root {
  --pz-ink: #17231c;
  --pz-moss: #5e6e5c;
  --pz-limestone: #f2f4f1;
  --pz-blaze: #c4362c;

  --pz-panel-width: 22rem;
  --pz-radius: 0.75rem;
  --pz-shadow: 0 1.25rem 2.5rem rgb(23 35 28 / 18%);

  --bs-body-font-family: "IBM Plex Sans", system-ui, sans-serif;
  --bs-body-color: var(--pz-ink);
}

html,
body {
  height: 100%;
}

body {
  background: var(--pz-limestone);
  overflow: hidden;
}

/* Map ------------------------------------------------------------------- */

.pz-map {
  position: fixed;
  inset: 0;
  background: var(--pz-limestone);
}

/* Leaflet's own chrome, toned down to sit under the panel. */
.leaflet-container {
  font-family: var(--bs-body-font-family);
}

.leaflet-control-zoom a,
.leaflet-control-attribution {
  color: var(--pz-ink);
}

.leaflet-tooltip.pz-tooltip {
  background: var(--pz-ink);
  border: 0;
  border-radius: 0.375rem;
  box-shadow: var(--pz-shadow);
  color: var(--pz-limestone);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
}

.leaflet-tooltip.pz-tooltip::before {
  display: none;
}

.pz-tooltip__number {
  color: rgb(255 255 255 / 60%);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  margin-right: 0.375rem;
}

.mapy-logo-control {
  background: rgb(255 255 255 / 85%);
  border-radius: 0.25rem;
  line-height: 0;
  padding: 0.2rem;
}

.mapy-logo-control img {
  height: auto;
  width: 100px;
}

/* Panel ----------------------------------------------------------------- */

.pz-panel {
  position: fixed;
  z-index: 1000; /* above Leaflet panes and controls */
  inset: 1rem 1rem auto 1rem;
  pointer-events: none;
}

.pz-panel__card {
  backdrop-filter: blur(0.75rem);
  background: rgb(242 244 241 / 92%);
  border-radius: var(--pz-radius);
  box-shadow: var(--pz-shadow);
  /* The page itself does not scroll, so a tall panel scrolls on its own. */
  max-height: calc(100dvh - 2rem);
  max-width: var(--pz-panel-width);
  overflow-y: auto;
  pointer-events: auto;
}

.pz-panel__head {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
}

.pz-panel__titles {
  flex: 1 1 auto;
  min-width: 0;
}

.pz-account {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 0.5rem;
}

.pz-account__name {
  color: var(--pz-moss);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
}

.pz-account__form {
  margin: 0;
}

/* The blaze: white / red / white, tilted a touch because the real ones are
 * painted by hand and never sit square on the tree. */
.pz-blaze {
  background: linear-gradient(
    to bottom,
    #fff 0 32%,
    var(--pz-blaze) 32% 68%,
    #fff 68% 100%
  );
  border: 1px solid rgb(23 35 28 / 12%);
  border-radius: 0.125rem;
  box-shadow: 0 0.125rem 0.375rem rgb(23 35 28 / 12%);
  flex: 0 0 auto;
  height: 1.75rem;
  rotate: -2.5deg;
  width: 1.75rem;
}

.pz-eyebrow {
  color: var(--pz-moss);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.pz-title {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0.0625rem 0 0;
}

.pz-panel__body {
  border-top: 1px solid rgb(23 35 28 / 10%);
  margin: 0 1rem;
  padding: 0.875rem 0 1rem;
}

.pz-lede {
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0;
}

.pz-note {
  color: var(--pz-moss);
  font-size: 0.8125rem;
  line-height: 1.45;
  margin: 0.5rem 0 0;
}

/* Route figures ---------------------------------------------------------- */

.pz-figures {
  border-top: 1px solid rgb(23 35 28 / 10%);
  display: flex;
  gap: 1.5rem;
  margin: 0.875rem 0 0;
  padding-top: 0.875rem;
}

.pz-figure__label {
  color: var(--pz-moss);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pz-figure__value {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0.125rem 0 0;
  /* Keeps "2 166 km" on one line at the panel's width. */
  white-space: nowrap;
}

.pz-branches {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.pz-branch {
  display: flex;
  font-size: 0.8125rem;
  gap: 0.5rem;
  justify-content: space-between;
}

.pz-branch + .pz-branch {
  margin-top: 0.1875rem;
}

.pz-branch__detail {
  color: var(--pz-moss);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  white-space: nowrap;
}

.pz-toggle {
  border: 1px solid rgb(23 35 28 / 15%);
  color: var(--pz-ink);
  flex: 0 0 auto;
  font-size: 0.8125rem;
}

.pz-toggle[aria-expanded="true"] .pz-toggle__label::after {
  content: "\2212"; /* minus */
}

.pz-toggle[aria-expanded="false"] .pz-toggle__label::after {
  content: "\002B"; /* plus */
}

.pz-toggle__label::after {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  margin-left: 0.375rem;
}

:where(a, button, .leaflet-control a):focus-visible {
  outline: 2px solid var(--pz-blaze);
  outline-offset: 2px;
}

/* Below the panel breakpoint the card spans the top of the screen, so the zoom
 * buttons move down clear of it. */
@media (max-width: 991.98px) {
  .leaflet-top.leaflet-right {
    top: 5rem;
  }
}

@media (min-width: 992px) {
  .pz-panel {
    inset: 1.5rem auto 1.5rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .collapsing {
    transition: none;
  }
}
