/* ============================================================
   AEC Testimonials — Frontend Wall Styles
   Inspired by senja.io — masonry card wall
   ============================================================ */

/* ── Design tokens ────────────────────────────────────────── */
.aec-wall {
	--aec-cols: 3;
	--aec-gap: 1.25rem;
	--aec-radius: 14px;
	--aec-card-bg: #ffffff;
	--aec-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.06);
	--aec-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.11), 0 12px 32px rgba(0, 0, 0, 0.09);

	--aec-text: #111827;
	--aec-muted: #6b7280;
	--aec-star-on: #f59e0b;
	--aec-star-off: #e5e7eb;
	--aec-accent: #339f88;
	font-family: inherit;
	color: var(--aec-text);
	background: transparent;
	/* never paint a section background */
}

/* ── Wall title ───────────────────────────────────────────── */

.aec-wall__title {
	text-align: center;
	font-size: clamp(1.4rem, 3vw, 2rem);
	font-weight: 700;
	margin: 0 0 2rem;
	color: var(--aec-text);
}

/* ── Controls (filter + sort) ──────────────────────────────── */

.aec-controls {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem 1rem;
	align-items: center;
	margin-bottom: 2rem;
	padding: 0;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

/* ── Filter bar ───────────────────────────────────────────── */

.aec-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	justify-content: center;
	flex: 1 1 100%;
	margin: 0;
}

.aec-filter-btn {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .45rem 1.1rem;
	border: 1.5px solid #dbe1e8;
	border-radius: 999px;
	background: transparent;
	/* pills are ghost by default — no white strip */
	font-size: .875rem;
	font-weight: 500;
	color: var(--aec-muted);
	cursor: pointer;
	line-height: 1;
	transition: border-color .2s, color .2s, background .2s, box-shadow .2s;
}

.aec-filter-btn:hover {
	border-color: var(--aec-accent);
	color: var(--aec-accent);
	background: rgba(51, 159, 136, 0.05);
}


.aec-filter-btn.active {
	background: var(--aec-accent);
	border-color: var(--aec-accent);
	color: #fff;
	box-shadow: 0 2px 8px rgba(51, 159, 136, .35);
}

/* Source icon inside filter pill */
.aec-filter-btn .aec-source-icon {
	display: inline-flex;
	align-items: center;
}

.aec-filter-btn .aec-source-icon svg {
	width: 14px;
	height: 14px;
}

/* Keep coloured logos visible on active (white) background */
.aec-filter-btn.active .aec-source-icon svg path[fill="currentColor"],
.aec-filter-btn.active .aec-source-icon svg path:not([fill]) {
	fill: #fff;
}

/* ── Sort dropdown ────────────────────────────────────────── */

.aec-sort {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	width: 100%;
	justify-content: flex-end;
	margin: 0;
}

.aec-sort__field {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.aec-sort__label {
	font-size: .875rem;
	color: var(--aec-muted);
}

.aec-sort__select {
	padding: .5rem 2rem .5rem .95rem;
	border: 1.5px solid #d1d5db;
	border-radius: 999px;
	background: #fff;
	font-size: .875rem;
	font-weight: 600;
	color: var(--aec-text);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	display: block;
	line-height: 1.2;
	min-height: 2.25rem;
	min-width: 11.5rem;
}

.aec-sort__select:focus {
	outline: 2px solid rgba(51, 159, 136, .35);
	outline-offset: 2px;
	border-color: var(--aec-accent);
}

.aec-sort__chevron {
	position: absolute;
	right: .8rem;
	pointer-events: none;
	font-size: .7rem;
	color: #6b7280;
}

/* ── Load more ────────────────────────────────────────────── */

.aec-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: .5rem;
}

.aec-load-more {
	padding: .6rem 1.4rem;
	border-radius: 999px;
	border: 1.5px solid var(--aec-accent);
	background: transparent;
	color: var(--aec-accent);
	font-weight: 600;
	cursor: pointer;
	transition: background .2s, color .2s, box-shadow .2s;
}

.aec-load-more:hover {
	background: var(--aec-accent);
	color: #fff;
	box-shadow: 0 8px 20px rgba(51, 159, 136, .25);
}

.aec-load-more[hidden] {
	display: none;
}

