/**
 * HG Archive Spotlight
 *
 * Colours are the theme's own: navy #002b54, green #289747, light #f0f4f6.
 * Type is inherited so the block picks up whatever the theme is using.
 */

.hgs {
	--hgs-navy: #002b54;
	--hgs-navy-soft: #3a4d6d;
	--hgs-green: #289747;
	--hgs-green-dark: #227f3c;
	--hgs-light: #f0f4f6;
	--hgs-muted: #666;
	--hgs-dark: #35383c;
	--hgs-paper: #f7f4ec;
	--hgs-paper-ink: #2c2a26;

	position: relative;
	padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
	background: var(--hgs-light);
	overflow: hidden;
}

/* A quiet navy hairline at the top, so the band reads as a distinct section. */
.hgs::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 3px;
	background: linear-gradient(90deg, var(--hgs-navy) 0%, var(--hgs-green) 100%);
}

/* --------------------------------------------------------- section heading */

.hgs__head {
	max-width: 1140px;
	margin: 0 auto clamp(2rem, 4vw, 3.25rem);
	text-align: center;
}

.hgs__heading {
	margin: 0;
	font-size: clamp(1.9rem, 4.2vw, 3rem);
	line-height: 1.12;
	color: var(--hgs-navy);
	/* Font is inherited, so this matches the theme's other section headings. */
}

/* The theme's .green-span rule already does this; repeated so the block still
   renders two-tone if that class is ever renamed. */
.hgs__heading span {
	color: var(--hgs-green);
}

.hgs__heading-rule {
	display: block;
	width: 4.5rem;
	height: 3px;
	margin: clamp(0.85rem, 1.6vw, 1.15rem) auto 0;
	background: var(--hgs-green);
}

.hgs__inner {
	max-width: 1140px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	gap: clamp(1.75rem, 5vw, 4rem);
	align-items: center;
}

/* ---------------------------------------------------------------- visual */

.hgs__visual {
	margin: 0;
	position: relative;
	width: 100%;
}

/*
 * The theme's own framing motif: a 2px outline at 5px radius, rotated behind the
 * content and flattened on small screens. Copied from .outline-one-offset-inner in
 * src/scss/_custom.scss, including the -2.72deg, so the block reads as part of the
 * site rather than as something bolted on.
 */
.hgs__visual::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 2px solid var(--hgs-dark);
	border-radius: 5px;
	transform: rotate(-2.72deg);
	pointer-events: none;
}

.hgs__visual-link {
	position: relative;
	z-index: 2;
	display: block;
	background: #fff;
	padding: 0.55rem;
	border-radius: 5px;
	border: 1px solid rgba(0, 43, 84, 0.1);
	box-shadow: 0 1px 2px rgba(0, 43, 84, 0.06), 0 8px 18px -10px rgba(0, 43, 84, 0.28);
	transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.35s ease;
	will-change: transform;
}

.hgs__visual-link:hover,
.hgs__visual-link:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 2px 4px rgba(0, 43, 84, 0.08), 0 16px 30px -12px rgba(0, 43, 84, 0.4);
}

.hgs__visual-link:focus-visible {
	outline: 3px solid var(--hgs-green);
	outline-offset: 3px;
}

.hgs-visual__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: center top;
	background: var(--hgs-light);
}

/* Scans are portrait pages; show the top of the sheet where the letterhead is. */
.hgs-visual__img--scan {
	object-fit: cover;
	object-position: center top;
}

/* ------------------------------------------------- typographic stand-in */

.hgs-paper {
	aspect-ratio: 4 / 5;
	background:
		repeating-linear-gradient(
			180deg,
			transparent 0 2.05rem,
			rgba(0, 43, 84, 0.045) 2.05rem 2.1rem
		),
		var(--hgs-paper);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(1.25rem, 3vw, 2.25rem);
}

.hgs-paper__sheet {
	text-align: center;
	color: var(--hgs-paper-ink);
	max-width: 26ch;
}

.hgs-paper__kind {
	display: block;
	font-size: 0.7rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--hgs-green-dark);
	margin-bottom: 0.85rem;
}

.hgs-paper__year {
	display: block;
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(2.75rem, 7vw, 4.25rem);
	line-height: 1;
	color: var(--hgs-navy);
	opacity: 0.85;
}

.hgs-paper__rule {
	display: block;
	width: 3rem;
	height: 2px;
	margin: 1.1rem auto;
	background: var(--hgs-green);
}

