/* FM.guide – kartor (frekvenskarta och täckningskartor) */

.fmg-freqmap {
  --fmg-blue: #3388ff;
  --fmg-red: #cc0000;
  --fmg-grey: #999999;
  --fmg-border: #cfd5db;
  --fmg-line: #e4e8ec;
  --fmg-muted: #5c6773;
  --fmg-soft: #f4f6f8;
  margin: 0 0 1.5em;
}

.fmg-freqmap [hidden] {
  display: none !important;
}

/* ---- Kartan ---- */

.fmg-map {
  width: 100%;
  max-width: 100%;
  height: min(var(--fmg-map-h, 650px), 75vh);
  min-height: 320px;
  position: relative;
  z-index: 0; /* håller Leaflets lager under temats meny */
  border-radius: 4px;
}

.fmg-map .leaflet-popup-content {
  line-height: 1.45;
}

/* ---- Reglage ---- */

.fmg-freqmap .fmg-controls {
  margin-bottom: 10px;
}

.fmg-freqmap .fmg-freq-label {
  display: block;
  margin: 0 0 6px;
  font-weight: 600;
}

.fmg-freqmap .fmg-freq-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.fmg-freqmap .fmg-slider {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 620px;
  margin: 0;
  accent-color: var(--fmg-blue);
}

.fmg-freqmap .fmg-step {
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #333;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
}

.fmg-freqmap .fmg-step:hover,
.fmg-freqmap .fmg-step:focus-visible {
  background: var(--fmg-soft);
  color: #000;
}

.fmg-freqmap .fmg-freq-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.fmg-freqmap .fmg-freq-input {
  width: 4.4em;
  margin: 0;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 1.15em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  box-shadow: none;
}

.fmg-freqmap .fmg-freq-input.is-invalid {
  border-color: var(--fmg-red);
  outline-color: var(--fmg-red);
}

.fmg-freqmap .fmg-hint {
  min-height: 0;
  margin: 6px 0 0;
  color: var(--fmg-red);
  font-size: 0.9em;
}

.fmg-freqmap .fmg-hint:empty {
  display: none;
}

/* ---- Teckenförklaring ---- */

.fmg-freqmap .fmg-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  color: var(--fmg-muted);
  font-size: 0.9em;
}

.fmg-freqmap .fmg-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.fmg-freqmap .fmg-legend li::before {
  content: none;
}

.fmg-freqmap .fmg-legend img {
  width: 12px;
  height: 20px;
  margin: 0;
}

.fmg-freqmap .fmg-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--fmg-grey);
  border-radius: 50%;
  background: rgba(153, 153, 153, 0.25);
}

.fmg-freqmap .fmg-legend .fmg-legend-note {
  flex-basis: 100%;
  font-size: 0.95em;
}

/* ---- Resultat under kartan ---- */

.fmg-freqmap .fmg-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 14px 0 6px;
}

.fmg-freqmap .fmg-count {
  font-weight: 700;
}

.fmg-freqmap .fmg-zoom,
.fmg-freqmap .fmg-show {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  box-shadow: none;
  cursor: pointer;
}

.fmg-freqmap .fmg-zoom {
  font-size: 0.9em;
  color: var(--fmg-muted);
}

.fmg-freqmap .fmg-zoom:hover,
.fmg-freqmap .fmg-show:hover,
.fmg-freqmap .fmg-zoom:focus-visible,
.fmg-freqmap .fmg-show:focus-visible {
  background: none;
  color: var(--fmg-blue);
  text-decoration-style: solid;
}

.fmg-freqmap .fmg-table-wrap {
  overflow-x: auto;
}

.fmg-freqmap .fmg-table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  font-size: 0.95em;
}

.fmg-freqmap .fmg-table th,
.fmg-freqmap .fmg-table td {
  padding: 6px 10px 6px 0;
  border: 0;
  border-bottom: 1px solid var(--fmg-line);
  background: none;
  text-align: left;
  vertical-align: top;
}

.fmg-freqmap .fmg-table thead th {
  color: var(--fmg-muted);
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fmg-freqmap .fmg-table .fmg-group th {
  padding-top: 16px;
  color: var(--fmg-muted);
  font-weight: 600;
}

.fmg-freqmap .fmg-col-freq {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fmg-freqmap .fmg-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--fmg-blue);
  vertical-align: 0;
}

.fmg-freqmap .fmg-row-inactive .fmg-dot {
  background: var(--fmg-red);
}

.fmg-freqmap .fmg-row-adj .fmg-dot {
  background: var(--fmg-grey);
}

.fmg-freqmap .fmg-row-adj td {
  color: var(--fmg-muted);
}

.fmg-freqmap .fmg-row-inactive .fmg-col-status {
  color: var(--fmg-red);
}

.fmg-freqmap .fmg-muted {
  color: var(--fmg-muted);
  font-size: 0.9em;
}

@media (max-width: 480px) {
  .fmg-freqmap .fmg-col-status {
    display: none;
  }

  .fmg-freqmap .fmg-legend .fmg-legend-note {
    font-size: 0.9em;
  }
}
