/* AquaNetica Core: shared UI primitives.
 *
 * Every rule here is an EXTRACTION from AquaNetica Learning 1.19.0, not a
 * redesign. Values, breakpoints and transition timings are unchanged, so a
 * page migrating onto these classes should render pixel-identical.
 *
 * What is deliberately NOT here: anything course-shaped. Search, sort, the
 * facet sidebar and its drawer, the featured strip, card media band, provider
 * logo, provider label, the course metadata tag (Learning's .aqnl-pill), the
 * facts list and its icons all stay Learning-local. Visual similarity to a
 * future Business Tools element is not evidence that the component is shared.
 *
 * Requires tokens.css.
 */

/* ---------------------------------------------------------------------------
 * Page shell
 * Was Learning's .aqnl root, which carried the tokens AND the page shell on one
 * element. Those are separated here: .aqn (tokens.css) is the token and context
 * wrapper, .aqn-page is the shell. A future component that only needs AquaNetica
 * tokens must not silently inherit a 1200px measure and 56px/64px outer padding.
 *
 * A full AquaNetica page therefore carries both: class="aqn aqn-page".
 * ------------------------------------------------------------------------ */

.aqn-page {
	color: var(--aqn-ink);
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 56px 20px 64px;
}

.aqn-page *,
.aqn-page *::before,
.aqn-page *::after {
	box-sizing: border-box;
}

.aqn-page [hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------------------
 * Hero
 * Was .aqnl-head / -eyebrow / -title / -intro. A centred page introduction,
 * with no course concept anywhere in it.
 * ------------------------------------------------------------------------ */

.aqn-hero {
	max-width: 760px;
	margin: 0 auto 32px;
	text-align: center;
}

.aqn-hero__eyebrow {
	display: inline-block;
	margin: 0 0 12px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--aqn-teal);
}

.aqn-hero__title {
	margin: 0 0 12px;
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.15;
	color: var(--aqn-head);
}

.aqn-hero__intro {
	margin: 0 auto;
	font-size: 16px;
	line-height: 1.55;
	color: var(--aqn-body);
}

/* ---------------------------------------------------------------------------
 * Filter bar and filter pills
 * Was .aqnl-chips / .aqnl-chip. NOTE the naming: Learning's .aqnl-pill is the
 * small metadata tag inside a card and is NOT this component. It stays local.
 * ------------------------------------------------------------------------ */

.aqn-filterbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 24px;
}

.aqn-pill {
	appearance: none;
	background: #fff;
	border: 1px solid var(--aqn-line);
	color: var(--aqn-body);
	border-radius: 999px;
	padding: 9px 16px;
	min-height: 40px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}

.aqn-pill:hover {
	border-color: var(--aqn-teal);
	color: var(--aqn-teal);
}

.aqn-pill.is-active {
	background: var(--aqn-teal);
	border-color: var(--aqn-teal);
	color: #fff;
}

/* ---------------------------------------------------------------------------
 * Button, outline variant only
 * Base geometry from .aqnl-filterbtn. There is no solid or primary button
 * anywhere in Learning 1.19.0, so none is invented here. A primary variant is
 * new design work, deferred to Release 2 with explicit sign-off.
 *
 * There is also no :focus-visible rule, because .aqnl-filterbtn has none.
 * Adding one would be an improvement, and 1B is extraction only. Logged as an
 * accessibility gap to close deliberately after the Learning gate passes.
 * ------------------------------------------------------------------------ */

.aqn-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 48px;
	min-height: 44px;
	padding: 0 16px;
	font-size: 15px;
	font-weight: 600;
	color: var(--aqn-ink);
	background: #fff;
	border: 1px solid var(--aqn-line);
	border-radius: var(--aqn-radius-control);
	cursor: pointer;
}

.aqn-btn:hover {
	border-color: var(--aqn-line-hover);
}

/* ---------------------------------------------------------------------------
 * Results container and card grid
 * Was .aqnl-main and .aqnl-grid. The grid answers to the width of the RESULTS
 * column, not the viewport, so a sidebar taking 260px is accounted for rather
 * than guessed at. The shared component owns its own container name; it must
 * never inherit Learning's aqnlmain.
 * ------------------------------------------------------------------------ */

.aqn-results {
	min-width: 0;
	container-type: inline-size;
	container-name: aqn-results;
}

/* Column ladder 1 / 2 / 3. Three is the ceiling. */
.aqn-cardgrid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
	width: 100%;
}

.aqn-cardgrid > * {
	min-width: 0;
}

