/*
 * Академія: the hub and the course pages.
 *
 * Built from the same pieces as the other service pages — the cards, the icon
 * tiles, the section headings are all the site's own. A course page is not a
 * different kind of page, it is a service page that happens to sell a seat.
 */

/* ---- Заголовок сторінки з логотипом Академії ----
   The lockup, then the H1, then the lead. The logo is the sub-brand's only
   appearance on the page, so it gets room and nothing else competes with it. */

.sx-academy-hero {
	margin: 0 0 var( --wp--preset--spacing--50 );
	padding-bottom: 22px;
	border-bottom: 1px solid var( --sx-border );
}

.sx-academy-hero__logo {
	display: block;
	width: auto;
	height: 52px;
	margin-bottom: 20px;
}

/* The H1 is written here rather than inherited: these pages carry no heading
   block of their own any more, so nothing else sets its size. */
.sx-academy-hero__title {
	margin: 0;
	font-size: var( --sx-title-page );
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.sx-academy-hero__lead {
	margin: 14px 0 0;
	max-width: 68ch;
	font-size: 1.05rem;
	line-height: 1.6;
	color: var( --sx-text-secondary );
}

@media ( max-width: 700px ) {
	.sx-academy-hero__logo {
		height: 40px;
		margin-bottom: 16px;
	}

	.sx-academy-hero__lead {
		font-size: 1rem;
	}
}

.sx-course__h2 {
	margin: var( --wp--preset--spacing--60 ) 0 0.75rem;
	font-size: var( --sx-title-section );
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.sx-course__h3 {
	margin: var( --wp--preset--spacing--40 ) 0 0.5rem;
	font-size: 1.1rem;
	line-height: 1.3;
}

.sx-course__lead {
	margin: 0 0 1rem;
	max-width: 68ch;
	color: var( --sx-text-secondary );
}

/* ---- Навіщо вчитися ----
   The argument, before the catalogue: the programs are already bought and
   already installed, and most of what they do is not being used. */

.sx-course__why {
	padding: 26px 32px;
	background: var( --sx-surface );
	border-radius: var( --sx-radius-lg );
	border-left: 3px solid var( --sx-brand );
}

.sx-course__why .sx-course__h2 {
	margin-top: 0;
}

.sx-course__why p {
	margin: 0;
	max-width: 68ch;
	color: var( --sx-text-secondary );
}





/* Ознаки, не статистика: чотири впізнавані ситуації з супроводу. */

.sx-course__signs {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 10px 32px;
	margin: 22px 0 0;
	padding: 0;
	list-style: none;
}

.sx-course__signs li {
	position: relative;
	min-width: 0;
	padding-left: 26px;
	color: var( --sx-text-secondary );
	font-size: 0.97rem;
	line-height: 1.5;
	overflow-wrap: break-word;
}

/* The tick is drawn, not an icon file: one glyph, four repeats, no request. */
.sx-course__signs li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 0.42em;
	width: 10px;
	height: 6px;
	border-left: 2px solid var( --sx-brand );
	border-bottom: 2px solid var( --sx-brand );
	transform: rotate( -45deg );
}

.sx-course__signs-note {
	margin: 20px 0 0;
	max-width: 68ch;
	font-weight: 600;
}

@media ( max-width: 700px ) {
	.sx-course__signs {
		grid-template-columns: minmax( 0, 1fr );
	}
}

/* ---- Вхід у кабінет ----
   Logo, one sentence, one link. Not a call to action for a buyer — a door for
   someone who has already bought, so it stays quiet and does not compete with
   the tariff cards above it. */

.sx-academy-portal {
	display: grid;
	grid-template-columns: auto minmax( 0, 1fr ) auto;
	align-items: center;
	gap: 24px;
	margin: var( --wp--preset--spacing--50 ) 0 0;
	padding: 22px 28px;
	background: var( --sx-surface );
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
}

.sx-academy-portal__logo {
	width: auto;
	height: 44px;
}

.sx-academy-portal__text {
	min-width: 0;
}

.sx-academy-portal__title {
	margin: 0 0 4px;
	font-size: 1.1rem;
	line-height: 1.25;
}

.sx-academy-portal__text p {
	margin: 0;
	color: var( --sx-text-muted );
	font-size: 0.95rem;
	line-height: 1.5;
	overflow-wrap: break-word;
}

.sx-academy-portal__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border: 1px solid var( --sx-brand );
	border-radius: var( --sx-radius-pill, 999px );
	color: var( --sx-brand-text );
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none;
	transition:
		background-color var( --sx-transition-base ) var( --sx-ease ),
		color var( --sx-transition-base ) var( --sx-ease );
}

