/**
 * vnm-chat.css — ai-chatboxes THEME-SIDE CONTRACT for the block theme.
 *
 * ---------------------------------------------------------------------------
 * DO NOT "CLEAN UP" THE BOOTSTRAP-LOOKING CLASS NAMES IN templates/single.html.
 * ---------------------------------------------------------------------------
 * `.container`, `.pix-width-1300`, `.pix-container-boxed`, `.row`,
 * `.col-xl-4.col-lg-4.col-md-12.d-xl-block` and `div.post-content` mean nothing
 * to this block theme. They are a CONTRACT SURFACE consumed by the
 * ai-chatboxes plugin, which hard-codes them at NINE sites in
 * public/js/aic-ai-chat.js (7 mount sites + the gallery sidebar + the
 * back-to-top container). Removing any one of them silently un-mounts the
 * chat: the plugin's selector is a jQuery ternary with NO body fallback, so a
 * miss yields an EMPTY set and .append() becomes a no-op — no error, no log,
 * no chat.
 *
 * `div.post-content` is separately load-bearing: aic-ai-chat.js gates the
 * text-selection handler on `$ancestor.closest('div.post-content')`. Without
 * it the "Ask AI" bubble can never appear, however good the mount is.
 *
 * The plugin already ships
 *   .pix-container-boxed > .row:first-child > .col-xl-4...{display:block!important;position:relative}
 * in public/css/aic-ai-chat.css, so this file only supplies the ROW geometry
 * the classic theme got from Bootstrap and the block theme does not load.
 */

/* The boxed container escapes the constrained layout via alignfull, so cap it. */
.pix-container-boxed {
	max-width: 1300px;
	margin-inline: auto;
	width: 100%;
	padding-inline: var(--wp--preset--spacing--4, 1.5rem);
	box-sizing: border-box;
}

/* Bootstrap's .row, minimally. `align-items: stretch` is REQUIRED, not
   cosmetic: #aic-ai-chat-wrapper is position:absolute/top:0/bottom:0 inside the
   dock column, so the column must span the article's height or the chat gets a
   zero-height positioning context and docks at y=0 with no scroll track. */
.pix-container-boxed > .row {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: var(--wp--preset--spacing--5, 2rem);
}

.pix-container-boxed > .row > .vnm-single__article {
	flex: 1 1 auto;
	min-width: 0;      /* without this a long <pre> in the post forces overflow */
	max-width: 100%;
}

.pix-container-boxed > .row > .vnm-chat-dock {
	flex: 0 0 433px;
	max-width: 433px;
	position: relative;   /* positioning context for #aic-ai-chat-wrapper */
	overflow: visible;
}

/* Below the xl breakpoint solutech collapsed the dock (that is what `d-xl-block`
   encoded). The plugin's own sheet sets `display:block !important` on this exact
   selector, so overriding it needs at least equal specificity + !important. */
@media (max-width: 1199.98px) {
	.pix-container-boxed > .row {
		flex-wrap: wrap;
	}
	.pix-container-boxed > .row:first-child > .col-xl-4.col-lg-4.col-md-12.d-xl-block.vnm-chat-dock {
		display: none !important;
	}
	.pix-container-boxed > .row > .vnm-single__article {
		flex: 1 1 100%;
	}
}

/* The chat panel itself. solutech styled these in css/single.css (lines ~1080,
   ~1179, ~6925) which dies with the stylesheet name; these are the equivalents. */
#aic-ai-unified-chat {
	--vnm-chat-radius: 20px;
	font-family: var(--wp--preset--font-family--body, inherit);
}

/* REMOVED 2026-08-25 — this rule was wrong and is deliberately not replaced.
 *
 * It was written as a stand-in for solutech's chat-panel styling on the reasoning
 * that those rules "die with the stylesheet name". But the values here were
 * INVENTED — a 1px token border and a soft shadow — not copied from the
 * reference, so it did not reproduce anything: it simply overrode the plugin's
 * own `.pix-chat-container` styling, which is already correct and is what the
 * reference shows. Confirmed by the owner: unchecking this rule makes the panel
 * look right.
 *
 * The lesson, since the same mistake appears elsewhere in this file's history:
 * when a reference stylesheet is unavailable, port its ACTUAL declarations or
 * leave the element alone. An approximation that outranks working plugin CSS is
 * worse than no rule at all, because it looks deliberate.
 */

/* ⚠ THE BLUR IS GONE — owner's call, 2026-09-02.
   This used to read:
       body.aic-sidebar-login-active … .vnm-single__article {
           filter: blur(2px); pointer-events: none; }
   written so `body.aic-sidebar-login-active` would not be inert. But the class
   is not inert any more: it is what reveals the login form in the rail, which is
   a visible, in-place response on its own. The blur added a glassed-over article
   nobody asked for, and `pointer-events: none` also made the post unselectable
   while the form was open — so a reader could not copy the passage they were
   about to ask about.
   Deleted rather than neutralised elsewhere: a rule that exists only to be
   overridden is the thing this file's own header warns against. */

/* The selection bubble is appended to <body> at z-index 10000; make sure no
   block-theme stacking context outranks it. */
.aic-ai-actions {
	z-index: 10000;
}

/* The deep-chat web component itself. Owner-specified values, applied to the
   HOST element — deep-chat renders its interior in shadow DOM, so a border set
   from outside reaches the host box and nothing within it, which is exactly what
   is wanted here. */
deep-chat {
	/* !important because deep-chat writes these INLINE on load; an inline style
	   is beaten only by an important author declaration. */
	border: 1px solid #777 !important;
	border-radius: 13px !important;
}
