/* PublicMusic Article Stream 1.0.22 — directional article entry and bottom-of-article continuation. */
html.pm-as-stream-started .pm-an-root,
html.pm-as-stream-started .pm-ia-stream,
html.pm-as-stream-started .pm-ia-status {
    display: none !important;
    visibility: hidden !important;
}

html.pm-as-stream-started main nav[aria-label*="Post navigation"],
html.pm-as-stream-started main .wp-block-post-navigation-link,
html.pm-as-stream-started main .pm-as-more-posts {
    display: none !important;
}

.pm-as-stream {
    display: block;
    /* The stream is a full-width sibling of the first alignfull article block.
       Expand through the parent main's 10px global gutters so every loaded post
       starts on the same horizontal grid as the initial article. */
    width: calc(100% + var(--wp--preset--spacing--20, 10px) + var(--wp--preset--spacing--20, 10px));
    max-width: none;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: calc(0px - var(--wp--preset--spacing--20, 10px)) !important;
    margin-right: calc(0px - var(--wp--preset--spacing--20, 10px)) !important;
    padding: 0 !important;
    clear: both;
    align-self: stretch;
    box-sizing: border-box;
}

.pm-as-item {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent;
    box-sizing: border-box;
}

.pm-as-item:not(.is-ready):not(.is-error) {
    min-height: 88px;
}

iframe.pm-as-frame {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 1px;
    border: 0;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent;
    color-scheme: light;
    opacity: 0;
    transition: opacity .18s ease;
    box-sizing: border-box;
}

.pm-as-item.is-ready iframe.pm-as-frame { opacity: 1; }

.pm-as-loading {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 88px;
    padding: 10px 12px;
    color: #626262;
    background: transparent;
    font: 500 13px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    box-sizing: border-box;
}

.pm-as-spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid rgba(190, 35, 45, .17);
    border-top-color: #be232d;
    border-radius: 50%;
    animation: pm-as-spin .75s linear infinite;
}

@keyframes pm-as-spin { to { transform: rotate(360deg); } }
.pm-as-item.is-ready .pm-as-loading { display: none; }

.pm-as-error,
.pm-as-end {
    max-width: 760px;
    margin: 10px auto 6px;
    padding: 8px 10px;
    border-top: 1px solid rgba(0, 0, 0, .1);
    color: #666;
    font: 13px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    box-sizing: border-box;
}

.pm-as-error p { margin: 0 0 6px; }
.pm-as-error a { color: #b4232d; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.pm-as-retry {
    display: inline-block;
    margin: 7px 0 0;
    padding: 7px 13px;
    border: 1px solid rgba(0, 0, 0, .16);
    border-radius: 5px;
    background: #fff;
    color: #333;
    font: 600 12px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
}
.pm-as-end-debug {
    display: block;
    margin-top: 4px;
    color: #8a5b16;
    font-size: 11px;
}
.pm-as-sentinel { display: block; width: 100%; height: 1px; pointer-events: none; }

/* The iframe displays only the real WordPress <main>. Do not count admin UI,
   docks, share widgets or hidden fixed overlays when sizing the frame. */
html.pm-as-frame-html {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    background: transparent !important;
}

body.pm-as-frame,
body.pm-as-frame.admin-bar {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    background: transparent !important;
}

body.pm-as-frame #wpadminbar { display: none !important; }

/* Every appended document runs its own wp_footer. Super Web Share and the
   Sponsors shortcode both output viewport-fixed widgets, so each full-height
   iframe would otherwise add another floating button at the end of its post.
   Keep the single global controls owned by the parent page. Inline share
   controls and inline sponsor placements remain available inside the article. */
body.pm-as-frame .sws_superaction,
body.pm-as-frame .pm-sponsors:not(.pm-pos-inline) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* PM Background Changer normally paints each document with body::before and
   body::after and appends .pm-bg-overlay. In Article Stream the parent page
   must remain the only owner of that background; inner article frames stay
   transparent so the same site backdrop continues uninterrupted. */
html.pm-as-frame-html,
body.pm-as-frame {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}
body.pm-as-frame::before,
body.pm-as-frame::after {
    display: none !important;
    content: none !important;
    background: none !important;
    opacity: 0 !important;
}
body.pm-as-frame .pm-bg-overlay {
    display: none !important;
    visibility: hidden !important;
}