/* ── Marquee layout ───────────────────────────────────────── */

/*
 * Breaks out of the WordPress content column to span full viewport width.
 * The inner .aec-marquee track still clips and fades edges with a mask.
 */
.aec-wall--marquee {
	width: 100vw;
	margin-left: calc(50% - 50vw);
	padding: 2.5rem 0;
	overflow: hidden;
	/* Fade cards in/out at both edges */
	-webkit-mask-image: linear-gradient(to right,
			transparent 0%,
			black 8%,
			black 92%,
			transparent 100%);
	mask-image: linear-gradient(to right,
			transparent 0%,
			black 8%,
			black 92%,
			transparent 100%);
}

/* Title still needs normal content width when placed above the marquee */
.aec-wall--marquee .aec-wall__title {
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
	padding: 0 1.25rem;
}

.aec-marquee {
	display: flex;
	gap: 1.25rem;
	width: max-content;
	animation: aec-marquee-scroll 55s linear infinite;
}

/* Pause on hover so readers can focus on a card */
.aec-marquee:hover {
	animation-play-state: paused;
}

@keyframes aec-marquee-scroll {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.aec-marquee {
		animation: none;
	}
}

/* ── Marquee card (Senja-style) ───────────────────────────── */

.aec-card--marquee {
	width: 300px;
	flex-shrink: 0;
	margin-bottom: 0;
	padding: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	border-radius: var(--aec-radius);
	/* Gradient border: white bg inside, subtle colour gradient at the 1.5px edge */
	background:
		linear-gradient(#fff, #fff) padding-box,
		linear-gradient(135deg, #dbeafe 0%, #ede9fe 50%, #fce7f3 100%) border-box;
	border: 1.5px solid transparent;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.25s, transform 0.25s;
}


.aec-card--marquee:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, .10), 0 16px 40px rgba(0, 0, 0, .07);
	transform: translateY(-4px);
}

/* Top image / video-thumb area */
.aec-card--marquee .aec-card__media {
	width: 100%;
	height: 180px;
	flex-shrink: 0;
	overflow: hidden;
	border-radius: calc(var(--aec-radius) - 1px) calc(var(--aec-radius) - 1px) 0 0;
}

.aec-card--marquee .aec-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Coloured initial block when there's no photo */
.aec-card--marquee .aec-card__media--initials {
	background: var(--aec-avatar-bg, var(--aec-accent));
	display: flex;
	align-items: center;
	justify-content: center;
}

.aec-card--marquee .aec-card__media--initials span {
	font-size: 2.75rem;
	font-weight: 700;
	color: rgba(255, 255, 255, .85);
	text-transform: uppercase;
	letter-spacing: .05em;
}

/* Body wrapper: quote + divider + footer */
.aec-card--marquee .aec-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.1rem 1.25rem 1.2rem;
}

/* Quote text — clamped to 4 lines */
.aec-card--marquee .aec-card__text {
	flex: 1;
	font-size: .875rem;
	line-height: 1.65;
	color: #374151;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Thin rule separating quote from author line */
.aec-card--marquee .aec-card__divider {
	border: none;
	border-top: 1px solid #f3f4f6;
	margin: .9rem 0 .75rem;
}

.aec-card--marquee .aec-card__foot {
	font-size: .8125rem;
}

.aec-card--marquee .aec-card__name {
	font-weight: 700;
	color: var(--aec-text);
}

.aec-card--marquee .aec-card__sep {
	color: var(--aec-muted);
	margin: 0 .2rem;
}

.aec-card--marquee .aec-card__meta {
	color: var(--aec-accent);
	font-style: italic;
}

/* ── SliderText layout (Swiper carousel, text-only) ──────── */

.aec-wall--sliderText .aec-swiper--text {
	width: 100%;
	padding-bottom: 3rem;
	/* space for pagination dots */
	overflow: hidden;
}

.aec-wall--sliderText .swiper-slide {
	height: auto;
}

/* Swiper accent colours */
.aec-wall--sliderText .swiper-button-prev,
.aec-wall--sliderText .swiper-button-next {
	color: var(--aec-accent);
}

.aec-wall--sliderText .swiper-button-prev::after,
.aec-wall--sliderText .swiper-button-next::after {
	font-size: 1.25rem;
	font-weight: 700;
}

.aec-wall--sliderText .swiper-pagination-bullet-active {
	background: var(--aec-accent);
}

/* ── Slider card ──────────────────────────────────────────── */

.aec-card--slider {
	height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--aec-card-bg);
	border-radius: var(--aec-radius);
	border: 1.5px solid transparent;
	box-shadow: var(--aec-shadow);
	overflow: hidden;
	break-inside: unset;
	margin-bottom: 0;
	transition: box-shadow .25s, transform .25s, border-color .25s;
}

