/*
 * Collection layout 2, Load first (parts/collection/layout-load.php): an ink band with a
 * faint drawing grid holds the title and the load panel (readout, square cells, live
 * count), then the models in capacity bands of photo cards. Rules in collection.css are
 * shared.
 */

@layer components {
	.hdc-col--load .hdc-collection-finder {
		position: relative;
		padding-block: 1rem 2.5rem;
		background-color: var(--ink);
		background-image:
			linear-gradient(rgb(255 255 255 / 0.045) 1px, transparent 1px),
			linear-gradient(90deg, rgb(255 255 255 / 0.045) 1px, transparent 1px);
		background-size: 1.5rem 1.5rem;
		color: var(--fog);
		--focus: var(--accent);
	}

	.hdc-col--load .hdc-collection-finder__grid {
		display: grid;
		grid-template-areas:
			"head"
			"panel"
			"lead";
		gap: 1.5rem;
	}

	.hdc-col--load .hdc-collection-finder__head {
		grid-area: head;
	}

	.hdc-col--load .hdc-collection-finder__lead {
		display: grid;
		grid-area: lead;
		gap: 1rem;
		align-content: start;
	}

	.hdc-col--load .hdc-collection-finder__panel {
		grid-area: panel;
	}

	.hdc-col--load .hdc-collection-finder__h1 {
		margin-top: 0.5rem;
		color: var(--white);
		font-size: clamp(2.75rem, 2rem + 4vw, 5.5rem);
		font-stretch: 75%;
		font-weight: 800;
		line-height: 0.92;
		text-wrap: balance;
	}

	.hdc-col--load .hdc-collection-finder__summary {
		max-width: 36rem;
		margin: 0;
		color: var(--fog);
		font-size: 1.125rem;
		line-height: 1.5;
	}

	.hdc-col--load .hdc-collection-finder .hdc-collection-actions {
		max-width: 34rem;
		margin-top: 0.5rem;
	}

	/* The load panel: a graphite plate with hairline edges. */
	.hdc-col--load .hdc-collection-finder__panel {
		display: grid;
		gap: 0.75rem;
		align-content: start;
		padding: 1.25rem;
		border: 1px solid var(--line-dark);
		background: var(--graphite);
	}

	.hdc-col--load .hdc-collection-finder__load {
		margin: 0;
		padding: 0;
		border: 0;
	}

	.hdc-col--load .hdc-collection-finder__label {
		padding: 0;
		color: var(--mist);
		font-size: 0.875rem;
		font-weight: 700;
	}

	.hdc-col--load .hdc-collection-finder__readout {
		display: flex;
		align-items: baseline;
		gap: 0.5rem;
		min-height: 1em;
		margin: 0.25rem 0 1rem;
		color: var(--white);
		font-size: clamp(3.5rem, 2.5rem + 5vw, 6rem);
		font-stretch: 75%;
		font-weight: 800;
		font-variant-numeric: tabular-nums;
		line-height: 1;
	}

	.hdc-col--load .hdc-collection-finder__unit {
		color: var(--accent);
		font-size: 0.35em;
		font-stretch: 100%;
	}

	.hdc-col--load .hdc-collection-finder__unit[hidden] {
		display: none;
	}

	.hdc-col--load .hdc-collection-finder__cells {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(3.5rem, 1fr));
		gap: 1px;
		border: 1px solid var(--line-dark);
		background: var(--line-dark);
	}

	.hdc-col--load .hdc-collection-finder__cell {
		display: flex;
		position: relative;
		align-items: center;
		justify-content: center;
		min-height: 3.5rem;
		background: var(--ink);
		color: var(--fog);
		font-weight: 700;
		font-variant-numeric: tabular-nums;
		cursor: pointer;
	}

	.hdc-col--load .hdc-collection-finder__cell input {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		margin: 0;
		opacity: 0;
		cursor: pointer;
	}

	.hdc-col--load .hdc-collection-finder__cell:hover {
		background: color-mix(in srgb, var(--ink), var(--white) 8%);
	}

	.hdc-col--load .hdc-collection-finder__cell:has(input:checked) {
		background: var(--white);
		color: var(--ink);
	}

	.hdc-col--load .hdc-collection-finder__cell:has(input:focus-visible) {
		z-index: 1;
		outline: var(--focus-ring);
		outline-offset: 0;
	}

	.hdc-col--load .hdc-collection-finder__foot {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
	}

	.hdc-col--load .hdc-collection-finder__fits {
		margin: 0;
		color: var(--white);
		font-size: 1.125rem;
		font-weight: 700;
		font-variant-numeric: tabular-nums;
	}

	.hdc-col--load .hdc-collection-finder__more {
		border-color: var(--fog);
		background: transparent;
		color: var(--white);
	}

	.hdc-col--load .hdc-collection-finder__applied {
		color: var(--white);
	}

	.hdc-col--load .hdc-collection-finder__applied .hdc-collection-toolbar__value,
	.hdc-col--load .hdc-collection-finder__applied .hdc-collection-toolbar__clear {
		color: var(--white);
	}

	/* Bands. */
	.hdc-col--load .hdc-collection-bands {
		padding-block: 3rem var(--space-section);
	}

	.hdc-col--load .hdc-collection-bands__head {
		display: grid;
		gap: 0.75rem;
		margin-bottom: 1.5rem;
	}

	.hdc-col--load .hdc-collection-bands__unsure {
		max-width: 40rem;
		margin: 0;
		color: var(--steel);
	}

	.hdc-col--load .hdc-collection-bands__band {
		margin-top: 2rem;
	}

	.hdc-col--load .hdc-collection-bands__band[hidden] {
		display: none;
	}

	.hdc-col--load .hdc-collection-bands__bar {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 1rem;
		margin-bottom: 1rem;
		padding-top: 0.75rem;
		border-top: 2px solid var(--ink);
	}

	.hdc-col--load .hdc-collection-bands__title {
		color: var(--ink);
		font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
		font-stretch: 75%;
		font-weight: 800;
		font-variant-numeric: tabular-nums;
		line-height: 1;
	}

	.hdc-col--load .hdc-collection-bands__count {
		margin: 0;
		color: var(--steel);
		font-variant-numeric: tabular-nums;
	}

	/* Types as a quiet strip after the list. */
	.hdc-col--load .hdc-collection-types--strip .hdc-collection-types__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hdc-col--load .hdc-collection-types--strip .hdc-collection-types__card {
		flex-direction: row;
		align-items: stretch;
	}

	.hdc-col--load .hdc-collection-types--strip .hdc-collection-types__photo {
		flex: none;
		width: 4.5rem;
		aspect-ratio: 1;
		padding: 0.25rem;
	}

	.hdc-col--load .hdc-collection-types--strip .hdc-collection-types__bar {
		flex: 1;
		background: var(--white);
		color: var(--ink);
	}

	.hdc-col--load .hdc-collection-types--strip .hdc-collection-types__name {
		color: var(--ink);
		font-size: 1rem;
	}

	.hdc-col--load .hdc-collection-types--strip .hdc-collection-types__count {
		color: var(--steel);
	}

	.hdc-col--load .hdc-collection-types--strip {
		padding-bottom: var(--space-section);
	}

	@media (min-width: 64rem) {
		.hdc-col--load .hdc-collection-finder {
			padding-block: 1.5rem 3.5rem;
		}

		.hdc-col--load .hdc-collection-finder__grid {
			grid-template-areas:
				"head panel"
				"lead panel";
			grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
			grid-template-rows: auto 1fr;
			gap: 1rem 4rem;
		}

		.hdc-col--load .hdc-collection-finder__panel {
			align-self: end;
			padding: 2rem;
		}

		.hdc-col--load .hdc-collection-bands__bar {
			position: sticky;
			top: var(--sticky);
			z-index: 2;
			background: var(--white);
		}

		.hdc-col--load .hdc-collection-types--strip .hdc-collection-types__list {
			grid-template-columns: repeat(4, minmax(0, 1fr));
		}
	}
}
