/*
 * Internship blocks: structural, neutral styles.
 *
 * Like volunteer.css, this only makes the tracks and the internship form
 * readable everywhere: colors derive from currentColor so the cards work on
 * paper and on ink sections, layout is single column on phones, and every
 * value reads a theme.json preset first. The theme owns the look.
 */

.wtr-tracks {
	--wtr-t-line: var(--wp--preset--color--line, color-mix(in srgb, currentColor 16%, transparent));
	--wtr-t-soft: color-mix(in srgb, currentColor 4%, transparent);
	--wtr-t-muted: color-mix(in srgb, currentColor 68%, transparent);
	--wtr-t-gap: var(--wp--preset--spacing--40, 1.5rem);
	--wtr-t-radius: 2px;
	box-sizing: border-box;
	/* Layout follows the width the block is given, not the window, so the
	   cards read well in a narrow content column and in a wide section. */
	container-type: inline-size;
	container-name: wtr-tracks;
}
.wtr-tracks *,
.wtr-tracks *::before,
.wtr-tracks *::after {
	box-sizing: inherit;
}
.wtr-tracks__header {
	max-width: 46rem;
	margin-bottom: var(--wtr-t-gap);
}
.wtr-tracks__intro {
	color: var(--wtr-t-muted);
}
.wtr-tracks__list {
	display: grid;
	gap: var(--wtr-t-gap);
}
.wtr-track {
	display: grid;
	gap: 1rem;
	padding: clamp(1.25rem, 3vw, 2rem);
	border: 1px solid var(--wtr-t-line);
	border-radius: var(--wtr-t-radius);
	min-width: 0;
}
.wtr-tracks--single .wtr-track {
	border: 0;
	padding: 0;
}
.wtr-track__header > * {
	margin: 0;
}
.wtr-track__title {
	font-family: var(--wp--preset--font-family--display, inherit);
	line-height: 1.15;
	margin-bottom: .5rem !important;
}
.wtr-track__summary {
	color: var(--wtr-t-muted);
	max-width: 46rem;
}

/* Facts: label over value, two or four across on wider screens. */
.wtr-track__meta {
	display: grid;
	gap: .75rem var(--wtr-t-gap);
	margin: 0;
	padding: 1rem 0;
	border-block: 1px solid var(--wtr-t-line);
}
@container wtr-tracks (min-width: 560px) {
	.wtr-track__meta {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@container wtr-tracks (min-width: 1000px) {
	.wtr-track__meta {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}
.wtr-track__fact {
	min-width: 0;
}
.wtr-track__fact dt {
	font-family: var(--wp--preset--font-family--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
	font-size: .75em;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--wtr-t-muted);
	margin-bottom: .2rem;
}
.wtr-track__fact dd {
	margin: 0;
	font-size: .95em;
	line-height: 1.45;
}

/* The three sections side by side on wide screens. */
.wtr-track__body {
	display: grid;
	gap: var(--wtr-t-gap);
}
@container wtr-tracks (min-width: 860px) {
	.wtr-track__body {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
.wtr-track__label {
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 .5rem;
}
.wtr-track__need ul,
.wtr-track__expect ul,
.wtr-track__gain ul,
.wtr-track__deliverables ul,
.wtr-track__more ul {
	margin: 0;
	padding-inline-start: 1.1em;
}
.wtr-track li {
	margin-bottom: .45rem;
	line-height: 1.5;
}
.wtr-track__more {
	border-top: 1px solid var(--wtr-t-line);
	padding-top: .75rem;
}
.wtr-track__more summary {
	cursor: pointer;
	font-weight: 700;
	min-height: 44px;
	display: flex;
	align-items: center;
}
.wtr-track__more summary:focus-visible,
.wtr-track__apply:focus-visible,
.wtr-track__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}
.wtr-track__more ul {
	padding-top: .25rem;
}
.wtr-track__actions {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem 1.25rem;
	align-items: center;
	margin: 0;
}
.wtr-track__apply {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: .75rem 1.25rem;
	text-decoration: none;
}
.wtr-track__paused {
	color: var(--wtr-t-muted);
}

/* Internship form additions. */
.wtr-apply__counter {
	font-size: .85em;
	color: color-mix(in srgb, currentColor 68%, transparent);
	margin: .35rem 0 0;
	font-variant-numeric: tabular-nums;
}
.wtr-apply__counter.is-over,
.wtr-apply__counter.is-under {
	color: inherit;
}
.wtr-apply__trackinfo {
	margin: -.5rem 0 1rem;
	font-size: .9em;
	color: color-mix(in srgb, currentColor 68%, transparent);
}
.wtr-apply__trackinfo:empty {
	display: none;
}
.wtr-apply__held {
	margin: 0 0 .5rem;
	font-size: .9em;
}
.wtr-apply__file input[type="file"] {
	padding: .6rem;
}
.wtr-apply__credit[hidden],
.wtr-apply [data-wtr-minors-only][hidden] {
	display: none !important;
}

/* Folded tracks: what we need stays open, the rest sits behind one line. */
@container wtr-tracks (min-width: 860px) {
	.wtr-track__body:has(> :only-child) {
		grid-template-columns: minmax(0, 1fr);
		max-width: 46rem;
	}
}
.wtr-track__more summary {
	list-style: none;
	gap: .75rem;
	font-weight: 500;
}
.wtr-track__more summary::-webkit-details-marker {
	display: none;
}
.wtr-track__more summary::after {
	content: "+";
	margin-inline-start: auto;
	font-size: 1.4em;
	line-height: 1;
	transition: transform .25s ease;
}
.wtr-track__more[open] summary::after {
	transform: rotate(45deg);
}
.wtr-track__more[open] > .wtr-track__body {
	margin: 1rem 0 1.5rem;
}