.aec-card--slider:hover {
	box-shadow: var(--aec-shadow-hover);
	border-color: var(--aec-accent);
	transform: translateY(-4px);
}

/* Banner image fills the top of the card */
.aec-card--slider .aec-card__media {
	width: 100%;
	height: 180px;
	flex-shrink: 0;
	overflow: hidden;
}

.aec-card--slider .aec-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s;
}

.aec-card--slider:hover .aec-card__media img {
	transform: scale(1.04);
}

/* Coloured initials block when no photo */
.aec-card--slider .aec-card__media--initials {
	background: var(--aec-avatar-bg, var(--aec-accent));
	display: flex;
	align-items: center;
	justify-content: center;
}

.aec-card--slider .aec-card__media--initials span {
	font-size: 2.5rem;
	font-weight: 700;
	color: rgba(255, 255, 255, .85);
	text-transform: uppercase;
	letter-spacing: .04em;
}

/* Content area below the image */
.aec-card--slider .aec-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.25rem;
}

.aec-card--slider .aec-card__stars {
	display: flex;
	gap: 1px;
	font-size: 1rem;
	line-height: 1;
	margin-bottom: .75rem;
}

.aec-card--slider .aec-card__text {
	flex: 1;
	font-size: .9375rem;
	line-height: 1.7;
	color: var(--aec-text);
	margin: 0;
	word-break: break-word;
	overflow-wrap: break-word;
}

.aec-card--slider .aec-card__divider {
	border: none;
	border-top: 1px solid #f3f4f6;
	margin: 1rem 0 .8rem;
}

.aec-card--slider .aec-card__foot {
	font-size: .875rem;
}

/* Name on the left, source badge on the right */
.aec-card--slider .aec-card__name-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
}

.aec-card--slider .aec-card__name {
	font-weight: 700;
	color: var(--aec-text);
	font-size: .875rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aec-card--slider .aec-card__name a {
	color: inherit;
	text-decoration: none;
}

.aec-card--slider .aec-card__name a:hover {
	text-decoration: underline;
}

.aec-card--slider .aec-card__meta {
	display: block;
	font-size: .8125rem;
	color: var(--aec-muted);
	margin-top: 2px;
}

.aec-card--slider .aec-card__date {
	display: block;
	font-size: .75rem;
	color: var(--aec-muted);
	margin-top: 3px;
}

/* ── CentreSection layout ─────────────────────────────────── */

/* Constrain to a comfortable reading/viewing width */
.aec-wall--centreSection {
	max-width: 860px;
	margin-left: auto;
	margin-right: auto;
}

/* ── Featured player ── */
.aec-centre__stage {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	background: transparent;
	margin-bottom: 1.5rem;
	overflow: visible;
}

.aec-centre__player {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 16px;
	flex: 1 1 0;
	min-width: 0;
}

/* ── Mini quote card (beside video) ── */
.aec-centre__quote-card {
	flex: 0 0 360px;
	align-self: center;
	background: #ecfdf5;
	border-radius: 16px;
	padding: .75rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: .35rem;
}

.aec-centre__quote-card-mark {
	font-size: 1.75rem;
	line-height: 1;
	color: #16a34a;
	font-family: Georgia, 'Times New Roman', serif;
	display: block;
	margin-bottom: -.1rem;
}

.aec-centre__quote-card-text {
	font-size: .9375rem;
	line-height: 1.55;
	color: #14532d;
	font-style: italic;
	margin: 0;
}

.aec-centre__quote-card-name {
	font-size: .8125rem;
	font-weight: 700;
	color: #166534;
	font-style: normal;
	display: flex;
	align-items: center;
	gap: .4rem;
	margin-top: .2rem;
}

.aec-centre__quote-card-name::before {
	content: '';
	display: inline-block;
	width: 1rem;
	height: 2px;
	background: #16a34a;
	border-radius: 1px;
	flex-shrink: 0;
}

/* Hide on mobile — the info bar below already has the quote */
@media (max-width: 680px) {
	.aec-centre__quote-card {
		display: none;
	}
}

.aec-centre__iframe,
.aec-centre__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	display: block;
	background: #000;
	outline: none;
}

