/* =========================================================
   Gaudau.lt – map list expansion control focus rings
   Visible keyboard focus styles for the map side list
   "Rodyti daugiau / Rodyti mažiau" toggle and the map
   seasonal species "Rodyti daugiau / Rodyti mažiau" toggle.

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

/* ---------- Map side list toggle ---------- */
.map-list-toggle: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"] .map-list-toggle: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 map side list toggle. The :focus-visible rule above
   takes precedence in modern browsers. */
.map-list-toggle: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"] .map-list-toggle: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. */
.map-list-toggle:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
  border-color: var(--line-strong);
  background-color: var(--surface-3);
  color: var(--text);
}

/* ---------- Map seasonal "show more" toggle ---------- */
.map-seasonal-more-btn: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"] .map-seasonal-more-btn: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 seasonal "show more" toggle. The :focus-visible rule
   above takes precedence in modern browsers. */
.map-seasonal-more-btn: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"] .map-seasonal-more-btn: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. */
.map-seasonal-more-btn: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) {
  .map-list-toggle:focus-visible,
  .map-seasonal-more-btn:focus-visible,
  .map-list-toggle:focus,
  .map-seasonal-more-btn:focus {
    transition: none;
  }
}
