@extends('website.layout')

@section('content')
    @foreach($sections as $section)
        @php
            $paddingClass = match($section->padding_y) {
                'none' => 'py-0',
                'small' => 'py-8',
                'medium' => 'py-16',
                'large' => 'py-24',
                'xlarge' => 'py-40',
                default => '',
            };
            $mobileHidden = $section->hidden_on_mobile ? 'hidden md:block' : '';
            $animAttr = ($settings->animations_enabled ?? true) ? $section->animation ?? 'fade-up' : 'none';
        @endphp
        <section id="section-{{ $section->section_key->value }}"
                 class="{{ $mobileHidden }} {{ $paddingClass }}"
                 @if($animAttr !== 'none') data-animation="{{ $animAttr }}" @endif>
            @if($section->bg_type !== 'inherit')
                @include('website.partials.section-bg', ['section' => $section])
            @else
                @include('website.sections.' . $section->section_key->value, [
                    'section' => $section,
                    'academy' => $academy,
                    'settings' => $settings,
                    'data' => $data,
                ])
            @endif
        </section>

        @if(($settings->section_divider ?? 'none') !== 'none' && !$loop->last)
            @include('website.partials.divider', ['settings' => $settings])
        @endif
    @endforeach
@endsection
