/*
 * Graduation List — minimal, non-overriding styles.
 * - No font families set: inherits from the theme / Elementor Global Fonts.
 * - Low specificity (:where) so theme, Elementor style controls and custom CSS win.
 * - Colours via custom properties; override e.g. `.gl { --gl-accent: #8a1538; }`.
 */
:where(.gl) {
	--gl-accent: currentColor;
	--gl-border: rgba(127, 127, 127, 0.25);
	--gl-muted: rgba(127, 127, 127, 0.95);
	--gl-row-alt: rgba(127, 127, 127, 0.06);
	--gl-mark: rgba(255, 210, 0, 0.45);
	--gl-radius: 8px;
	--gl-gap: 0.75rem;
	container-type: inline-size;
}

/* Controls */
:where(.gl__controls) {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--gl-gap);
	margin: 0 0 var(--gl-gap);
}

@container (min-width: 640px) {
	:where(.gl__controls) {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	:where(.gl__field--search) {
		grid-column: 1 / -1;
	}
}

@container (min-width: 960px) {
	:where(.gl__controls) {
		grid-template-columns: 2fr repeat(3, minmax(0, 1fr));
	}
	:where(.gl__field--search) {
		grid-column: auto;
	}
}

:where(.gl__input, .gl__select) {
	width: 100%;
	min-height: 44px; /* touch target */
	padding: 0.5em 0.75em;
	border: 1px solid var(--gl-border);
	border-radius: var(--gl-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	box-sizing: border-box;
}

:where(.gl__input:focus-visible, .gl__select:focus-visible, .gl__page-btn:focus-visible) {
	outline: 2px solid var(--gl-accent);
	outline-offset: 2px;
}

:where(.gl__status) {
	margin: 0 0 0.5rem;
	color: var(--gl-muted);
	font-size: 0.9em;
}

/* Results: stacked cards on narrow, table-like rows on wide containers */
:where(.gl__list) {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--gl-border);
	transition: opacity 0.15s;
}

:where(.gl.is-loading .gl__list) {
	opacity: 0.5;
}

:where(.gl__item) {
	display: grid;
	gap: 0.15rem;
	padding: 0.75rem 0.25rem;
	border-bottom: 1px solid var(--gl-border);
}

:where(.gl__item:nth-child(even)) {
	background: var(--gl-row-alt);
}

@container (min-width: 720px) {
	:where(.gl__item) {
		grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) minmax(0, 1fr);
		gap: 1rem;
		align-items: center;
		padding-inline: 0.75rem;
	}
}

:where(.gl__name) {
	font-weight: 600;
}

:where(.gl__programme, .gl__school) {
	font-size: 0.9em;
}

:where(.gl__school) {
	color: var(--gl-muted);
}

:where(.gl__badge) {
	display: inline-block;
	margin-inline-start: 0.5em;
	padding: 0.1em 0.5em;
	border: 1px solid var(--gl-border);
	border-radius: 999px;
	font-size: 0.75em;
	font-weight: 400;
	vertical-align: middle;
	white-space: nowrap;
}

:where(.gl mark) {
	background: var(--gl-mark);
	color: inherit;
	padding: 0;
	border-radius: 2px;
}

/* Pager */
:where(.gl__pager) {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--gl-gap);
	margin-top: var(--gl-gap);
}

:where(.gl__pager[hidden]) {
	display: none;
}

:where(.gl__page-btn) {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 1em;
	border: 1px solid var(--gl-border);
	border-radius: var(--gl-radius);
	color: inherit;
	text-decoration: none;
}

:where(.gl__page-btn[aria-disabled="true"]) {
	opacity: 0.4;
	pointer-events: none;
}

:where(.gl__page-info) {
	font-size: 0.9em;
	color: var(--gl-muted);
}

@media print {
	:where(.gl__controls, .gl__pager) {
		display: none;
	}
}
