/* Shared mobile rules load after block styles and also apply in the editor. */
:where(.wp-block-post-content, .editor-styles-wrapper) :where(.wp-block-column, .wp-block-group, .wp-block-media-text__content) { min-width: 0; }
.np-block .button, .np-block .mini-button { max-width: 100%; white-space: normal; text-align: center; justify-content: center; }
.np-block .button > span { flex-shrink: 0; }
.np-block.header .brand { min-width: 0; }
.np-block.header .brand-mark { flex-shrink: 0; }
.np-block.header .brand-name { overflow-wrap: anywhere; letter-spacing: -.02em; line-height: 1.2; }
.np-table-frame { min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
:where(.np-table-frame) { max-width: 100%; }
.np-table-frame:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.np-table-frame table { border-collapse: collapse; }
.np-table-value { display: contents; }
.np-table-frame td::before { display: none; }

@media (max-width: 760px) {
	.wp-site-blocks, .editor-styles-wrapper {
		--wp--style--root--padding-left: clamp(16px, 4vw, 24px);
		--wp--style--root--padding-right: clamp(16px, 4vw, 24px);
	}
	/* Cap desktop/inline heading sizes on phones, including Custom HTML headings. */
	:where(.wp-block-post-content, .np-page-content, .editor-styles-wrapper) :is(h1, h2, h3, h4, h5, h6):not(.np-block *) {
		font-size: var(--np-mobile-heading-size) !important;
		line-height: 1.25 !important;
		letter-spacing: -.02em !important;
		overflow-wrap: break-word;
		text-wrap: pretty;
	}
	:where(.wp-block-post-content, .np-page-content, .editor-styles-wrapper) h1 { --np-mobile-heading-size: clamp(28px, 7.5vw, 36px); }
	:where(.wp-block-post-content, .np-page-content, .editor-styles-wrapper) h2 { --np-mobile-heading-size: clamp(24px, 6.5vw, 30px); }
	:where(.wp-block-post-content, .np-page-content, .editor-styles-wrapper) h3 { --np-mobile-heading-size: clamp(21px, 5.5vw, 26px); }
	:where(.wp-block-post-content, .np-page-content, .editor-styles-wrapper) h4 { --np-mobile-heading-size: 20px; }
	:where(.wp-block-post-content, .np-page-content, .editor-styles-wrapper) h5 { --np-mobile-heading-size: 18px; }
	:where(.wp-block-post-content, .np-page-content, .editor-styles-wrapper) h6 { --np-mobile-heading-size: 16px; }
	.np-block.join-banner { padding: 36px 20px; border-radius: 18px; }
	.np-block.join-banner h2 { font-size: clamp(28px, 7.5vw, 36px); line-height: 1.15; letter-spacing: -.025em; text-wrap: balance; }
	.np-block.promo-card { min-height: 0; padding: 26px 20px; }
	.np-block.promo-card h2 { font-size: clamp(26px, 7vw, 34px); line-height: 1.15; letter-spacing: -.025em; }
	.np-block.live { padding: 28px 20px; grid-template-columns: minmax(0, 1fr); }
	.np-block.live h2, .np-block.section h2 { font-size: clamp(26px, 7vw, 32px); line-height: 1.2; letter-spacing: -.025em; }
	.np-block .section-heading { flex-wrap: wrap; align-items: flex-start; gap: 14px; }
	.np-block .section-heading .text-link { max-width: 100%; }
	.np-block .section-heading h2 { min-width: 0; }
	.np-inner-title h1, .np-auth-wrap h1 { font-size: clamp(28px, 7.5vw, 36px); letter-spacing: -.025em; }
	.np-auth-mark { font-size: clamp(24px, 7vw, 34px); letter-spacing: -.025em; overflow-wrap: anywhere; }
	.np-auth-wrap { padding: 28px 20px; }
	.np-bonus-shell h2 { font-size: clamp(28px, 7.5vw, 36px); letter-spacing: -.025em; }
	.np-content-card { padding: 26px 20px; }
	.np-block.header { height: auto; min-height: 65px; padding-block: 10px; gap: 12px; }
	.np-block.header .brand { flex: 0 1 auto; max-width: 52%; }
	.np-block.header .brand-logo { max-width: 100%; }
	.np-block.header .actions { min-width: 0; flex: 0 1 auto; }
	.np-block.header .button { padding: 10px 12px; font-size: 12px; }
	.np-block.header .menu-toggle { flex-shrink: 0; min-width: 44px; min-height: 44px; }
	.np-block.header.open .nav { top: 100%; max-height: calc(100dvh - var(--np-header-height, 76px) - var(--wp-admin--admin-bar--height, 0px)); }
	.wp-block-media-text.is-stacked-on-mobile { grid-template-columns: minmax(0, 1fr) !important; gap: 20px; }
	.wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__media { grid-column: 1; grid-row: 1; }
	.wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__content { grid-column: 1; grid-row: 2; padding: 0; }
	:where(.wp-block-post-content, .editor-styles-wrapper) :is(div, section)[style*="grid-template-columns"]:not(.wp-block-media-text) { grid-template-columns: minmax(0, 1fr) !important; }
	/* Accessible scrolling remains the fallback for merged/complex tables and no JS. */
	:where(.wp-block-post-content, .editor-styles-wrapper) table:not(.np-table-stack):not(.np-table-scroll) { display: block; min-width: 0 !important; max-width: 100%; overflow-x: auto; }
	.np-table-frame table.np-table-scroll { display: table; min-width: var(--np-table-min-width, 36rem); }
}

@media (max-width: 600px) {
	/* Simple tables become labelled rows; their headers remain available to AT. */
	.np-table-frame .np-table-stack { display: block; width: 100% !important; min-width: 0 !important; max-width: 100%; }
	.np-table-stack > thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
	.np-table-stack > tbody { display: block; }
	.np-table-stack > tbody > tr { display: block; margin: 0 0 12px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius: 12px; overflow: hidden; }
	.np-table-stack > tbody > tr:last-child { margin-bottom: 0; }
	.np-table-stack > tbody > tr > td {
		display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 12px;
		width: auto !important; min-width: 0 !important; padding: 12px 14px !important;
		font-size: 14px; line-height: 1.5; text-align: start !important; white-space: normal !important;
		border: 0; border-bottom: 1px solid color-mix(in srgb, currentColor 16%, transparent);
	}
	.np-table-stack > tbody > tr > td:last-child { border-bottom: 0; }
	.np-table-stack td::before { display: block; content: attr(data-np-label); font-weight: 700; overflow-wrap: break-word; }
	.np-table-stack .np-table-value { display: block; min-width: 0; overflow-wrap: anywhere; }
	.np-table-stack[data-np-columns="2"] > tbody > tr > td { display: block; }
	.np-table-stack[data-np-columns="2"] td::before { display: none; }
	.np-table-stack[data-np-columns="2"] > tbody > tr > td:first-child { font-weight: 700; padding-bottom: 6px !important; border-bottom: 0; }
	.np-table-stack[data-np-columns="2"] > tbody > tr > td:last-child { padding-top: 6px !important; }
}
