{% extends "base.html" %}
{% import "macros/section_title.html" as st %}
{% import "macros/page_title.html" as pt %}
{% import "macros/team_carousel.html" as tc %}

{% block content %}

{{ pt::page_title(title=section.title) }}

{% if section.content %}
<section class="ptb-100">
  <div class="container">
    <div class="row"><div class="col-md-12">{{ section.content | safe }}</div></div>
  </div>
</section>
{% endif %}

{% for page in section.pages %}
  {% set layout = page.extra.layout | default(value="") %}
  {% if layout == "carousel" %}
    {{ tc::team_carousel(
         title=page.title,
         anchor=page.extra.anchor | default(value=page.slug),
         slides=page.extra.slides) }}
  {% else %}
    <section class="text ptb-text">
      {{ st::section_title(title=page.title, anchor=page.extra.anchor | default(value=page.slug)) }}
      <div class="container">
        <div class="row">
          {# Live's text.html.twig wraps the rendered markdown in
             `<p>{{ content }}</p>`. The browser auto-closes the outer
             <p> on the first inner <p>, leaving an empty <p></p> at
             the top of each section — which adds the 10px margin that
             aligns the first float-right image with the first text
             line. #}
          <p>{{ page.content | safe }}</p>
        </div>
      </div>
    </section>
  {% endif %}
{% endfor %}

{% endblock %}