.hgs-paper__title {
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(0.95rem, 1.5vw, 1.1rem);
	line-height: 1.5;
	margin: 0;
}

/* ------------------------------------------------------------------ body */

.hgs__title {
	margin: 0 0 0.9rem;
	font-size: clamp(1.35rem, 2.5vw, 1.85rem);
	line-height: 1.24;
	color: var(--hgs-navy);
}

.hgs__title a {
	color: inherit;
	text-decoration: none;
	background-image: linear-gradient(var(--hgs-green), var(--hgs-green));
	background-size: 0 2px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size 0.35s ease;
}

.hgs__title a:hover,
.hgs__title a:focus-visible {
	background-size: 100% 2px;
}

.hgs__meta {
	margin: 0 0 1.5rem;
	font-size: 0.92rem;
	color: var(--hgs-muted);
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
}

.hgs__kind {
	color: var(--hgs-navy-soft);
	font-weight: 600;
}

.hgs__sep {
	color: rgba(0, 43, 84, 0.35);
}

.hgs__collection {
	color: var(--hgs-muted);
	text-decoration: underline;
	text-decoration-color: rgba(0, 43, 84, 0.25);
	text-underline-offset: 3px;
}

.hgs__collection:hover {
	color: var(--hgs-navy);
}

/* ------------------------------------------------------- the curator's note */

.hgs__note {
	display: flex;
	gap: 0.85rem;
	align-items: flex-start;
	margin: 0 0 1.6rem;
	padding: 0.95rem 1.15rem;
	background: #fff;
	border-left: 3px solid var(--hgs-green);
	border-radius: 0 4px 4px 0;
	box-shadow: 0 1px 2px rgba(0, 43, 84, 0.05);
}

.hgs__note-icon {
	flex: none;
	margin-top: 0.1rem;
	color: var(--hgs-green-dark);
}

.hgs__note-body {
	min-width: 0;
}

.hgs__note-label {
	display: block;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hgs-green-dark);
	margin-bottom: 0.3rem;
}

.hgs__note-text {
	margin: 0;
	font-size: 0.98rem;
	line-height: 1.55;
	color: var(--hgs-navy-soft);
}

.hgs__actions {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.85rem 1.75rem;
}

.hgs__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.8rem 1.6rem;
	background: var(--hgs-green);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 0.25s ease;
}

.hgs__cta:hover,
.hgs__cta:focus-visible {
	background: var(--hgs-green-dark);
	color: #fff;
}

.hgs__cta-arrow {
	transition: transform 0.25s ease;
}

.hgs__cta:hover .hgs__cta-arrow {
	transform: translateX(4px);
}

.hgs__secondary {
	color: var(--hgs-navy);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-color: rgba(0, 43, 84, 0.3);
}

.hgs__secondary:hover {
	text-decoration-color: var(--hgs-green);
}

/* --------------------------------------------------------------- compact */

.hgs--compact {
	padding: 2rem 1.25rem;
}

.hgs--compact .hgs__inner {
	grid-template-columns: minmax(0, 1fr);
	gap: 1.5rem;
	max-width: 420px;
}

/* A sidebar card cannot carry a display-size heading. */
.hgs--compact .hgs__head {
	max-width: 420px;
	margin-bottom: 1.35rem;
}

.hgs--compact .hgs__heading {
	font-size: 1.3rem;
}

.hgs--compact .hgs__heading-rule {
	width: 3rem;
	height: 2px;
}

.hgs--compact .hgs__title {
	font-size: 1.25rem;
}

.hgs--compact .hgs__secondary {
	display: none;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 860px) {
	.hgs__inner {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
		text-align: center;
	}

	.hgs__visual {
		max-width: 230px;
	}

	.hgs__meta,
	.hgs__actions {
		justify-content: center;
	}

	/* Left-align the note even when the column is centred; a centred paragraph
	   behind an icon reads badly. */
	.hgs__note {
		text-align: left;
		max-width: 34rem;
	}

	/* The theme flattens its offset outlines below md; match that. */
	.hgs__visual::after {
		transform: none;
	}
}

/* Long collection names wrap onto their own line, leaving the separator dangling. */
@media (max-width: 620px) {
	.hgs__meta {
		display: block;
	}

	.hgs__sep {
		display: none;
	}

	.hgs__collection {
		display: inline-block;
		margin-top: 0.35rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hgs__visual-link,
	.hgs__cta-arrow,
	.hgs__title a {
		transition: none;
	}

	.hgs__visual-link:hover {
		transform: none;
	}
}
