@layer legacy {
/**
 * Morocco Passage — Layout
 * Containers, page shell, section rhythm, grids.
 */

/* CONTAINERS */

.mp-container {
    width: 100%;
    max-width: var(--w-content);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.mp-container--wide {
    max-width: var(--w-wide);
}

/* PAGE SHELL */

.mp-site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
}

.mp-main {
    flex: 1 0 auto;
}

/* The header is fixed, so non-transparent pages reserve its height.
   The hero reserves its own space on pages with a transparent header,
   which keeps the header out of the layout flow without shifting content. */
body:not(.mp-has-transparent-header) .mp-main {
    padding-top: var(--h-header);
}

/* SECTIONS */

.mp-section {
    padding-block: var(--section-y);
}

.mp-section--flush-top {
    padding-block-start: 0;
}

.mp-section--deep {
    background-color: var(--c-deep);
    color: var(--c-on-deep);
}

.mp-section--alt {
    background-color: var(--c-canvas-alt);
}

.mp-section__head {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    margin-block-end: var(--s-12);
    max-width: var(--w-reading);
}

.mp-section__foot {
    margin-block-start: var(--s-12);
}

/* GRIDS */

.mp-grid {
    display: grid;
    gap: var(--gap-card);
}

.mp-grid--cards {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {

    .mp-grid--cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--gap-layout);
    }
}

@media (min-width: 1024px) {

    .mp-grid--cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* HEADER LAYOUT */

.mp-header {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: var(--z-header);
    height: var(--h-header);
    display: flex;
    align-items: center;
    background-color: var(--c-canvas);
    border-block-end: var(--border);
    transition:
        background-color var(--dur-base) var(--ease),
        border-color var(--dur-base) var(--ease),
        color var(--dur-base) var(--ease);
}

.mp-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-8);
    width: 100%;
    max-width: var(--w-wide);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* Visibility of .mp-header__nav is owned by the navigation breakpoint
   authority in components.css. Do not add display rules for it here. */

.mp-header__actions {
    display: flex;
    align-items: center;
    gap: var(--s-6);
}

/* FOOTER LAYOUT */

/* FOOTER COLUMN PROGRESSION — 1 / 2 / 4.

   The base was two columns at every width, so a 360px phone rendered two
   ~156px columns and long labels such as "Frequently asked questions" broke
   across three lines. Narrow phones now get a single column.

   480px is reused deliberately: it is already a breakpoint in this theme
   (tokens.css steps --section-y there), so this adds a stage, not a
   breakpoint. The 768px four-column desktop footer is unchanged. */

}
