/*
 * Page components: the home hero, the inscription heading, and the collection
 * arch / catalog card. Colors are tokens only (var(--token) from tokens.css);
 * type and radii use the theme.json presets. Built from site-vision Main,
 * MainLight and Mobile; where a mockup used a color with no token (a muted
 * description, a hairline) the nearest token is used instead.
 */

/* ---- Inscription heading: short all-caps label in Cinzel, 12px or more ---- */
.as-inscription {
	margin: 0;
	font-family: var(--wp--preset--font-family--inscription);
	font-size: var(--wp--preset--font-size--inscription-label);
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	line-height: 1.4;
	color: var(--text-muted);
}

/* ---- Home hero ---- */
.as-hero {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	/* Spare height beside the tall portrait goes above and below the text. */
	grid-template-rows: 1fr auto auto auto auto 1fr;
	column-gap: 64px;
	row-gap: 24px;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
	padding: 72px 32px 56px;
}
.as-hero.is-layout-flow > * {
	margin-block: 0;
}
.as-hero__eyebrow {
	grid-area: 2 / 1;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--record);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent-strong);
	}
.as-hero__title {
	grid-area: 3 / 1;
	font-size: clamp(42px, 7vw, var(--wp--preset--font-size--display-xl));
	line-height: 1;
	letter-spacing: -0.01em;
}
.as-hero__lead {
	grid-area: 4 / 1;
	max-width: 600px;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--display-s);
	font-weight: 500;
	line-height: 1.25;
}
.as-hero__body {
	grid-area: 5 / 1;
	max-width: 560px;
	color: var(--text-muted);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.6;
}

/* The portrait: an arch with a hairline frame and 10px of space inside it. */
.as-hero__portrait {
	grid-area: 1 / 2 / 7 / 3;
	box-sizing: border-box;
	justify-self: center;
	align-self: center;
	width: 340px;
	max-width: 100%;
	aspect-ratio: 3 / 4;
	margin: 0;
	padding: 10px;
	border: 1px solid var(--accent);
	border-radius: var(--wp--preset--border-radius--arch) var(--wp--preset--border-radius--arch) var(--wp--preset--border-radius--md) var(--wp--preset--border-radius--md);
}
.as-hero__portrait img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--wp--preset--border-radius--arch) var(--wp--preset--border-radius--arch) var(--wp--preset--border-radius--sm) var(--wp--preset--border-radius--sm);
}

/* ---- Collections ---- */
.as-collections-section {
	box-sizing: border-box;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
	padding: 8px 32px 88px;
}
.as-collections-section.is-layout-flow > * {
	margin-block: 0;
}
.as-collections-section .as-inscription {
	margin-bottom: 28px;
}
.as-collections {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 24px;
}
.as-collections.is-layout-flow > * {
	margin-block: 0;
}

/* Each collection owns a ground and one accent (brand book, Color). */
.as-collection--writing {
	--c-bg: var(--mm-laurel);
	--c-line: var(--mm-verdigris-mid);
	--c-rule: var(--mm-verdigris-mid);
	--c-mark: var(--mm-gold-bright);
	--c-edge: var(--mm-gold-bright);
	--c-sub: var(--mm-verdigris);
	--c-name: var(--mm-ink-inv);
	--c-text: var(--mm-ink-inv);
	--c-desc: var(--mm-muted-inv);
	--c-date: var(--mm-verdigris);
}
.as-collection--podcast {
	--c-bg: var(--dos-butter);
	/* The resting line sits on the page, so it uses the copper that turns
	   light at night (dos-label). The hover double frame (outer line and inner
	   line) is one color, as on Writing and Tech: dos-frame, teal by day and a
	   mid teal at night that reads on both the night page and the butter. */
	--c-line: var(--dos-label);
	--c-frame: var(--dos-frame);
	--c-rule: var(--dos-copper);
	--c-mark: var(--dos-copper-deep);
	--c-edge: var(--dos-frame);
	--c-sub: var(--dos-copper-deep);
	--c-name: var(--dos-teal);
	--c-text: var(--dos-ink);
	--c-desc: var(--dos-ink);
	--c-date: var(--dos-copper-deep);
}
.as-collection--tech {
	--c-bg: var(--tech-blueprint);
	--c-line: var(--tech-line);
	--c-rule: var(--tech-line);
	--c-mark: var(--tech-accent);
	--c-edge: var(--tech-accent);
	--c-sub: var(--tech-accent);
	--c-name: var(--tech-text);
	--c-text: var(--tech-text);
	--c-desc: var(--tech-muted);
	--c-date: var(--tech-accent);
}

/* The arch (wider than 720px): call number and subject in the crown, the
   name, one line of description, and the newest item under a hairline. */
