/*
 * Parasol Data styles, loaded on the front end and in the editor.
 * Colours, fonts and sizes live in theme.json; this file holds the pieces
 * theme.json can't express (the header texture, boxed labels, post cards).
 */

/*
 * Header: the ring texture and halftone graphic from the Illustrator draft.
 * header-texture.svg is one 6000px-wide image so the graphic always lines up
 * with the texture. The graphic's right edge sits 3000px from the image's
 * right edge, and is placed in line with the right edge of the wide content.
 */
.parasol-header {
	--parasol-graphic-inset: max(var(--wp--style--root--padding-right, 30px), calc((100vw - var(--wp--style--global--wide-size, 1200px)) / 2));
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 252px;
	box-sizing: border-box;
	background-color: var(--wp--preset--color--base);
	background-image: url(../images/header-texture.svg);
	background-repeat: no-repeat;
	background-position: right calc(var(--parasol-graphic-inset) - 3000px) top 0;
}

.parasol-header > .parasol-header__inner {
	width: 100%;
}

@media (max-width: 1099px) {
	.parasol-header {
		min-height: 214px;
		background-size: 5100px 306px;
		background-position: right calc(var(--parasol-graphic-inset) - 2550px) top 0;
	}
}

/* On phones the graphic would sit behind the title, so show the texture only. */
@media (max-width: 781px) {
	.parasol-header {
		min-height: 0;
		background-image: url(../images/header-texture-tile.svg);
		background-repeat: repeat;
		background-size: auto;
		background-position: 0 0;
	}
}

.parasol-header .wp-block-site-title {
	margin: 0;
}

/* Boxed tagline, labels and annotations: light grey box, black outline, offset shadow. */
.parasol-tagline,
.parasol-label {
	width: fit-content;
	margin: 0;
	background-color: var(--wp--preset--color--accent-1);
	border: 1px solid var(--wp--preset--color--contrast);
	box-shadow: 3px 3px 0 var(--wp--preset--color--accent-2);
	font-weight: 700;
	line-height: 1.3;
}

.parasol-tagline {
	padding: 0.15em 0.5em 0.2em;
}

.parasol-label {
	padding: 0.25em 0.6em;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* Blog grid cards: picture, date, title. */
.parasol-post-grid > .wp-block-post {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.parasol-post-grid > .wp-block-post > * {
	margin: 0;
}

.parasol-post-grid .wp-block-post-featured-image {
	margin-bottom: 0.35rem;
}

.parasol-post-grid .wp-block-post-featured-image img {
	box-sizing: border-box;
	border: 1px solid var(--wp--preset--color--contrast);
}

/* Posts without a featured image get a dotted placeholder of the same size. */
.parasol-post-grid > .wp-block-post:not(:has(> .wp-block-post-featured-image))::before {
	content: "";
	display: block;
	aspect-ratio: 4 / 3;
	margin-bottom: 0.35rem;
	box-sizing: border-box;
	border: 1px solid var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--accent-1) url(../images/header-texture-tile.svg);
}

.parasol-post-grid .wp-block-post-title {
	line-height: 1.2;
}

.wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--60);
}

.wp-block-query-pagination .page-numbers.current {
	padding: 0 0.4em;
	border: 1px solid currentColor;
}

/* Square, outlined form fields to match the buttons. */
.wp-block-post-comments-form :where(input:not([type=submit]):not([type=checkbox]), textarea) {
	border: 1px solid var(--wp--preset--color--contrast);
	border-radius: 0;
	background-color: transparent;
}

/* Post pages: the main picture gets the same thin black frame as the blog cards. */
.parasol-framed img {
	box-sizing: border-box;
	border: 1px solid var(--wp--preset--color--contrast);
}

/* "More posts" picture cards at the end of a post; hidden when there are none. */
.parasol-more-posts .wp-block-query {
	margin-top: var(--wp--preset--spacing--50);
}

.parasol-more-posts:not(:has(.wp-block-post)) {
	display: none;
}
