/**
 * Single post (inc/single.php): the article header, the post footer row,
 * the author box. The post content is in content.css (shared with static
 * pages), the columns and the sidebar in sidebar.css. Loaded on single
 * posts only. See "Single post" in docs/design-system.md
 * (single-post-01.jpg, single-post-02.jpg, layout and feel only).
 */

.bst-post-header {
	margin-bottom: var(--gap);
}

/* Featured image: 16:9 across the column; not a link. */
.bst-post-header__media {
	aspect-ratio: 16 / 9;
	margin: 0 0 var(--gap);
	overflow: hidden;
	background-color: var(--color-border); /* while the photo loads */
}

.bst-post-header__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * Meta row: the date in the date style, then the category in the eyebrow
 * style after a short decorative hairline (single-post-01.jpg).
 */
.bst-post-header__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25em 1em;
	margin-bottom: 0.75em;
}

.bst-post-header__date {
	color: var(--color-accent);
	font-family: var(--font-heading);
	font-size: var(--text-body);
	font-style: italic;
	line-height: 1.4;
}

.bst-post-header__category {
	display: inline-flex;
	align-items: center;
	gap: 1em;
	color: var(--color-accent);
	font-family: var(--font-body);
	font-size: var(--text-small);
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: 0.3em;
	text-decoration: none;
	text-transform: uppercase;
}

.bst-post-header__category::before {
	width: 1.5em;
	height: 1px;
	background-color: var(--color-border);
	content: "";
}

.bst-post-header__category:hover,
.bst-post-header__category:focus {
	color: var(--color-forest);
}

/* The post title: the only h1 of the page, at --text-h2. */
.bst-post-header__title {
	margin: 0;
	font-size: var(--text-h2);
	overflow-wrap: break-word;
	text-wrap: balance;
}

/*
 * Post footer row: hairline, then tags left and share right from 600px;
 * stacked and left aligned below. Labels in the menu type style in
 * forest; tags in the eyebrow style.
 */
.bst-post-footer {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75em var(--gap);
	margin-top: calc(var(--section-y) / 2);
	padding-top: var(--gap);
	border-top: 1px solid var(--color-border);
}

.bst-post-footer__part {
	margin: 0;
}

.bst-post-footer__label {
	margin-right: 0.5em;
	color: var(--color-forest);
	font-family: var(--font-body);
	font-size: var(--text-menu);
	font-weight: 500;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

/* margin-right cancels the trailing letter-spacing, so the comma sits close. */
.bst-post-footer__tag {
	margin-right: -0.3em;
	color: var(--color-accent);
	font-family: var(--font-body);
	font-size: var(--text-small);
	font-weight: 500;
	letter-spacing: 0.3em;
	text-decoration: none;
	text-transform: uppercase;
}

.bst-post-footer__tag:hover,
.bst-post-footer__tag:focus {
	color: var(--color-forest);
}

.bst-post-footer__share .bst-link-italic + .bst-link-italic {
	margin-left: 1em;
}

/* The copy button in the italic link look (resets the GeneratePress button). */
button.bst-share-copy,
button.bst-share-copy:hover,
button.bst-share-copy:focus {
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-forest);
	line-height: inherit;
	cursor: pointer;
}

button.bst-share-copy:hover,
button.bst-share-copy:focus {
	text-decoration-color: var(--color-accent);
}

@media (min-width: 600px) {

	.bst-post-footer {
		flex-direction: row;
		align-items: baseline;
		justify-content: space-between;
	}

	/* Share stays on one line; the tags wrap. */
	.bst-post-footer__share {
		flex-shrink: 0;
		margin-left: auto;
		white-space: nowrap;
	}
}

/*
 * Author box: on sage, padding --gap. Square photo left (a quarter of the
 * box, at most 160px), then the eyebrow, the name (h2 at --text-h3) and
 * the bio. Below 600px the photo sits above the text.
 */
.bst-author {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--gap);
	margin-top: calc(var(--section-y) / 2);
	padding: var(--gap);
	background-color: var(--color-sage);
}

.bst-author__media {
	width: min(100%, 160px);
	aspect-ratio: 1;
	overflow: hidden;
	background-color: var(--color-border); /* while the photo loads */
}

.bst-author__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bst-author__eyebrow {
	margin-bottom: 0.75em;
}

.bst-author__name {
	margin: 0 0 0.5em;
	font-size: var(--text-h3);
}

.bst-author__name a:hover,
.bst-author__name a:focus-visible {
	text-decoration: underline;
	text-decoration-color: var(--color-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.bst-author__bio > :last-child {
	margin-bottom: 0;
}

@media (min-width: 600px) {

	.bst-author {
		grid-template-columns: min(25%, 160px) minmax(0, 1fr);
		align-items: start;
	}

	.bst-author__media {
		width: 100%;
	}
}
