<div class="fantasy-settlement-domain-grid">
    <section class="fantasy-settlement-domain-panel fantasy-settlement-establishments">
        <h3><i class="fas fa-store"></i> Establishments <span>{{establishmentCount}}</span></h3>
        <div class="fantasy-settlement-establishment-grid {{#if hasFewEstablishments}}is-few{{/if}}">
            {{#each cards}}
            <button type="button" class="fantasy-settlement-establishment-card" data-action="openSettlementSite" data-card-kind="{{kind}}" data-card-id="{{id}}">
                <span class="nexus-entity-image is-place">{{#if artSrc}}<img src="{{artSrc}}" alt="">{{else}}{{#if imageSrc}}<img src="{{imageSrc}}" alt="">{{else}}<i class="{{#if icon}}{{icon}}{{else}}fas fa-location-dot{{/if}}"></i>{{/if}}{{/if}}</span>
                <span><strong>{{name}}</strong><small>{{subtitle}}</small></span>
            </button>
            {{/each}}
            {{#if missingMarketplace}}
            <div class="fantasy-settlement-establishment-card fantasy-settlement-marketplace-missing">
                <span class="nexus-entity-image is-place"><i class="fas fa-scale-balanced"></i></span>
                <span><strong>Marketplace Missing</strong><small>This settlement requires a Marketplace.</small></span>
                <button type="button" data-action="recreateSettlementMarketplace"><i class="fas fa-arrows-rotate"></i> Recreate</button>
            </div>
            {{else}}{{#unless hasEstablishmentCards}}<div class="fantasy-settlement-empty">No establishments recorded.</div>{{/unless}}{{/if}}
        </div>
        {{#if canCreateEstablishment}}<button type="button" class="fantasy-settlement-panel-add nexus-create-button-round" data-action="createSettlementShop" title="New Shop" aria-label="New Shop"><i class="fas fa-plus"></i></button>{{/if}}
    </section>

    <section class="fantasy-settlement-domain-panel fantasy-settlement-people" data-settlement-people-drop>
        <h3><i class="fas fa-people-roof"></i> Notable People <span>{{overview.people.length}}</span></h3>
        <div class="fantasy-settlement-people-grid">
            {{#each overview.people}}
            <button type="button" class="fantasy-settlement-person-card {{#if allegiance}}has-allegiance{{/if}}" data-settlement-person-card data-action="openSettlementPerson" data-person-id="{{entityId}}" {{#if @root.isGM}}draggable="true"{{/if}} title="Open {{name}}">
                <span class="nexus-entity-image is-person">{{#if imageSrc}}<img src="{{imageSrc}}" alt="">{{else}}<i class="fas fa-user"></i>{{/if}}</span>
                <span class="fantasy-settlement-person-copy"><strong>{{name}}</strong><em>{{subtitle}}</em></span>
                {{#if allegiance}}
                <span class="fantasy-settlement-person-allegiance" title="{{allegiance.rank}} &mdash; {{allegiance.name}}">
                    <span class="fantasy-settlement-person-allegiance-image nexus-entity-image is-emblem">{{#if allegiance.imageSrc}}<img src="{{allegiance.imageSrc}}" alt="">{{else}}<i class="fas fa-shield-halved"></i>{{/if}}</span>
                    <span class="fantasy-settlement-person-allegiance-copy"><strong>{{allegiance.rank}}</strong><small>{{allegiance.name}}</small></span>
                </span>
                {{/if}}
            </button>
            {{else}}<div class="fantasy-settlement-empty">No notable people recorded.</div>{{/each}}
        </div>
        {{#if isGM}}
        <div class="fantasy-settlement-people-footer">
            <p class="fantasy-settlement-drop-hint"><i class="fas fa-hand-pointer"></i> NPCs can be dragged here to make them notable people.</p>
            <button type="button" class="fantasy-settlement-panel-add nexus-create-button-round" data-action="createSettlementPerson" title="New NPC" aria-label="New NPC"><i class="fas fa-plus"></i></button>
        </div>
        {{/if}}
    </section>
</div>
