/* Meteolab 2027 – Potresi */

.ml-earthquakes-section {
  padding-top: 0;
}

.ml-earthquakes-card {
  overflow: hidden;
  padding: 0;
}

.ml-earthquake-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  background: #fff;
  scrollbar-width: thin;
}

.ml-earthquake-region {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid rgba(21, 130, 199, .24);
  border-radius: 999px;
  background: #eaf5fc;
  color: #0d5f9c;
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.ml-earthquake-region:hover {
  transform: translateY(-1px);
  border-color: #002050;
}

.ml-earthquake-region.is-active {
  border-color: #002050;
  background: #002050;
  color: #fff;
}

.ml-earthquake-map-wrap {
  position: relative;
}

.ml-earthquake-map {
  width: 100%;
  height: 690px;
  min-height: 520px;
  background: #e7eff6;
}

.ml-earthquake-loading {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 900;
  transform: translateX(-50%);
  padding: 8px 13px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  color: #526176;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .14);
  font-size: .78rem;
  font-weight: 750;
  pointer-events: none;
}

.ml-earthquake-loading[hidden] {
  display: none;
}

.ml-earthquake-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  border-top: 1px solid rgba(15, 23, 42, .08);
  background: #fff;
  color: #64748b;
  font-size: .78rem;
}

.ml-earthquake-foot div,
.ml-earthquake-foot strong,
.ml-earthquake-foot span {
  display: block;
}

.ml-earthquake-foot strong {
  margin-bottom: 2px;
  color: #0f172a;
  font-size: .86rem;
}

.ml-earthquake-note {
  margin-top: 20px;
}

/* Leaflet */
.ml-earthquake-map .leaflet-control-zoom a {
  color: #0f172a;
}

.ml-earthquake-map .leaflet-popup-content-wrapper {
  border-radius: 12px;
}

.ml-earthquake-map .leaflet-popup-content {
  min-width: 220px;
  margin: 14px 16px;
}

.ml-quake-popup h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 1rem;
}

.ml-quake-popup dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 10px;
  margin: 0;
  font-size: .78rem;
}

.ml-quake-popup dt {
  color: #64748b;
  font-weight: 650;
}

.ml-quake-popup dd {
  margin: 0;
  color: #0f172a;
  font-weight: 750;
  text-align: right;
}

.ml-quake-popup .ml-quake-place {
  margin: 9px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 23, 42, .09);
  color: #334155;
  font-size: .78rem;
  line-height: 1.35;
}

.ml-quake-mag-label {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #111827 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-shadow:
    -1px -1px 0 rgba(255,255,255,.98),
     1px -1px 0 rgba(255,255,255,.98),
    -1px  1px 0 rgba(255,255,255,.98),
     1px  1px 0 rgba(255,255,255,.98),
     0 2px 3px rgba(255,255,255,.98);
  pointer-events: none;
}

.ml-quake-mag-label::before {
  display: none !important;
}

.ml-earthquake-legend {
  width: max-content;
  min-width: 0;
  max-width: 126px;
  padding: 8px 8px;
  border: 1px solid rgba(15, 23, 42, .16);
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .16);
  font-size: 10px;
  line-height: 1.25;
}

.ml-earthquake-legend strong {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.ml-earthquake-legend-row {
  display: grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 5px;
  margin: 2px 0;
  white-space: nowrap;
}

.ml-earthquake-legend-color {
  width: 16px;
  height: 7px;
  border: 1px solid rgba(0, 0, 0, .25);
  border-radius: 3px;
}

.ml-earthquake-legend-scale {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(15, 23, 42, .09);
  color: #475569;
}

.ml-earthquake-empty {
  position: relative;
  width: min(232px, calc(100vw - 96px));
  padding: 10px 12px 10px 38px;
  border: 1px solid rgba(21, 130, 199, .24);
  border-radius: 11px;
  background: rgba(255, 255, 255, .96);
  color: #334155;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .14);
  font-size: .72rem;
  line-height: 1.25;
}

.ml-earthquake-empty::before {
  content: "i";
  position: absolute;
  top: 50%;
  left: 11px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #002050;
  color: #fff;
  font-size: .7rem;
  font-weight: 900;
  font-style: normal;
  line-height: 1;
}

.ml-earthquake-empty-title,
.ml-earthquake-empty-text {
  display: block;
}

.ml-earthquake-empty-title {
  margin-bottom: 2px;
  color: #0f172a;
  font-size: .76rem;
  font-weight: 850;
}

.ml-earthquake-empty-text {
  color: #64748b;
  font-weight: 650;
}

@media (max-width: 700px) {
  .ml-earthquake-toolbar {
    padding: 11px 12px;
  }

  .ml-earthquake-region {
    min-height: 36px;
    padding: 7px 13px;
    font-size: .78rem;
  }

  .ml-earthquake-map {
    height: 68vh;
    min-height: 500px;
  }

  .ml-earthquake-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 11px 13px;
  }

  .ml-earthquake-legend {
    min-width: 0;
    max-width: 118px;
    padding: 6px 7px;
  }

  .ml-quake-mag-label {
    font-size: 10px !important;
  }
}

