/**
 * WordPress post content styles.
 *
 * Supports Classic Editor and core block alignment, media, captions,
 * galleries, embeds, tables, lists, quotes, and common content elements.
 *
 * @theme wfy-2026
 * @author jasonk@montanab.com
 * @agent willy
 */

.post-content {
	--post-content-gap: 1.5rem;
	--post-content-wide-width: 75rem;
	--post-content-border-color: #d9d9d9;
	--post-content-caption-color: #595959;
	--post-content-muted-background: #f5f5f5;
	overflow-wrap: break-word;
}

.post-content::after {
	clear: both;
	content: "";
	display: table;
}

.post-content *,
.post-content *::before,
.post-content *::after {
	box-sizing: border-box;
}

/* Content flow */

.post-content > :first-child {
	margin-top: 0;
}

.post-content > :last-child {
	margin-bottom: 0;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content dl,
.post-content blockquote,
.post-content pre,
.post-content table,
.post-content figure,
.post-content address {
	margin-bottom: var(--post-content-gap);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
	clear: both;
}

.post-content ul,
.post-content ol {
	padding-left: 1.5em;
}

.post-content li + li {
	margin-top: 0.35em;
}

.post-content li > ul,
.post-content li > ol {
	margin-bottom: 0;
	margin-top: 0.35em;
}

.post-content dt {
	font-weight: 700;
}

.post-content dd {
	margin: 0 0 1em 1.5em;
}

/* Core alignment classes */

.post-content .has-text-align-left {
	text-align: left;
}

.post-content .has-text-align-center {
	text-align: center;
}

.post-content .has-text-align-right {
	text-align: right;
}

.post-content .has-text-align-justify {
	text-align: justify;
}

.post-content .alignnone {
	margin-left: 0;
	margin-right: 0;
}

.post-content .aligncenter {
	clear: both;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.post-content .alignleft {
	float: left;
	margin: 0 var(--post-content-gap) var(--post-content-gap) 0;
	max-width: 50%;
}

.post-content .alignright {
	float: right;
	margin: 0 0 var(--post-content-gap) var(--post-content-gap);
	max-width: 50%;
}

.post-content .alignwide {
	left: 50%;
	margin-left: 0;
	margin-right: 0;
	max-width: min(var(--post-content-wide-width), calc(100vw - (2 * var(--post-content-gap))));
	position: relative;
	transform: translateX(-50%);
	width: calc(100% + (2 * var(--post-content-gap)));
}

.post-content .alignfull {
	left: 50%;
	margin-left: 0;
	margin-right: 0;
	max-width: none;
	position: relative;
	transform: translateX(-50%);
	width: 100vw;
}

/* Images and captions */

.post-content img {
	height: auto;
	max-width: 100%;
	vertical-align: middle;
}

.post-content img.aligncenter,
.post-content img.alignnone,
.post-content img.alignleft,
.post-content img.alignright {
	height: auto;
}

.post-content figure {
	max-width: 100%;
}

.post-content .wp-caption,
.post-content .wp-block-image {
	max-width: 100%;
}

.post-content .wp-caption {
	margin-bottom: var(--post-content-gap);
}

.post-content .wp-caption img,
.post-content .wp-block-image img {
	display: block;
}

.post-content .wp-caption.aligncenter,
.post-content .wp-block-image.aligncenter {
	text-align: center;
}

.post-content .wp-caption-text,
.post-content figcaption,
.post-content .wp-element-caption {
	color: var(--post-content-caption-color);
	font-size: 0.875em;
	line-height: 1.5;
	margin: 0.65em 0 0;
	text-align: center;
}

.post-content .wp-caption.alignleft .wp-caption-text,
.post-content .wp-block-image.alignleft figcaption {
	text-align: left;
}

.post-content .wp-caption.alignright .wp-caption-text,
.post-content .wp-block-image.alignright figcaption {
	text-align: right;
}

.post-content .wp-block-image.is-resized {
	display: table;
}

.post-content .wp-block-image.is-resized figcaption {
	display: table-caption;
	caption-side: bottom;
}

.post-content .is-style-rounded img,
.post-content img.is-style-rounded {
	border-radius: 9999px;
}

.post-content .wp-smiley,
.post-content .emoji {
	border: 0;
	box-shadow: none;
	display: inline;
	height: 1em;
	margin: 0 0.07em;
	max-height: 1em;
	padding: 0;
	vertical-align: -0.1em;
	width: 1em;
}

/* Classic galleries and Gallery blocks */

.post-content .gallery {
	--gallery-columns: 3;
	display: grid;
	gap: var(--post-content-gap);
	grid-template-columns: repeat(var(--gallery-columns), minmax(0, 1fr));
	margin-bottom: var(--post-content-gap);
}

.post-content .gallery-columns-1 {
	--gallery-columns: 1;
}

.post-content .gallery-columns-2 {
	--gallery-columns: 2;
}

.post-content .gallery-columns-3 {
	--gallery-columns: 3;
}

.post-content .gallery-columns-4 {
	--gallery-columns: 4;
}

.post-content .gallery-columns-5 {
	--gallery-columns: 5;
}

.post-content .gallery-columns-6 {
	--gallery-columns: 6;
}

.post-content .gallery-columns-7 {
	--gallery-columns: 7;
}

.post-content .gallery-columns-8 {
	--gallery-columns: 8;
}

.post-content .gallery-columns-9 {
	--gallery-columns: 9;
}

.post-content .gallery-item {
	margin: 0;
	min-width: 0;
	text-align: center;
}

.post-content .gallery-icon img {
	display: block;
	margin: 0 auto;
	width: 100%;
}

.post-content .gallery-caption {
	color: var(--post-content-caption-color);
	font-size: 0.8125em;
	line-height: 1.4;
	margin-top: 0.65em;
}

.post-content .wp-block-gallery,
.post-content .blocks-gallery-grid {
	--block-gallery-columns: 3;
	display: grid;
	gap: var(--wp--style--unstable-gallery-gap, var(--post-content-gap));
	grid-template-columns: repeat(var(--block-gallery-columns), minmax(0, 1fr));
	list-style: none;
	padding-left: 0;
}

.post-content .wp-block-gallery.columns-1,
.post-content .blocks-gallery-grid.columns-1 {
	--block-gallery-columns: 1;
}

.post-content .wp-block-gallery.columns-2,
.post-content .blocks-gallery-grid.columns-2 {
	--block-gallery-columns: 2;
}

.post-content .wp-block-gallery.columns-3,
.post-content .blocks-gallery-grid.columns-3 {
	--block-gallery-columns: 3;
}

.post-content .wp-block-gallery.columns-4,
.post-content .blocks-gallery-grid.columns-4 {
	--block-gallery-columns: 4;
}

.post-content .wp-block-gallery.columns-5,
.post-content .blocks-gallery-grid.columns-5 {
	--block-gallery-columns: 5;
}

.post-content .wp-block-gallery.columns-6,
.post-content .blocks-gallery-grid.columns-6 {
	--block-gallery-columns: 6;
}

.post-content .wp-block-gallery.columns-7,
.post-content .blocks-gallery-grid.columns-7 {
	--block-gallery-columns: 7;
}

.post-content .wp-block-gallery.columns-8,
.post-content .blocks-gallery-grid.columns-8 {
	--block-gallery-columns: 8;
}

.post-content .wp-block-gallery .wp-block-image,
.post-content .wp-block-gallery .blocks-gallery-item {
	margin: 0;
	min-width: 0;
	position: relative;
	width: auto;
}

.post-content .wp-block-gallery.has-nested-images figure.wp-block-image img,
.post-content .blocks-gallery-grid .blocks-gallery-item img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

/* Audio, video, and embeds */

.post-content audio,
.post-content video {
	display: block;
	max-width: 100%;
}

.post-content audio {
	width: 100%;
}

.post-content iframe,
.post-content object,
.post-content embed {
	max-width: 100%;
}

.post-content .wp-video,
.post-content .mejs-container {
	max-width: 100%;
}

.post-content .wp-block-embed {
	margin-bottom: var(--post-content-gap);
}

.post-content .wp-block-embed__wrapper {
	max-width: 100%;
}

.post-content .wp-embed-aspect-21-9 .wp-block-embed__wrapper,
.post-content .wp-embed-aspect-18-9 .wp-block-embed__wrapper,
.post-content .wp-embed-aspect-16-9 .wp-block-embed__wrapper,
.post-content .wp-embed-aspect-4-3 .wp-block-embed__wrapper,
.post-content .wp-embed-aspect-1-1 .wp-block-embed__wrapper,
.post-content .wp-embed-aspect-9-16 .wp-block-embed__wrapper,
.post-content .wp-embed-aspect-1-2 .wp-block-embed__wrapper {
	height: 0;
	overflow: hidden;
	position: relative;
}

.post-content .wp-embed-aspect-21-9 .wp-block-embed__wrapper {
	padding-top: 42.857%;
}

.post-content .wp-embed-aspect-18-9 .wp-block-embed__wrapper {
	padding-top: 50%;
}

.post-content .wp-embed-aspect-16-9 .wp-block-embed__wrapper {
	padding-top: 56.25%;
}

.post-content .wp-embed-aspect-4-3 .wp-block-embed__wrapper {
	padding-top: 75%;
}

.post-content .wp-embed-aspect-1-1 .wp-block-embed__wrapper {
	padding-top: 100%;
}

.post-content .wp-embed-aspect-9-16 .wp-block-embed__wrapper {
	padding-top: 177.778%;
}

.post-content .wp-embed-aspect-1-2 .wp-block-embed__wrapper {
	padding-top: 200%;
}

.post-content [class*="wp-embed-aspect-"] .wp-block-embed__wrapper > iframe,
.post-content [class*="wp-embed-aspect-"] .wp-block-embed__wrapper > object,
.post-content [class*="wp-embed-aspect-"] .wp-block-embed__wrapper > embed {
	height: 100%;
	inset: 0;
	position: absolute;
	width: 100%;
}

/* Quotes, preformatted text, and separators */

.post-content blockquote,
.post-content .wp-block-quote {
	border-left: 0.25rem solid currentColor;
	margin-left: 0;
	margin-right: 0;
	padding: 0.25rem 0 0.25rem var(--post-content-gap);
}

.post-content blockquote > :last-child {
	margin-bottom: 0;
}

.post-content blockquote cite,
.post-content .wp-block-quote cite {
	color: var(--post-content-caption-color);
	display: block;
	font-size: 0.875em;
	font-style: normal;
	margin-top: 0.75em;
}

.post-content .wp-block-pullquote {
	border-bottom: 0.25rem solid currentColor;
	border-top: 0.25rem solid currentColor;
	margin: calc(2 * var(--post-content-gap)) 0;
	padding: calc(2 * var(--post-content-gap)) var(--post-content-gap);
	text-align: center;
}

.post-content .wp-block-pullquote blockquote {
	border: 0;
	margin: 0;
	padding: 0;
}

.post-content pre,
.post-content .wp-block-code {
	background: var(--post-content-muted-background);
	max-width: 100%;
	overflow-x: auto;
	padding: var(--post-content-gap);
	white-space: pre;
}

.post-content code,
.post-content kbd,
.post-content samp {
	overflow-wrap: normal;
	word-break: normal;
}

.post-content hr,
.post-content .wp-block-separator {
	border: 0;
	border-top: 1px solid var(--post-content-border-color);
	clear: both;
	margin: calc(2 * var(--post-content-gap)) auto;
}

.post-content .wp-block-separator.is-style-wide {
	width: 100%;
}

.post-content .wp-block-separator.is-style-dots {
	background: none;
	border: 0;
	height: auto;
	line-height: 1;
	text-align: center;
}

.post-content .wp-block-separator.is-style-dots::before {
	content: "\00b7 \00b7 \00b7";
	font-size: 1.5em;
	letter-spacing: 0.75em;
	padding-left: 0.75em;
}

/* Tables */

.post-content table,
.post-content .wp-block-table table {
	border-collapse: collapse;
	border-spacing: 0;
	display: block;
	max-width: 100%;
	overflow-x: auto;
	width: 100%;
}

.post-content th,
.post-content td {
	border: 1px solid var(--post-content-border-color);
	padding: 0.75em 1em;
	text-align: left;
	vertical-align: top;
}

.post-content th {
	font-weight: 700;
}

.post-content .wp-block-table {
	margin-bottom: var(--post-content-gap);
	overflow-x: auto;
}

.post-content .wp-block-table table {
	display: table;
	margin-bottom: 0;
}

.post-content .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background: var(--post-content-muted-background);
}

.post-content .wp-block-table figcaption {
	margin-top: 0.65em;
}

/* Columns, media/text, covers, and groups */

.post-content .wp-block-columns {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--post-content-gap);
	margin-bottom: var(--post-content-gap);
}

