/* =================================================================
   AION Nexus - Shared Section Styles
   =================================================================
   Components used by every page in the AION Nexus section: the hub,
   the CRM page, the Financial Operations page, and any module page
   added later.

   Loaded by inc/enqueue.php for any template listed in
   aion_nexus_templates(), ahead of that page's own stylesheet.

   Page-specific rules belong in nexus.css, nexus-crm.css or
   nexus-finance.css — not here.
   ----------------------------------------------------------------- */

/* -----------------------------------------------------------------
   Status pill
   Maturity marker in a hero. Deliberately plain — it is a statement
   of fact, not a promotional badge.
   ----------------------------------------------------------------- */

.nexus-status-pill {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	margin-top: var(--space-5);
	padding: var(--space-2) var(--space-4);
	border-radius: var(--radius-full);
	background-color: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.25);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	color: var(--color-white);
}

/*
 * The .page-hero on the child pages is navy, so the pill's default light-on-dark
 * treatment is already correct there and needs no override.
 *
 * What does need overriding are the components below, which were written for
 * light sections and are placed on that navy hero — breadcrumb links at
 * #4A4A68 and the eyebrow at #0077A8 both sit at roughly 1.5:1 against
 * #1B3A6B, which is unreadable rather than merely subtle.
 */

/* Breadcrumb and eyebrow colours for the navy .page-hero now live in
   components.css, next to .page-hero itself — they are needed by every page
   that uses that hero, not only the Nexus ones. */

/* -----------------------------------------------------------------
   Status cards — the "where we are" block
   ----------------------------------------------------------------- */

.nexus-status-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-4);
	margin-top: var(--space-8);
}

@media (min-width: 768px) {
	.nexus-status-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: var(--space-5);
	}
}

.nexus-status-card {
	display: flex;
	align-items: flex-start;
	gap: var(--space-4);
	padding: var(--space-5);
	background-color: var(--color-white);
	border: 1px solid var(--color-border);
	/* Accent rule rather than a warning colour: this is context, not an alarm. */
	border-left: 3px solid var(--color-accent);
	border-radius: var(--radius-md);
}

.nexus-status-card__icon {
	display: inline-flex;
	flex-shrink: 0;
	color: var(--color-accent-text);
}

.nexus-status-card__title {
	margin: 0 0 var(--space-2);
	font-size: var(--text-base);
	font-weight: var(--weight-semibold);
	color: var(--color-dark-text);
}

.nexus-status-card__text {
	margin: 0;
	font-size: var(--text-sm);
	line-height: var(--leading-relaxed);
	color: var(--color-body-text);
}

/* -----------------------------------------------------------------
   Module cards
   The repeater behind these is what makes adding a future module
   page a content change rather than a code change.
   ----------------------------------------------------------------- */

.nexus-module-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-5);
	margin-top: var(--space-8);
}

@media (min-width: 768px) {
	.nexus-module-grid {
		grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
	}
}

.nexus-module-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: var(--space-6);
	background-color: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.nexus-module-card:hover {
	box-shadow: var(--shadow-lg);
	transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
	.nexus-module-card {
		transition: none;
	}

	.nexus-module-card:hover {
		transform: none;
	}
}

.nexus-module-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	margin-bottom: var(--space-4);
	border-radius: var(--radius-md);
	background-color: var(--color-light-bg);
	color: var(--color-accent-text);
}

.nexus-module-card__status {
	position: absolute;
	top: var(--space-6);
	right: var(--space-6);
}

.nexus-module-card__title {
	margin: 0 0 var(--space-3);
	font-size: var(--text-xl);
	font-weight: var(--weight-semibold);
	color: var(--color-dark-text);
}

.nexus-module-card__text {
	margin: 0 0 var(--space-5);
	font-size: var(--text-base);
	line-height: var(--leading-relaxed);
	color: var(--color-body-text);
	/* Push the link to the bottom so cards of unequal length still align. */
	flex: 1;
}

.nexus-module-card__link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-weight: var(--weight-semibold);
	color: var(--color-accent-text);
	text-decoration: none;
}

.nexus-module-card__link:hover {
	text-decoration: underline;
}

/* -----------------------------------------------------------------
   Metric strip
   ----------------------------------------------------------------- */

.nexus-metrics {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-4);
	margin: var(--space-8) 0 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.nexus-metrics {
		grid-template-columns: repeat(4, 1fr);
		gap: var(--space-6);
	}
}

