/*
 * PPS AccessPlanit — frontend styles
 * All colours, fonts and spacing inherit from the active theme.
 * Only structural / layout rules are hardcoded here.
 * BEM naming: .pps-{block}__{element}--{modifier}
 */

/* =============================================================================
   Shared utilities
   ============================================================================= */

.pps-badge {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 0.2em 0.65em;
	border-radius: 999px;
	white-space: nowrap;
	vertical-align: middle;
}

.pps-badge--classroom {
	background: #e8f0fe;
	color: #1a56db;
}

.pps-badge--virtual {
	background: #def7ec;
	color: #03543f;
}

/* =============================================================================
   Coming soon placeholder  .pps-coming-soon
   ============================================================================= */

.pps-coming-soon {
	padding: 2.5rem 1rem;
	text-align: center;
}

.pps-coming-soon__inner {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	max-width: 480px;
}

.pps-coming-soon__icon {
	opacity: 0.35;
}

.pps-coming-soon__heading {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
}

.pps-coming-soon__body {
	margin: 0;
	opacity: 0.75;
}

.pps-coming-soon__cta {
	margin: 0;
	font-size: 0.9rem;
}

/* =============================================================================
   Course catalogue  [pps_courses]  and  [pps_elearning]
   ============================================================================= */

.pps-courses__list,
.pps-elearning__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1rem;
}

.pps-courses__item,
.pps-elearning__item {
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
	padding: 1rem 1.1rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.pps-courses__item-header,
.pps-elearning__item-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.5rem;
}

.pps-courses__item-title,
.pps-elearning__item-title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
}

.pps-courses__item-meta,
.pps-elearning__item-meta {
	margin: 0;
	font-size: 0.8rem;
	opacity: 0.65;
}

/* =============================================================================
   Upcoming courses  [pps_upcoming]
   ============================================================================= */

.pps-upcoming__scroll-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.pps-upcoming__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.pps-upcoming__th {
	text-align: left;
	padding: 0.6rem 0.9rem;
	border-bottom: 2px solid rgba(0, 0, 0, 0.15);
	font-weight: 700;
	white-space: nowrap;
}

.pps-upcoming__td {
	padding: 0.65rem 0.9rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.07);
	vertical-align: middle;
}

.pps-upcoming__row:last-child .pps-upcoming__td {
	border-bottom: none;
}

.pps-upcoming__row:hover .pps-upcoming__td {
	background: rgba(0, 0, 0, 0.025);
}

.pps-upcoming__td--date {
	white-space: nowrap;
}

