/* Interaktivní ukázka topografických funkcí (js/topograficke-funkce.js) */

.tf {
  --tf-border: var(--md-default-fg-color--lightest);

  position: relative;
  margin: 1.2em 0;
  padding: 0.8rem;
  border: 0.05rem solid var(--tf-border);
  border-radius: 0.2rem;
  font-size: 0.7rem;
  line-height: 1.4;
}

/* záložky */
.tf-tabs { display: flex; flex-wrap: wrap; margin-bottom: 0.8rem; }
.tf-seg { display: flex; flex-wrap: wrap; margin-bottom: 0.6rem; }   /* přepínač režimu ve Viewshed */
.tf-tabs .tf-btn, .tf-seg .tf-btn { border-radius: 0; margin: 0 -0.05rem -0.05rem 0; }
.tf-tabs .tf-btn:first-child, .tf-seg .tf-btn:first-child { border-radius: 0.1rem 0 0 0.1rem; }
.tf-tabs .tf-btn:last-child, .tf-seg .tf-btn:last-child { border-radius: 0 0.1rem 0.1rem 0; }

.tf-btn {
  font: inherit;
  cursor: pointer;
  color: var(--md-primary-fg-color);
  background: transparent;
  border: 0.05rem solid var(--md-primary-fg-color);
  border-radius: 0.1rem;
  padding: 0.25rem 0.6rem;
  white-space: nowrap;
  transition: background-color 125ms, color 125ms;
}
.tf-btn:hover { background: var(--md-accent-fg-color--transparent, rgba(0,0,0,0.05)); }
.tf-btn[aria-pressed="true"] {
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
}
.tf-btn:focus-visible { outline: 0.1rem solid var(--md-accent-fg-color); outline-offset: 0.1rem; }

/* mapa + panel vedle sebe, na úzkém displeji pod sebou */
.tf-body { display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; }
.tf-mapcol { flex: 1 1 16rem; min-width: 0; max-width: 28rem; }
.tf-panel { flex: 1 1 12rem; min-width: 0; }

.tf-map {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #000;
  border-radius: 0.1rem;
  cursor: crosshair;
}
.tf-map canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.tf-map .tf-overlay { position: absolute; inset: 0; image-rendering: auto; pointer-events: none; }
.tf-map.tf-drag { touch-action: none; }
.tf-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e53935;
  box-shadow: 0 0 0 1px #000;
  pointer-events: none;
}
.tf-marker[hidden] { display: none; }
.tf-north {
  position: absolute;
  top: 0.3rem;
  right: 0.4rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.6rem;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 3px #000;
  pointer-events: none;
}

.tf-below { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; margin-top: 0.3rem; }
.tf-readout {
  min-height: 1.4em;
  font-family: var(--md-code-font-family);
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
  color: var(--md-default-fg-color--light);
}

/* panel */
.tf-title { font-size: 0.8rem; font-weight: 700; }
.tf-tool, .tf-hint { color: var(--md-default-fg-color--light); }
.tf-tool { margin-bottom: 0.4rem; }
.md-typeset .tf-panel p { margin: 0 0 0.5rem; }

.tf-ctrl {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0;
  border-top: 0.05rem solid var(--tf-border);
  border-bottom: 0.05rem solid var(--tf-border);
}
.tf-ctrl > .tf-btn { align-self: flex-start; }
.tf-check { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; user-select: none; }
.tf input[type="checkbox"], .tf input[type="radio"] { accent-color: var(--md-primary-fg-color); margin: 0; }
.tf input[type="range"] { width: 100%; accent-color: var(--md-primary-fg-color); margin: 0.2rem 0; }
.tf-lab { display: flex; justify-content: space-between; gap: 0.4rem; color: var(--md-default-fg-color--light); }
.tf-val { color: var(--md-default-fg-color); font-variant-numeric: tabular-nums; font-weight: 700; }

.tf-dirs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.1rem 0.2rem; text-align: center; margin: 0.2rem 0; }
.tf-dirs .tf-check { justify-content: center; }
.tf-expr { margin-top: 0.3rem; }

/* legenda */
.tf-legend > div { margin: 0.1rem 0; }
.tf-sw {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.3rem;
  border: 0.05rem solid var(--tf-border);
  border-radius: 0.1rem;
  vertical-align: -0.1rem;
}
.tf-grad { height: 0.5rem; border-radius: 0.1rem; }
.tf-scale-lab { display: flex; justify-content: space-between; color: var(--md-default-fg-color--light); margin-top: 0.15rem; }
.tf-stat {
  margin-top: 0.4rem;
  padding-top: 0.3rem;
  border-top: 0.05rem dashed var(--tf-border);
  color: var(--md-default-fg-color--light);
}
.tf-los { margin-bottom: 0.3rem; }
.tf-profile { display: block; width: 100%; height: 7rem; margin: 0.2rem 0 0.4rem; }
.tf-bivar {
  display: grid;
  grid-template-columns: 2.6rem repeat(8, 1fr);
  gap: 2px;
  align-items: center;
  text-align: center;
  font-size: 0.55rem;
}
.tf-bivar span { height: 0.7rem; border-radius: 2px; }

@media screen and (max-width: 30em) {
  .tf { padding: 0.6rem; }
  .tf-mapcol { max-width: none; }
}
