/**
 * Opensolr Search — Embeddable Search UI page.
 *
 * Block themes render post content inside a "constrained" layout: children are
 * capped at the theme's content width and the wrapper adds generous vertical
 * spacing. That is right for an article and wrong for a search application —
 * the widget came out as a narrow column with a large empty band above it.
 *
 * These rules apply ONLY on the search page (body.opensolr-search-embedded,
 * set by the plugin) and only to the wrappers around the iframe, so the theme's
 * header, footer and every other page are untouched.
 */

/* The iframe is a child of a constrained layout, which caps it at the content
   width. Let the search widget use the full width available to it. */
body.opensolr-search-embedded #os-embed-iframe {
	max-width: none !important;
	width: 100% !important;
}

/* Drop the content wrapper's own width cap and side padding for this page. */
body.opensolr-search-embedded .entry-content,
body.opensolr-search-embedded .wp-block-post-content {
	max-width: none !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* The theme's spacing preset puts a tall band above and below the content
   group; on a search page that reads as a broken layout, not as breathing room. */
body.opensolr-search-embedded main .wp-block-group.has-global-padding {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

/*
 * Full-height, seamless search — the same shape the Drupal module uses.
 *
 * The widget is an application, not an article: it has its own scrolling results,
 * its own filters and its own footer affordances. Leaving the theme's footer
 * underneath meant the page scrolled twice (once inside the widget, once outside)
 * and the widget only ever got a slice of the screen. Hiding the site footer on
 * THIS page lets the iframe own the viewport below the header, which is what
 * makes it feel like part of the site instead of a box dropped into it.
 *
 * Scoped to the search page's body class, so every other page keeps its footer.
 */
body.opensolr-search-embedded footer.wp-block-template-part,
body.opensolr-search-embedded .wp-block-site-footer {
	display: none !important;
}

/* No page scrollbar of its own — the widget scrolls inside the frame. */
body.opensolr-search-embedded {
	overflow-y: hidden !important;
}

/* Kill the gap the content group leaves under the header. */
body.opensolr-search-embedded main {
	padding-top: 0 !important;
	margin-top: 0 !important;
}