.pps-upcoming__book-btn {
	display: inline-block;
	padding: 0.3em 0.9em;
	border-radius: 4px;
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	background: var(--color-primary, #3D1E6D);
	color: var(--color-text-on-primary, #fff);
	opacity: 0.9;
	border: 1px solid var(--color-primary, #3D1E6D);
}

.pps-upcoming__book-btn:hover {
	opacity: 1;
	text-decoration: none;
}

/* =============================================================================
   Schedule grouped by month  [pps_schedule]
   ============================================================================= */

.pps-schedule {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.pps-schedule__month {
}

.pps-schedule__month-heading {
	margin: 0 0 0.75rem;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid rgba(0, 0, 0, 0.12);
	font-size: 1.05rem;
	font-weight: 700;
}

.pps-schedule__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.pps-schedule__item {
	display: grid;
	grid-template-columns: 9rem auto 1fr auto;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.pps-schedule__item:last-child {
	border-bottom: none;
}

.pps-schedule__item-date {
	font-size: 0.85rem;
	white-space: nowrap;
	opacity: 0.75;
}

.pps-schedule__item-title {
	font-size: 0.9rem;
	font-weight: 500;
}

.pps-schedule__book-btn {
	font-size: 0.78rem;
	font-weight: 600;
	text-decoration: none;
	padding: 0.2em 0.7em;
	border-radius: 3px;
	border: 1px solid currentColor;
	white-space: nowrap;
}

.pps-schedule__book-btn:hover {
	text-decoration: none;
	opacity: 0.8;
}

@media (max-width: 600px) {
	.pps-schedule__item {
		grid-template-columns: 1fr auto;
		grid-template-rows: auto auto;
	}

	.pps-schedule__item-date {
		grid-column: 1;
		grid-row: 2;
		font-size: 0.8rem;
	}

	.pps-schedule__item-title {
		grid-column: 1;
		grid-row: 1;
	}

	.pps-schedule__item .pps-badge {
		grid-column: 2;
		grid-row: 1;
	}

	.pps-schedule__book-btn {
		grid-column: 2;
		grid-row: 2;
	}
}

/* =============================================================================
   Search  [pps_search]
   ============================================================================= */

.pps-search {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.pps-search__label {
	display: block;
	font-weight: 600;
	font-size: 0.9rem;
	margin-bottom: 0.35rem;
}

.pps-search__input-row {
	position: relative;
	display: flex;
	align-items: center;
	max-width: 520px;
}

.pps-search__input {
	width: 100%;
	padding: 0.6em 2.5em 0.6em 0.85em;
	font-size: 1rem;
	font-family: inherit;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 5px;
	box-sizing: border-box;
	background: #fff;
	color: inherit;
}

.pps-search__input:focus {
	outline: none;
	border-color: currentColor;
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.pps-search__clear {
	position: absolute;
	right: 0.6rem;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	opacity: 0.45;
	line-height: 0;
}

.pps-search__clear:hover {
	opacity: 0.8;
}

.pps-search__results {
	min-height: 1.5rem;
}

.pps-search__count {
	margin: 0 0 0.75rem;
	font-size: 0.85rem;
	opacity: 0.65;
}

.pps-search__result-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.pps-search__result-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.65rem 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.pps-search__result-item:last-child {
	border-bottom: none;
}

.pps-search__result-title {
	font-size: 0.9rem;
	font-weight: 500;
}

.pps-search__no-results {
	margin: 0;
	font-size: 0.9rem;
	opacity: 0.65;
	font-style: italic;
}

.pps-search__spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(0, 0, 0, 0.15);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: pps-spin 0.7s linear infinite;
	vertical-align: middle;
}

@keyframes pps-spin {
	to { transform: rotate(360deg); }
}

/* =============================================================================
   Presenters placeholder  [pps_presenters]
   (no separate styles needed beyond .pps-coming-soon)
   ============================================================================= */

/* =============================================================================
   Per-course upcoming dates  [pps_course_dates]
   ============================================================================= */

.pps-course-dates__card {
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
	padding: 0 1.25rem;
}

.pps-course-dates__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
	padding: 0.9rem 0;
}

.pps-course-dates__row--divided {
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.pps-course-dates__info {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.pps-course-dates__date {
	font-weight: 600;
	min-width: 8.75rem;
}

.pps-course-dates__meta {
	font-size: 0.85rem;
	opacity: 0.7;
}

.pps-course-dates__book-btn {
	display: inline-block;
	padding: 0.4em 1.1em;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	background: var(--color-primary, #3D1E6D);
	color: var(--color-text-on-primary, #fff);
	opacity: 0.9;
	border: 1px solid var(--color-primary, #3D1E6D);
}

.pps-course-dates__book-btn:hover {
	opacity: 1;
	text-decoration: none;
}

.pps-course-dates__footnote {
	font-size: 0.85rem;
	opacity: 0.7;
	margin: 1rem 0 0;
}

.pps-course-dates--in-house {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	padding: 1.25rem;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
}

.pps-course-dates__in-house-note {
	margin: 0;
	font-size: 0.9rem;
	opacity: 0.75;
}

.pps-course-dates__request-btn {
	display: inline-block;
	padding: 0.5em 1.25em;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	background: var(--color-primary, #3D1E6D);
	color: var(--color-text-on-primary, #fff);
	opacity: 0.9;
	border: 1px solid var(--color-primary, #3D1E6D);
}

.pps-course-dates__request-btn:hover {
	opacity: 1;
	text-decoration: none;
}

/* =============================================================================
   AccessPlanit HTML Plug-in widget  [pps_course_dates] (mapped courses)
   Best-effort styling of AP's own rendered table via the CssClasses hooks
   their script accepts — the exact DOM AP produces can't be confirmed until
   the site is whitelisted and the widget actually renders, so expect to
   revisit these once real output is visible.
   ============================================================================= */

.pps-ap-widget-wrap {
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
	padding: 0 1.25rem;
	overflow-x: auto;
}

.pps-ap-widget {
	min-height: 3rem;
	display: flex;
	align-items: center;
	font-size: 0.9rem;
	opacity: 0.65;
}

.pps-ap-widget__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.pps-ap-widget__headrow {
	text-align: left;
}

.pps-ap-widget__headcell {
	text-align: left;
	padding: 0.9rem 0.5rem 0.6rem;
	font-weight: 700;
	white-space: nowrap;
	border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.pps-ap-widget__row {
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.pps-ap-widget__row:first-child {
	border-top: none;
}

.pps-ap-widget__cell {
	padding: 0.9rem 0.5rem;
	vertical-align: middle;
}

.pps-ap-widget__cell--date {
	font-weight: 600;
	white-space: nowrap;
}

.pps-ap-widget__cell--venue {
	opacity: 0.75;
}

.pps-ap-widget__course-name {
	font-weight: 600;
}

.pps-ap-widget__book-btn {
	display: inline-block;
	padding: 0.4em 1.1em;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	background: var(--color-primary, #3D1E6D);
	color: var(--color-text-on-primary, #fff);
	opacity: 0.9;
	border: 1px solid var(--color-primary, #3D1E6D);
}

.pps-ap-widget__book-btn:hover {
	opacity: 1;
	text-decoration: none;
}

.pps-ap-widget__enquire-btn {
	display: none; /* legacy per AP's own docs — not used */
}
