/*
 * vnm-research.css — research-card parity with vania-novikau.me (P2)
 * =============================================================================
 * SCOPE: every rule here is scoped to a descendant of `.research-card`. That
 * element only exists where the ai-chatboxes plugin ran its [research_cards]
 * shortcode, and inc/<module>.php only enqueues this file when the plugin's own
 * stylesheet is enqueued, so it is not even downloaded on any other page.
 *
 * -----------------------------------------------------------------------------
 * ★ THIS FILE DELIBERATELY DOES NOT SET THE CONTAINER WIDTH. THAT IS LANE P4's.
 * -----------------------------------------------------------------------------
 * The card box differs from prod because the CONTAINER differs, not because any
 * card rule differs. Measured at 1440px:
 *
 *     prod  .research-cards-container 1280 -> grid 1240 -> 3 tracks -> card 393.3
 *     dev   .research-cards-container  980 -> grid  940 -> 2 tracks -> card 455.0
 *
 * The grid is `repeat(auto-fill, minmax(300px,1fr))` with a 30px gap, so the
 * track count is pure arithmetic on the container width and no card rule is
 * involved:
 *
 *      940 -> 3 tracks need 900+60 =  960 >  940 -> 2 tracks -> (940-30)/2 = 455.00
 *     1240 -> 4 tracks need 1200+90 = 1290 > 1240 -> 3 tracks -> (1240-60)/3 = 393.33
 *
 * The 980 comes from `--wp--style--global--content-size:980px` capping
 * `.entry-content` / `article.is-layout-constrained`. ATTRIBUTION, measured:
 * the container's ancestor chain on dev contains **zero** WPBakery elements
 * (body > .wp-site-blocks > main > article > .entry-content > container), and
 * the one raw `[vc_` text run on the page sits in a <p> OUTSIDE the container.
 * So this is the block theme's content measure, not WPBakery leakage.
 *
 * Compensating for that inside card CSS would be wrong: it would bake a
 * container bug into a component. A tested rule is handed to P4 in
 * HANDOFF-P4-container-width.md instead.
 *
 * CONSEQUENCE FOR THIS FILE: the rule below is necessary but NOT sufficient for
 * the 393.3 x 390.8 target. Once the container is 1280 it lands exactly; until
 * then the cards stay two-up. Measured, both halves:
 *
 *     container fix only            -> 393.3 x 357.2   (width right, title 16px)
 *     this file only                -> 455.0 x 315.2   (title right, 2 tracks)
 *     both                          -> 393.3 x 390.8   == prod, exactly
 *
 * Card HEIGHT needs no rule of its own: at 393px a 18px/25.2px title wraps to 4
 * lines (4x25.2 = 100.8 + 40 padding = 140.8 content + 250 image = 390.8).
 * Height is an output of width and type size, not an independent defect.
 *
 * =============================================================================
 * TITLE SIZE — 18px, and why it is a SITE rule and not a plugin rule
 * =============================================================================
 * The plugin declares `font-size:16px`, and dev renders 16px — i.e. dev shows
 * the plugin's own value and it is PROD that deviates. Prod's 18px comes from
 * solutech's
 *
 *     html .wpb_text_column :last-child { font-size: var(--pix-font-size) }
 *
 * which is specificity (0,2,1) against the plugin's (0,1,0), and which catches
 * the cards container only because it happens to be the last child of a
 * WPBakery text column. `--pix-font-size` is `18px` on prod and is one of the
 * 78 solutech tokens deliberately not aliased on dev.
 *
 * So 18px is a page-builder side effect, not a design decision — but it is the
 * parity target, so it is reproduced HERE, scoped to the one site that has it,
 * and deliberately NOT pushed into the shared plugin. Editing the plugin's 16px
 * would have been a smaller diff that silently restyled every other ArneIron
 * tenant rendering research cards in order to copy an accident.
 *
 * Two classes rather than one so this does not depend on load order. It happens
 * to load after the plugin today, but that is an enqueue-priority fact a future
 * change could invert.
 *
 * line-height stays the plugin's 1.4, giving 18 x 1.4 = 25.2px == prod.
 */

.research-card .research-card-title {
	font-size: 18px;
}

/* ---------------------------------------------------------------------------
 * Container escape — applied at INTEGRATION, not by P2.
 *
 * P2 measured and documented this rule in HANDOFF-P4-container-width.md and
 * handed it to P4, which shipped its article/footer/mermaid work and never
 * picked it up. Without it P2's card fix lands its colour but not its geometry:
 * the grid stays 2 tracks at 455x312 instead of 3 at 393.3x390.8.
 *
 * Scoped deliberately to .research-cards-container. The underlying cause is
 * --wp--style--global--content-size (980) capping .entry-content while
 * --wide-size is 1280; changing THAT would rewidth every route, so this escapes
 * one container instead.
 *
 * Three properties of this rule are load-bearing and were each measured:
 *   1. width:auto — the plugin sets width:100%, and a SPECIFIED width pins the
 *      box so negative margins shift it without widening it. The same rule
 *      without this line measured 980/940/2 tracks/455x312.4: every digit
 *      identical to the unfixed baseline. A silent no-op.
 *   2. no transform/filter/will-change/contain here, ever. .research-modal is
 *      position:fixed AND a descendant, so any of those would make this element
 *      the containing block and open the lightbox clipped inside the grid.
 *   3. 1344px is measured, not chosen. The escape needs 300px to give, and main
 *      is min(1280px, 100vw - 64px). At 1343: 980/2 tracks/455, overflow 0. At
 *      1344: 1280/3 tracks/393.3, L=32 R=1312, overflow 0.
 * ------------------------------------------------------------------------- */
@media (min-width: 1344px) {
	.research-cards-container {
		width: auto;
		margin-inline: calc(
			( var(--wp--style--global--content-size, 980px)
			- var(--wp--style--global--wide-size, 1280px) ) / 2
		);
	}
}
