/**
 * Instructor biography styles.
 *
 * Everything is expressed with LearnPress' own custom properties and inherits
 * the theme's font, colour and radius wherever one is defined, so the cards sit
 * inside any LearnPress theme without looking bolted on. Logical properties are
 * used throughout, which makes the layout mirror correctly in Arabic and other
 * right-to-left languages without a separate RTL stylesheet.
 */

.lp-tb-bio {
	--lp-tb-gap: 20px;
	--lp-tb-surface: var(--lp-white-grey, #f7f7fb);
	--lp-tb-border: var(--lp-border-color, #e2e0db);
	--lp-tb-radius: var(--lp-border-radius, 5px);
	--lp-tb-accent: var(--lp-primary-color, #ffb606);
	--lp-tb-muted: var(--lp-color-meta, #8a8a8a);

	margin-block: var(--lp-tb-gap);
}

.lp-tb-bio__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: var(--lp-tb-gap);
	align-items: start;
}

/* The prose card carries the most weight, so it spans the full row. */
.lp-tb-bio__card:has(.lp-tb-bio__prose) {
	grid-column: 1 / -1;
}

.lp-tb-bio__card {
	border: 1px solid var(--lp-tb-border);
	border-radius: var(--lp-tb-radius);
	background: transparent;
	overflow: hidden;
}

.lp-tb-bio__card-title {
	margin: 0;
	padding: 14px 20px;
	background: var(--lp-tb-surface);
	border-block-end: 1px solid var(--lp-tb-border);
	border-inline-start: 3px solid var(--lp-tb-accent);
	font-size: calc(var(--lp-font-size-base, 1em) * 1.05);
	font-weight: var(--lp-font-weight-link, 600);
	line-height: 1.4;
}

.lp-tb-bio__card-body {
	padding: 16px 20px;
}

/* Prose --------------------------------------------------------------- */

.lp-tb-bio__prose > *:first-child {
	margin-block-start: 0;
}

.lp-tb-bio__prose > *:last-child {
	margin-block-end: 0;
}

.lp-tb-bio__prose img {
	max-width: 100%;
	height: auto;
}

/* Label / value pairs -------------------------------------------------- */

.lp-tb-bio__list {
	margin: 0;
	padding: 0;
}

.lp-tb-bio__row {
	display: grid;
	grid-template-columns: minmax(120px, 34%) 1fr;
	gap: 4px 16px;
	padding-block: 10px;
	border-block-end: 1px solid var(--lp-tb-border);
}

.lp-tb-bio__row:first-child {
	padding-block-start: 0;
}

.lp-tb-bio__row:last-child {
	padding-block-end: 0;
	border-block-end: 0;
}

.lp-tb-bio__label {
	margin: 0;
	color: var(--lp-tb-muted);
	font-size: calc(var(--lp-font-size-base, 1em) * 0.925);
}

.lp-tb-bio__value {
	margin: 0;
	overflow-wrap: anywhere;
}

.lp-tb-bio__value a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.lp-tb-bio__value a:hover,
.lp-tb-bio__value a:focus-visible {
	color: var(--lp-tb-accent);
}

@media (max-width: 480px) {
	.lp-tb-bio__row {
		grid-template-columns: 1fr;
	}
}

/* Social links --------------------------------------------------------- */

.lp-tb-bio__socials {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lp-tb-bio__social-item {
	margin: 0;
	list-style: none;
}

.lp-tb-bio__social-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border: 1px solid var(--lp-tb-border);
	border-radius: 999px;
	color: inherit;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.lp-tb-bio__social-link:hover,
.lp-tb-bio__social-link:focus-visible {
	border-color: var(--lp-tb-accent);
	color: var(--lp-tb-accent);
}

/* Instructor page tab strip -------------------------------------------- */

.lp-tb-instructor-tabs {
	--lp-tb-border: var(--lp-border-color, #e2e0db);
	--lp-tb-accent: var(--lp-primary-color, #ffb606);

	margin-block-start: 30px;
}

.lp-tb-instructor-tabs > input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.lp-tb-instructor-tabs__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 24px;
	border-block-end: 1px solid var(--lp-tb-border);
}

.lp-tb-instructor-tabs__label {
	padding: 12px 0;
	border-block-end: 2px solid transparent;
	margin-block-end: -1px;
	color: inherit;
	font-weight: var(--lp-font-weight-link, 600);
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.lp-tb-instructor-tabs__label:hover {
	color: var(--lp-tb-accent);
}

.lp-tb-instructor-tabs__panel {
	display: none;
	padding-block-start: 24px;
}

/* Map each radio to the panel at the same index. */
.lp-tb-instructor-tabs > input:nth-of-type(1):checked ~ .lp-tb-instructor-tabs__panels .lp-tb-instructor-tabs__panel:nth-of-type(1),
.lp-tb-instructor-tabs > input:nth-of-type(2):checked ~ .lp-tb-instructor-tabs__panels .lp-tb-instructor-tabs__panel:nth-of-type(2) {
	display: block;
}

.lp-tb-instructor-tabs > input:nth-of-type(1):checked ~ .lp-tb-instructor-tabs__nav .lp-tb-instructor-tabs__label:nth-of-type(1),
.lp-tb-instructor-tabs > input:nth-of-type(2):checked ~ .lp-tb-instructor-tabs__nav .lp-tb-instructor-tabs__label:nth-of-type(2) {
	color: var(--lp-tb-accent);
	border-block-end-color: var(--lp-tb-accent);
}

/* Keyboard users get the same focus ring the theme uses elsewhere. */
.lp-tb-instructor-tabs__label:focus-visible,
.lp-tb-instructor-tabs > input:focus-visible ~ .lp-tb-instructor-tabs__nav .lp-tb-instructor-tabs__label {
	outline: 2px solid var(--lp-tb-accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.lp-tb-bio__social-link,
	.lp-tb-instructor-tabs__label {
		transition: none;
	}
}
