---
const { cities = [] } = Astro.props;
const sorted = cities.sort((a: string, b: any) => a.localeCompare(b, "pl"));
---

<div class="fuz-cities-box">
  <h4 class="fuz-cities-title">Miejscowości w zasięgu sieci światłowodowej</h4>

  <div class="fuz-cities-grid">
    {sorted.map((city: unknown) => (
      <span class="fuz-city-item">{city}</span>
    ))}
  </div>
</div>

<style>
  .fuz-cities-box {
    
    background: var(--f-background);
    color: var(--f-text);
    padding: 16px;
    
  }

  .fuz-cities-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
  }

  .fuz-cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px 14px;
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .fuz-city-item {
    color: var(--f-text);
  }
</style>
