<?php if($content->layout === 'links' && $content->header): ?>
    <div class="photo-block-header relative z-2 md:rounded-t-lg shadow-md -mb-1 pb-1 w-full max-w-6xl print:shadow-none">
        <div class="flex justify-center items-baseline relative px-8">
            <div class="h2 py-2 mt-0"><?php echo e($content->header); ?></div>
            <div class="text-xl opacity-60 leading-none pl-2 w-6 hidden md:block"><fa-icon icon="fas fa-angle-right"></fa-icon></div>
        </div>
    </div> 
<?php endif; ?>

<div class="absolute debug"><?php echo e($content->height); ?>p</div>

<?php 

if ($content->columns >= 4 && $content->photos->count() > 4) {
    $mobile_cols = 2;
} else {
    $mobile_cols = 1;
}

$single_col = 0;

?>

<div class="w-full relative z-5 grid avoid-page-break overflow-hidden 
    <?php echo e($content->text_style && $content->photos->count() ? ( $content->layout !== 'full' ? 'shadow' : 'shadow-lg' ) : ''); ?>

    <?php echo e(!$content_element->pivot->no_margin ? ($sort_order > 1 ? 'md:rounded-lg' : 'md:rounded-b-lg' )  : ''); ?>

    <?php echo e($content->photos->count() ? ( $content->layout !== 'full' ? 'max-w-6xl' : 'md:rounded-none' ) : 'max-w-6xl'); ?> 
    <?php echo e($content->layout === 'links' ?  'photo-block-header px-2 pb-2' : ''); ?>


<?php if($content_element->pivot->randomize): ?>
    contents
