/*
 * News posts: post cards in Query Loops, the single post hero, meta row, content,
 * tag pills (Post Terms style "Tag pills") and previous/next cards (Post Navigation
 * Link style "Card"). The post card markup lives in inc/content/posts.php.
 */

/* ---------- Eyebrow text: card month, hero category ---------- */
.pqmd-post-eyebrow {
	margin: 0;
	color: var(--wp--preset--color--orange);
	font-size: var(--wp--preset--font-size--label);
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: var(--wp--custom--tracking--eyebrow);
	text-transform: uppercase;
}
.pqmd-post-eyebrow a {
	color: inherit;
	text-decoration: none;
}
.pqmd-post-eyebrow a:is(:hover, :focus-visible) {
	text-decoration: underline;
}

/* ---------- Post cards: equal heights, Read more at the foot ---------- */
.wp-block-post-template > li > .is-style-card-resource {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	height: 100%;
}
.pqmd-post-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
}
.pqmd-post-card-body > * {
	margin-block: 0;
}
.pqmd-post-card-body .wp-block-post-excerpt__excerpt {
	margin: 0;
}
.pqmd-post-card-body > .wp-block-read-more {
	align-self: flex-start;
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--xs);
}
/* Cards without a featured image keep the photo row's height free. */
.is-style-card-resource > .wp-block-post-featured-image:empty {
	display: none;
}

/* ---------- Single post hero: category above the H1 ---------- */
.is-style-hero-split .wp-block-cover__inner-container > .wp-block-post-terms {
	max-width: var(--wp--style--global--wide-size);
	margin-block: 0 var(--wp--preset--spacing--l);
	color: var(--wp--preset--color--lime);
}

/* ---------- Meta row: date, author, reading time ---------- */
.pqmd-post-meta {
	padding-bottom: var(--wp--preset--spacing--l);
	border-bottom: var(--wp--custom--border--hairline) solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--label);
	font-weight: 500;
	letter-spacing: var(--wp--custom--tracking--eyebrow);
	text-transform: uppercase;
}
.pqmd-post-meta > * {
	margin: 0;
	font-size: inherit;
}
.pqmd-post-meta .wp-block-post-date {
	color: var(--wp--preset--color--orange);
}
.pqmd-post-meta .wp-block-post-author__content {
	display: flex;
	flex: none;
	gap: 0.3em;
}
.pqmd-post-meta .wp-block-post-author__content > * {
	width: auto;
	margin: 0;
	font-size: inherit;
	white-space: nowrap;
}

/* ---------- Content ---------- */
.pqmd-post-content {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.75;
}
.pqmd-post-content .wp-block-image img {
	border-radius: var(--wp--custom--radius--m);
}
.pqmd-post-content :is(.wp-block-image, figure) figcaption {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
}
.pqmd-post-content .wp-block-quote {
	margin-block: var(--wp--preset--spacing--l);
	padding: 0;
	border: 0;
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--custom--font-size--pillar);
	line-height: 1.3;
}
.pqmd-post-content .wp-block-quote cite {
	display: block;
	margin-top: var(--wp--preset--spacing--s);
	color: var(--wp--preset--color--orange);
	font-size: var(--wp--preset--font-size--label);
	font-style: normal;
	font-weight: 500;
	letter-spacing: var(--wp--custom--tracking--eyebrow);
	text-transform: uppercase;
}

/* ---------- Tag pills ---------- */
.wp-block-post-terms.is-style-tag-pills {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--xs);
	padding-top: var(--wp--preset--spacing--l);
	border-top: var(--wp--custom--border--hairline) solid var(--wp--preset--color--line);
}
.wp-block-post-terms.is-style-tag-pills .wp-block-post-terms__separator {
	display: none;
}
.wp-block-post-terms.is-style-tag-pills a {
	padding: 0.5rem 0.875rem 0.375rem;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--slate-tint);
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 500;
	letter-spacing: var(--wp--custom--tracking--badge);
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color var(--wp--custom--motion--fast) var(--wp--custom--motion--ease);
}
.wp-block-post-terms.is-style-tag-pills a:is(:hover, :focus-visible) {
	background: var(--wp--preset--color--border);
}

