/*
 * Issue page ("Issue" template): the content of the page as the editors
 * wrote it (PDF button, cover, "In this issue" list, sponsors), laid out
 * like a magazine spread: the cover on the left, sticky, everything else
 * on the right. Loaded only on issue pages.
 */
.issue-header .wp-block-post-date {
	color: var(--wp--preset--color--primary);
}

.issue-content > * {
	margin-block: 0;
}

.issue-content > * + * {
	margin-block-start: var(--wp--preset--spacing--40);
}

/* The cover: the first image of the page. */
.issue-content > .wp-block-image:not(.wp-block-image ~ .wp-block-image) {
	max-inline-size: min(100%, 26rem);
	margin-inline: auto;
}

.issue-content > .wp-block-image:not(.wp-block-image ~ .wp-block-image) :is(figure, img) {
	margin: 0;
}

.issue-content > .wp-block-image:not(.wp-block-image ~ .wp-block-image) img {
	display: block;
	inline-size: 100% !important;
	block-size: auto !important;
	border: 1px solid var(--wp--preset--color--border);
	box-shadow: 0 2px 4px rgb(0 0 0 / 8%), 0 24px 48px -24px rgb(0 0 0 / 45%);
}

/* "In this issue:" heading, as the section headings of the site. */
.issue-content > .wp-block-heading {
	margin-block-start: var(--wp--preset--spacing--60);
	padding-block-start: var(--wp--preset--spacing--20);
	border-block-start: 3px solid var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* The list of articles: a numbered index with rules. */
.issue-content > .wp-block-list {
	padding: 0;
	list-style: none;
	counter-reset: local-news-issue;
}

.issue-content > .wp-block-list > li {
	display: grid;
	grid-template-columns: 2rem minmax(0, 1fr);
	align-items: baseline;
	margin: 0;
	padding-block: var(--wp--preset--spacing--30);
	border-block-end: 1px solid var(--wp--preset--color--border);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--lg);
	line-height: 1.3;
	counter-increment: local-news-issue;
}

.issue-content > .wp-block-list > li::before {
	color: var(--wp--preset--color--primary);
	font-weight: 700;
	content: counter(local-news-issue);
}

.issue-content > .wp-block-list a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.issue-content > .wp-block-list a:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

.issue-content > .wp-block-buttons {
	justify-content: center;
}

@media (min-width: 782px) {

	.issue-content {
		display: grid;
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		column-gap: var(--wp--preset--spacing--80);
		align-items: start;
	}

	.issue-content > * {
		grid-column: 2;
	}

	.issue-content > .wp-block-image:not(.wp-block-image ~ .wp-block-image) {
		position: sticky;
		grid-row: 1 / span 40;
		grid-column: 1;
		inset-block-start: calc(var(--wp-admin--admin-bar--height, 0px) + 5rem);
		max-inline-size: none;
		margin: 0;
	}

	.issue-content > .wp-block-buttons {
		justify-content: flex-start;
	}

	.issue-content > .wp-block-image ~ .wp-block-image {
		max-inline-size: 20rem;
	}

	.issue-content > .wp-block-heading:first-of-type,
	.issue-content > :first-child:not(.wp-block-image) {
		margin-block-start: 0;
	}
}