.aec-centre__iframe[hidden],
.aec-centre__video[hidden] {
	display: none;
}

/* ── Author pill overlay (top-right of player) ── */
.aec-centre__author-pill {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 9;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	padding: 7px 12px 8px;
	border-radius: 20px;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.18);
	pointer-events: none; /* don't intercept video clicks */
	max-width: 55%;
}

.aec-centre__author-pill .aec-centre__stars {
	display: flex;
	gap: 1px;
	font-size: .8rem;
	line-height: 1;
	color: #f59e0b;
	margin-bottom: 0;
}

.aec-centre__author-pill .aec-centre__stars[hidden] {
	display: none;
}

.aec-centre__author-pill .aec-centre__name {
	font-size: .78rem;
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

/* ── Info bar ── */
.aec-centre__info {
	padding: 1.1rem 0 1.5rem;
}

.aec-centre__stars {
	display: flex;
	gap: 1px;
	font-size: 1.1rem;
	line-height: 1;
	margin-bottom: .75rem;
}

.aec-centre__stars[hidden] {
	display: none;
}

.aec-centre__author-row {
	display: flex;
	align-items: center;
	gap: .75rem;
	margin-bottom: .85rem;
}

/* Circular avatar image */
.aec-centre__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

/* Initials fallback */
.aec-centre__avatar--initials {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .8125rem;
	font-weight: 700;
	color: #fff;
}

.aec-centre__author-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.aec-centre__name {
	font-size: .9375rem;
	font-weight: 700;
	color: var(--aec-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aec-centre__role {
	font-size: .8125rem;
	color: var(--aec-muted);
}

/* Short quote excerpt below the author row */
.aec-centre__quote {
	font-size: .9375rem;
	line-height: 1.7;
	color: var(--aec-text);
	margin: 0;
	padding-left: .9rem;
	border-left: 3px solid var(--aec-accent);
	font-style: italic;
}

/* ── Thumbnail strip ── */
.aec-centre__strip {
	width: 100%;
	overflow: hidden;
}

/* Each slide sized to its content so we can use slidesPerView:"auto" */
.aec-centre__strip .swiper-slide {
	width: auto;
	flex-shrink: 0;
}

.aec-centre__thumb {
	display: block;
	/* Width is determined by the inner thumb-img aspect-ratio + fixed height.
	   portrait → narrow, landscape → wide; all thumbnails the same height. */
	width: auto;
	padding: 0;
	background: none;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	transition: border-color .2s, transform .2s;
	flex-shrink: 0;
}

.aec-centre__thumb:hover {
	border-color: var(--aec-accent);
	transform: translateY(-2px);
}

.aec-centre__thumb.is-active {
	border-color: var(--aec-accent);
	box-shadow: 0 0 0 2px var(--aec-accent);
}

.aec-centre__thumb-img {
	position: relative;
	/* Default landscape ratio; JS overrides via inline style for the actual ratio */
	aspect-ratio: 16 / 9;
	height: 90px;
	overflow: hidden;
	border-radius: 6px;
	background: #0f172a;
}

@media (max-width: 540px) {
	.aec-centre__thumb-img {
		height: 72px;
	}
}

.aec-centre__thumb-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s;
}

.aec-centre__thumb:hover .aec-centre__thumb-img img {
	transform: scale(1.06);
}

.aec-centre__thumb-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
	font-weight: 700;
	color: rgba(255, 255, 255, .85);
}

.aec-centre__thumb-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.28);
	transition: background 0.2s;
}


.aec-centre__thumb:hover .aec-centre__thumb-play,
.aec-centre__thumb.is-active .aec-centre__thumb-play {
	background: rgba(0, 0, 0, 0.45);
}


