﻿/* === WebPage Row & Column Layout === */

/* Row container */
.wpe-row {
	display: flex;
	justify-content: center; /* centers inner wrapper horizontally */
	margin: 0 auto 1.5rem auto;
	width: 100%;
}

.wpe-row-inner {
	display: flex;
	flex-wrap: wrap;
	width: 100%; /* this + max-width gives centering control */
	margin-left: -0.75rem;
	margin-right: -0.75rem;
	box-sizing: border-box;
}


.wpe-column {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding-left: 0.75rem;
	padding-right: 0.75rem;
	min-width: 200px;
}

	/* Flow-mode column: horizontal packing */
	.wpe-column.wpe-column--flow {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 12px;
	}

	/* Stack-mode column */
	.wpe-column.wpe-column--stack {
		flex-direction: column;
	}

	/* Full-width items take a whole row */
	.wpe-column.wpe-column--flow > .wpe-item--full {
		flex: 0 0 100%;
		max-width: 100%;
	}

	/* Fixed/auto items flow horizontally */
	.wpe-column.wpe-column--flow > .wpe-item--fixed,
	.wpe-column.wpe-column--flow > .wpe-item--auto {
		flex: 0 0 auto;
		max-width: 100%;
	}

.wpe-item--full {
	width: 100%;
}

.wpe-item--fixed,
.wpe-item--auto {
	width: auto;
}

.wpe-row.wpe-row--full {
	justify-content: flex-start; /* default left-aligned */
}

/* === Content Types === */

/* Generic text block */
.af-text {
	line-height: 1.6;
	font-size: 1rem;
}

.af-light {
	padding: 15px;
	background: #f8f8f8;
}

.af-dark {
	padding: 15px;
	background: #444;
	color: #fff;
}

/* Photos */
.wpe-item-photo img {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
}

/* Captions */
.af-caption {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	background-color: #f8f8f8;
	padding: 10px;
	border-radius: 4px;
	flex-wrap: wrap;
}

/* Layout modifiers */
.af-caption--top {
	flex-direction: column;
}

.af-caption--bottom {
	flex-direction: column-reverse;
}

.af-caption--left {
	flex-direction: row;
}

.af-caption--right {
	flex-direction: row-reverse;
}

/* Image sizing */
.af-caption img {
	max-width: 100%;
	height: auto;
	display: block;
}

.af-caption--left img,
.af-caption--right img {
	max-width: 300px;
}

/* Caption text block */
.af-caption-text {
	flex: 1;
	padding: 10px;
	line-height: 1.5;
}

/* === Slideshow (basic container styling) === */
.af-slideshow {
	position: relative;
	overflow: hidden;
	width: 100%;
	margin-left: -12px;
	width: calc(100% + 36px);
	display: block;
	background-color: #fff; /* fallback background */
}

.af-slides {
	position: relative;
	width: 100%;
	height: 100%;
}

.af-slide {
	position: absolute;
	top: 0px;
	left: 0px;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 0.3s ease-in-out;
	display: flex;
	justify-content: center;
	align-items: center;
}

	.af-slide img {
		max-width: 100%;
		max-height: 100%;
		display: block;
	}

	.af-slide.is-active {
		opacity: 1;
		z-index: 1; /* keep active slide above others */
	}


/* Optional: hide prev/next/dots if you decided not to use them */
.af-prev, .af-next, .af-dots {
	display: none;
}

/* === Responsive behavior === */
@media (max-width: 768px) {
	.wpe-row {
		flex-direction: column;
		margin-left: 0;
		margin-right: 0;
	}

	/* MDR-03: neutralise desktop negative gutters on mobile so
	   centred fixed-width content aligns with the true page centre. */
	.wpe-row-inner {
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	/* Stack CMS columns, overriding the desktop inline flex-basis. */
	.wpe-row > .wpe-row-inner {
		flex-direction: column;
		flex-wrap: nowrap;
	}

		.wpe-row > .wpe-row-inner > .wpe-column {
			width: 100% !important;
			max-width: 100% !important;
			flex: 0 0 auto !important;
			min-width: 0;
			padding-left: 0;
			padding-right: 0;
		}

			.wpe-row > .wpe-row-inner > .wpe-column img {
				max-width: 100%;
				height: auto;
			}

	.af-caption--left, .af-caption--right {
		flex-direction: column;
	}

		.af-caption--left img,
		.af-caption--right img {
			max-width: 100%;
		}

	.af-text {
		padding: 0px 10px;
	}
}
