/* =========================================================
   Gaudau.lt – weather toolbar focus rings
   Visible keyboard focus styles for the weather city select
   and the weather refresh button so keyboard users see focus
   on every weather toolbar control.

   Matches the existing weather spot quick-pick focus
   treatment (bright green outline plus a soft halo) so every
   interactive control in the weather section has a
   consistent, clearly distinguishable focus indicator on
   both themes.
   ========================================================= */

/* ---------- Weather city select ---------- */
.weather-city-select:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 3px;
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

[data-theme="light"] .weather-city-select:focus-visible {
  outline-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

/* Fallback focus ring for browsers that do not support :focus-visible.
   Uses :focus so keyboard users on older engines still see a clear
   indicator on the city select. The :focus-visible rule above takes
   precedence in modern browsers. */
.weather-city-select:focus {
  outline: 2px solid var(--green-bright);
  outline-offset: 3px;
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

[data-theme="light"] .weather-city-select:focus {
  outline-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

/* Suppress the fallback ring for mouse users in browsers that support
   :focus-visible, so the ring only appears for keyboard navigation. */
.weather-city-select:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* ---------- Weather refresh button ---------- */
.weather-refresh:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 3px;
  border-color: var(--green-line);
  background-color: var(--green-soft);
  color: var(--text-strong);
  box-shadow: 0 0 0 4px var(--green-soft);
}

[data-theme="light"] .weather-refresh:focus-visible {
  outline-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

/* Fallback focus ring for browsers that do not support :focus-visible.
   Uses :focus so keyboard users on older engines still see a clear
   indicator on the refresh button. The :focus-visible rule above takes
   precedence in modern browsers. */
.weather-refresh:focus {
  outline: 2px solid var(--green-bright);
  outline-offset: 3px;
  border-color: var(--green-line);
  background-color: var(--green-soft);
  color: var(--text-strong);
  box-shadow: 0 0 0 4px var(--green-soft);
}

[data-theme="light"] .weather-refresh:focus {
  outline-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

/* Suppress the fallback ring for mouse users in browsers that support
   :focus-visible, so the ring only appears for keyboard navigation. */
.weather-refresh:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
  border-color: var(--line-strong);
  background-color: var(--surface-3);
  color: var(--text);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .weather-city-select:focus-visible,
  .weather-refresh:focus-visible,
  .weather-city-select:focus,
  .weather-refresh:focus {
    transition: none;
  }
}