body.pm-as-frame .wp-site-blocks {
    display: block !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    /* The parent page already scales the iframe with its desktop zoom.
       Reset the site's own .wp-site-blocks zoom inside the iframe to avoid
       applying the 1.05 enlargement a second time. */
    zoom: 1 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 0 !important;
    gap: 0 !important;
    row-gap: 0 !important;
    transform: none !important;
    box-sizing: border-box !important;
}

body.pm-as-frame .wp-site-blocks > .wp-block-template-part,
body.pm-as-frame .wp-site-blocks > header,
body.pm-as-frame .wp-site-blocks > footer,
body.pm-as-frame #pmScrollDock,
body.pm-as-frame .pm-an-root,
body.pm-as-frame .pm-ia-stream,
body.pm-as-frame .pm-ia-status,
body.pm-as-frame .pm-as-stream {
    display: none !important;
}

body.pm-as-frame main {
    display: block !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    /* A header is intentionally omitted in the embedded document. Recreate
       the same small top breathing room that the original page main has below
       its header, while keeping the iframe's horizontal grid full-width. */
    /* Match the original Twenty Twenty-Five main: its standard 10px side
       gutters are needed by comments and every non-alignfull block. The
       article's first alignfull group is broken back out below. */
    padding-top: 18px !important;
    padding-bottom: 0 !important;
    padding-left: var(--wp--preset--spacing--20, 10px) !important;
    padding-right: var(--wp--preset--spacing--20, 10px) !important;
    transform: none !important;
    box-sizing: border-box !important;
}

body.pm-as-frame main > .wp-block-group.alignfull:first-child {
    /* Restore WordPress alignfull behavior after main's horizontal gutters
       have been reinstated. This keeps the title/content group full width,
       while comments and other normal-flow blocks stay inset by 10px. */
    width: calc(100% + var(--wp--preset--spacing--20, 10px) + var(--wp--preset--spacing--20, 10px)) !important;
    max-width: none !important;
    margin-left: calc(0px - var(--wp--preset--spacing--20, 10px)) !important;
    margin-right: calc(0px - var(--wp--preset--spacing--20, 10px)) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    /* Keep the same inner 10px gutter used by the first article. The frame
       still bleeds to the main edges, but its contents must not. */
    padding-left: var(--wp--preset--spacing--20, 10px) !important;
    padding-right: var(--wp--preset--spacing--20, 10px) !important;
    box-sizing: border-box !important;
}