@media ( hover: hover ) {
	.sx-academy-portal__link:hover {
		background: var( --sx-brand );
		color: var( --sx-white );
	}
}

.sx-academy-portal__link:focus-visible {
	outline: 3px solid var( --sx-brand );
	outline-offset: 3px;
}

.sx-academy-portal__ext {
	font-size: 1.05em;
	line-height: 1;
}

@media ( max-width: 860px ) {
	.sx-academy-portal {
		grid-template-columns: minmax( 0, 1fr );
		gap: 16px;
		padding: 22px 20px;
	}

	.sx-academy-portal__logo {
		height: 38px;
	}

	.sx-academy-portal__link {
		justify-content: center;
	}
}

/* ---- Картки (кому це потрібно / що отримуєте) ---- */

.sx-course__grid {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 20px;
}

.sx-course__card {
	min-width: 0;
	padding: 24px 26px;
	background: var( --sx-white );
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
}

.sx-course__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin-bottom: 14px;
	border-radius: var( --sx-radius-md );
	background: var( --sx-brand-50 );
	color: var( --sx-brand-text );
}

.sx-course__icon svg {
	width: 22px;
	height: 22px;
}

.sx-course__card h3 {
	margin: 0 0 8px;
	font-size: 1.05rem;
	line-height: 1.3;
	overflow-wrap: break-word;
}

.sx-course__card p {
	margin: 0;
	color: var( --sx-text-muted );
	font-size: 0.95rem;
	line-height: 1.6;
	overflow-wrap: break-word;
}

/* ---- Програма ----
   An accordion, because the full programme is 380 topics across 22 modules:
   printed flat it is a wall nobody reads, and the question a buyer actually
   has — "is my area of work in here" — is answered by the module names alone.
   The topics are one click away for whoever wants to check.

   Native <details>, so the programme opens with the script blocked and prints
   in full. The slide comes from ::details-content, the same way the FAQ opens
   everywhere else on the site. */

.sx-course-modules {
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
	border-top: 1px solid var( --sx-border );
}

.sx-course-modules__item {
	border-bottom: 1px solid var( --sx-border );
}

.sx-course-modules__head {
	display: grid;
	grid-template-columns: 2.6rem minmax( 0, 1fr ) 1.4rem;
	align-items: center;
	gap: 4px;
	padding: 15px 4px;
	cursor: pointer;
	list-style: none;
	transition: color var( --sx-transition-fast ) var( --sx-ease );
}

/* Safari still draws its own triangle without this. */
.sx-course-modules__head::-webkit-details-marker {
	display: none;
}

.sx-course-modules__head:focus-visible {
	outline: 3px solid var( --sx-brand );
	outline-offset: -3px;
	border-radius: var( --sx-radius-sm, 6px );
}

.sx-course-modules__num {
	font-family: var( --wp--preset--font-family--manrope, inherit );
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var( --sx-brand-200 );
	transition: color var( --sx-transition-fast ) var( --sx-ease );
}

.sx-course-modules__title {
	min-width: 0;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: break-word;
}

/* Drawn rather than an icon file: twenty-two of them on one page. */
.sx-course-modules__chevron {
	justify-self: end;
	width: 9px;
	height: 9px;
	border-right: 2px solid var( --sx-text-muted );
	border-bottom: 2px solid var( --sx-text-muted );
	transform: translateY( -2px ) rotate( 45deg );
	transition:
		transform var( --sx-transition-base ) var( --sx-ease ),
		border-color var( --sx-transition-fast ) var( --sx-ease );
}

.sx-course-modules__fold[open] .sx-course-modules__chevron {
	transform: translateY( 2px ) rotate( -135deg );
	border-color: var( --sx-brand );
}

.sx-course-modules__fold[open] .sx-course-modules__num {
	color: var( --sx-brand );
}