/* ---------- Previous / next cards ---------- */
.wp-block-post-navigation-link.is-style-card {
	position: relative;
	padding: var(--wp--preset--spacing--l);
	border-radius: var(--wp--custom--radius--m);
	background: var(--wp--preset--color--surface);
	transition: box-shadow var(--wp--custom--motion--base) var(--wp--custom--motion--ease);
}
.wp-block-post-navigation-link.is-style-card:empty {
	display: none;
}
.wp-block-post-navigation-link.is-style-card a {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--xs);
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.25;
	text-decoration: none;
}
/* The whole card is the link. */
.wp-block-post-navigation-link.is-style-card a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}
.wp-block-post-navigation-link.is-style-card .post-navigation-link__label {
	color: var(--wp--preset--color--orange);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 500;
	letter-spacing: var(--wp--custom--tracking--eyebrow);
	text-transform: uppercase;
}
.wp-block-post-navigation-link.is-style-card [class*="__arrow"] {
	position: absolute;
	top: var(--wp--preset--spacing--l);
	color: var(--wp--preset--color--orange);
	font-size: var(--wp--preset--font-size--caption);
	line-height: 1.6;
}
.wp-block-post-navigation-link.is-style-card.post-navigation-link-previous {
	padding-left: calc(var(--wp--preset--spacing--l) + 1.25em);
}
.wp-block-post-navigation-link.is-style-card.post-navigation-link-previous [class*="__arrow"] {
	left: var(--wp--preset--spacing--l);
}
.wp-block-post-navigation-link.is-style-card.post-navigation-link-next {
	padding-right: calc(var(--wp--preset--spacing--l) + 1.25em);
}
.wp-block-post-navigation-link.is-style-card.post-navigation-link-next [class*="__arrow"] {
	right: var(--wp--preset--spacing--l);
}
.wp-block-post-navigation-link.is-style-card:has(a:focus-visible) {
	outline: var(--wp--custom--focus--width) solid var(--wp--preset--color--navy);
	outline-offset: var(--wp--custom--focus--offset);
}
.wp-block-post-navigation-link.is-style-card a:focus-visible {
	outline: none;
}
@media (hover: hover) and (pointer: fine) {
	.wp-block-post-navigation-link.is-style-card:hover {
		box-shadow: var(--wp--preset--shadow--card);
	}
}

/*
 * ================= Blog (Pencil "PQMD Blog" and "PQMD Blog Details") =================
 */

/* ---------- Blog cards: category badge and month in one row ---------- */
.pqmd-post-card-meta {
	align-items: center;
}
.pqmd-post-card-meta > * {
	margin: 0;
}
.pqmd-post-card-meta .pqmd-post-eyebrow {
	color: var(--wp--preset--color--muted);
}
.pqmd-post-badge {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--xxs);
	margin: 0;
	font-size: var(--wp--preset--font-size--caption);
	line-height: 1.2;
}
.pqmd-post-badge .wp-block-post-terms__separator {
	display: none;
}
.pqmd-post-badge a {
	position: relative;
	z-index: 1;
	padding: 0.3125rem 0.625rem;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--slate-tint);
	color: var(--wp--preset--color--navy-deep);
	font-weight: 500;
	text-decoration: none;
}
.pqmd-post-badge a:is(:hover, :focus-visible) {
	background: var(--wp--preset--color--border);
}
.pqmd-post-featured-date::before {
	content: "Featured · ";
}

/* ---------- Featured card: photo beside the text from 782px ---------- */
.pqmd-post-card--featured :is(h2, h3) {
	font-size: var(--wp--custom--font-size--statement);
	line-height: 1.12;
}
@media (min-width: 782px) {
	.wp-block-post-template > li > .pqmd-post-card--featured {
		flex-direction: row;
	}
	.pqmd-post-card--featured > .wp-block-post-featured-image {
		flex: 0 0 57%;
	}
	.pqmd-post-card--featured > .wp-block-post-featured-image img {
		height: 100%;
		min-height: 22rem;
	}
	.pqmd-post-card--featured > .pqmd-post-card-body {
		justify-content: center;
		padding: var(--wp--preset--spacing--xxl) !important;
	}
	.pqmd-post-card--featured > .pqmd-post-card-body > .wp-block-read-more {
		margin-top: var(--wp--preset--spacing--xs);
	}
}

/*
 * ---------- Category chips and search ----------
 * The chips take all the width left of the search and wrap into more rows when there
 * are many; the search stays at the top right. Below 782px the search comes first at
 * full width and the chips become one row that scrolls sideways, so a long list never
 * pushes the posts down.
 */
