<?php
/**
 * Country-Footer — „Andere Länder: 🇨🇭 / 🇩🇪 / 🇱🇮"
 * --------------------------------------------------
 * Kleine Zeile unten in den öffentlichen Seiten. Zeigt die jeweils
 * *nicht* aktuell gewählten Länder mit Flaggen-Link.
 */
require_once __DIR__ . '/../../php/lib/Country.php';

$current = Country::current();
$others = array_filter(Country::allCountries(), fn($c) => $c !== $current);
?>
<div class="md-country-foot">
  Andere Länder:
  <?php foreach ($others as $c): ?>
    <a href="?country=<?= htmlspecialchars($c) ?>"
       onclick="event.preventDefault(); window.__GGS_setCountry('<?= htmlspecialchars($c) ?>');"
       class="md-country-foot-link"
       title="<?= htmlspecialchars(Country::label($c)) ?>">
      <?= Country::flag($c) ?> <?= htmlspecialchars(Country::label($c)) ?>
    </a>
  <?php endforeach; ?>
</div>

<style>
  .md-country-foot {
    font-size: .78rem; color: var(--ggs-text-muted);
    padding: .6rem 0 0;
    text-align: center;
  }
  .md-country-foot a {
    display: inline-block; margin: 0 .3rem; padding: .3rem .5rem;
    color: var(--ggs-fjord); text-decoration: none;
    border-radius: var(--ggs-radius-sm);
    min-height: 32px;
  }
  .md-country-foot a:hover { background: var(--ggs-fjord-light); }
</style>