.as-collection {
	box-sizing: border-box;
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-height: 420px;
	padding: 52px 30px 28px;
	border: 1px solid var(--c-line);
	border-radius: var(--wp--preset--border-radius--arch) var(--wp--preset--border-radius--arch) var(--wp--preset--border-radius--md) var(--wp--preset--border-radius--md);
	background: var(--c-bg);
	color: var(--c-text);
	text-decoration: none;
	transition: border-color 150ms ease;
}
.as-collection:hover {
	border-color: var(--c-mark);
	color: var(--c-text);
}
.as-collection > span {
	display: block;
}
.as-collection__call {
	align-self: center;
	margin-bottom: auto;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	font-family: var(--wp--preset--font-family--mono);
	color: var(--c-mark);
}
.as-collection__no {
	font-size: 40px;
	line-height: 1;
}
.as-collection__subject {
	font-size: var(--wp--preset--font-size--record-label);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--c-sub);
}
.as-collection__name {
	font-family: var(--wp--preset--font-family--display);
	font-size: 46px;
	font-weight: 600;
	line-height: 1;
	color: var(--c-name);
}
.as-collection__desc {
	min-height: calc(1.55em * 3);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.55;
	color: var(--c-desc);
}
.as-collection__go {
	display: flex !important;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--c-name);
}
.as-collection__arrow {
	display: inline-block !important;
	transition: transform 150ms ease;
}
.as-collection:hover .as-collection__label,
.as-collection:focus-visible .as-collection__label {
	text-decoration: underline;
	text-underline-offset: 4px;
}
.as-collection:hover .as-collection__arrow,
.as-collection:focus-visible .as-collection__arrow {
	transform: translateX(4px);
}
.as-collection__foot {
	display: flex !important;
	justify-content: space-between;
	gap: 12px;
	white-space: nowrap;
	padding-top: 16px;
	border-top: 1px solid var(--c-rule);
	font-size: var(--wp--preset--font-size--body-s);
}
.as-collection__foot > span:first-child {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}
.as-collection__date {
	font-family: var(--wp--preset--font-family--mono);
	color: var(--c-date);
	white-space: nowrap;
}
.as-collection__short,
.as-collection__punch {
	display: none !important;
}

/* ---- Tablets (721 to 1000px): keep all three arches on one row ---- */
@media (min-width: 721px) and (max-width: 1000px) {
	.as-collections {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 16px;
	}
	.as-collection {
		padding: 44px 18px 22px;
		gap: 12px;
	}
	.as-collection__no {
		font-size: 34px;
	}
	.as-collection__name {
		font-size: 36px;
	}
	.as-collection__desc {
		font-size: var(--wp--preset--font-size--body-s);
	}
	.as-collection__foot {
		flex-direction: column;
		gap: 4px;
	}
}

/* ---- Phones and small tablets (brand breakpoint: 720px) ---- */
@media (max-width: 720px) {
	/* Hero: heading and a small arched portrait share a row. */
	.as-hero {
		grid-template-columns: minmax(0, 1fr) 88px;
		grid-template-rows: auto auto auto auto;
		column-gap: 16px;
		row-gap: 10px;
		padding: 22px 20px 20px;
	}
	.as-hero__eyebrow {
		grid-area: 1 / 1;
		align-self: end;
	}
	.as-hero__title {
		grid-area: 2 / 1;
		align-self: start;
	}
	.as-hero__lead {
		grid-area: 3 / 1 / 4 / 3;
		margin-top: 6px;
	}
	.as-hero__body {
		display: none;
	}
	.as-hero__portrait {
		grid-area: 1 / 2 / 3 / 3;
		width: 88px;
		align-self: end;
		padding: 0;
		border-radius: 44px 44px var(--wp--preset--border-radius--sm) var(--wp--preset--border-radius--sm);
	}
	.as-hero__portrait img {
		border-radius: 43px 43px var(--wp--preset--border-radius--sm) var(--wp--preset--border-radius--sm);
	}

	/* Collections become catalog cards: call number and subject over a
	   hairline, the name, and a punch hole near the bottom edge. */
	.as-collections-section {
		padding: 16px 20px 48px;
	}
	.as-collections-section .as-inscription {
		margin-bottom: 14px;
	}
	.as-collections {
		display: flex;
		flex-direction: column;
		gap: 12px;
	}
	.as-collection {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"call  call"
			"name  short";
		align-items: baseline;
		row-gap: 8px;
		min-height: 0;
		padding: 14px 18px 30px;
		border-radius: var(--wp--preset--border-radius--sm);
	}
	.as-collection__call {
		grid-area: call;
		display: flex !important;
		flex-direction: row;
		justify-content: space-between;
		align-self: auto;
		margin-bottom: 0;
		padding-bottom: 8px;
		border-bottom: 1px solid var(--c-rule);
		font-size: var(--wp--preset--font-size--record-label);
	}
	.as-collection__no {
		font-size: var(--wp--preset--font-size--record-label);
	}
	.as-collection__name {
		grid-area: name;
		font-size: var(--wp--preset--font-size--display-s);
	}
	.as-collection__short {
		grid-area: short;
		display: block !important;
		font-size: var(--wp--preset--font-size--body-s);
		color: var(--c-desc);
	}
	.as-collection__desc,
	.as-collection__go,
	.as-collection__foot {
		display: none !important;
	}
	.as-collection__punch {
		position: absolute;
		left: 50%;
		bottom: 9px;
		display: block !important;
		width: 12px;
		height: 12px;
		margin-left: -6px;
		border: 1px solid var(--c-rule);
		border-radius: var(--wp--preset--border-radius--pill);
		background: var(--bg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.as-collection {
		transition: none;
	}
}
