/* Page layout for /magazine/ and /intranet/magazine.html.
   The <magazine-viewer> fills the viewport below the site's fixed nav (or the
   intranet's sticky nav); the shared footer follows below the fold. The viewer
   styles itself (css/magazine-viewer.css, inside its shadow root); this file only
   sizes the page around it. Values come from webflow-prep/design-system-standard.css
   tokens, with the token's own value as the fallback because styles.css does not
   define them. */

.mz-main {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100svh;
    margin: 0 auto;
    padding: calc(var(--nav-h, 68px) + var(--space-2, 0.5rem)) var(--space-2, 0.5rem) var(--space-2, 0.5rem);
}

/* The announcement banner pushes the fixed nav down by 44px (see styles.css). */
body.has-announcement .mz-main {
    padding-top: calc(var(--nav-h, 68px) + 44px + var(--space-2, 0.5rem));
}

/* The issue title shows once, in the viewer's own bar; the page heading is for
   assistive technology only. */
.mz-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.mz-stage {
    flex: 1;
    min-height: 0;
    display: flex;
}

.mz-stage magazine-viewer {
    flex: 1;
    height: auto;
    min-height: 0;
}

/* The site's floating quick-actions button (js/main.js) sits over the viewer's own
   controls on a page the viewer fills, so this page does without it; everything it
   offers is in the site nav. */
.mz-page .quick-actions-widget {
    display: none;
}

.mz-noscript {
    margin: var(--space-4, 1rem) 0;
    font-size: var(--font-size-sm, 0.875rem);
}

.mz-noscript a {
    color: var(--color-primary-600, #9A4A2C);
}

/* Intranet: the Team GPDC nav is sticky and in the flow, 68px tall
   (.tg-nav-inner in intranet-portal.css), so the page subtracts it instead. */
.mz-main.mz-intranet {
    height: calc(100vh - 68px);
    height: calc(100svh - 68px);
    padding-top: var(--space-2, 0.5rem);
    /* The intranet's feedback button (.tg-fb, 56px, fixed 20px from the bottom right)
       stays available to staff; the viewer ends above it instead of under it. */
    padding-bottom: calc(56px + 20px + var(--space-2, 0.5rem));
}

/* Phones: the viewer runs edge to edge below the nav. */
@media (max-width: 640px) {
    .mz-main {
        padding: var(--nav-h, 68px) 0 0;
    }
    .mz-main.mz-intranet {
        padding-top: 0;
    }
}

@media (max-height: 520px) {
    .mz-main {
        padding-top: var(--nav-h, 68px);
        padding-bottom: 0;
    }
    .mz-main.mz-intranet {
        padding-top: 0;
    }
}

/* Phones, and any screen too short for the fixed header: the announcement banner and
   the site nav sit in the page flow above the viewer instead of fixed over it, and the
   viewer gets the whole screen. One short scroll down hides the header; scrolling up
   brings it back. The banner can wrap to several lines on a phone, which the fixed
   layout (which assumes 44px) cannot allow for. Public magazine page only. */
@media (max-width: 640px), (max-height: 520px) {
    .mz-page .announcement-banner,
    .mz-page .nav,
    body.has-announcement.mz-page .nav {
        position: relative;
        top: 0;
    }
    .mz-page .mz-main,
    body.has-announcement.mz-page .mz-main {
        height: 100vh;
        height: 100svh;
        padding: 0;
    }
}

/* The site announcement is a floating pill just under the menu (.gi, js/main.js).
   On the magazine it would sit on the viewer's own top bar, so while it is on the
   page the viewer starts below it; once it is dismissed (removed) the room goes.
   The pill is 44px (--tap) and sits 0.75rem under the menu. */
.mz-page:has(> .gi) .mz-main {
    padding-top: calc(var(--nav-h, 68px) + 0.75rem + 44px + 0.75rem);
}

/* Phones and short screens, where the menu is in the page flow (see above): the
   pill scrolls away with the menu instead of floating over the viewer. */
@media (max-width: 640px), (max-height: 520px) {
    .mz-page .gi {
        position: absolute;
    }
    .mz-page:has(> .gi) .mz-main {
        padding-top: calc(44px + 1rem);
    }
}
