{#- DESIGN PENDING (PREM-1): the paid Contact. One calm card in two halves: the ways to reach the school on the left (phone, email,
    WhatsApp as full-width rows, then opening hours), the location on the right (a drawn tile with the aerodrome pin, the ICAO
    code, the address, Directions). One primary button opens the enquiry form inside the card. On a phone the halves stack and a
    slim Call / Email / Directions bar stays pinned to the bottom. Missing details are left out. SAMPLE details only
    (--premium-preview), [hidden] until ?preview-premium=1. A paid school with its own content gets it live (pr_mode "live"), with no flag. -#}
{% set chev %}<svg class="pc-chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg>{% endset %}
{% set has_reach = profile.phone or profile.email or profile.whatsapp or profile.hours %}
{% set has_where = profile.icao or profile.address or profile.directions %}
<section class="pc-sec" id="pc-contact" aria-labelledby="pc-h"{% if pr_mode == "preview" %} data-design-pending="premium-extras" hidden{% endif %}>
  <div class="ob-hrow pc-hrow"><h2 class="ob-h" id="pc-h">Contact</h2>{% if profile.sample %}<span class="pa-sample">Sample details</span>{% endif %}</div>
  <div class="ob-card pc-card">
    <div class="pc-split{% if not has_reach or not has_where %} is-one{% endif %}">
      {% if has_reach %}
      <div class="pc-reach">
        <ul class="pc-rows">
          {% if profile.phone %}<li><a class="pc-row" href="tel:{{ profile.phone|replace(' ', '') }}"><span class="pc-k">Phone</span><span class="pc-v is-mono">{{ profile.phone }}</span>{{ chev }}</a></li>{% endif %}
          {% if profile.email %}<li><a class="pc-row" href="mailto:{{ profile.email }}"><span class="pc-k">Email</span><span class="pc-v">{{ profile.email }}</span>{{ chev }}</a></li>{% endif %}
          {% if profile.whatsapp %}<li><a class="pc-row" href="{{ profile.whatsapp }}" rel="noopener nofollow ugc"><span class="pc-k">WhatsApp</span><span class="pc-v is-mono">{{ profile.whatsapp_text }}</span>{{ chev }}</a></li>{% endif %}
        </ul>
        {% if profile.hours %}
        <div class="pc-hours"{% if profile.hours_json %} data-hours="{{ profile.hours_json }}"{% endif %}>
          <p class="pc-hh"><span class="pc-k">Hours</span><span class="pc-open" hidden><i class="pc-dot" aria-hidden="true"></i><span class="pc-open-t"></span></span></p>
          <dl>
            {% for h in profile.hours %}<div><dt>{{ h.label }}</dt><dd>{% if h.closed %}Closed{% else %}{{ h.open }} to {{ h.close }}{% endif %}</dd></div>{% endfor %}
          </dl>
        </div>
        {% endif %}
      </div>
      {% endif %}
      {% if has_where %}
      <div class="pc-where">
        {% if profile.icao %}
        <div class="pc-tile">
          <svg class="pc-map" viewBox="0 0 480 300" preserveAspectRatio="xMidYMid slice" aria-hidden="true" focusable="false">
            <path class="pc-grat" d="M0 60H480M0 120H480M0 180H480M0 240H480M80 0V300M160 0V300M240 0V300M320 0V300M400 0V300"/>
            <g class="pc-rings"><circle cx="240" cy="150" r="46"/><circle cx="240" cy="150" r="92"/><circle cx="240" cy="150" r="138"/></g>
            <g class="pc-north"><path d="M440 36V68M440 36l-5 8M440 36l5 8"/><text x="440" y="86" text-anchor="middle">N</text></g>
          </svg>
          <svg class="pc-pin" viewBox="0 0 36 46" aria-hidden="true" focusable="false">
            <ellipse class="pc-pin-sh" cx="18" cy="41" rx="9" ry="3"/>
            <path class="pc-pin-b" d="M18 41S3 25 3 15a15 15 0 1 1 30 0c0 10-15 26-15 26z"/>
            <circle class="pc-pin-c" cx="18" cy="15" r="5.5"/>
          </svg>
          {% if profile.icao_href %}<a class="pc-chip" href="{{ profile.icao_href }}">{{ profile.icao }}</a>{% else %}<span class="pc-chip">{{ profile.icao }}</span>{% endif %}
        </div>
        {% endif %}
        <div class="pc-where-t">
          {% if profile.place %}<p class="pc-place">{{ profile.place }}</p>{% endif %}
          {% if profile.address %}<address class="pc-addr">{{ profile.address }}</address>{% endif %}
          {% if profile.directions %}<a class="pc-dir" href="{{ profile.directions }}" rel="noopener nofollow ugc">Directions<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7 17L17 7M9 7h8v8"/></svg></a>{% endif %}
        </div>
      </div>
      {% endif %}
    </div>
    <div class="pc-ask">
      <button type="button" class="pc-btn" id="pc-ask-btn" aria-expanded="false" aria-controls="pc-form">Ask about training</button>
      <form class="pc-form" id="pc-form" novalidate hidden data-design-note="No enquiry endpoint exists yet (README, Needed fields). The preview keeps the form on the page and sends nothing.">
        <div class="pc-form-h"><h3>Ask about training</h3><button type="button" class="pc-cancel">Cancel</button></div>
        <div class="pc-fields">
          <label class="pc-f"><span>Name</span><input name="name" type="text" autocomplete="name" maxlength="80" required></label>
          <label class="pc-f"><span>Email</span><input name="email" type="email" autocomplete="email" inputmode="email" maxlength="120" required></label>
          <label class="pc-f is-wide"><span>Course</span>
            <select name="course">
              <option value="">Not sure yet</option>
              {% for c in profile.courses %}<option>{{ c }}</option>{% endfor %}
            </select>
          </label>
          <label class="pc-f is-wide"><span>Message</span><textarea name="message" rows="4" maxlength="1000" required></textarea></label>
        </div>
        <div class="pc-done" tabindex="-1"><h3 class="pc-done-t"></h3><p>Preview only: this form does not send anything yet.</p><button type="button" class="pc-cancel">Close</button></div>
        <div class="pc-form-f"><button type="submit" class="pc-btn">Send enquiry</button><p class="pc-msg" role="status" aria-live="polite"></p></div>
      </form>
    </div>
  </div>
</section>
{% if profile.phone or profile.email or profile.directions %}
<nav class="pc-bar is-away" aria-label="Contact the school"{% if pr_mode == "preview" %} data-design-pending="premium-extras" hidden{% endif %}>
  {% if profile.phone %}<a href="tel:{{ profile.phone|replace(' ', '') }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6.6 3.5h3l1.5 4-2 1.3a11 11 0 006.1 6.1l1.3-2 4 1.5v3a2 2 0 01-2.2 2A16.5 16.5 0 014.6 5.7a2 2 0 012-2.2z"/></svg>Call</a>{% endif %}
  {% if profile.email %}<a href="mailto:{{ profile.email }}"><svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3.5" y="5.5" width="17" height="13" rx="2"/><path d="M4 7l8 6 8-6"/></svg>Email</a>{% endif %}
  {% if profile.directions %}<a href="{{ profile.directions }}" rel="noopener nofollow ugc"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0113 0c0 5.4-6.5 11-6.5 11z"/><circle cx="12" cy="10" r="2.4"/></svg>Directions</a>{% endif %}
</nav>
{% endif %}
