/*
 * Blog side, part 2: posts page, category/tag archives, search, 404, Podcast category.
 * Cards: padding 30 (20 mobile), gap 50 (20 mobile), image edge to edge 4:3, title 25/20/18.
 */

.hp-main-col > * {
	margin-block: 0;
}
.hp-main-col > .hero-section {
	margin-bottom: 40px;
}
.hp-main-col .hero-section .page-title {
	margin: 0;
	font-size: 30px;
}

.hp-entries .wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: var(--hp-grid-gap, 50px);
	margin: 0;
	padding: 0;
	list-style: none;
}
.hp-entries .wp-block-post-template > li {
	margin: 0;
	display: flex;
	flex-direction: column;
}
@media (max-width: 689.98px) {
	.hp-entries:not(.is-grid) { --hp-grid-gap: 20px; --hp-card-padding: 20px; }
}

.hp-card {
	--card-element-spacing: 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--hp-card-padding, 30px);
	background-color: transparent;
	border-radius: var(--theme-boxed-content-border-radius);
	box-shadow: var(--theme-boxed-content-box-shadow);
	--theme-link-initial-color: var(--theme-headings-color);
}
.hp-entries.is-white-cards .hp-card {
	background-color: var(--theme-palette-color-6);
}
.hp-card > * {
	margin-block: 0 var(--card-element-spacing);
}
.hp-card > :last-child {
	margin-bottom: 0;
}
.hp-card .entry-title {
	font-size: 25px;
	line-height: 1.2;
}
.is-white-cards .hp-card .entry-title {
	line-height: 1.3;
}
.hp-card .entry-title a {
	color: var(--theme-headings-color);
}
@media (max-width: 999.98px) {
	.hp-card .entry-title { font-size: 20px; }
}
@media (max-width: 689.98px) {
	.hp-card .entry-title { font-size: 18px; }
}

/* Card meta: 12px uppercase */
.hp-meta--card {
	margin: 0 0 15px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.6;
	text-transform: uppercase;
}
.hp-meta--card > :not(:last-child)::after {
	content: "-";
	font-size: 1em;
	top: 0;
}
.hp-meta--card .wp-block-post-terms__separator { white-space: pre; }

/* Edge-to-edge image */
.hp-card__image {
	--card-element-spacing: 30px;
	width: calc(100% + var(--hp-card-padding, 30px) * 2);
	max-width: none;
	margin-inline: calc(var(--hp-card-padding, 30px) * -1);
	overflow: hidden;
}
.hp-card > .hp-card__image:first-child {
	margin-top: calc(var(--hp-card-padding, 30px) * -1);
}
.hp-card__image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.hp-card .entry-excerpt {
	font-size: 15px;
	line-height: 1.6;
	color: var(--theme-text-color);
}
.hp-card .entry-excerpt p {
	margin: 0 0 1.5em;
}
.hp-card .entry-excerpt p:last-child {
	margin-bottom: 0;
}

/* Read more: text link on the blog page, button on archives */
.hp-read-more {
	display: flex;
	align-items: center;
	gap: 0.5em;
	align-self: flex-start;
	font-size: 15px;
	line-height: 1.6;
}
.hp-read-more.is-button {
	min-height: 40px;
	padding: 5px 15px;
	border-radius: var(--theme-button-border-radius);
	color: var(--theme-button-text-initial-color);
	background-color: var(--theme-button-background-initial-color);
	transition: color 0.12s, background-color 0.12s;
}
.hp-read-more.is-button::after {
	content: "→";
}
.hp-read-more.is-button:hover {
	color: var(--theme-button-text-hover-color);
	background-color: var(--theme-button-background-hover-color);
}
.hp-read-more .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Search results: enhanced grid (first two cards of five wide) */
.hp-entries.is-grid { --hp-grid-gap: 30px; }
.hp-entries.is-grid .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 30px;
}
.hp-entries.is-grid { --hp-card-padding: 30px; }
.hp-entries.is-grid .entry-excerpt { font-size: 14px; }
.hp-entries.is-grid .entry-title { font-size: 20px; line-height: 1.3; }
.hp-entries.is-grid .hp-meta--card { font-weight: 600; }
.hp-entries.is-grid .hp-meta--date { margin: auto 0 0; padding-top: 0; }
.hp-entries.is-grid .hp-card > .hp-meta--card:first-child { margin-bottom: 15px; }
.hp-entries.is-grid .hp-card > :nth-last-child(2) { margin-bottom: 20px; }
@media (min-width: 690px) {
	.hp-entries.is-grid .wp-block-post-template { grid-template-columns: repeat(6, 1fr); }
	.hp-entries.is-grid .wp-block-post-template > li { grid-column: span 3; }
}
@media (min-width: 1000px) {
	.hp-entries.is-grid .wp-block-post-template > li { grid-column: span 2; }
	.hp-entries.is-grid .wp-block-post-template > li:nth-child(5n+1),
	.hp-entries.is-grid .wp-block-post-template > li:nth-child(5n+2) { grid-column: span 3; }
}
@media (max-width: 689.98px) {
	.hp-entries.is-grid .entry-title { font-size: 18px; }
}