@media ( hover: hover ) {
	.sx-course-modules__head:hover .sx-course-modules__title {
		color: var( --sx-brand-text );
	}

	.sx-course-modules__head:hover .sx-course-modules__chevron {
		border-color: var( --sx-brand );
	}
}

/* The padding lives on the body, not on ::details-content: the fold animates
   the wrapper's height, and padding on the wrapper would not collapse with it. */
.sx-course-modules__body {
	padding: 2px 4px 20px calc( 2.6rem + 4px );
}

.sx-course-modules__lesson {
	margin: 14px 0 6px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --sx-brand-text );
}

.sx-course-modules__lesson:first-child {
	margin-top: 0;
}

.sx-course-modules__topics {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 7px;
}

.sx-course-modules__topics li {
	position: relative;
	padding-left: 18px;
	color: var( --sx-text-secondary );
	font-size: 0.94rem;
	line-height: 1.5;
	overflow-wrap: break-word;
}

.sx-course-modules__topics li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 0.6em;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var( --sx-brand-200 );
}

/*
 * The slide. interpolate-size is what lets a height animate to the content's
 * real height instead of to a number guessed in advance; where the pair is
 * missing the module opens at once, which is what a <details> does anyway.
 */
@supports ( interpolate-size: allow-keywords ) {
	.sx-course-modules {
		interpolate-size: allow-keywords;
	}

	.sx-course-modules__fold::details-content {
		block-size: 0;
		overflow: hidden;
		transition:
			block-size var( --sx-transition-base ) var( --sx-ease ),
			content-visibility var( --sx-transition-base ) var( --sx-ease ) allow-discrete;
	}

	.sx-course-modules__fold[open]::details-content {
		block-size: auto;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.sx-course-modules__chevron {
		transition: none;
	}

	@supports ( interpolate-size: allow-keywords ) {
		.sx-course-modules__fold::details-content {
			transition: none;
		}
	}
}


/* ---- Три курси на хабі ---- */

.sx-course__courses {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 20px;
}

.sx-course__course {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 26px;
	background: var( --sx-white );
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	color: inherit;
	text-decoration: none;
	transition:
		border-color var( --sx-transition-base ) var( --sx-ease ),
		box-shadow var( --sx-transition-base ) var( --sx-ease ),
		transform var( --sx-transition-base ) var( --sx-ease );
}

@media ( hover: hover ) {
	.sx-course__course:hover {
		transform: translateY( -3px );
		border-color: var( --sx-border-strong );
		box-shadow: 0 12px 28px color-mix( in srgb, var( --sx-text ) 9%, transparent );
	}
}

.sx-course__course-title {
	display: block;
	font-family: var( --wp--preset--font-family--manrope, inherit );
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.25;
	overflow-wrap: break-word;
}

.sx-course__course-modules {
	display: block;
	margin-top: 6px;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var( --sx-brand-text );
}

.sx-course__course-text {
	display: block;
	margin-top: 12px;
	color: var( --sx-text-muted );
	font-size: 0.93rem;
	line-height: 1.55;
	overflow-wrap: break-word;
}

/* Bottom-aligned, so the three prices sit on one line whatever the blurbs
   above them do. */
.sx-course__course-foot {
	margin-top: auto;
	padding-top: 18px;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.sx-course__course-price {
	font-family: var( --wp--preset--font-family--manrope, inherit );
	font-size: 1.1rem;
	font-weight: 700;
	white-space: nowrap;
}

.sx-course__course-more {
	color: var( --sx-brand-text );
	font-size: 1.1rem;
}

@media ( max-width: 900px ) {
	.sx-course__grid,
	.sx-course__courses {
		grid-template-columns: minmax( 0, 1fr );
	}
}

@media ( max-width: 700px ) {
	.sx-course__why {
		padding: 22px 20px;
	}

	.sx-course__signs {
		grid-template-columns: minmax( 0, 1fr );
	}

	/* The number column costs 2.6rem the topics need more. */
	.sx-course-modules__head {
		grid-template-columns: 2rem minmax( 0, 1fr ) 1.4rem;
		padding: 14px 2px;
	}

	.sx-course-modules__body {
		padding-left: 2rem;
		padding-right: 2px;
	}
}
