/* web-v2/css/components/national-overlay.css
   Whole-map cue for country-wide alerts. "כל הארץ" draws a solid frame,
   "בחלק מהאזורים בארץ" a dashed one: the shape says how much of the country is
   affected before any text is read. The color follows the alert kind. */

.national-overlay {
  --nat-color: var(--threat-rockets);
  --nat-bg: var(--threat-rockets-bg);
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 400;                         /* above map tiles, below map controls' popups */
}
.national-overlay[hidden] { display: none; }
/* The tinted frame lives on ::before so only it pulses, never the label. */
.national-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--nat-bg);
  box-shadow: inset 0 0 0 3px var(--nat-color);
  animation: nat-frame 2.4s ease-in-out infinite;
}
.national-overlay[data-scope="partial-national"]::before {
  box-shadow: none;
  outline: 3px dashed var(--nat-color);
  outline-offset: -6px;
}

.national-overlay[data-kind="3"]  { --nat-color: var(--threat-quake);   --nat-bg: var(--threat-quake-bg); }
.national-overlay[data-kind="21"] { --nat-color: var(--threat-tsunami); --nat-bg: var(--threat-tsunami-bg); }
.national-overlay[data-kind="22"],
.national-overlay[data-kind="24"] { --nat-color: var(--threat-hazmat);  --nat-bg: var(--threat-hazmat-bg); }
.national-overlay[data-kind="23"] { --nat-color: var(--threat-rad);     --nat-bg: var(--threat-rad-bg); }
.national-overlay[data-kind="2"]  { --nat-color: var(--threat-uav);     --nat-bg: var(--threat-uav-bg); }
.national-overlay[data-kind="14"] { --nat-color: var(--threat-prealert); --nat-bg: var(--threat-prealert-bg); }

.national-overlay__label {
  /* Bottom-center: the top corners hold the layer buttons and the ACTIVE
     badge, the bottom-left the zoom control. */
  position: absolute;
  bottom: .9rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .45rem;
  max-width: calc(100% - 7.5rem);
  padding: .4rem .8rem;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--nat-color);
  color: var(--nat-color);
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.national-overlay__scope { color: var(--text-primary); font-weight: 400; }

@keyframes nat-frame {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}
@media (prefers-reduced-motion: reduce) {
  .national-overlay::before { animation: none; }
}