.aec-centre__thumb-play svg {
	width: 26px;
	height: 26px;
	filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .5));
}

/* Strip navigation arrows — circular with better icons */
.aec-centre__strip .swiper-button-prev,
.aec-centre__strip .swiper-button-next {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	border: 1.5px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	top: 50%;
	transform: translateY(-50%);
	transition: background .2s, border-color .2s, transform .2s;
}

.aec-centre__strip .swiper-button-prev:hover,
.aec-centre__strip .swiper-button-next:hover {
	background: var(--aec-accent);
	border-color: var(--aec-accent);
}

.aec-centre__strip .swiper-button-prev:active,
.aec-centre__strip .swiper-button-next:active {
	transform: translateY(-50%) scale(0.92);
}

.aec-centre__strip .swiper-button-prev::after,
.aec-centre__strip .swiper-button-next::after {
	font-size: .75rem;
	font-weight: 900;
}

/* ── Masonry grid (CSS columns — no JS required) ──────────── */

.aec-masonry {
	column-count: var(--aec-cols);
	column-gap: var(--aec-gap);
}

/* ── Card ─────────────────────────────────────────────────── */

.aec-card {
	break-inside: avoid;
	display: block;
	/* essential for CSS masonry */
	width: 100%;
	background: var(--aec-card-bg);
	border-radius: var(--aec-radius);
	border: 1.5px solid transparent;
	box-shadow: var(--aec-shadow);
	padding: 1.35rem;
	margin-bottom: var(--aec-gap);
	box-sizing: border-box;
	transition: box-shadow .25s, transform .25s, border-color .25s;
	animation: aec-fade-in .4s ease both;
}

.aec-card:hover {
	box-shadow: 0 10px 30px rgba(51, 159, 136, 0.45);
	border-color: #339f88;
	transform: translateY(-8px);
}

/* Stagger entrance animation for first 9 cards */
.aec-card:nth-child(1) {
	animation-delay: .04s;
}

.aec-card:nth-child(2) {
	animation-delay: .08s;
}

.aec-card:nth-child(3) {
	animation-delay: .12s;
}

.aec-card:nth-child(4) {
	animation-delay: .16s;
}

.aec-card:nth-child(5) {
	animation-delay: .20s;
}

.aec-card:nth-child(6) {
	animation-delay: .24s;
}

.aec-card:nth-child(7) {
	animation-delay: .28s;
}

.aec-card:nth-child(8) {
	animation-delay: .32s;
}

.aec-card:nth-child(n+9) {
	animation-delay: .36s;
}

/* Hidden cards (filtered out) */
.aec-card[hidden] {
	display: none !important;
}

/* ── Card head (stars + source badge) ────────────────────── */

.aec-card__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: .9rem;
	gap: .5rem;
}

.aec-card__stars {
	display: flex;
	gap: 1px;
	font-size: 1.05rem;
	line-height: 1;
}

.aec-star {
	color: var(--aec-star-off);
}

.aec-star.filled {
	color: var(--aec-star-on);
}

.aec-card__source-badge {
	flex-shrink: 0;
	display: inline-flex;
}

.aec-card__source-badge svg {
	width: 20px;
	height: 20px;
	display: block;
}

/* ── Card body text ───────────────────────────────────────── */

.aec-card__text {
	font-size: .9375rem;
	line-height: 1.7;
	color: var(--aec-text);
	margin: 0 0 1.1rem;
	/* No line-clamp — masonry layout handles varying heights naturally.
	   Text must never be truncated mid-sentence. */
	word-break: break-word;
	overflow-wrap: break-word;
}

/* ── Author row ───────────────────────────────────────────── */

.aec-card__author {
	display: flex;
	align-items: flex-start;
	/* top-align avatar with stacked text */
	gap: .75rem;
	margin-top: auto;
	/* push to bottom of card in flex/grid contexts */
}

/* Circular avatar — image */
.aec-card__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	/* Prevent avatar from being pushed down by long text */
	align-self: flex-start;
}

/* Circular avatar — initials fallback */
.aec-card__avatar--initials {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .8125rem;
	font-weight: 700;
	color: #fff;
	user-select: none;
	align-self: flex-start;
}

