/* =========================================
   DESKTOP MEGA MENU
========================================= */

.mega-panel {
    display: none;
}

@media (min-width: 1100px) {

    /* Background overlay — no blur */

    .menu-shade {
        display: block;
        position: fixed;
        inset: var(--header-bottom) 0 0;
        background: rgb(17 24 39 / 32%);
        z-index: 1;

        opacity: 1;

        transition: opacity 180ms ease-in-out;

        transition:
            opacity 180ms ease-in-out,
            display 180ms allow-discrete;
    }

    /* Hidden background overlay */

    .menu-shade[hidden] {
        opacity: 0;
        pointer-events: none;
    }

    /* Background overlay opening animation */

    @starting-style {
        .menu-shade:not([hidden]) {
            opacity: 0;
        }
    }

    /* Mega menu container */

    .mega-panel {
        display: grid;

        grid-template-columns:
            minmax(0, 34%) minmax(0, 1fr);

        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);

        width: min(
            calc(100% - 2 * var(--gutter)),
            1440px
        );

        max-height: calc(
            100dvh - var(--header-bottom) - 14px
        );

        min-height: min(
            490px,
            calc(100dvh - var(--header-bottom) - 14px)
        );

        overflow: auto;
        z-index: 2;

        background: var(--white);
        padding: 28px 38px 42px;
        border-radius: 0 0 24px 24px;
        align-items: start;

        opacity: 1;

        transition: opacity 180ms ease-in-out;

        transition:
            opacity 180ms ease-in-out,
            display 180ms allow-discrete;
    }

    /* Hidden mega menu */

    .mega-panel[hidden] {
        opacity: 0;
        pointer-events: none;
    }

    /* Mega menu opening animation */

    @starting-style {
        .mega-panel:not([hidden]) {
            opacity: 0;
        }
    }

    /* Left navigation column */

    .mega-categories {
        display: grid;
        gap: 2px;
        padding-inline-end: 16px;
        border-inline-end: 1px solid var(--line);
        align-self: stretch;
        align-content: start;
    }

    /* Mega menu category buttons */

    .category-button {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;

        text-align: start;
        padding: 13px 16px;
        min-height: 48px;
        border-radius: 10px;

        font-size: clamp(15px, 1.15vw, 19px);
        font-weight: 600;

        cursor: pointer;
        text-decoration: none;

        transition:
            background-color 180ms ease,
            color 180ms ease;
    }

    /* Category arrow icons */

    .category-button .icon {
        color: #9CA3AF;
        width: 19px;
        height: 19px;

        transition: color 180ms ease;
    }

    /* Category hover without underline */

    .category-button:hover,
    .category-button[aria-pressed="true"] {
        color: var(--green);
        background: var(--soft-green);
    }

    .category-button:hover .icon,
    .category-button[aria-pressed="true"] .icon {
        color: var(--green);
    }

    /* Middle and right columns */

    .mega-detail {
        display: grid;

        grid-template-columns:
            minmax(0, 1fr) minmax(0, 0.85fr);

        gap: clamp(22px, 3vw, 55px);

        padding: 12px 0 0 clamp(24px, 4vw, 70px);

        min-width: 0;
    }

    /* Layout when a photograph is unavailable */

    .mega-detail.no-photo {
        grid-template-columns: minmax(0, 1fr);
    }

    .mega-detail.no-photo .detail-copy {
        max-width: 620px;
    }

    /* Mega menu photographs */

    .mega-detail .detail-photo {
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 4;
        max-height: 435px;
        object-fit: cover;
        border-radius: 12px;
    }

    /* Content typography */

    .detail-copy h2 {
        font-size: clamp(24px, 2vw, 32px);
        font-weight: 750;
        line-height: 1.2;
        margin: 0 0 26px;
    }

    .detail-copy p {
        font-size: clamp(15px, 1.15vw, 19px);
        line-height: 1.5;
        margin: 0 0 22px;
    }

    /* Secondary destination links */

    .detail-links {
        margin: 0 0 26px;
        padding-inline-start: 20px;
        display: grid;
        gap: 8px;
    }

    .detail-links a {
        cursor: pointer;
        font-size: 17px;
        font-weight: 550;
        text-decoration: none;

        transition: color 180ms ease;
    }

    .detail-links a:hover {
        color: var(--green);
    }

    /* Mega menu action button */

    .detail-cta {
        min-height: 52px;
        padding: 14px 20px;
    }
}

/* =========================================
   REDUCED MOTION ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {

    .mega-panel,
    .menu-shade,
    .category-button,
    .category-button .icon,
    .detail-links a {
        transition: none;
    }
}