.nexus-metric {
	padding: var(--space-5);
	text-align: center;
	background-color: var(--color-light-bg);
	border-radius: var(--radius-md);
}

.nexus-metric__value {
	display: block;
	font-size: var(--text-3xl);
	font-weight: var(--weight-bold);
	line-height: var(--leading-tight);
	color: var(--color-primary);
}

.nexus-metric__label {
	display: block;
	margin-top: var(--space-2);
	font-size: var(--text-sm);
	color: var(--color-body-text);
}

/* -----------------------------------------------------------------
   Capability band
   The workhorse layout on the CRM and Financial Operations pages:
   prose and a bullet list beside a screenshot or clip, alternating
   sides down the page. One block serves both, and any future module
   page gets it for free.
   ----------------------------------------------------------------- */

.nexus-capability {
	padding-block: var(--space-12);
	border-bottom: 1px solid var(--color-border);
}

.nexus-capability:last-of-type {
	border-bottom: none;
}

.nexus-capability__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-8);
	align-items: center;
}

@media (min-width: 1024px) {
	.nexus-capability__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: var(--space-12);
	}

	/*
	 * Media on the left is achieved by reordering, not by reversing the
	 * source, so the heading still precedes its illustration for a screen
	 * reader and in the tab order.
	 */
	.nexus-capability--media-left .nexus-capability__media {
		order: -1;
	}
}

.nexus-capability__eyebrow {
	margin: 0 0 var(--space-2);
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--color-accent-text);
}

.nexus-capability__title {
	margin: 0 0 var(--space-4);
	font-size: var(--text-2xl);
	font-weight: var(--weight-bold);
	line-height: var(--leading-tight);
	color: var(--color-dark-text);
}

@media (min-width: 768px) {
	.nexus-capability__title {
		font-size: var(--text-3xl);
	}
}

.nexus-capability__body {
	margin: 0 0 var(--space-5);
	font-size: var(--text-lg);
	line-height: var(--leading-relaxed);
	color: var(--color-body-text);
}

.nexus-capability__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nexus-capability__list li {
	display: flex;
	align-items: flex-start;
	gap: var(--space-3);
	padding-block: var(--space-2);
	font-size: var(--text-base);
	line-height: var(--leading-relaxed);
	color: var(--color-body-text);
}

.nexus-capability__list li > i[data-lucide] {
	flex-shrink: 0;
	margin-top: 0.3em;
	color: var(--color-accent);
}

.nexus-capability__note {
	margin: var(--space-5) 0 0;
	padding: var(--space-4);
	background-color: var(--color-light-bg);
	border-left: 3px solid var(--color-medium-gray);
	border-radius: var(--radius-sm);
	font-size: var(--text-sm);
	line-height: var(--leading-relaxed);
	color: var(--color-body-text);
}

/* -----------------------------------------------------------------
   Honest-gaps list
   Used for "what is not there today". Styled as neutral information
   rather than as a warning — the point is candour, not alarm.
   ----------------------------------------------------------------- */

.nexus-gaps {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-3);
	margin: var(--space-8) 0 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.nexus-gaps {
		grid-template-columns: repeat(2, 1fr);
	}
}

.nexus-gap {
	display: flex;
	align-items: flex-start;
	gap: var(--space-3);
	padding: var(--space-4);
	background-color: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
}

.nexus-gap > i[data-lucide] {
	flex-shrink: 0;
	margin-top: 0.15em;
	color: var(--color-body-text);
}

.nexus-gap__title {
	display: block;
	font-weight: var(--weight-semibold);
	color: var(--color-dark-text);
}

.nexus-gap__note {
	display: block;
	margin-top: var(--space-1);
	font-size: var(--text-sm);
	line-height: var(--leading-relaxed);
	color: var(--color-body-text);
}

/* -----------------------------------------------------------------
   Maturity matrix
   ----------------------------------------------------------------- */

/* Wide tables scroll inside their own container, never the page. */
.nexus-matrix-wrap {
	margin-top: var(--space-8);
	overflow-x: auto;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
}

.nexus-matrix {
	width: 100%;
	min-width: 34rem;
	border-collapse: collapse;
	font-size: var(--text-sm);
}

.nexus-matrix th,
.nexus-matrix td {
	padding: var(--space-4);
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--color-border);
}

.nexus-matrix thead th {
	background-color: var(--color-light-bg);
	font-weight: var(--weight-semibold);
	color: var(--color-dark-text);
	white-space: nowrap;
}

.nexus-matrix tbody tr:last-child th,
.nexus-matrix tbody tr:last-child td {
	border-bottom: none;
}

