<?php
$facts = $facts ?? [];
$title = $title ?? 'About';
$hint = $hint ?? 'Key facts for this record.';
$icon = $icon ?? 'bi-info-circle';
if ($facts === []) {
    return;
}
?>
<div class="card-soft rec-card p-3 mb-3">
  <?php \App\Core\View::partial('record_section_head', compact('title', 'hint', 'icon')); ?>
  <dl class="rec-facts">
    <?php foreach ($facts as $fact):
        $label = (string) ($fact['label'] ?? '');
        $value = $fact['value'] ?? '—';
        $href = (string) ($fact['href'] ?? '');
        $empty = $value === null || $value === '';
    ?>
      <div>
        <dt><?= e($label) ?></dt>
        <dd>
          <?php if ($empty): ?>
            —
          <?php elseif ($href !== ''): ?>
            <a href="<?= e($href) ?>"><?= e((string) $value) ?></a>
          <?php else: ?>
            <?= e((string) $value) ?>
          <?php endif; ?>
        </dd>
      </div>
    <?php endforeach; ?>
  </dl>
</div>