.pqmd-blog-filters > .pqmd-chips {
	flex: 1 1 0;
	min-width: 0;
}
.pqmd-blog-filters > .wp-block-search {
	flex: 0 0 20.625rem;
	margin: 0;
}
@media (max-width: 781px) {
	/* !important: the Group's flex layout writes its alignment in a generated class. */
	.pqmd-blog-filters {
		flex-direction: column;
		align-items: stretch !important;
	}
	.pqmd-blog-filters > .wp-block-search {
		flex-basis: auto;
		order: -1;
	}
	.pqmd-blog-filters > .pqmd-chips {
		margin-inline: calc(-1 * var(--wp--preset--spacing--l));
	}
	.pqmd-blog-filters > .pqmd-chips ul {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding: 2px var(--wp--preset--spacing--l);
		scroll-padding-inline: var(--wp--preset--spacing--l);
		scroll-snap-type: x proximity;
		scrollbar-width: none;
	}
	.pqmd-blog-filters > .pqmd-chips li {
		flex: none;
		scroll-snap-align: start;
	}
}
.pqmd-chips ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--xs);
	margin: 0;
	padding: 0;
	list-style: none;
}
.pqmd-chip {
	display: inline-flex;
	align-items: center;
	min-height: 2.25rem;
	padding: 0 var(--wp--preset--spacing--m);
	border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	transition:
		background-color var(--wp--custom--motion--fast) var(--wp--custom--motion--ease),
		border-color var(--wp--custom--motion--fast) var(--wp--custom--motion--ease);
}
.pqmd-chip:is(:hover, :focus-visible) {
	border-color: var(--wp--preset--color--navy);
}
.pqmd-chip[aria-current="page"] {
	border-color: var(--wp--preset--color--navy);
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}
.pqmd-blog-search .wp-block-search__inside-wrapper {
	gap: var(--wp--preset--spacing--xs);
}
.pqmd-blog-search .wp-block-search__input {
	min-height: 2.75rem;
	padding: 0 var(--wp--preset--spacing--m);
	border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--s);
	font-size: var(--wp--preset--font-size--small);
}
.pqmd-blog-search .wp-block-search__button {
	margin: 0;
	padding: 0 var(--wp--preset--spacing--l);
	border: 0;
	border-radius: var(--wp--custom--radius--s);
	background: var(--wp--preset--color--orange);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: var(--wp--custom--tracking--button);
	text-transform: uppercase;
}
.pqmd-blog-search .wp-block-search__button:is(:hover, :focus-visible) {
	background: var(--wp--preset--color--orange-hover);
}

/* ---------- Boxed pagination (class is-style-boxed on Query Pagination) ---------- */
.wp-block-query-pagination.is-style-boxed {
	gap: var(--wp--preset--spacing--xs);
}
.wp-block-query-pagination.is-style-boxed :is(.page-numbers, .wp-block-query-pagination-previous, .wp-block-query-pagination-next) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 var(--wp--preset--spacing--xs);
	box-sizing: border-box;
	border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--s);
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}
.wp-block-query-pagination.is-style-boxed .page-numbers.dots {
	min-width: 0;
	border: 0;
}
.wp-block-query-pagination.is-style-boxed .page-numbers.current {
	border-color: var(--wp--preset--color--navy);
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}
.wp-block-query-pagination.is-style-boxed :is(.wp-block-query-pagination-previous, .wp-block-query-pagination-next) {
	font-size: 0;
}
.wp-block-query-pagination.is-style-boxed [class*="-arrow"] {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

/* ---------- Blog post hero byline: "By name · date · reading time" ---------- */
.pqmd-post-byline {
	margin-top: var(--wp--preset--spacing--l) !important;
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--body);
}
.pqmd-post-byline > *,
.pqmd-post-byline .wp-block-post-date {
	margin: 0;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: normal;
	text-transform: none;
}
.pqmd-post-byline > * + *::before {
	content: "·";
	margin: 0 0.5em;
}
.pqmd-post-byline .wp-block-post-author__content {
	display: flex;
	flex: none;
	gap: 0.3em;
}
.pqmd-post-byline .wp-block-post-author__content > * {
	width: auto;
	margin: 0;
	font-size: inherit;
}

/* ---------- Blog article ---------- */
.pqmd-blog-article .wp-block-breadcrumbs li:last-child a {
	color: var(--wp--preset--color--navy);
	font-weight: 500;
}
.pqmd-blog-image img {
	border-radius: var(--wp--custom--radius--m);
}
.pqmd-blog-content {
	font-size: var(--wp--preset--font-size--large);
}
.pqmd-blog-content > p:first-child {
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.55;
}
.pqmd-blog-content li::marker {
	color: var(--wp--preset--color--lime);
}
.pqmd-blog-content .wp-block-quote {
	padding-left: var(--wp--preset--spacing--l);
	border-left: var(--wp--custom--border--bar) solid var(--wp--preset--color--lime);
	font-size: var(--wp--preset--font-size--subheading);
}
.pqmd-blog-content .wp-block-quote cite {
	color: var(--wp--preset--color--muted);
}
.pqmd-blog-content .wp-block-quote cite::before {
	content: "— ";
}

