/*
 * seamlessmd/card-grid — repeatable card grid block.
 *
 * Variants: feature | stat | press
 * Card styles: elevated | bordered | plain
 */

.seamlessmd-card-grid {
	--cols: var(--seamlessmd-card-grid-cols, 3);
	padding-block: var(--seamlessmd-section-pad);
	color: var(--seamlessmd-text, #1a2540);
	background-color: transparent;
}

.seamlessmd-card-grid .seamlessmd-container {
    display: flex;
    gap: 5rem;
}

/* The side-by-side header/grid flex row never stacked on small screens,
 * which squeezed both columns to half a phone's width (reported on the
 * solutions hero, but it affected every side-layout card-grid). Stack at
 * the block's standard mobile breakpoint; header-stacked and leader
 * variants already display:block so they are unaffected. */
@media (max-width: 767px) {
	.seamlessmd-card-grid .seamlessmd-container {
		display: block;
	}

	/* The centered-header cap reads wrong once the header sits alone
	 * above the grid on a narrow screen — let it fill the container. */
	.seamlessmd-card-grid__inner .seamlessmd-card-grid__header {
		max-width: none;
	}
}

/* Inner wrapper carries the shared `.seamlessmd-container` class in
 * render.php — that gives it max-width + responsive horizontal gutter.
 * No per-block max-width / margin override needed. */

/* ---------- Header ---------- */

.seamlessmd-card-grid__header {
	margin-bottom: var(--seamlessmd-space-8, 3rem);
}

/* Centered header: constrain to a readable line-length when populated,
 * but the grid below must span the full container width — without this
 * separation a unified `width: 50%` rule shrank both elements to half
 * the viewport, which collapsed the multi-column grid into one column. */
.seamlessmd-card-grid__inner .seamlessmd-card-grid__header {
    max-width: 720px;
    margin-inline: auto;
    text-align: center;
}

/* Self-center every block child of the centered header. Without this the
 * subheading's own `max-width` rule (or a narrower global `p` max-width
 * inherited from theme CSS) leaves it anchored to the inline-start of
 * the header, so `text-align: center` only centers text within that
 * narrower box — visually off-center vs the section midpoint. */
.seamlessmd-card-grid__inner .seamlessmd-card-grid__header > * {
    margin-inline: auto;
}

/* `leader` variant overrides the default side-by-side container layout
 * (where the .seamlessmd-container is `display: flex; gap: 5rem` per the
 * card-grid layout overhaul in 2f763f8) and stacks the header above the
 * grid instead. Source pattern on seamless.md/company/leadership: each
 * leader section centres an optional eyebrow + heading + subheading
 * directly above an N-column grid of leader cards. Scoped to the leader
 * variant so the side-by-side feature/stat/press layouts are untouched. */
.seamlessmd-card-grid--variant-leader .seamlessmd-container,
.seamlessmd-card-grid--header-stacked .seamlessmd-container {
    display: block;
}

/* `header-stacked` adopts the leader-variant rhythm for any other variant
 * (feature / stat / press) that opts in. Used by the FAQ page where the
 * "Frequently Asked Questions" header sits centred above a 3-column card
 * grid (matches the source seamless.md/frequently-asked-questions layout
 * and the project pattern of centred-column section intros). */
.seamlessmd-card-grid--header-stacked .seamlessmd-card-grid__header {
    margin-bottom: var(--seamlessmd-space-8, 3rem);
}

.seamlessmd-card-grid__eyebrow {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--seamlessmd-primary, #2563eb);
	margin: 0 0 var(--seamlessmd-space-2, 0.5rem);
}

.seamlessmd-card-grid__heading {
	font-size: clamp(1.75rem, 3vw, 2rem);
	font-weight: 700;
	line-height: 1.2;
	color: var(--seamlessmd-dark-navy, #1e2a5c);
	margin: 0 0 var(--seamlessmd-space-3, 0.75rem);
}

.seamlessmd-card-grid__subheading {
	font-size: 1.125rem;
	line-height: 1.6;
	color: var(--seamlessmd-muted, #5a6475);
	max-width: 720px;
    white-space: pre-line;
}

/* ---------- Grid ---------- */

.seamlessmd-card-grid__grid {
	display: grid;
	/* Column count is editor-driven (`columns` attr, enum 2|3|4) and flows
	 * in via the `--seamlessmd-card-grid-cols` CSS variable emitted by
	 * render.php on the section's inline style. Fallback 3 mirrors the
	 * block.json default so unset blocks render at the same width as
	 * before this variable existed. */
	grid-template-columns: repeat(var(--seamlessmd-card-grid-cols, 3), minmax(0, 1fr));
	gap: var(--seamlessmd-space-6, 1.75rem);
}

@media (max-width: 991px) {
	.seamlessmd-card-grid__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.seamlessmd-card-grid__grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Card shell ---------- */

.seamlessmd-card-grid__card {
	display: flex;
	/* flex-direction: column; */
	gap: var(--seamlessmd-space-3, 0.75rem);
	/* padding: var(--seamlessmd-space-6, 1.75rem); */
	border-radius: var(--seamlessmd-radius-lg, 16px);
	background-color: #fff;
	box-shadow: var(--seamlessmd-shadow-sm, 0 1px 3px rgba(30, 42, 92, 0.08));
	transition: transform 250ms ease, box-shadow 250ms ease;
}

.seamlessmd-card-grid__card:hover {
	transform: translateY(-4px);
	box-shadow: var(--seamlessmd-shadow-md, 0 8px 24px rgba(30, 42, 92, 0.12));
}

/* Card-style modifiers */

.seamlessmd-card-grid--card-elevated .seamlessmd-card-grid__card {
	background-color: #fff;
	box-shadow: var(--seamlessmd-shadow-sm, 0 1px 3px rgba(30, 42, 92, 0.08));
	border: none;
}

.seamlessmd-card-grid--card-bordered .seamlessmd-card-grid__card {
	background-color: transparent;
	border: 1px solid rgba(30, 42, 92, 0.12);
	box-shadow: none;
}

.seamlessmd-card-grid--card-bordered .seamlessmd-card-grid__card:hover {
	border-color: var(--seamlessmd-primary, #2563eb);
	box-shadow: none;
}

.seamlessmd-card-grid--card-plain .seamlessmd-card-grid__card {
	background-color: transparent;
	border: none;
	box-shadow: none;
	/* padding: var(--seamlessmd-space-3, 0.75rem) 0; */
}

.seamlessmd-card-grid--card-plain .seamlessmd-card-grid__card:hover {
	transform: none;
	box-shadow: none;
}

/* ---------- Feature variant ---------- */

.seamlessmd-card-grid__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* `--seamlessmd-card-grid-icon-size` is editor-driven via the
	 * `iconSize` attribute (rendered on the section's inline style when
	 * > 0). Fallback 56px preserves the historical feature-variant
	 * footprint. Leader variant overrides the fallback to 200px in its
	 * own scope below. */
	width: var(--seamlessmd-card-grid-icon-size, 56px);
	height: var(--seamlessmd-card-grid-icon-size, 56px);
	border-radius: 50%;
	background-color: var(--seamlessmd-primary, #2563eb);
	color: #fff;
	font-size: 1.5rem;
	/* margin-bottom: var(--seamlessmd-space-2, 0.5rem); */
}

.seamlessmd-card-grid__icon i {
	line-height: 1;
}

.seamlessmd-card-grid__title {
	/* font-size: 1.25rem; */
	font-weight: 700;
	line-height: 1.3;
	color: var(--seamlessmd-dark-navy, #1e2a5c);
	margin: 0;
}

.seamlessmd-card-grid__description {
	font-size: 1rem;
	line-height: 1.6;
	color: var(--seamlessmd-muted, #5a6475);
	margin: 0;
}

.seamlessmd-card-grid__link {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	font-weight: 600;
	color: var(--seamlessmd-primary, #2563eb);
	text-decoration: none;
	margin-top: auto;
	padding-top: var(--seamlessmd-space-2, 0.5rem);
	transition: color 200ms ease;
}

.seamlessmd-card-grid__link:hover {
	color: var(--seamlessmd-primary-dark, #1d4fd7);
}

.seamlessmd-card-grid__link-arrow {
	transition: transform 200ms ease;
}

.seamlessmd-card-grid__link:hover .seamlessmd-card-grid__link-arrow {
	transform: translateX(3px);
}

/* RTL: mirror the → glyph and flip the hover-slide direction. */
[dir="rtl"] .seamlessmd-card-grid__link-arrow {
	transform: scaleX(-1);
}
[dir="rtl"] .seamlessmd-card-grid__link:hover .seamlessmd-card-grid__link-arrow {
	transform: scaleX(-1) translateX(3px);
}

/* ---------- Stat variant ---------- */

.seamlessmd-card-grid--variant-stat .seamlessmd-card-grid__card {
	text-align: center;
	align-items: center;
	background-color: transparent;
	box-shadow: none;
	border: none;
	padding: var(--seamlessmd-space-4, 1rem);
}

.seamlessmd-card-grid--variant-stat .seamlessmd-card-grid__card:hover {
	transform: none;
	box-shadow: none;
}

.seamlessmd-card-grid__stat-number {
	font-size: clamp(3rem, 6vw, 5rem);
	font-weight: 800;
	line-height: 1;
	color: var(--seamlessmd-primary, #2563eb);
	margin: 0 0 var(--seamlessmd-space-2, 0.5rem);
	letter-spacing: -0.02em;
}

.seamlessmd-card-grid__stat-value,
.seamlessmd-card-grid__stat-suffix {
	display: inline;
}

.seamlessmd-card-grid__stat-suffix {
	font-size: 0.65em;
	color: var(--seamlessmd-primary-dark, #1d4fd7);
	margin-left: 0.1em;
}

.seamlessmd-card-grid__stat-label {
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--seamlessmd-dark-navy, #1e2a5c);
	margin: 0 0 var(--seamlessmd-space-1, 0.25rem);
}

.seamlessmd-card-grid__stat-description {
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--seamlessmd-muted, #5a6475);
	margin: 0;
	max-width: 320px;
}

/* ---------- Press variant ---------- */

.seamlessmd-card-grid--variant-press .seamlessmd-card-grid__card {
	align-items: flex-start;
}

.seamlessmd-card-grid__press-logo {
	height: 40px;
	width: auto;
	max-width: 160px;
	object-fit: contain;
	object-position: left center;
	margin-bottom: var(--seamlessmd-space-2, 0.5rem);
	filter: grayscale(100%);
	opacity: 0.85;
}

.seamlessmd-card-grid__press-citation {
	font-size: 1.0625rem;
	line-height: 1.55;
	font-style: italic;
	color: var(--seamlessmd-text, #1a2540);
	margin: 0;
	padding: 0;
	border: none;
	quotes: none;
}

.seamlessmd-card-grid__press-source {
	margin-top: auto;
}

/* ---------- Empty state (editor only) ---------- */

.seamlessmd-card-grid__empty {
	padding: var(--seamlessmd-space-6, 1.75rem);
	text-align: center;
}

/* ---------- Density: compact (design §5.4) ----------
 *
 * Used by the accessibility "Design Features" 12-cell icon-only grid:
 * no description, tighter padding, smaller card chrome. Visually hides
 * the description slot when one is left in place; structural omission
 * is editor-driven (leave description empty per-card). */

.seamlessmd-card-grid--density-compact .seamlessmd-card-grid__grid {
	gap: 0;
    /* gap: var(--seamlessmd-space-4, 1.25rem); */
}

/* .seamlessmd-card-grid--density-compact .seamlessmd-card-grid__card {
	padding: var(--seamlessmd-space-4, 1.25rem);
	gap: var(--seamlessmd-space-2, 0.5rem);
} */

.seamlessmd-card-grid--density-compact .seamlessmd-card-grid__icon {
	width: 44px;
	height: 44px;
	font-size: 1.125rem;
}

/* .seamlessmd-card-grid--density-compact .seamlessmd-card-grid__title {
	font-size: 1rem;
} */

.seamlessmd-card-grid--density-compact .seamlessmd-card-grid__description {
	display: none;
}

/* ---------- linkBehavior: card (whole-card anchor) ----------
 *
 * When the wrapper itself is the <a>, neutralise the default
 * anchor underline + colour so the card visuals match the
 * non-anchor article form. */

.seamlessmd-card-grid__card--link {
	color: inherit;
	text-decoration: none;
}

.seamlessmd-card-grid__card--link:hover,
.seamlessmd-card-grid__card--link:focus-visible {
	color: inherit;
	text-decoration: none;
}

.seamlessmd-card-grid__card--link:focus-visible {
	outline: 3px solid var(--seamlessmd-primary, #2563eb);
	outline-offset: 3px;
}

.seamlessmd-card-grid__link--card {
	pointer-events: none; /* the parent anchor is the real click target */
	color: var(--seamlessmd-primary, #2563eb);
}

/* ---------- linkBehavior: none ----------
 *
 * Suppresses the trailing "Read more →" affordance for read-only
 * benefit cards (e.g. care-plan-library Operational Benefits). */

.seamlessmd-card-grid--link-none .seamlessmd-card-grid__link {
	display: none;
}

/* ---------- Per-item bullets (design §5.4) ----------
 *
 * Used by care-plan-library "Surgical Specialties" cards. Parent-class
 * specificity floor per .claude/blocks.md §5 — the
 * `.editor-styles-wrapper ul` core rule (0,1,1) loses cleanly to
 * `.seamlessmd-card-grid .seamlessmd-card-grid__item-bullets` (0,2,0). */

.seamlessmd-card-grid .seamlessmd-card-grid__item-bullets {
	list-style: disc;
	margin: var(--seamlessmd-space-2, 0.5rem) 0 0;
	padding-inline-start: 1.25rem;
	color: var(--seamlessmd-muted, #5a6475);
	font-size: 0.9375rem;
	line-height: 1.55;
}

.seamlessmd-card-grid .seamlessmd-card-grid__item-bullets li {
	margin: 0 0 0.25rem;
}

/* ---------- Per-item image (design §5.4) ----------
 *
 * Used by Customer Care Team role cards (person photo replaces the
 * icon). Parent-class specificity (0,2,0) + max-width:none beats the
 * editor canvas `.editor-styles-wrapper img { max-width: 100% }` rule
 * cleanly, per .claude/blocks.md §5 specificity floor. */

.seamlessmd-card-grid .seamlessmd-card-grid__item-image {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	margin: 0 0 var(--seamlessmd-space-2, 0.5rem);
	border-radius: var(--seamlessmd-radius-md, 12px);
	object-fit: cover;
}

/* Per-item demo-video trigger (chronic-care conditions list). Each
 * condition card may opt into a "Watch Care Plan Demo" button that opens
 * its own YouTube / Vimeo / MP4 lightbox. Hidden when item.useVideo is off. */
.seamlessmd-card-grid .seamlessmd-card-grid__item-video-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--seamlessmd-primary, #4a3fa0);
    transition: background-color 200ms ease, color 200ms ease;
}
.seamlessmd-card-grid .seamlessmd-card-grid__item-video-trigger:hover {
    background-color: var(--seamlessmd-primary, #4a3fa0);
    color: #fff;
}
.seamlessmd-card-grid__item-video-icon {
    font-size: 0.75rem;
    line-height: 1;
}
[dir="rtl"] .seamlessmd-card-grid__item-video-icon {
    transform: scaleX(-1);
}

/* ------------------------------------------------------------------ *
 * iconShape modifier — feature variant only
 *
 * Default: keeps the filled primary-color circle that ships at line 123.
 *          (no override needed; rules above apply.)
 *
 * Hexagon: orange-rimmed hex sticker with a white interior — built from
 *          two stacked pseudo-elements clipped to a regular hexagon
 *          polygon. The outer pseudo paints the rim color, the inner
 *          pseudo (inset 3px) paints the white fill. The FontAwesome
 *          <i> sits above both at z-index 2.
 *
 * Circle:  outlined-only circle — same shape as default but transparent
 *          background with a 2px brand-color stroke, for a lighter
 *          visual touch.
 *
 * The base `.seamlessmd-card-grid__icon` block above sets the size +
 * flex centering + margin-bottom; these modifier rules only change
 * the chrome around the icon.
 * ------------------------------------------------------------------ */

.seamlessmd-card-grid--icon-hexagon .seamlessmd-card-grid__icon {
    background: transparent;
    border-radius: 0;
    width: 64px;
    height: 72px;
    position: relative;
    color: var(--seamlessmd-primary, #2563eb);
    overflow: visible;
}

.seamlessmd-card-grid--icon-hexagon .seamlessmd-card-grid__icon::before,
.seamlessmd-card-grid--icon-hexagon .seamlessmd-card-grid__icon::after {
    content: '';
    position: absolute;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    pointer-events: none;
}

.seamlessmd-card-grid--icon-hexagon .seamlessmd-card-grid__icon::before {
    inset: 0;
    background: var(--seamlessmd-primary, #2563eb);
    z-index: 0;
}

.seamlessmd-card-grid--icon-hexagon .seamlessmd-card-grid__icon::after {
    inset: 3px;
    background: #ffffff;
    z-index: 1;
}

/* FA glyph sits on top of both pseudo layers so the icon is always
 * legible regardless of the rim/fill stacking order. */
.seamlessmd-card-grid--icon-hexagon .seamlessmd-card-grid__icon i,
.seamlessmd-card-grid--icon-hexagon .seamlessmd-card-grid__icon img,
.seamlessmd-card-grid--icon-hexagon .seamlessmd-card-grid__icon svg {
    position: relative;
    z-index: 2;
    color: var(--seamlessmd-primary, #2563eb);
}

/* `.seamlessmd-card-grid__icon-img` — when the per-item `icon` attr is
 * an image path (vs a FontAwesome class), render.php emits an <img>
 * inside the icon chrome. Size it to fit comfortably within the
 * default circle / hex (56-64px wrappers): cap at ~60% of wrapper
 * width so the rim is visible on the hex variant, and preserve
 * aspect-ratio with `object-fit: contain`. */
.seamlessmd-card-grid__icon .seamlessmd-card-grid__icon-img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    display: block;
}

/* Hex variant: image needs a touch more breathing room because the
 * hex inner-white fill is inset 3px from the rim. */
.seamlessmd-card-grid--icon-hexagon .seamlessmd-card-grid__icon .seamlessmd-card-grid__icon-img {
    width: 55%;
    height: 55%;
}

/* Compact density modifier already shrinks the icon width/height (see
 * line 293 of this file); preserve the smaller footprint for hex too. */
.seamlessmd-card-grid--density-compact.seamlessmd-card-grid--icon-hexagon .seamlessmd-card-grid__icon {
    width: 44px;
    height: 50px;
}

.seamlessmd-card-grid--icon-circle .seamlessmd-card-grid__icon {
    background: transparent;
    border: 2px solid var(--seamlessmd-primary, #2563eb);
    color: var(--seamlessmd-primary, #2563eb);
}

.seamlessmd-card-grid--icon-circle .seamlessmd-card-grid__icon i {
    color: var(--seamlessmd-primary, #2563eb);
}

/* Leader variant + icon-shape:circle — collapse the default full-bleed
 * square portrait into a centered circular headshot sized by
 * `--seamlessmd-card-grid-icon-size` (fallback 200px). The card chrome
 * (elevated / bordered / plain) is preserved; we reset the padding-zero
 * + overflow-hidden + gap-zero specific to the full-bleed layout so the
 * circle has breathing room and the name/role text sits centered below. */
.seamlessmd-card-grid--variant-leader.seamlessmd-card-grid--icon-circle .seamlessmd-card-grid__card {
    padding: var(--seamlessmd-space-5, 1.5rem);
    overflow: visible;
    gap: var(--seamlessmd-space-3, 0.75rem);
    align-items: center;
}

.seamlessmd-card-grid--variant-leader.seamlessmd-card-grid--icon-circle .seamlessmd-card-grid__leader-photo {
    width: var(--seamlessmd-card-grid-icon-size, 200px);
    height: var(--seamlessmd-card-grid-icon-size, 200px);
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
}

/* Name/role: drop the photo-adjacent padding the full-bleed layout
 * needs (the photo no longer hugs the card edges in circle mode). */
.seamlessmd-card-grid--variant-leader.seamlessmd-card-grid--icon-circle .seamlessmd-card-grid__leader-name {
    padding: 0;
}

.seamlessmd-card-grid--variant-leader.seamlessmd-card-grid--icon-circle .seamlessmd-card-grid__leader-role {
    padding-inline: 0;
}

/* ------------------------------------------------------------------ *
 * Leader variant — headshot + name + role; click opens a modal with
 * full bio + LinkedIn + Twitter + optional linked articles.
 *
 * No-JS fallback: the modal HTML lives at the end of the section and
 * is visible by default. view.js applies `.is-js-ready` to the section
 * root, which switches modals into an overlay (hidden until activated
 * via `.is-open`). This complies with blocks.md §10 "no opacity:0 by
 * default" — the JS opts INTO the hide.
 * ------------------------------------------------------------------ */

.seamlessmd-card-grid--variant-leader .seamlessmd-card-grid__card {
    /* Vertical stack: full-bleed headshot at the top, name + role
     * centred underneath with bottom + horizontal padding only. Top /
     * left / right padding is zero so the photo can hug the card edges.
     * `align-items: stretch` lets the photo span the full card width;
     * `overflow: hidden` clips the photo to the card's border-radius so
     * the rounded top corners stay clean. */
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    padding: 0 0 var(--seamlessmd-space-5, 1.5rem);
    overflow: hidden;
    gap: 0;
}

.seamlessmd-card-grid--variant-leader .seamlessmd-card-grid__card:hover,
.seamlessmd-card-grid--variant-leader .seamlessmd-card-grid__card:focus-visible {
    color: inherit;
    text-decoration: none;
}

.seamlessmd-card-grid--variant-leader .seamlessmd-card-grid__card:focus-visible {
    outline: 3px solid var(--seamlessmd-primary, #2563eb);
    outline-offset: 3px;
}

/* Parent-class selector floor on the leader headshot beats the editor
 * canvas `.editor-styles-wrapper img { max-width: 100% }` core rule
 * (blocks.md §5 specificity contract). Headshot fills the card head:
 * width 100%, square aspect (object-fit: cover crops to the natural
 * subject), no border-radius / margin so the photo hugs the card's
 * top + left + right edges; the card's own `overflow: hidden` clips
 * the top corners to the card border-radius. */
.seamlessmd-card-grid .seamlessmd-card-grid__leader-photo {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0;
    margin: 0;
}

/* Text payload (name + role) gets horizontal + top padding so it
 * breathes from the photo above and the card edges; bottom padding
 * comes from the card itself. */
.seamlessmd-card-grid .seamlessmd-card-grid__leader-name {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--seamlessmd-dark-navy, #1e2a5c);
    margin: 0 0 var(--seamlessmd-space-1, 0.25rem);
    padding: var(--seamlessmd-space-5, 1.5rem) var(--seamlessmd-space-5, 1.5rem) 0;
}

.seamlessmd-card-grid .seamlessmd-card-grid__leader-role {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--seamlessmd-muted, #5a6475);
    margin: 0;
    padding-inline: var(--seamlessmd-space-5, 1.5rem);
}

/* Static leader card (linkBehavior !== 'card') — no modal trigger, no
 * pointer/anchor chrome. The whole card stays non-clickable; only the
 * inline social-icon links inside it are interactive. */
.seamlessmd-card-grid--variant-leader .seamlessmd-card-grid__card--leader-static {
    cursor: default;
}

.seamlessmd-card-grid--variant-leader .seamlessmd-card-grid__card--leader-static:hover {
    /* Suppress the default card hover lift — there's nothing to click. */
    transform: none;
}

/* Inline social icons (LinkedIn / Twitter) rendered under the role line
 * on static leader cards. Visually a centered row of compact pill-icons
 * that match the modal-footer social block at smaller scale, so editors
 * see one consistent visual idiom for the team's social presence. */
.seamlessmd-card-grid .seamlessmd-card-grid__leader-social {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--seamlessmd-space-2, 0.5rem);
    margin: var(--seamlessmd-space-3, 0.75rem) 0 0;
    padding: 0 var(--seamlessmd-space-5, 1.5rem);
}

.seamlessmd-card-grid .seamlessmd-card-grid__leader-social li {
    margin: 0;
}

.seamlessmd-card-grid .seamlessmd-card-grid__leader-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--seamlessmd-primary, #2563eb);
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 200ms ease;
}

.seamlessmd-card-grid .seamlessmd-card-grid__leader-social a:hover,
.seamlessmd-card-grid .seamlessmd-card-grid__leader-social a:focus-visible {
    background-color: var(--seamlessmd-primary-dark, #1d4fd7);
    color: #fff;
}

/* ---------- Leader modal: no-JS fallback (default visible block) ----------
 *
 * Without view.js, the modal markup just sits at the end of the section
 * styled as a stacked detail panel. With view.js, the section gets
 * `.is-js-ready` and modals become overlays. */

.seamlessmd-card-grid__modals {
    margin-top: var(--seamlessmd-space-6, 1.75rem);
    display: flex;
    flex-direction: column;
    gap: var(--seamlessmd-space-4, 1.25rem);
}

.seamlessmd-card-grid__modal {
    background-color: #fff;
    border-radius: var(--seamlessmd-radius-lg, 16px);
    box-shadow: var(--seamlessmd-shadow-sm, 0 1px 3px rgba(30, 42, 92, 0.08));
    padding: var(--seamlessmd-space-5, 1.5rem);
}

.seamlessmd-card-grid__modal-overlay {
    display: none;
}

.seamlessmd-card-grid__modal-panel {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: var(--seamlessmd-space-5, 1.5rem);
    align-items: start;
}

@media (max-width: 767px) {
    .seamlessmd-card-grid__modal-panel {
        grid-template-columns: 1fr;
    }
}

.seamlessmd-card-grid__modal-close {
    position: absolute;
    inset-inline-end: var(--seamlessmd-space-3, 0.75rem);
    inset-block-start: var(--seamlessmd-space-3, 0.75rem);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--seamlessmd-muted, #5a6475);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: none; /* hidden in no-JS fallback; revealed when overlay is active */
}

.seamlessmd-card-grid__modal-close:hover,
.seamlessmd-card-grid__modal-close:focus-visible {
    background-color: rgba(30, 42, 92, 0.06);
    color: var(--seamlessmd-dark-navy, #1e2a5c);
}

.seamlessmd-card-grid__modal-body {
    display: contents;
}

.seamlessmd-card-grid .seamlessmd-card-grid__modal-photo {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 0;
    border-radius: var(--seamlessmd-radius-md, 12px);
    object-fit: cover;
}

.seamlessmd-card-grid .seamlessmd-card-grid__modal-name {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--seamlessmd-dark-navy, #1e2a5c);
    margin: 0 0 var(--seamlessmd-space-1, 0.25rem);
}

.seamlessmd-card-grid__modal-role {
    font-size: 1rem;
    color: var(--seamlessmd-muted, #5a6475);
    margin: 0 0 var(--seamlessmd-space-3, 0.75rem);
}

.seamlessmd-card-grid__modal-bio {
    color: var(--seamlessmd-text, #1a2540);
    font-size: 1rem;
    line-height: 1.6;
}

.seamlessmd-card-grid__modal-bio p {
    margin: 0 0 var(--seamlessmd-space-3, 0.75rem);
}

.seamlessmd-card-grid__modal-bio p:last-child {
    margin-bottom: 0;
}

.seamlessmd-card-grid__modal-social {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--seamlessmd-space-2, 0.5rem);
    margin: var(--seamlessmd-space-3, 0.75rem) 0 0;
    padding: 0;
}

.seamlessmd-card-grid__modal-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--seamlessmd-primary, #2563eb);
    color: #fff;
    text-decoration: none;
    transition: background-color 200ms ease;
}

.seamlessmd-card-grid__modal-social a:hover,
.seamlessmd-card-grid__modal-social a:focus-visible {
    background-color: var(--seamlessmd-primary-dark, #1d4fd7);
    color: #fff;
}

.seamlessmd-card-grid .seamlessmd-card-grid__modal-articles-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--seamlessmd-dark-navy, #1e2a5c);
    margin: var(--seamlessmd-space-3, 0.75rem) 0 var(--seamlessmd-space-2, 0.5rem);
}

.seamlessmd-card-grid__modal-articles ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--seamlessmd-space-1, 0.25rem);
}

.seamlessmd-card-grid__modal-articles a {
    color: var(--seamlessmd-primary, #2563eb);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
}

.seamlessmd-card-grid__modal-articles a:hover {
    color: var(--seamlessmd-primary-dark, #1d4fd7);
}

.seamlessmd-card-grid__modal-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: var(--seamlessmd-space-3, 0.75rem);
    color: var(--seamlessmd-primary, #2563eb);
    text-decoration: none;
    font-weight: 600;
}

.seamlessmd-card-grid__modal-back:hover {
    color: var(--seamlessmd-primary-dark, #1d4fd7);
}

/* ---------- Leader modal: JS-elevated overlay state ----------
 *
 * view.js sets `.is-js-ready` on the section root once the listeners
 * are bound. From that point modals are display:none until `.is-open`
 * lifts them into a fixed-position overlay. */

.seamlessmd-card-grid.is-js-ready .seamlessmd-card-grid__modals {
    margin-top: 0;
    display: block;
}

.seamlessmd-card-grid.is-js-ready .seamlessmd-card-grid__modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.seamlessmd-card-grid.is-js-ready .seamlessmd-card-grid__modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.seamlessmd-card-grid.is-js-ready .seamlessmd-card-grid__modal-overlay {
    display: block;
    position: absolute;
    inset: 0;
    background-color: rgba(30, 42, 92, 0.55);
    cursor: pointer;
}

.seamlessmd-card-grid.is-js-ready .seamlessmd-card-grid__modal-panel {
    position: relative;
    max-width: 720px;
    width: calc(100% - 2rem);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    background-color: #fff;
    border-radius: var(--seamlessmd-radius-lg, 16px);
    box-shadow: 0 24px 64px rgba(30, 42, 92, 0.35);
    padding: var(--seamlessmd-space-6, 1.75rem);
}

.seamlessmd-card-grid.is-js-ready .seamlessmd-card-grid__modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Inline-end-anchored close-X automatically mirrors under RTL via
 * `inset-inline-end`. No `[dir="rtl"]` override needed for the X
 * itself — but the modal back-arrow flips like the rest of the
 * card-grid arrows. */
[dir="rtl"] .seamlessmd-card-grid__modal-back .seamlessmd-card-grid__link-arrow {
    transform: scaleX(-1);
}
[dir="rtl"] .seamlessmd-card-grid__modal-back:hover .seamlessmd-card-grid__link-arrow {
    transform: scaleX(-1);
}

/* Body-scroll-lock helper (set by view.js on document.body). */
body.seamlessmd-card-grid-modal-open {
    overflow: hidden;
}

/* ------------------------------------------------------------------ *
 * Editor canvas parity — `view.js` does not run inside the WP block-
 * editor iframe, so the modal markup (rendered after the grid as a
 * visible no-JS fallback) would otherwise appear as a stacked list of
 * duplicate "name + role + photo" panels below the card grid. That's
 * confusing for editors — they only need to see what end-users see.
 *
 * `.editor-styles-wrapper` is the WP-injected ancestor present ONLY
 * inside the block-editor iframe, so the rule is scoped to the editor
 * and the frontend no-JS fallback continues to work.
 * ------------------------------------------------------------------ */
.editor-styles-wrapper .seamlessmd-card-grid__modals {
    display: none;
}

/* ---------- iconPosition: bottom modifier (feature variant only) ----------
 *
 * `iconPosition: top` (default) leaves the historical icon-on-top treatment
 * untouched. `iconPosition: bottom` paints content (title / description /
 * link) above the icon. DOM order stays icon-then-content for semantic
 * decoration-first ordering; visual swap is done via `order` so screen
 * readers and the inserter preview remain consistent across both modes.
 *
 * Scope is the double-class compound `.--variant-feature.--icon-pos-bottom`
 * so stat / press / leader variants (which render different inner trees) are
 * unaffected. */
.seamlessmd-card-grid--variant-feature.seamlessmd-card-grid--icon-pos-bottom .seamlessmd-card-grid__card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
}
.seamlessmd-card-grid--variant-feature.seamlessmd-card-grid--icon-pos-bottom .seamlessmd-card-grid__content {
    order: 1;
}
.seamlessmd-card-grid--variant-feature.seamlessmd-card-grid--icon-pos-bottom .seamlessmd-card-grid__icon {
    order: 2;
}

/* ---------- Content layout: `split` ----------
 *
 * Opt-in via the `contentLayout: "split"` attribute (feature variant only).
 * Layout: two columns — header (eyebrow / heading / subheading) + body prose
 * on the inline-start (`__split-content` wrapping `__header` + `__split-body`),
 * vertical stack of feature rows on the inline-end (`__split-items`). Used by
 * the chronic-care-management solution to pair an editor-authored intro
 * column with a clickable condition rail; the default `grid` content layout
 * stays unchanged for every other card-grid usage.
 *
 * Note: the `.seamlessmd-container` default for card-grid is
 * `display: flex; gap: 5rem` (the side-by-side header rail). Split layout
 * reverts that to block flow so the `__split` row owns its own flex layout. */
.seamlessmd-card-grid--content-layout-split .seamlessmd-container {
    display: block;
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: clamp(2rem, 4vw, 4rem);
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-content {
    flex: 1 1 0;
    min-width: 0;
}

/* Override the project-wide centred-header rule (style.css:34-47) inside the
 * split layout — the header lives in the left column now, so it should hug
 * the inline-start with the rest of the prose, not centre + max-width itself. */
.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-content .seamlessmd-card-grid__header {
    max-width: none;
    margin-inline: 0;
    margin-bottom: var(--seamlessmd-space-4, 1.25rem);
    text-align: inherit;
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-content .seamlessmd-card-grid__header > * {
    margin-inline: 0;
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-body {
    color: var(--seamlessmd-text, #1a2540);
    font-size: 1rem;
    line-height: 1.7;
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-body > *:first-child {
    margin-top: 0;
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-body > *:last-child {
    margin-bottom: 0;
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-body :is(h2, h3, h4) {
    color: var(--seamlessmd-dark-navy, #1e2a5c);
    font-weight: 700;
    line-height: 1.25;
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-body a {
    color: var(--seamlessmd-primary, #2563eb);
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-items {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--seamlessmd-space-4, 1rem);
}

/* Each feature row lays out icon + content horizontally — overriding the
 * default vertical card stack so the split rail reads as a list rather
 * than a column of cards. Scoped tightly to `--content-layout-split` so
 * grid-layout cards remain untouched. */
.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-items .seamlessmd-card-grid__card {
    flex-direction: row;
    align-items: center;
    gap: var(--seamlessmd-space-3, 0.75rem);
    width: 100%;
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-items .seamlessmd-card-grid__icon {
    flex: 0 0 auto;
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-items .seamlessmd-card-grid__content {
    flex: 1 1 0;
    min-width: 0;
}

.seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split-items .seamlessmd-card-grid__title {
    margin: 0;
}

/* Mobile: stack the content pane above the feature rail (single column). */
@media (max-width: 768px) {
    .seamlessmd-card-grid--content-layout-split .seamlessmd-card-grid__split {
        flex-direction: column;
        gap: var(--seamlessmd-space-6, 2rem);
    }
}

/* Screen-reader-only text used inside icon-only social links. */
.seamlessmd-card-grid .screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
