/*
 * Early work: loaded after site.css on the /early-work/ pages only, which
 * reuse its masthead, rail, case study head, facts, pager, footer and
 * lightbox. This adds the year-by-year index with its type filters, the
 * project galleries and the resume.
 */

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Index: type filters. Radio inputs drive :has() rules, one pair per type in
 * inc/early-work/projects.php, so a new type needs its own pair here. Without
 * :has() support everything simply stays visible. */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; border: 0; }
.filter-input { position: absolute; opacity: 0; pointer-events: none; }
.chip {
	padding: 0.375rem 0.875rem;
	border: 1px solid var(--rule);
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	user-select: none;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chip span { margin-left: 0.125rem; color: var(--ink-3); transition: color 0.15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-input:checked + .chip { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.filter-input:checked + .chip span { color: #ffffff; }
.filter-input:focus-visible + .chip { outline: 3px solid var(--accent); outline-offset: 3px; }

body:has(#f-branding:checked) .ew-card:not(.t-branding),
body:has(#f-branding:checked) .ew-year:not(:has(.t-branding)),
body:has(#f-merchandise:checked) .ew-card:not(.t-merchandise),
body:has(#f-merchandise:checked) .ew-year:not(:has(.t-merchandise)),
body:has(#f-illustration:checked) .ew-card:not(.t-illustration),
body:has(#f-illustration:checked) .ew-year:not(:has(.t-illustration)),
body:has(#f-editorial:checked) .ew-card:not(.t-editorial),
body:has(#f-editorial:checked) .ew-year:not(:has(.t-editorial)),
body:has(#f-exhibition:checked) .ew-card:not(.t-exhibition),
body:has(#f-exhibition:checked) .ew-year:not(:has(.t-exhibition)),
body:has(#f-interactive:checked) .ew-card:not(.t-interactive),
body:has(#f-interactive:checked) .ew-year:not(:has(.t-interactive)),
body:has(#f-motion-graphics:checked) .ew-card:not(.t-motion-graphics),
body:has(#f-motion-graphics:checked) .ew-year:not(:has(.t-motion-graphics)),
body:has(#f-photography:checked) .ew-card:not(.t-photography),
body:has(#f-photography:checked) .ew-year:not(:has(.t-photography)) { display: none; }

/* Index: one rail per year, its numeral pinned while the year's work scrolls */
.ew-year .numeral { position: sticky; top: 1.5rem; align-self: start; font-weight: 400; }
.ew-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
	gap: 2.25rem 1.5rem;
	list-style: none;
}
.ew-card a { display: flex; flex-direction: column; color: var(--ink); }
.ew-card a:hover { color: var(--ink); }
.ew-card-title {
	margin-top: 0.875rem;
	font-family: var(--serif);
	font-size: 1.25rem;
	font-weight: 500;
	line-height: 1.2;
	transition: color 0.15s;
}
.ew-card a:hover .ew-card-title { color: var(--accent); }
.ew-card-meta { margin-top: 0.375rem; font-size: 0.875rem; line-height: 1.4; color: var(--ink-3); }

/* Project: summary lists, and the gallery of work at its own shape */
.cs-summary ul { display: flex; flex-direction: column; gap: 0.25rem; padding-left: 1.25rem; }
.cs-summary li ul { margin-top: 0.25rem; }
.cs-summary li::marker { color: var(--accent); }
.ew-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
	gap: 1rem;
	align-items: start;
}
.ew-shot { width: 100%; background: var(--wash); }
.ew-video { grid-column: 1 / -1; aspect-ratio: 16 / 9; background: var(--ink); }
.ew-video iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Resume: rails of dated entries */
.cv { display: flex; flex-direction: column; gap: 2.25rem; list-style: none; }
.cv > li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); column-gap: 2rem; }
.cv-when { padding-top: 0.25rem; font-size: 0.875rem; color: var(--ink-3); }
.cv-what { display: flex; flex-direction: column; gap: 0.625rem; }
.cv-org { font-family: var(--serif); font-size: 1.375rem; font-weight: 500; line-height: 1.25; }
.cv-role { margin-top: -0.375rem; color: var(--ink-2); }
.cv-what .skills { gap: 0.25rem; list-style-type: disc; }
.cv-what .skills li::marker { color: var(--accent); }

@media (max-width: 759px) {
	.ew-year .numeral { position: static; }
	.ew-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1rem; }
	.ew-card-title { font-size: 1.0625rem; }
	.cv > li { grid-template-columns: minmax(0, 1fr); row-gap: 0.25rem; }
	.cv-when { padding-top: 0; }
}