/* Info block fills remaining space; date lives inside here */
.aec-card__author-info {
	display: flex;
	flex-direction: column;
	gap: 1px;
	flex: 1;
	min-width: 0;
	/* prevents overflow from pushing avatar off screen */
}

.aec-card__name {
	font-size: .875rem;
	font-weight: 700;
	color: var(--aec-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: block;
}

.aec-card__name a {
	color: inherit;
	text-decoration: none;
}

.aec-card__name a:hover {
	text-decoration: underline;
}

.aec-card__meta {
	font-size: .8125rem;
	color: var(--aec-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Date sits below name + role inside the info block — no floating right */
.aec-card__date {
	font-size: .75rem;
	color: var(--aec-muted);
	margin-top: 2px;
}

/* ── Text card head: avatar+name/stars left, source badge right ── */

/* The head in text cards now contains the full author block */
.aec-card:not(.aec-card--video) .aec-card__head {
	align-items: center;
}

/* Author block (left side of head) — avatar + stacked name/stars */
.aec-card:not(.aec-card--video) .aec-card__author {
	display: flex;
	align-items: center;
	gap: .65rem;
	flex: 1;
	min-width: 0;
	margin-top: 0;
}

/* Stack name above stars */
.aec-card:not(.aec-card--video) .aec-card__author-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

/* Stars sit below the name in text cards */
.aec-card:not(.aec-card--video) .aec-card__stars {
	font-size: 1rem;
	line-height: 1;
	display: flex;
	gap: 1px;
}

/* Testimonial title — bold, slightly larger than body text */
.aec-card__testimonial-title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--aec-text);
	margin: .9rem 0 .4rem;
	line-height: 1.4;
}

/* Date at bottom of card, centered */
.aec-card__date--bottom {
	display: block;
	text-align: center;
	font-size: .75rem;
	color: var(--aec-muted);
	margin-top: 1rem;
	padding-top: .75rem;
	border-top: 1px solid #f3f4f6;
}

/* ── Gallery images inside card ───────────────────────────── */

.aec-card__gallery {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	margin-top: 1rem;
}

.aec-card__gallery--single {
	grid-template-columns: 1fr;
}

.aec-card__gallery-img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}

/* ── Video card ───────────────────────────────────────────── */

.aec-card--video .aec-card__video {
	position: relative;
	border-radius: calc(var(--aec-radius) - 4px);
	overflow: hidden;
	margin-bottom: 1rem;
	background: #0f172a;
	aspect-ratio: 16 / 9;
}

.aec-card__video-thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
	/* never intercept clicks — play button must receive them */
	transition: opacity .2s, transform .3s;
}

.aec-card--video:hover .aec-card__video-thumb {
	opacity: 0.85;
	transform: scale(1.02);
}


.aec-card__video-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.aec-card__video--portrait {
	aspect-ratio: 9 / 16 !important;
	max-width: 280px;
	margin: 0 auto 1.25rem;
}


.aec-card__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}

.aec-card__play svg {
	width: 56px;
	height: 56px;
	filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .5));
	transition: transform .2s;
}

.aec-card__play:hover svg {
	transform: scale(1.12);
}

/* ── Video modal ──────────────────────────────────────────── */

.aec-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.aec-modal[hidden] {
	display: none;
}

.aec-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
	backdrop-filter: blur(6px);

	-webkit-backdrop-filter: blur(6px);
}

.aec-modal__content {
	position: relative;
	width: min(900px, 96vw);
	aspect-ratio: 16 / 9;
	z-index: 1;
	animation: aec-modal-in .25s ease both;
}

.aec-modal__iframe {
	width: 100%;
	height: 100%;
	border: none;
	border-radius: 10px;
	display: block;
}

/* MP4 direct video inside modal */
.aec-modal__video {
	width: 100%;
	height: 100%;
	border-radius: 10px;
	display: block;
	background: #000;
	outline: none;
}

/* CSS display:block above overrides the HTML hidden attribute — restore it explicitly */
.aec-modal__iframe[hidden],
.aec-modal__video[hidden] {
	display: none;
}

.aec-modal__close {
	position: absolute;
	top: -2.75rem;
	right: 0;
	background: none;
	border: none;
	color: rgba(255, 255, 255, .8);
	font-size: 2.25rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	transition: color .2s, transform .2s;
}