body.pm-as-frame main .wp-block-post-content {
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

body.pm-as-frame main .wp-block-post-title { margin-block-start: 0 !important; }
body.pm-as-frame main .wp-block-post-content > :first-child { margin-block-start: 0 !important; }
body.pm-as-frame main .wp-block-post-content > :last-child { margin-block-end: 0 !important; }
body.pm-as-frame main nav[aria-label*="Post navigation"],
body.pm-as-frame main .wp-block-post-navigation-link,
body.pm-as-frame main .pm-as-more-posts,
body.pm-as-frame [data-pm-as-hidden-more="1"] { display: none !important; }

@media (max-width: 600px) {
    .pm-as-item:not(.is-ready):not(.is-error) { min-height: 76px; }
    .pm-as-loading { min-height: 76px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    iframe.pm-as-frame { transition: none; }
    .pm-as-spinner { animation: none; }
}

/* Compact the repeated Twenty Twenty-Five post metadata without changing
   the spacing chosen inside the actual article text and media blocks. */
body.pm-as-frame main > .wp-block-group.alignfull:first-child > .wp-block-group.has-global-padding:not(.entry-content) {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body.pm-as-frame main > .wp-block-group.alignfull:first-child .post-meta-inline {
    margin-bottom: 7px !important;
}

body.pm-as-frame main > .wp-block-group.alignfull:first-child .wp-block-columns.is-style-section-3 {
    padding-top: 9px !important;
    padding-bottom: 9px !important;
}

body.pm-as-frame main > .wp-block-group.alignfull:first-child > .wp-block-post-content {
    /* The original single-post template constrains this block to its editorial
       content width. Do not expand it to the full iframe canvas. */
    width: 100% !important;
    max-width: min(100%, 1000px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--wp--preset--spacing--20) !important;
    padding-right: var(--wp--preset--spacing--20) !important;
    box-sizing: border-box !important;
}

/* Social Comments 1.3.8+ keeps the core Gutenberg comments wrapper around
   its custom section. Size that wrapper as the original comments block, then
   let the inner Social Board fill it. Keep the legacy direct-section selector
   for older plugin versions. */
body.pm-as-frame main .wp-block-comments-query-loop,
body.pm-as-frame main .wp-block-post-comments {
    display: block !important;
    width: 100% !important;
    max-width: min(100%, 1000px) !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

body.pm-as-frame main > .pm-sc-comments,
html.pm-as-stream-started main > .pm-sc-comments,
body.pm-as-frame main .wp-block-comments-query-loop > .pm-sc-comments,
body.pm-as-frame main .wp-block-post-comments > .pm-sc-comments {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    /* The Gutenberg wrapper owns the block's outer spacing. The Social
       Board fills the same constrained wrapper as title/content/meta blocks. */
    display: block !important;
    width: 100% !important;
    max-width: min(100%, 1000px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}


/* Keep the first title of each appended article at the same visual distance
   from the previous article as the initial title has from the site header. */
body.pm-as-frame main > .wp-block-group.alignfull:first-child > .wp-block-post-title {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}

@media (max-width: 600px) {
    body.pm-as-frame main {
        padding-top: 18px !important;
        padding-left: var(--wp--preset--spacing--20, 10px) !important;
        padding-right: var(--wp--preset--spacing--20, 10px) !important;
    }
}


/* Responsive fidelity: each appended document must use the phone's real
   viewport width, not a desktop-sized layout canvas inside a narrow iframe. */
body.pm-as-frame,
html.pm-as-frame-html {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: clip !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.pm-as-frame .wp-site-blocks,
body.pm-as-frame main,
body.pm-as-frame main > *,
body.pm-as-frame main .wp-block-post-content,
body.pm-as-frame main .wp-block-post-content > * {
    min-width: 0;
    box-sizing: border-box;
}

body.pm-as-frame main .wp-block-post-content {
    width: 100% !important;
    max-width: 100% !important;
}

body.pm-as-frame main img,
body.pm-as-frame main video,
body.pm-as-frame main iframe:not(.pm-as-frame),
body.pm-as-frame main embed,
body.pm-as-frame main object,
body.pm-as-frame main canvas,
body.pm-as-frame main svg {
    max-width: 100% !important;
    box-sizing: border-box;
}

body.pm-as-frame main img,
body.pm-as-frame main video {
    height: auto;
}

body.pm-as-frame main .wp-block-image,
body.pm-as-frame main .wp-block-video,
body.pm-as-frame main .wp-block-embed,
body.pm-as-frame main .wp-block-gallery,
body.pm-as-frame main .wp-block-columns,
body.pm-as-frame main .wp-block-column {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 781px) {
    body.pm-as-frame {
        --wp--style--global--content-size: min(645px, calc(100vw - 20px));
        --wp--style--global--wide-size: calc(100vw - 20px);
        --wp--style--root--padding-left: 10px;
        --wp--style--root--padding-right: 10px;
    }

    body.pm-as-frame main {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    body.pm-as-frame main > .wp-block-group.alignfull:first-child {
        width: calc(100% + 20px) !important;
        max-width: none !important;
        margin-left: -10px !important;
        margin-right: -10px !important;
    }

    body.pm-as-frame main .wp-block-post-content {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    body.pm-as-frame main .wp-block-image img,
    body.pm-as-frame main .wp-block-video video {
        max-width: 100% !important;
        height: auto !important;
    }

    body.pm-as-frame main .wp-block-embed iframe {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.pm-as-frame main .wp-block-gallery {
        width: 100% !important;
        max-width: 100% !important;
        flex-wrap: wrap;
    }

    body.pm-as-frame main .wp-block-columns {
        flex-wrap: wrap !important;
    }

    body.pm-as-frame main .wp-block-columns > .wp-block-column {
        flex-basis: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}


/* 1.0.16 — Mobile grid parity with the original, non-iframe article.
   The title wrapper and Social Board can be nested under intermediate blocks,
   so direct-child selectors do not reliably reach them. Keep this correction
   limited to narrow viewports; desktop styling remains untouched. */
@media (max-width: 781px) {
    body.pm-as-frame main .wp-block-group.alignfull:has(> .wp-block-post-title) {
        padding-left: 10px !important;
        padding-right: 10px !important;
        box-sizing: border-box !important;
    }

    body.pm-as-frame main .pm-sc-comments {
        display: block !important;
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        margin-left: 10px !important;
        margin-right: 10px !important;
        box-sizing: border-box !important;
    }
}

/* Optional editorial hand-off elements, controlled independently in the admin panel. */
.pm-as-transition {
    width: min(100%, 1000px);
    max-width: 1000px;
    margin: 18px auto 28px;
    padding: 0 10px;
    box-sizing: border-box;
    color: #555;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pm-as-end-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin: 0 auto 17px;
    color: #929292;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    line-height: 1.2;
}

.pm-as-end-divider::before,
.pm-as-end-divider::after {
    content: "";
    display: block;
    flex: 1 1 auto;
    height: 1px;
    background: rgba(0, 0, 0, .13);
}

.pm-as-continue {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.pm-as-continue-copy {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.pm-as-continue-kicker {
    color: #be232d;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .14em;
    line-height: 1.25;
}

.pm-as-continue-title {
    display: inline;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #292929;
    font: inherit;
    font-family: inherit;
    font-size: clamp(15px, 1.8vw, 19px);
    font-weight: 650;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.pm-as-continue-title:hover,
.pm-as-continue-title:focus-visible {
    color: #be232d;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pm-as-continue-title:focus-visible {
    outline: 2px solid rgba(190, 35, 45, .2);
    outline-offset: 3px;
    border-radius: 2px;
}

.pm-as-continue-meta {
    color: #888;
    font-size: 11px;
    line-height: 1.35;
}

.pm-as-next-arrow {
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 3px 0 0;
    border: 1px solid rgba(190, 35, 45, .38);
    border-radius: 50%;
    background: transparent;
    color: #be232d;
    font: 500 22px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.pm-as-next-arrow:hover,
.pm-as-next-arrow:focus-visible {
    border-color: #be232d;
    background: #be232d;
    color: #fff;
}

.pm-as-next-arrow:focus-visible {
    outline: 2px solid rgba(190, 35, 45, .25);
    outline-offset: 3px;
}

.pm-as-progress {
    position: fixed;
    z-index: 99990;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    overflow: hidden;
    pointer-events: none;
    background: rgba(190, 35, 45, .10);
}

.pm-as-progress-fill {
    display: block;
    width: 100%;
    height: 100%;
    background: #be232d;
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

/* Directional entry: move the frame horizontally without adding a fade effect.
   The loading indicator stays in place while the article document is prepared. */
.pm-as-item.pm-as-enter-right iframe.pm-as-frame,
.pm-as-item.pm-as-enter-left iframe.pm-as-frame {
    transition: transform .48s cubic-bezier(.22, .72, .24, 1);
}

.pm-as-item.pm-as-enter-right iframe.pm-as-frame {
    transform: translateX(38px);
}

.pm-as-item.pm-as-enter-left iframe.pm-as-frame {
    transform: translateX(-38px);
}

.pm-as-item.pm-as-enter-right.is-ready iframe.pm-as-frame,
.pm-as-item.pm-as-enter-left.is-ready iframe.pm-as-frame {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 600px) {
    .pm-as-transition {
        margin-top: 14px;
        margin-bottom: 21px;
        padding-left: 12px;
        padding-right: 12px;
    }
    .pm-as-end-divider { margin-bottom: 14px; }
    .pm-as-continue { gap: 12px; }
    .pm-as-next-arrow { flex-basis: 34px; width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    .pm-as-next-arrow,
    .pm-as-item.pm-as-enter-right iframe.pm-as-frame,
    .pm-as-item.pm-as-enter-left iframe.pm-as-frame {
        transition: none !important;
    }
    .pm-as-item.pm-as-enter-right iframe.pm-as-frame,
    .pm-as-item.pm-as-enter-left iframe.pm-as-frame {
        transform: none !important;
    }
}