@media (max-width: 430px) {
  .ml-earthquake-map {
    height: 64vh;
    min-height: 460px;
  }
}


/* Gumb za lokacijo pod kontrolnikom za povečavo/pomanjšavo. */
.ml-earthquake-location-control {
  margin-top: 10px !important;
}

.ml-earthquake-location-btn {
  display: grid;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #0f172a;
  line-height: 30px;
  cursor: pointer;
}

.ml-earthquake-location-btn:hover {
  background: #f1f5f9;
  color: #002050;
}

.ml-earthquake-location-btn:disabled {
  cursor: wait;
}

.ml-earthquake-location-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ml-earthquake-location-btn.is-loading svg {
  animation: ml-earthquake-location-spin .8s linear infinite;
}

.ml-earthquake-location-btn.has-error {
  color: #c2410c;
}

@keyframes ml-earthquake-location-spin {
  to { transform: rotate(360deg); }
}

/* Obvestilo brez dogodkov v zgornjem desnem kotu zemljevida. */
.ml-earthquake-map .leaflet-top.leaflet-right {
  right: 0 !important;
}

.ml-earthquake-map .leaflet-top.leaflet-right .ml-earthquake-empty {
  margin-top: 10px;
  margin-right: 8px;
}


/* Desktop legenda tik ob desnem robu karte. */
.ml-earthquake-map .leaflet-bottom.leaflet-right {
  right: 0 !important;
}

.ml-earthquake-map .leaflet-bottom.leaflet-right .ml-earthquake-legend {
  margin-right: 0 !important;
  margin-bottom: 7px !important;
  transform: translateX(0);
}

/* Mobilna legenda je ločena od Leaflet karte. */
.ml-earthquake-legend-mobile {
  display: none;
}

@media (max-width: 700px) {
  .ml-earthquake-map .leaflet-bottom.leaflet-right {
    display: none;
  }

  .ml-earthquake-legend-mobile {
    display: block;
    padding: 7px 10px 6px;
    border-top: 1px solid rgba(15, 23, 42, .10);
    background: #fff;
    color: #0f172a;
    font-size: 9px;
    line-height: 1.15;
  }

  .ml-earthquake-legend-mobile strong {
    display: block;
    margin: 0 0 5px;
    font-size: 10px;
  }

  .ml-earthquake-legend-mobile .ml-earthquake-legend-items {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 7px;
  }

  .ml-earthquake-legend-mobile .ml-earthquake-legend-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin: 0;
    white-space: nowrap;
  }

  .ml-earthquake-legend-mobile .ml-earthquake-legend-color {
    width: 13px;
    height: 6px;
    flex: 0 0 13px;
  }

  .ml-earthquake-legend-mobile .ml-earthquake-legend-scale {
    margin-top: 5px;
    padding-top: 4px;
    border-top: 1px solid rgba(15, 23, 42, .08);
    color: #64748b;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .ml-earthquake-legend-mobile .ml-earthquake-legend-items {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px 4px;
  }

  .ml-earthquake-legend-mobile {
    padding-inline: 7px;
    font-size: 8px;
  }
}


@media (max-width: 700px) {
  .ml-earthquake-map .leaflet-top.leaflet-right .ml-earthquake-empty {
    width: min(216px, calc(100vw - 88px));
    margin-top: 8px;
    margin-right: 7px;
    padding: 8px 10px 8px 34px;
  }

  .ml-earthquake-empty::before {
    left: 9px;
    width: 17px;
    height: 17px;
  }

  .ml-earthquake-empty-title {
    font-size: .72rem;
  }

  .ml-earthquake-empty-text {
    font-size: .66rem;
  }
}


/* V5: lastna pozicionirana elementa, neodvisna od Leaflet control vogalov. */
.ml-earthquake-map {
  position: relative;
}

.ml-earthquake-legend-desktop {
  position: absolute;
  right: 12px;
  bottom: 31px;
  z-index: 800;
  margin: 0 !important;
  transform: none !important;
}

.ml-earthquake-empty {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 820;
  width: min(224px, calc(100% - 92px));
  margin: 0 !important;
}

/* Stari Leaflet položaj legende se ne uporablja več. */
.ml-earthquake-map .leaflet-bottom.leaflet-right .ml-earthquake-legend {
  display: none !important;
}

@media (max-width: 700px) {
  .ml-earthquake-legend-desktop {
    display: none !important;
  }

  .ml-earthquake-empty {
    top: 10px;
    right: 10px;
    width: min(210px, calc(100% - 84px));
  }
}


/* Končna poravnava zgornjega obvestila in namizne legende. */
.ml-earthquake-map > .ml-earthquake-empty {
  right: 12px !important;
}

.ml-earthquake-map > .ml-earthquake-legend-desktop {
  right: 12px !important;
}

@media (max-width: 700px) {
  .ml-earthquake-map > .ml-earthquake-empty {
    right: 10px !important;
  }
}