/* Podcast category */
.hp-podcast-intro {
	margin-bottom: 2em;
	font-size: 1.25em;
	line-height: 1.4;
}
.hp-podcast-intro > * {
	margin-block: 0 1.5em;
}
.hp-podcast-intro > :last-child {
	margin-bottom: 0;
}
.hp-podcast-intro p a {
	text-decoration: underline;
}
.hp-card--podcast .hp-read-more {
	width: 180px;
}
.hp-card--podcast .hp-podcast-player {
	margin-bottom: var(--card-element-spacing);
}
.hp-card--podcast iframe {
	max-width: 100%;
}

/* Pagination */
.hp-pagination {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	margin-top: 50px;
	font-size: 14px;
	font-weight: 600;
	color: var(--theme-palette-color-5);
}
@media (max-width: 999.98px) { .hp-pagination { margin-top: 60px; } }
@media (max-width: 689.98px) { .hp-pagination { margin-top: 30px; } }
.hp-pagination > * { margin-block: 0; }
.hp-pagination .page-numbers,
.hp-pagination .wp-block-query-pagination-previous,
.hp-pagination .wp-block-query-pagination-next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	border: 2px solid transparent;
	border-radius: 4px;
	color: var(--theme-palette-color-5);
	text-decoration: none;
}
.hp-pagination .wp-block-query-pagination-numbers {
	grid-column: 2;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	column-gap: 4px;
	margin: -5px;
}
.hp-pagination .page-numbers {
	flex: 0 0 41px;
	width: 41px;
	margin: 5px;
}
.hp-pagination .page-numbers.current {
	color: var(--theme-palette-color-2);
	background: var(--theme-palette-color-1);
}
.hp-pagination .page-numbers:not(.dots):not(.current):hover {
	border-color: var(--theme-palette-color-1);
	color: var(--theme-palette-color-5);
}
.hp-pagination .wp-block-query-pagination-previous,
.hp-pagination .wp-block-query-pagination-next {
	margin: 0;
	padding: 0 17px;
	font-size: 12px;
	text-transform: uppercase;
	white-space: nowrap;
	border-color: var(--theme-border-color);
}
.hp-pagination .wp-block-query-pagination-previous { grid-column: 1; justify-self: start; }
.hp-pagination .wp-block-query-pagination-next { grid-column: 3; justify-self: end; }
.hp-pagination .wp-block-query-pagination-next::after {
	content: "";
	width: 6px;
	height: 6px;
	border-top: 1.5px solid currentColor;
	border-right: 1.5px solid currentColor;
	transform: rotate(45deg);
	margin-inline-start: 2px;
}
.hp-pagination .wp-block-query-pagination-previous::before {
	content: "";
	width: 6px;
	height: 6px;
	border-bottom: 1.5px solid currentColor;
	border-left: 1.5px solid currentColor;
	transform: rotate(45deg);
	margin-inline-end: 2px;
}
.hp-pagination .wp-block-query-pagination-previous:hover,
.hp-pagination .wp-block-query-pagination-next:hover {
	border-color: var(--theme-palette-color-1);
}
@media (max-width: 689.98px) {
	.hp-pagination .wp-block-query-pagination-numbers { display: none; }
}

/* 404 */
.hp-404 {
	row-gap: 40px;
}
.hp-404 .hero-section {
	text-align: center;
}
.hp-404 .hero-section .page-title {
	font-size: var(--wp--custom--heading--h-1--size);
	line-height: var(--wp--custom--heading--h-1--line-height);
}
@media (max-width: 999.98px) {
	.hp-404 .hero-section .page-title { font-size: var(--wp--custom--heading--h-1--size-tablet); }
}
@media (max-width: 689.98px) {
	.hp-404 .hero-section .page-title { font-size: var(--wp--custom--heading--h-1--size-mobile); line-height: var(--wp--custom--heading--h-1--line-height-mobile); }
}
.hp-404 .hero-section > * + * {
	margin-top: 20px;
}
.hp-404 .page-description {
	margin-bottom: 0;
}
.hp-404__search {
	width: 400px;
	max-width: 100%;
	margin-inline: auto;
}
.hp-404__search .wp-block-search__inside-wrapper {
	display: flex;
	align-items: center;
	height: 40px;
	border: 1px solid var(--theme-palette-color-5);
	border-radius: 35px;
	padding: 0 12px 0 15px;
	background: transparent;
}
.hp-404__search .wp-block-search__input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	padding: 0;
	height: 100%;
	font: inherit;
	font-size: 13px;
	color: var(--theme-palette-color-5);
	outline: none;
}
.hp-404__search .wp-block-search__button {
	display: inline-flex !important; /* the old Additional CSS hides every search button globally */
	min-height: 0;
	padding: 4px;
	background: transparent;
	color: var(--theme-palette-color-5);
	border-radius: 0;
}
.hp-404__search .wp-block-search__button svg {
	fill: currentColor;
	width: 15px;
	height: 15px;
	transform: scaleX(-1); /* core icon has the handle on the left, Blocksy on the right */
}

hp-raw {
	display: contents;
}

.hp-meta:not(:has(*)) {
	display: none;
}
