/*
 * Menu panels for the landing nav (Solutions, About Us, Company, Platform), after laravel.com.
 *
 * Desktop: ONE shared box (".mega-shell") of a fixed width stays under the nav. Moving the pointer from one menu word to the
 * next does not open a new pop-up: the box eases to the height of the next menu while its content slides across.
 * mega-nav.js does the opening, closing and measuring; this file is only the look.
 * Phones: the panels are a plain accordion inside the slide-down menu.
 */

:root {
    --mega-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --mega-ink: #171717;
    --mega-muted: #737373;
    --mega-line: rgba(0, 0, 0, 0.09);
    --mega-hover: rgba(0, 0, 0, 0.045);
}

/* ───────────── The menu word: a soft pill, like laravel.com ───────────── */

.nav-menu > li.mega-item > a {
    border-radius: 8px;
    margin: 0 2px;
    transition: background-color .15s ease-out, color .15s ease-out;
}

.navigation-landscape .nav-menu > li.mega-item { position: static; }

.nav-menu > li.mega-item.is-current > a {
    background: color-mix(in srgb, var(--maincolor, #d97706) 8%, transparent);
    color: var(--maincolor, #d97706);
}

.nav-menu > li.mega-item > a .submenu-indicator-chevron { transition: transform .2s var(--mega-ease); }
.nav-menu > li.mega-item.is-current > a .submenu-indicator-chevron { transform: rotate(-135deg); }

/* ───────────── The shared box (desktop) ───────────── */

.mega-shell { display: none; }

.navigation-landscape .mega-shell {
    display: block;
    position: absolute;
    z-index: 97;
    top: var(--mega-top, 100%);
    left: var(--mega-left, 0);
    width: var(--mega-w, 880px);
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--mega-line);
    background: #fff;
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    /* closing: fade, then leave */
    transition: height .3s var(--mega-ease), left .3s var(--mega-ease), width .3s var(--mega-ease), opacity .14s ease-out, transform .14s ease-out, visibility 0s linear .16s;
}

.navigation-landscape .mega-shell.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: height .3s var(--mega-ease), left .3s var(--mega-ease), width .3s var(--mega-ease), opacity .2s ease-out, transform .26s var(--mega-ease), visibility 0s;
}

/* the first time it opens it is placed at its height without growing from nothing */
.navigation-landscape .mega-shell.no-anim { transition: opacity .2s ease-out, transform .26s var(--mega-ease), visibility 0s; }

/* ───────────── A panel: the content that slides over the shared box ───────────── */

.mega-cards { white-space: normal; text-align: left; }

.navigation-landscape .mega-cards {
    position: absolute;
    z-index: 98;
    top: var(--mega-top, 100%);
    left: var(--mega-left, 0);
    width: var(--mega-w, 880px);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .14s ease-out, visibility 0s linear .14s;
}

.navigation-landscape .mega-cards.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity .22s ease-out .05s, visibility 0s;
}

.mega-cols {
    display: grid;
    padding: 10px;
    grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
}

.mega-col { min-width: 0; padding: 8px 8px 6px; }
.mega-col + .mega-col { border-left: 1px solid var(--mega-line); }

.mega-head {
    margin: 4px 10px 8px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--maincolor, #d97706);
}

/* ───────────── An item. Every one is the same size ───────────── */

.mega-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 68px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--mega-ink);
    text-decoration: none;
    transition: background-color .15s ease-out;
}

.mega-card:hover,
.mega-card:focus-visible { background: var(--mega-hover); outline: none; }

/* plain icons: no tile, no background */
.mega-icon {
    flex: 0 0 22px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    font-size: 19px;
    line-height: 1;
    color: var(--maincolor, #d97706);
}

.mega-body { display: block; min-width: 0; }

.mega-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.005em;
    color: var(--mega-ink);
}

/* a small arrow eases in beside the title; nothing else moves */
.mega-arrow {
    font-size: 12px;
    color: var(--maincolor, #d97706);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .18s ease-out, transform .22s var(--mega-ease);
}

.mega-card:hover .mega-arrow,
.mega-card:focus-visible .mega-arrow { opacity: 1; transform: translateX(0); }

.mega-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--mega-muted);
}

/* a tinted block on the right of a panel (like the featured article on laravel.com) */
.mega-feature {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    margin: 8px;
    padding: 18px 20px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--maincolor, #d97706) 7%, #fff);
    border: 1px solid color-mix(in srgb, var(--maincolor, #d97706) 14%, transparent);
}

.mega-feature .mega-head { margin: 0 0 2px; }
.mega-feature strong { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; color: var(--mega-ink); }
.mega-feature p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--mega-muted); }

.mega-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--maincolor, #d97706);
    text-decoration: none;
}

.mega-link i { font-size: 12px; transition: transform .22s var(--mega-ease); }
.mega-link:hover i { transform: translateX(3px); }

/* the quiet strip along the bottom of a panel */
.mega-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    font-size: 13px;
    color: var(--mega-muted);
    border-top: 1px solid var(--mega-line);
    background: rgba(250, 250, 250, 0.9);
}

.mega-foot .mega-link { margin: 0; }

/* ───────────── Phones: an accordion inside the slide-down menu ───────────── */

.navigation-portrait .mega-cards { display: none; position: static; width: auto; opacity: 1; visibility: visible; }
.navigation-portrait li.mega-item.is-open-m > .mega-cards { display: block; }
.navigation-portrait .nav-menu > li.mega-item > a { margin: 0; border-radius: 0; }
.navigation-portrait .mega-cols { grid-template-columns: 1fr; padding: 0 0 8px; }
.navigation-portrait .mega-col + .mega-col { border-left: 0; border-top: 1px solid var(--mega-line); }
.navigation-portrait .mega-feature,
.navigation-portrait .mega-foot { display: none; }
.navigation-portrait .mega-card { min-height: 56px; }
.navigation-portrait li.mega-item.is-open-m > a .submenu-indicator-chevron { transform: rotate(-135deg); }

/* the phone drawer is dark, so the cards turn light, and Sign In and Get Started show in it */
.navigation-portrait .nav-menus-wrapper .nav-menu.nav-menu-social { display: block !important; }
.navigation-portrait .nav-menu-social > li.mega-item > a { display: flex; align-items: center; }
.navigation-portrait .mega-cols { padding: 0 8px 10px; }
.navigation-portrait .mega-card { color: #e2e8f0; }
.navigation-portrait .mega-card:hover,
.navigation-portrait .mega-card:focus-visible { background: rgba(255, 255, 255, 0.07); }
.navigation-portrait .mega-title { color: #f8fafc; }
.navigation-portrait .mega-desc { color: #94a3b8; }
.navigation-portrait .mega-arrow { display: none; }
.navigation-portrait .mega-col + .mega-col { border-top-color: rgba(255, 255, 255, 0.1); }
.navigation-portrait .mega-cards { background: transparent; }

.navigation-portrait .nav-menu-social > li { display: block; width: 100%; margin: 0 !important; float: none; }
.navigation-portrait .nav-menu-social > li.list-buttons { padding: 14px 20px 22px; }
.navigation-portrait .nav-menu-social > li.list-buttons > a { display: block; text-align: center; }

@media (prefers-reduced-motion: reduce) {
    .navigation-landscape .mega-shell,
    .navigation-landscape .mega-shell.is-open,
    .navigation-landscape .mega-cards,
    .navigation-landscape .mega-cards.is-active,
    .mega-arrow, .mega-card, .mega-link i, .nav-menu > li.mega-item > a .submenu-indicator-chevron { transition: none; }
}