.post-content .wp-block-column {
	flex-basis: 0;
	flex-grow: 1;
	min-width: 0;
	overflow-wrap: break-word;
}

.post-content .wp-block-media-text {
	display: grid;
	gap: 0;
	grid-template-columns: 50% 1fr;
	grid-template-rows: auto;
}

.post-content .wp-block-media-text.has-media-on-the-right {
	grid-template-columns: 1fr 50%;
}

.post-content .wp-block-media-text__media {
	grid-column: 1;
	grid-row: 1;
	margin: 0;
}

.post-content .wp-block-media-text__content {
	align-self: center;
	grid-column: 2;
	grid-row: 1;
	padding: 0 var(--post-content-gap);
}

.post-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media {
	grid-column: 2;
}

.post-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
	grid-column: 1;
}

.post-content .wp-block-media-text__media img,
.post-content .wp-block-media-text__media video {
	height: auto;
	max-width: unset;
	vertical-align: middle;
	width: 100%;
}

.post-content .wp-block-cover {
	align-items: center;
	display: flex;
	justify-content: center;
	min-height: 26.875rem;
	overflow: hidden;
	padding: var(--post-content-gap);
	position: relative;
}

.post-content .wp-block-cover__background,
.post-content .wp-block-cover__image-background,
.post-content .wp-block-cover__video-background {
	height: 100%;
	inset: 0;
	object-fit: cover;
	position: absolute;
	width: 100%;
}