/* Tags, share links and author box under the content. */
.pqmd-blog-footer {
	padding-top: var(--wp--preset--spacing--l);
	border-top: var(--wp--custom--border--hairline) solid var(--wp--preset--color--line);
}
.pqmd-blog-footer > * {
	margin-block: 0;
}
.pqmd-blog-footer .wp-block-post-terms.is-style-tag-pills {
	align-items: center;
	padding-top: 0;
	border-top: 0;
}
.pqmd-blog-footer :is(.wp-block-post-terms__prefix, .pqmd-share__label) {
	margin-right: var(--wp--preset--spacing--xs);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 500;
	letter-spacing: var(--wp--custom--tracking--eyebrow);
	text-transform: uppercase;
}
.pqmd-blog-footer .is-style-tag-pills a {
	border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--white);
	letter-spacing: normal;
	text-transform: none;
	font-size: var(--wp--preset--font-size--small);
}
.pqmd-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--xs);
}
.pqmd-share ul {
	display: flex;
	gap: var(--wp--preset--spacing--xs);
	margin: 0;
	padding: 0;
	list-style: none;
}
.pqmd-share__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--border);
	border-radius: 50%;
	color: var(--wp--preset--color--navy);
	transition:
		background-color var(--wp--custom--motion--fast) var(--wp--custom--motion--ease),
		color var(--wp--custom--motion--fast) var(--wp--custom--motion--ease);
}
.pqmd-share__link:is(:hover, :focus-visible),
.pqmd-share__copy.is-copied {
	border-color: var(--wp--preset--color--navy);
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}
.pqmd-author-box {
	display: flex;
	gap: var(--wp--preset--spacing--l);
	padding: var(--wp--preset--spacing--l);
	border-radius: var(--wp--custom--radius--m);
	background: var(--wp--preset--color--surface-alt);
}
.pqmd-author-box__initials {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 500;
}
.pqmd-author-box__text > * {
	margin: 0;
}
.pqmd-author-box__eyebrow {
	color: var(--wp--preset--color--orange);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 500;
	letter-spacing: var(--wp--custom--tracking--eyebrow);
	text-transform: uppercase;
}
.pqmd-author-box__name {
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--subheading);
	line-height: 1.3;
}
.pqmd-author-box__bio {
	margin-block: var(--wp--preset--spacing--xxs) var(--wp--preset--spacing--xs) !important;
	color: var(--wp--preset--color--text-soft);
	font-size: var(--wp--preset--font-size--small);
}

/*
 * ================= Archives and search (Pencil archive and search frames) =================
 */

/* Archive titles end with a period, as in the design ("Guidelines."). */
.pqmd-title-dot::after {
	content: ".";
}

/* Search pages: the field spans the reading column. */
.pqmd-search-wide {
	width: 100%;
	max-width: var(--wp--style--global--content-size);
}
.pqmd-search-wide .wp-block-search__inside-wrapper {
	width: 100% !important;
}

/* Search results: a list with hairlines between results. */
.pqmd-search-results {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}
.pqmd-search-results > li {
	padding-block: var(--wp--preset--spacing--l);
	border-bottom: var(--wp--custom--border--hairline) solid var(--wp--preset--color--line);
}
.pqmd-search-results > li:first-child {
	padding-top: 0;
}
.pqmd-search-result > * {
	margin-block: 0;
}
.pqmd-search-result > :is(h2, h3) {
	margin-top: var(--wp--preset--spacing--xs);
}
.pqmd-search-result .wp-block-post-excerpt__excerpt {
	margin: 0;
	color: var(--wp--preset--color--text-soft);
	font-size: var(--wp--preset--font-size--card);
}
.pqmd-search-result > .wp-block-read-more {
	display: inline-flex;
	margin-top: var(--wp--preset--spacing--xs);
}

/* Search tips and other lists with lime bullets. */
.pqmd-lime-bullets li::marker {
	color: var(--wp--preset--color--lime);
}
.pqmd-search-tips > * {
	margin-block: 0;
}
.pqmd-search-tips > * + * {
	margin-top: var(--wp--preset--spacing--s);
}

/* Panel sentence built with a shortcode (Focus Area "Explore all six Pillars."). */
.pqmd-panel-statement p {
	max-width: 36rem;
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

/* Popular destinations: equal-height cards in a row. */
.pqmd-search-tips + .wp-block-heading + .wp-block-group > .is-style-card-info {
	height: 100%;
	box-sizing: border-box;
}

/* Archive and search eyebrow (shortcode output, so it carries the Eyebrow look itself). */
.pqmd-archive-eyebrow {
	font-size: var(--wp--preset--font-size--label);
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: var(--wp--custom--tracking--eyebrow);
	text-transform: uppercase;
}
