/* Page content rules that no block setting covers. Owned by the main rebuild session. */

/* Kadence gallery look: masonry of uncropped photos, 3 / 2 / 1 columns, 10px gutters. */
.wp-block-gallery.b33-masonry.has-nested-images {
	display: block;
	columns: 3;
	column-gap: 10px;
}
.wp-block-gallery.b33-masonry.has-nested-images figure.wp-block-image:not(#individual-image) {
	display: block;
	width: 100%;
	margin: 0 0 10px;
	break-inside: avoid;
}
.wp-block-gallery.b33-masonry.has-nested-images figure.wp-block-image img {
	height: auto;
}
@media (max-width: 1024px) {
	.wp-block-gallery.b33-masonry.has-nested-images {
		columns: 2;
	}
}
@media (max-width: 767px) {
	.wp-block-gallery.b33-masonry.has-nested-images {
		columns: 1;
	}
}

/* Kadence "equal column height" rows: every grid row as tall as the tallest one, per screen size
   (Kadence switches it off where the columns stack). */
@media (min-width: 1025px) {
	.b33-eq-d { grid-auto-rows: minmax(0, 1fr); }
}
@media (min-width: 768px) and (max-width: 1024px) {
	.b33-eq-t { grid-auto-rows: minmax(0, 1fr); }
}
@media (max-width: 767px) {
	.b33-eq-m { grid-auto-rows: minmax(0, 1fr); }
}

/* Button groups whose alignment changes on tablets (768-1024) or phones (<=767), as on Kadence.
   Core's per-screen layout rule loses to the block's static justification class. */
@media (min-width: 768px) and (max-width: 1024px) {
	.wp-block-buttons.b33-jt-left { justify-content: flex-start; }
	.wp-block-buttons.b33-jt-center { justify-content: center; }
	.wp-block-buttons.b33-jt-right { justify-content: flex-end; }
	.wp-block-buttons.b33-jt-space-between { justify-content: space-between; }
}
@media (max-width: 767px) {
	.wp-block-buttons.b33-jm-left { justify-content: flex-start; }
	.wp-block-buttons.b33-jm-center { justify-content: center; }
	.wp-block-buttons.b33-jm-right { justify-content: flex-end; }
	.wp-block-buttons.b33-jm-space-between { justify-content: space-between; }
}

/* Tables: Ollie forces its smallest font size on the inner table and tints header cells. Kadence
   lets the table follow the block's own settings, so undo both. */
.wp-block-table table {
	font-size: inherit;
}
.wp-block-table th,
.wp-block-table tfoot {
	background-color: transparent;
}

/* Kadence lets an over-long word break inside page content (.entry-content { word-break: break-word }). */
.wp-block-post-content {
	word-break: break-word;
}
.wp-block-post-content table {
	word-break: normal;
}

/* Single-post featured image: cover by default (as Kadence's stylesheet does), so a post's own CSS
   for img.post-top-featured (post 560 uses contain) can still override it. */
.wp-block-post-featured-image img.post-top-featured {
	object-fit: cover;
}

/* Kadence removes the bottom margin only from a post's real last element. When a post ends with an
   invisible <style> or <script> block (post 560), its last paragraph keeps Kadence's 2rem below. */
.b33-entry-content > :not(style):not(script):has(~ :is(style, script)):not(:has(~ :not(style):not(script))) {
	margin-block-end: 2rem;
}

/* Native Wildflowers bloom chart on phones: the season labels are wider than their three month columns,
   so use 13px and keep the words whole ("Summer" broke as "Summe / r"). */
@media (max-width: 767px) {
	.b33-bloom-chart > div > span:nth-child(-n+4) {
		font-size: 13px !important;
		word-break: keep-all;
	}
}

/* Native Wildflowers: the hero tags and Bloom Colors filter the bloom calendar (assets/js/bloom-filter.js).
   Rows carry an inline display:grid, so hidden rows need the override. The active filter gets the
   page's hover tint and a violet ring. */
.b33-bloom-row[hidden] {
	display: none !important;
}
.b33-filter.is-active .wp-block-button__link {
	background-color: #dedaf2 !important;
	box-shadow: inset 0 0 0 2px #5e4aa6;
}
.b33-filter.is-active > .wp-block-group {
	box-shadow: 0 0 0 2px #fcfcfc, 0 0 0 4px #5e4aa6;
}
.b33-filter.is-active p a {
	font-weight: 700;
}
/* Phones: with 31 flowers the names wrapped beside their bars (3,600px of chart). Each name and
   bloom time now sit on one line above a full-width bar. The name column becomes 0 wide, so the
   bars keep their column numbers and still line up with Spring, Summer and Fall. */
@media (max-width: 767px) {
	.b33-bloom-head,
	.b33-bloom-row {
		grid-template-columns: 0 repeat(9, minmax(0, 1fr)) !important;
	}
	.b33-bloom-row > a {
		grid-column: 1 / -1 !important;
		padding: 8px 0 6px !important;
	}
	.b33-bloom-row > a > span {
		display: inline !important;
	}
	.b33-bloom-row > a > span + span {
		margin-left: 8px;
	}
	.b33-bloom-row > span {
		grid-row: 2 !important;
	}
}

/* Kadence rows with "align middle" plus "equal height": the cards stretch to the row height (their own
   content alignment still applies); only rows without equal height centre their columns. */
@media (min-width: 1025px) {
	.b33-items-center.b33-eq-d { align-items: stretch; }
}
@media (min-width: 768px) and (max-width: 1024px) {
	.b33-items-center.b33-eq-t { align-items: stretch; }
}
@media (max-width: 767px) {
	.b33-items-center.b33-eq-m { align-items: stretch; }
}

/* Phones and tablets: the social icons under the older Subscribe Now forms line up with the form on the left. */
@media (max-width: 1024px) {
	.wp-block-post-content .wp-block-social-links.b33-icons-20 {
		justify-content: flex-start;
		align-self: flex-start;
		margin-left: 0 !important;
	}
}