<?php else: ?>
    <?php if($mobile_cols === 2): ?> {
        grid-cols-2
    <?php else: ?>
        grid-cols-1
    <?php endif; ?>

    <?php if($content->columns === 6): ?>
        md:grid-cols-6 print:grid-cols-6
    <?php elseif($content->columns === 5): ?>
        md:grid-cols-5 print:grid-cols-5
    <?php elseif($content->columns === 4): ?>
        md:grid-cols-4 print:grid-cols-4
    <?php elseif($content->columns === 3): ?>
        md:grid-cols-3 print:grid-cols-3
    <?php elseif($content->columns === 2): ?>
        md:grid-cols-2 print:grid-cols-2
    <?php else: ?>
        print:grid-cols-1
    <?php endif; ?>
<?php endif; ?>

<?php echo e($content->padding || $content->layout === 'links' ? 'gap-2' : ''); ?>

    print:shadow-none
">

<?php $__currentLoopData = $content_element->pivot->randomize ? $content->photos->shuffle()->values() :  $content->photos->sortBy('sort_order')->values(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $photo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

        <div class="w-full md:w-auto relative overflow-hidden
            <?php echo e($photo->hide_mobile ? 'hidden md:block' : ''); ?>

            <?php echo e($photo->hide_print ? 'print:hidden' : ''); ?>

            <?php echo e($content->layout === 'links' ? 'md:rounded overflow-hidden' : ''); ?>

            <?php echo e($content->text_style ? 'text-style-'.$content->text_style : ''); ?>

            <?php echo e($content_element->pivot->randomize ? 'h-full z-2 min-h-72 randomize-border' : ''); ?>


            <?php if($photo->span === 5): ?>
                md:col-span-5 print:col-span-5
            <?php elseif($photo->span === 4): ?>
                md:col-span-4 print:col-span-4
            <?php elseif($photo->span === 3): ?>
                md:col-span-3 print:col-span-3
            <?php elseif($photo->span === 2): ?>
                col-span-<?php echo e($mobile_cols); ?> md:col-span-2 print:col-span-2
            <?php else: ?>
                <?php 
                    $single_col++;
                ?>
                <?php if($index === $content->photos->count() - 1 && $single_col % 2 !== 0 && $mobile_cols === 2): ?>
                    col-span-2
                <?php endif; ?>
                md:col-span-1 print:col-span-1
            <?php endif; ?>

            <?php if(($photo->title || $photo->subtitle) && !$photo->link): ?>
                pb-66p
            <?php elseif($content->layout === 'links' || $photo->link): ?>
                <?php if($mobile_cols === 2): ?>
                    <?php if($index === $content->photos->count() - 1 && $single_col % 2 !== 0): ?>
                        pb-50p
                    <?php else: ?> 
                        pb-75p
                    <?php endif; ?>
                <?php else: ?>
                    pb-50p
                <?php endif; ?>
            <?php else: ?> 
                <?php if($mobile_cols === 2): ?>
                    <?php if($index === $content->photos->count() - 1 && $single_col % 2 !== 0): ?>
                        pb-50p
                    <?php else: ?> 
                        pb-66p
                    <?php endif; ?>
                <?php else: ?>
                    <?php if($content->height >= 75): ?>
                        pb-66p
                    <?php else: ?>
                        pb-50p
                    <?php endif; ?>
                <?php endif; ?>
            <?php endif; ?>

            <?php if($content->layout === 'links'): ?>
                <?php if($content->photos->count() < 3): ?>
                    md:pb-40p print:pb-40p
                <?php else: ?>
                    md:pb-50p print:pb-50p
                <?php endif; ?>
            <?php else: ?>

                <?php if(floor($content->height / $photo->span) == 200): ?>
                    md:pb-200p print:pb-200p
                <?php elseif(floor($content->height / $photo->span) == 150): ?>
                    md:pb-150p print:pb-150p
                <?php elseif(floor($content->height / $photo->span) == 100): ?>
                    md:pb-100p print:pb-100p
                <?php elseif(floor($content->height / $photo->span) == 75): ?>
                    md:pb-75p print:pb-75p
                <?php elseif(floor($content->height / $photo->span) == 66): ?>
                    md:pb-66p print:pb-66p
                <?php elseif(floor($content->height / $photo->span) == 50): ?>
                    md:pb-50p print:pb-50p
                <?php elseif(floor($content->height / $photo->span) == 40): ?>
                    md:pb-40p print:pb-40p
                <?php elseif(floor($content->height / $photo->span) == 37): ?>
                    md:pb-37p print:pb-37p
                <?php elseif(floor($content->height / $photo->span) == 33): ?>
                    md:pb-33p print:pb-33p
                <?php elseif(floor($content->height / $photo->span) == 25): ?>
                    md:pb-25p print:pb-25p
                <?php endif; ?>

            <?php endif; ?>


            <?php if($photo->vertical_span === 4): ?>
                pb-100p md:row-span-4 print:row-span-4
            <?php elseif($photo->vertical_span === 3): ?>
                pb-100p md:row-span-3 print:row-span-3
            <?php elseif($photo->vertical_span === 2): ?>
                pb-75p md:row-span-2 print:row-span-2
            <?php else: ?>
                md:row-span-1 print:row-span-1
            <?php endif; ?>
        "
            key="photo-<?php echo e($photo->id); ?>"
        >
            <?php if($index === $content->photos->count() - 1 && !$photo->link && !$content_element->pivot->randomize): ?>
                <div class="photo-border"></div>
            <?php endif; ?>

            <?php if($index === 0 && $photo->span === 1 && $content->columns === 3 && !$content->padding && $content->layout !== 'links' && !$content_element->pivot->randomize): ?>
                <div class="absolute h-full border-l-4 border-primary md:right-0 z-4"></div>
            <?php endif; ?>

            <?php echo $__env->make('content-elements.photo', ['photo' => $photo, 'max_size' => ( ($content->layout === 'full' ? 2304 : 1152) / $content->columns ) * $photo->span, 'layout' => $content->layout, 'sort_order' => $sort_order ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

        </div>

    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

    <?php if($content->columns === 5 && $content->photos->count() % 2): ?> 
        <div class="md:hidden flex items-center justify-center">
            <img src="/images/icon_gray.svg" class="w-16 opacity-50" />
        </div>
    <?php endif; ?>

    <?php if($content->show_text): ?>
        <?php echo $__env->make('content-elements/photo-block-text', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php endif; ?>

</div>
<?php /**PATH /var/www/html/resources/views/content-elements/photo-block.blade.php ENDPATH**/ ?>