.nexus-matrix__capability {
	font-weight: var(--weight-semibold);
	color: var(--color-dark-text);
}

.nexus-matrix__note {
	color: var(--color-body-text);
}

/*
 * Status is conveyed by the text label, with colour only reinforcing it —
 * never by colour alone.
 */
.nexus-status-tag {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-1) var(--space-3);
	border-radius: var(--radius-full);
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	white-space: nowrap;
}

.nexus-status-tag::before {
	content: '';
	width: 0.5rem;
	height: 0.5rem;
	border-radius: var(--radius-full);
	background-color: currentColor;
}

.nexus-status-tag--live {
	background-color: rgba(16, 185, 129, 0.12);
	color: #047857;
}

.nexus-status-tag--built {
	background-color: rgba(0, 180, 216, 0.12);
	color: var(--color-accent-text);
}

.nexus-status-tag--partial {
	background-color: rgba(245, 158, 11, 0.14);
	color: #92400e;
}

.nexus-status-tag--deferred {
	background-color: rgba(30, 41, 59, 0.08);
	color: var(--color-body-text);
}

/* -----------------------------------------------------------------
   Trust badges and integrations — Nexus additions
   ----------------------------------------------------------------- */

/*
 * The qualifier is what keeps a badge honest: "SOC 2" alone reads as a
 * certification, "SOC 2 · readiness, not attested" does not.
 */
.trust-badge__note {
	display: block;
	font-size: var(--text-xs);
	font-weight: var(--weight-normal);
	opacity: 0.75;
}

.nexus-badges {
	margin-top: var(--space-10);
	text-align: center;
}

.nexus-badges__label {
	margin: 0 0 var(--space-4);
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--color-body-text);
}

.nexus-badges__footnote {
	max-width: var(--container-md);
	margin: var(--space-5) auto 0;
	font-size: var(--text-sm);
	line-height: var(--leading-relaxed);
	color: var(--color-body-text);
}

/*
 * A link sitting inside a paragraph must be distinguishable by something other
 * than colour (WCAG 1.4.1) — colour alone fails for anyone who cannot
 * perceive the hue difference against the surrounding text.
 */
.nexus-badges__footnote a {
	color: var(--color-accent-text);
	font-weight: var(--weight-semibold);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.integration-logo__category {
	display: block;
	margin-top: var(--space-1);
	font-size: var(--text-xs);
	line-height: var(--leading-normal);
	text-align: center;
	color: var(--color-body-text);
}

.nexus-integrations__note {
	max-width: var(--container-md);
	margin: 0 auto var(--space-6);
	font-size: var(--text-base);
	line-height: var(--leading-relaxed);
	text-align: center;
	color: var(--color-body-text);
}

/* -----------------------------------------------------------------
   Child-page hero
   Shared by the CRM and Financial Operations pages so the two look
   like siblings rather than two separate designs.
   ----------------------------------------------------------------- */

.nexus-child-hero__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-8);
	align-items: center;
	margin-top: var(--space-6);
}

@media (min-width: 1024px) {
	.nexus-child-hero__grid {
		grid-template-columns: 1.05fr 1fr;
		gap: var(--space-12);
	}
}

/* Illegible at small widths, and it delays the call to action. */
.nexus-child-hero__media {
	display: none;
}

@media (min-width: 768px) {
	.nexus-child-hero__media {
		display: block;
	}
}

.nexus-child-hero .hero__cta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
	margin-top: var(--space-6);
}

/* -----------------------------------------------------------------
   Contrast corrections on the navy child-page hero
   ----------------------------------------------------------------- */

/*
 * .btn--outline defaults to navy text on a navy border, which is invisible
 * against the navy hero — it resolves to 1:1. Same treatment as the outline
 * button on the dark CTA banner.
 */
.page-hero .btn--outline {
	border-color: rgba(255, 255, 255, 0.5);
	color: var(--color-white);
}

.page-hero .btn--outline:hover,
.page-hero .btn--outline:focus-visible {
	background-color: rgba(255, 255, 255, 0.12);
	border-color: var(--color-white);
	color: var(--color-white);
}


/*
 * --color-accent-text (#0077A8) lands at 4.18:1 on the tinted tag background
 * and 4.49:1 on the light card — both fractionally under AA at these sizes.
 * A slightly darker blue clears it without changing the palette's character.
 */
.nexus-status-tag--built {
	color: #005F87;
}

.badge--accent {
	color: #005F87;
}