.post-content .wp-block-cover__inner-container {
	color: inherit;
	position: relative;
	width: 100%;
	z-index: 1;
}

.post-content .wp-block-group {
	clear: both;
}

/* Buttons and files */

.post-content .wp-block-buttons {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.post-content .wp-block-buttons.is-content-justification-center {
	justify-content: center;
}

.post-content .wp-block-buttons.is-content-justification-right {
	justify-content: flex-end;
}

.post-content .wp-block-button {
	display: inline-block;
}

.post-content .wp-block-button__link {
	display: inline-block;
	text-align: center;
}

.post-content .wp-block-file {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.post-content .wp-block-file__button {
	display: inline-block;
}

/* Responsive adjustments */

@media screen and (max-width: 48rem) {
	.post-content .alignleft,
	.post-content .alignright,
	.post-content .wp-caption.alignleft,
	.post-content .wp-caption.alignright,
	.post-content .wp-block-image.alignleft,
	.post-content .wp-block-image.alignright {
		float: none;
		margin-left: auto;
		margin-right: auto;
		max-width: 100%;
	}

	.post-content .wp-caption.alignleft .wp-caption-text,
	.post-content .wp-caption.alignright .wp-caption-text,
	.post-content .wp-block-image.alignleft figcaption,
	.post-content .wp-block-image.alignright figcaption {
		text-align: center;
	}

	.post-content .gallery {
		--gallery-columns: 2;
	}

	.post-content .gallery-columns-1 {
		--gallery-columns: 1;
	}

	.post-content .wp-block-gallery,
	.post-content .blocks-gallery-grid {
		--block-gallery-columns: 2;
	}

	.post-content .wp-block-gallery.columns-1,
	.post-content .blocks-gallery-grid.columns-1 {
		--block-gallery-columns: 1;
	}

	.post-content .wp-block-columns:not(.is-not-stacked-on-mobile) {
		flex-wrap: wrap;
	}

	.post-content .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
		flex-basis: 100%;
	}

	.post-content .wp-block-media-text.is-stacked-on-mobile {
		grid-template-columns: 100%;
	}

	.post-content .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media,
	.post-content .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content {
		grid-column: 1;
	}

	.post-content .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media {
		grid-row: 1;
	}

	.post-content .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content {
		grid-row: 2;
		padding: var(--post-content-gap) 0 0;
	}
}

@media screen and (max-width: 30rem) {
	.post-content .gallery {
		--gallery-columns: 1;
	}

	.post-content .wp-block-gallery,
	.post-content .blocks-gallery-grid {
		--block-gallery-columns: 1;
	}

	.post-content .alignwide {
		max-width: calc(100vw - var(--post-content-gap));
	}
}