.aec-modal__close:hover {
	color: #fff;
	transform: scale(1.15);
}

/* ── Empty state ──────────────────────────────────────────── */

.aec-empty {
	text-align: center;
	color: var(--aec-muted);
	padding: 3rem 1rem;
	font-size: .9375rem;
}

/* ── Animations ───────────────────────────────────────────── */

@keyframes aec-fade-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes aec-modal-in {
	from {
		opacity: 0;
		transform: scale(.95);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* ── Grid layout (layout="grid") ─────────────────────────── */
/*
 * When layout="grid" the masonry container switches to CSS Grid,
 * giving equal-height columns instead of the staggered masonry look.
 */

.aec-wall--grid .aec-masonry {
	/* Reset CSS columns so they don't fight the grid */
	column-count: unset;
	column-width: unset;
	/* Switch to grid */
	display: grid;
	grid-template-columns: repeat(var(--aec-cols), 1fr);
	gap: var(--aec-gap);
}

.aec-wall--grid .aec-card {
	display: flex;
	/* use flex so author row can pin to bottom */
	flex-direction: column;
	break-inside: unset;
	/* not needed in grid */
	margin-bottom: 0;
	/* gap handles spacing in grid */
}

.aec-wall--grid .aec-card__author {
	margin-top: auto;
	/* pushes author row to card bottom regardless of text length */
}

/* ── Carousel layout (layout="carousel" — powered by Swiper.js) ──── */

.aec-wall--carousel .aec-swiper {
	width: 100%;
	padding-bottom: 3rem;
	/* space for pagination dots */
	overflow: hidden;
	/* Swiper manages its own overflow */
}

/* Cards inside Swiper slides fill the slide height */
.aec-wall--carousel .swiper-slide {
	height: auto;
}

.aec-wall--carousel .aec-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	break-inside: unset;
	margin-bottom: 0;
}

.aec-wall--carousel .aec-card__author {
	margin-top: auto;
}

/* Swiper prev/next arrows — accent colour */
.aec-wall--carousel .swiper-button-prev,
.aec-wall--carousel .swiper-button-next {
	color: var(--aec-accent);
}

.aec-wall--carousel .swiper-button-prev::after,
.aec-wall--carousel .swiper-button-next::after {
	font-size: 1.25rem;
	font-weight: 700;
}

/* Swiper pagination bullets — accent colour */
.aec-wall--carousel .swiper-pagination-bullet-active {
	background: var(--aec-accent);
}

/* Circular arrows — carousel */
.aec-wall--carousel .swiper-button-prev,
.aec-wall--carousel .swiper-button-next {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
	border: 1.5px solid #e5e7eb;
	color: var(--aec-accent);
	transition: background .2s, box-shadow .2s, transform .2s;
}

.aec-wall--carousel .swiper-button-prev:hover,
.aec-wall--carousel .swiper-button-next:hover {
	background: var(--aec-accent);
	color: #fff;
	box-shadow: 0 4px 16px rgba(51, 159, 136, .35);
	border-color: var(--aec-accent);
}

.aec-wall--carousel .swiper-button-prev:active,
.aec-wall--carousel .swiper-button-next:active {
	transform: scale(0.92);
}

.aec-wall--carousel .swiper-button-prev::after,
.aec-wall--carousel .swiper-button-next::after {
	font-size: .85rem;
	font-weight: 900;
}

/* Circular arrows — sliderText */
.aec-wall--sliderText .swiper-button-prev,
.aec-wall--sliderText .swiper-button-next {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
	border: 1.5px solid #e5e7eb;
	color: var(--aec-accent);
	transition: background .2s, box-shadow .2s, transform .2s;
}

.aec-wall--sliderText .swiper-button-prev:hover,
.aec-wall--sliderText .swiper-button-next:hover {
	background: var(--aec-accent);
	color: #fff;
	box-shadow: 0 4px 16px rgba(51, 159, 136, .35);
	border-color: var(--aec-accent);
}

.aec-wall--sliderText .swiper-button-prev:active,
.aec-wall--sliderText .swiper-button-next:active {
	transform: scale(0.92);
}

.aec-wall--sliderText .swiper-button-prev::after,
.aec-wall--sliderText .swiper-button-next::after {
	font-size: .85rem;
	font-weight: 900;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 540px) {
	.aec-controls {
		gap: .5rem .75rem;
	}

	.aec-filter-bar {
		justify-content: flex-start;
	}

	.aec-sort {
		justify-content: flex-end;
	}

	.aec-masonry {
		column-count: 1 !important;
	}

	.aec-wall--grid .aec-masonry {
		grid-template-columns: 1fr !important;
	}
}

@media (min-width: 541px) and (max-width: 820px) {
	.aec-masonry {
		column-count: min(2, var(--aec-cols)) !important;
	}

	.aec-wall--grid .aec-masonry {
		grid-template-columns: repeat(min(2, var(--aec-cols)), 1fr) !important;
	}
}

/* ── Portrait video player ──────────────────────────────────── */
/* aspect-ratio and max-width are driven dynamically via inline style by JS.
   This class only provides the centering and the CSS fallback ratio for the
   brief window before JS fires (PHP-detected portrait). */

.aec-centre__player--portrait {
	aspect-ratio: 9 / 16; /* overridden by inline style once JS fires */
	margin: 0 auto;
	/* max-width intentionally not set here — JS sets it precisely per video */
}

/* ── Fix 3: YouTube-style custom controls ──────────────────── */

.aec-ctrl {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	z-index: 10;
	opacity: 1;
	transition: opacity .25s;
	pointer-events: auto;
}

.aec-ctrl.is-hidden {
	opacity: 0;
	pointer-events: none;
}

.aec-ctrl__gradient {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 80px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
	pointer-events: none;

	z-index: -1;
	border-radius: 0 0 10px 10px;
}

.aec-ctrl__btn {
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	flex-shrink: 0;
	border-radius: 4px;
	transition: background .15s;
}

.aec-ctrl__btn:hover {
	background: rgba(255, 255, 255, .15);
}

.aec-ctrl__icon {
	width: 20px;
	height: 20px;
	display: block;
	fill: currentColor;
}

/* Show pause icon when playing, play icon when paused */
.aec-ctrl__icon--pause {
	display: none;
}

.aec-ctrl.is-playing .aec-ctrl__icon--play {
	display: none;
}

.aec-ctrl.is-playing .aec-ctrl__icon--pause {
	display: block;
}

/* Show muted icon when muted */
.aec-ctrl__icon--muted {
	display: none;
}

.aec-ctrl.is-muted .aec-ctrl__icon--vol {
	display: none;
}

.aec-ctrl.is-muted .aec-ctrl__icon--muted {
	display: block;
}

/* Seek bar */
.aec-ctrl__seek-wrap {
	position: relative;
	flex: 1;
	height: 4px;
	background: rgba(255, 255, 255, .25);
	border-radius: 2px;
	cursor: pointer;
	margin: 0 2px;
}

.aec-ctrl__seek {
	position: absolute;
	inset: -6px 0;
	width: 100%;
	height: calc(100% + 12px);
	opacity: 0;
	cursor: pointer;
	margin: 0;
}

.aec-ctrl__progress {
	height: 100%;
	background: var(--aec-accent);
	border-radius: 2px;
	pointer-events: none;
	max-width: 100%;
	transition: width .1s linear;
}

.aec-ctrl__seek-wrap:hover .aec-ctrl__progress {
	background: #fff;
}

/* Time display */
.aec-ctrl__time {
	font-size: .7rem;
	color: rgba(255, 255, 255, .85);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	letter-spacing: .02em;
	flex-shrink: 0;
}

/* ── Strip thumbnails: dynamic aspect ratio ─────────────────── */
/* The JS sets inline aspect-ratio on .aec-centre__thumb-img to match the
   actual video dimensions, so landscape and portrait thumbnails all share
   the same height but have the correct width automatically. */

.aec-centre__thumb[data-orientation="portrait"] .aec-centre__thumb-img {
	/* Fallback for PHP-detected portrait when JS hasn't run yet */
	aspect-ratio: 9 / 16;
}

/* ── Marquee Portrait ── */
.aec-card--marquee[data-orientation="portrait"] {
	width: 200px;
}

.aec-card--marquee[data-orientation="portrait"] .aec-card__media {
	height: 320px;
}