@php
    /*
     * Navbar entry point.
     *
     * $sections only exists on the legacy section-rendered site; builder pages
     * render from website_blocks and pass no sections at all. Defaulting it here
     * is what lets one navbar serve both — without it every builder page fails
     * with "Undefined variable $sections" before a single block is rendered.
     */
    $sections = $sections ?? collect();

    $navBase = request()->routeIs('website.show')
        ? ''
        : route('website.show', ['slug' => $academy->slug]);

    $navbarStyle = $settings->navbar_style ?? 'transparent';
    $validStyles = ['solid', 'transparent', 'glass', 'floating', 'centered', 'minimal'];

    if (! in_array($navbarStyle, $validStyles, true)) {
        $navbarStyle = 'solid';
    }
@endphp

@include("website.navbars.{$navbarStyle}", [
    'sections' => $sections,
    'navBase' => $navBase,
    'academy' => $academy,
    'settings' => $settings,
])