@container aqn-results (max-width: 359px) {
	.aqn-cardgrid {
		grid-template-columns: 1fr;
	}
}

@container aqn-results (min-width: 860px) {
	.aqn-cardgrid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@container aqn-results (max-width: 559px) {
	.aqn-cardgrid {
		gap: 14px;
	}
}

/* ---------------------------------------------------------------------------
 * Card
 * Was .aqnl-card and its body, title, summary and CTA.
 *
 * The display:flex !important is carried over verbatim from the source. It is
 * there because something on aquanetica.com already overrides the card's
 * display, and removing it during a migration would be a behaviour change
 * disguised as a tidy-up. It is also the single best piece of evidence that
 * this stylesheet's cascade position matters, which is why the enqueued handle
 * must stay out of SiteGround's CSS combination.
 * ------------------------------------------------------------------------ */

.aqn-card {
	display: flex !important;
	flex-direction: column;
	width: 100%;
	background: var(--aqn-card);
	border: 1px solid var(--aqn-line);
	border-radius: var(--aqn-radius-card);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.aqn-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
	border-color: var(--aqn-line-hover);
}

.aqn-card:focus-visible {
	outline: 2px solid var(--aqn-teal);
	outline-offset: 2px;
}

.aqn-card__body {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 16px 18px 20px;
}

.aqn-card__title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--aqn-head);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.aqn-card__summary {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--aqn-body);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.aqn-card__cta {
	margin-top: 12px;
	font-size: 13px;
	font-weight: 600;
	color: var(--aqn-teal);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.aqn-card:hover .aqn-card__cta {
	text-decoration: underline;
}

@container aqn-results (max-width: 559px) {
	.aqn-card__body {
		padding: 12px 13px 16px;
	}

	.aqn-card__title {
		font-size: 14.5px;
		line-height: 1.3;
		-webkit-line-clamp: 3;
		margin-bottom: 4px;
	}

	.aqn-card__summary {
		font-size: 12px;
		line-height: 1.4;
		-webkit-line-clamp: 3;
		margin-bottom: 8px;
	}

	.aqn-card__cta {
		font-size: 12px;
		margin-top: 8px;
	}
}

/* ---------------------------------------------------------------------------
 * Empty state
 * Was .aqnl-empty. The box is generic; the wording ("No courses match...")
 * stays with the application that owns the results.
 * ------------------------------------------------------------------------ */

.aqn-empty {
	padding: 40px 20px;
	text-align: center;
	color: var(--aqn-muted);
	background: #fff;
	border: 1px dashed var(--aqn-line-hover);
	border-radius: var(--aqn-radius-card);
	margin-top: 16px;
}

/* ---------------------------------------------------------------------------
 * Disclosure
 * Was .aqnl-disclaimer. Both Learning and Business Tools are referral
 * directories that have to disclose the commercial relationship, so the block
 * is shared and only the copy differs.
 * ------------------------------------------------------------------------ */

.aqn-disclosure {
	margin: 40px 0 0;
	padding: 20px 0 0;
	border-top: 1px solid var(--aqn-line);
	max-width: 760px;
}

.aqn-disclosure h2 {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--aqn-muted);
}

.aqn-disclosure p {
	margin: 0 0 8px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--aqn-body);
}

.aqn-disclosure p:last-child {
	margin-bottom: 0;
}

.aqn-disclosure a {
	color: var(--aqn-teal);
}

.aqn-disclosure ul,
.aqn-disclosure ol {
	margin: 0 0 8px 18px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--aqn-body);
}

/* ---------------------------------------------------------------------------
 * Reduced motion
 * ------------------------------------------------------------------------ */

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

	.aqn-card:hover {
		transform: none;
	}
}

/* ---------------------------------------------------------------------------
 * Dark mode, shared components only.
 * Learning's dark rules for search, sort, select, sidebar, filter button,
 * provider logo and card media stay Learning-local alongside those components.
 * ------------------------------------------------------------------------ */

:root[data-theme="dark"] .aqn-empty,
body.is-dark .aqn-empty,
:root[data-theme="dark"] .aqn-btn,
body.is-dark .aqn-btn {
	background: var(--aqn-card);
	color: var(--aqn-ink);
}

:root[data-theme="dark"] .aqn-pill,
body.is-dark .aqn-pill {
	background: var(--aqn-card);
	color: var(--aqn-body);
}

:root[data-theme="dark"] .aqn-pill.is-active,
body.is-dark .aqn-pill.is-active {
	background: var(--aqn-teal);
	color: #fff;
}
