﻿/**************************************
    Caption Container
**************************************/
.af-caption {
	position: relative;
	width: calc(100% - 40px);
	min-height: 240px;
	background-size: cover;
	background-position: center;
	border-radius: 0px;
	overflow: hidden;
	color: #fff;
	padding: 40px 20px;
	/* REMOVE Flexbox to allow natural flow */
	display: block;
	border-radius: 16px;
}

.wpe-link-wrapper.af-caption,
.wpe-link-wrapper .af-caption,
.wpe-link-wrapper .af-caption * {
	text-decoration: none !important;
	color: inherit !important;
}

/**************************************
    Overlay Layer (background colour)
**************************************/
.af-caption-overlay {
	position: absolute;
	inset: 0;
	padding: 30px;
	display: block;
	/* Always define transitions here — NEVER on hover */
	transition: background-color 0.35s ease, filter 0.35s ease;
	/* Base brightness */
	filter: brightness(1);
}

/* Hover → solid background + darker */
.af-caption:hover .af-caption-overlay {
	background-color: var(--af-bg-solid) !important;
	filter: brightness(0.95);
}

/**************************************
    Text Styling
**************************************/
.af-caption-text {
	position: relative;
	max-width: 800px;
	z-index: 2;
}

	.af-caption-text h3 {
		font-family: Fredoka, sans-serif;
		font-size: 2.4rem;
		margin: 0 0 10px 0;
		line-height: 1.1;
		color: #fff;
		font-weight: 500;
		text-shadow: 0 2px 3px rgba(0,0,0,0.4);
	}

	.af-caption-text h4 {
		font-family: Fredoka, sans-serif;
		font-size: 1.6rem;
		font-weight: 400;
		margin: 0 0 20px 0;
		line-height: 1.1;
		color: #fff;
		text-shadow: 0 2px 3px rgba(0,0,0,0.4);
	}

.af-caption-details {
	font-size: 1.1rem;
	line-height: 1.4;
	margin-bottom: 20px;
	font-weight: 300;
	text-shadow: 0 2px 3px rgba(0,0,0,0.4);
}

/**************************************
    Button
**************************************/
.af-caption-btn {
	display: inline-block;
	padding: 16px 40px;
	border-radius: 40px;
	font-size: 1.3rem;
	font-weight: 500;
	color: #fff;
	text-decoration: none;
	width: fit-content;
	transition: background-color 0.25s ease, transform 0.15s ease;
	z-index: 2;
	position: relative;
}

	.af-caption-btn:hover {
		background-color: #222 !important;
		cursor: pointer;
	}


/**************************************
    Link wrapper when whole caption clickable
**************************************/
.af-caption-wrapper {
	text-decoration: none;
	color: inherit;
	display: block;
}

/**************************************
    Responsive
**************************************/
@media (max-width: 900px) {
	.af-caption-text h3 {
		font-size: 2.0rem;
	}

	.af-caption-text h4 {
		font-size: 1.6rem;
	}

	.af-caption-details {
		font-size: 1.1rem;
	}

	.af-caption {
		padding: 30px 20px;
	}
}

@media (max-width: 600px) {
	.af-caption-text h3 {
		font-size: 2rem;
	}

	.af-caption-text h4 {
		font-size: 1.4rem;
	}

	.af-caption-details {
		font-size: 1rem;
	}
}
