/* Release the page shell on templates with MultiAreaHome content. */
body:has(:is(#mah-home, #mah-home-detail, #mah-talk))
:is(#page, #content, .site-content, .ast-container, #primary, article, .entry-content, .wp-block-group, .wp-block-group__inner-container, .wp-block-html):has(:is(#mah-home, #mah-home-detail, #mah-talk)) {
    box-sizing: border-box;
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
}

body:has(:is(#mah-home, #mah-home-detail, #mah-talk)) .site-content > .ast-container {
    display: block;
}

body #mah-home#mah-home,
body #mah-home-detail#mah-home-detail,
body #mah-talk#mah-talk {
    box-sizing: border-box;
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
}

body #mah-home#mah-home .m-hero {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
}

body #mah-home#mah-home .m-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#mah-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: grid;
    place-items: center;
    background: #000;
    pointer-events: none;
    animation: mah-loading-exit 400ms 4.5s ease forwards;
}
#mah-loading-screen .mah-chrome-emblem {
    position: relative;
    width: min(760px, 100vw);
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
#mah-loading-screen .mah-chrome-emblem img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#mah-loading-screen .mah-chrome-light {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
        transparent 43%, rgba(255,255,255,.12) 47%,
        rgba(255,255,255,.98) 50%, rgba(205,225,255,.2) 53%, transparent 57%);
    background-size: 260% 100%;
    background-position: 110% 0;
    mask-image: url('chrome-house.png');
    mask-mode: luminance;
    mask-repeat: no-repeat;
    mask-size: 100% 100%;
    mix-blend-mode: screen;
    animation: mah-chrome-sweep 1.6s linear infinite;
}
@keyframes mah-chrome-sweep {
    from { background-position: 110% 0; }
    to { background-position: -10% 0; }
}
#mah-loading-screen.mah-loading-done {
    animation: mah-loading-exit 400ms ease forwards;
}
@keyframes mah-loading-exit {
    to { opacity: 0; visibility: hidden; }
}

#mah-cookie-panel,
#mah-cookie-settings {
    box-sizing: border-box;
    position: fixed;
    z-index: 2147483645;
    inset-inline-end: max(16px, env(safe-area-inset-right));
    inset-block-end: max(16px, env(safe-area-inset-bottom));
    background: #071f30;
    color: #fff;
    border: 1px solid #55717f;
    font: 14px/1.5 Arial, sans-serif;
}

#mah-cookie-panel[hidden],
#mah-cookie-settings[hidden] {
    display: none !important;
}

#mah-cookie-panel {
    width: min(400px, calc(100% - 36px));
    padding: 22px;
    box-shadow: 0 12px 40px #0003;
}

#mah-cookie-title {
    margin: 0 0 8px;
    color: inherit;
    font: 400 26px/1.2 Georgia, serif;
}

#mah-cookie-panel p { margin: 0 0 16px; }
#mah-cookie-panel .mah-cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#mah-cookie-panel button,
#mah-cookie-settings {
    padding: 9px 12px;
    min-height: 44px;
    cursor: pointer;
}

#mah-cookie-panel button {
    flex: 1 1 140px;
    border: 1px solid #a8c1cc;
    background: transparent;
    color: inherit;
    font: inherit;
}

#mah-cookie-panel button:hover,
#mah-cookie-settings:hover { background: #234354; }
#mah-cookie-panel button:focus-visible,
#mah-cookie-settings:focus-visible { outline: 2px solid #c9e7f0; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    #mah-loading-screen, #mah-loading-screen.mah-loading-done {
        animation-timing-function: steps(1, end);
        animation-duration: 1ms;
    }
}

@media print {
    #mah-loading-screen, #mah-cookie-panel, #mah-cookie-settings { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    #mah-loading-screen .mah-chrome-light { animation: none; display: none; }
}

/* The screen fills portrait and landscape; the image blends into true black. */
html body #mah-loading-screen {
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    background: #000 !important;
    overflow: hidden;
}
html body #mah-loading-screen .mah-chrome-emblem {
    flex: none;
    width: min(760px, 135vw);
    max-width: none;
    mix-blend-mode: screen;
}
html body #mah-loading-screen .mah-chrome-emblem img {
    mix-blend-mode: screen;
}

/* Explicit viewport centering also handles an emblem wider than portrait screens. */
html body #mah-loading-screen {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}
html body #mah-loading-screen .mah-chrome-emblem {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: min(760px, 150vw) !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translate(-50%, -50%) !important;
    background: #000;
}
