/* ---------------------------------------------------------------- Page content
 * Pieces shared by the content pages.
 */

/* Columns that stack from 1119px down (Breakdance "stack vertically at tablet landscape"). */
@media (max-width: 1119px) {
	.wp-block-columns.ioa-stack-1119 {
		flex-direction: column;
	}

	.wp-block-columns.ioa-stack-1119 > .wp-block-column {
		flex-basis: auto !important;
		width: 100%;
	}
}

/* A vertically centred column keeps its content centred in the full column height, as Breakdance did. */
.wp-block-column.is-vertically-aligned-center {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	gap: 15px;
	justify-content: center;
}

/* A section whose blocks sit 15px apart (Breakdance section with a 15px gap). */
.ioa-section.ioa-stack-15 > * + * {
	margin-block-start: 15px;
}

/* Red pill label ("DEFRA Approved - Official Closed ID Coded Rings"). */
.ioa-pill.ioa-pill {
	background: var(--wp--preset--color--red);
	border-radius: 15px;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	/* The constrained layout would centre a narrow block: keep it at the left edge of the 1080px content. */
	margin-left: calc((100% - min(100%, var(--wp--style--global--content-size))) / 2) !important;
	max-width: fit-content;
	padding: 5px 15px;
}

/* A picture cropped to 16:9 (Breakdance image with object-fit cover). */
.ioa-image-16x9 {
	margin: 0;
}
.ioa-image-16x9 img {
	aspect-ratio: 16 / 9;
	display: block;
	object-fit: cover;
	width: 100%;
}

/* A column whose blocks sit 15px apart, from the top (Breakdance column with a 15px gap). */
.wp-block-column.ioa-col-gap-15 {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

/* Bird ring fitting steps: Breakdance rich text, each step a paragraph inside the list item (1em apart). */
.ioa-steps {
	margin-bottom: 0;
	padding-left: 40px;
}

/* A column laid out as a flex column, so its last block keeps its bottom margin (TablePress's 16px). */
.wp-block-column.ioa-col-flex {
	display: flex;
	flex-direction: column;
}
.ioa-steps > li + li {
	margin-top: 1em;
}

/* Three photos in a row, 10px apart, each cropped to 3:2 on a 19% black tile (Breakdance gallery, lightbox on). */
.wp-block-gallery.ioa-gallery-3x2 {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 0;
	width: 100%;
}
.wp-block-gallery.ioa-gallery-3x2 > .wp-block-image {
	aspect-ratio: 3 / 2;
	background: #00000030;
	margin: 0;
	width: auto !important;
}
.wp-block-gallery.ioa-gallery-3x2 > .wp-block-image img {
	height: 100%;
	object-fit: cover;
	width: 100%;
}

/* TablePress's table wrapper keeps the 16px bottom margin it had on live (the block layout zeroes a last child's). */
.wp-block-column.ioa-col-flex > .dt-container {
	margin-bottom: 16px;
}

/* "Plain text page" template: browser-default margins that do not collapse (a flex column, as Breakdance's
   fallback template had): headings 0.83em above and below, paragraphs 1em. */
.ioa-plain .ioa-plain__content {
	align-items: flex-start;
	display: flex;
	flex-direction: column;
}
.ioa-plain .ioa-plain__content > h2 {
	margin-block: 0.83em;
}
.ioa-plain .ioa-plain__content > p {
	margin-block: 1em;
}
