/* ==========================================================================
   Smart Post Presenter Collection – Card Styles (same .spp-* class names as Smart Post Presenter)
   All rules use the .spp-* namespace to avoid conflicts.
   Developers can override any rule via the Custom CSS field or their theme.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

.spp-post {
	box-sizing: border-box;
	overflow: hidden;
	font-family: inherit;
	color: inherit;
}

.spp-post *,
.spp-post *::before,
.spp-post *::after {
	box-sizing: inherit;
}

.spp-image img.spp-img {
	display: block;
	/* width, height and object-fit intentionally removed — set via Custom CSS */
}

.spp-body {
	padding: 1rem;
}

.spp-title {
	margin: 0 0 .5rem;
	line-height: 1.3;
}

.spp-excerpt,
.spp-content {
	margin: 0;
	line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Layout: Card – Vertical  (default, image top)
   -------------------------------------------------------------------------- */

.spp-layout-card-vertical {
	/* border and border-radius intentionally removed — use Custom CSS */
}

.spp-layout-card-vertical .spp-image {
	overflow: hidden;
}

.spp-layout-card-vertical .spp-image img.spp-img {
	/* border-radius intentionally removed */
}

/* --------------------------------------------------------------------------
   Layout: Card – Vertical (image bottom)
   -------------------------------------------------------------------------- */

.spp-layout-card-vertical-bottom {
	/* border and border-radius intentionally removed — use Custom CSS */
}

.spp-layout-card-vertical-bottom .spp-image {
	overflow: hidden;
}

.spp-layout-card-vertical-bottom .spp-image img.spp-img {
	/* border-radius intentionally removed */
}

/* --------------------------------------------------------------------------
   Layout: Card – Horizontal  (image left)
   -------------------------------------------------------------------------- */

.spp-row {
	display: flex;
	align-items: stretch;
}

.spp-layout-card-horizontal,
.spp-layout-card-horizontal-rev {
	/* border and border-radius intentionally removed — use Custom CSS */
}

.spp-layout-card-horizontal .spp-image,
.spp-layout-card-horizontal-rev .spp-image {
	flex: 0 0 40%;
	max-width: 40%;
	overflow: hidden;
}

.spp-layout-card-horizontal .spp-image img.spp-img,
.spp-layout-card-horizontal-rev .spp-image img.spp-img {
	height: 100%;
	object-fit: cover;
}

.spp-layout-card-horizontal .spp-body,
.spp-layout-card-horizontal-rev .spp-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* --------------------------------------------------------------------------
   Layout: Card – Horizontal Reversed  (image right)
   -------------------------------------------------------------------------- */

.spp-row--rev {
	flex-direction: row-reverse;
}

/* --------------------------------------------------------------------------
   Layout: Overlay  (text over image)
   -------------------------------------------------------------------------- */

.spp-layout-overlay {
	position: relative;
	background-size: cover;
	background-position: center;
	min-height: 280px;
	overflow: hidden;
	/* border-radius intentionally removed — use Custom CSS */
}

.spp-layout-overlay::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient( to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.1) 60% );
}

.spp-overlay-inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 1.5rem;
	min-height: 280px;
}

.spp-layout-overlay .spp-title,
.spp-layout-overlay .spp-excerpt,
.spp-layout-overlay .spp-content {
	color: #fff;
}

/* --------------------------------------------------------------------------
   Layout: Minimal  (no image frame, clean text block)
   -------------------------------------------------------------------------- */

.spp-layout-minimal .spp-body {
	padding: 0;
}

/* --------------------------------------------------------------------------
   Layout: Banner  (full-width image background)
   -------------------------------------------------------------------------- */

.spp-layout-banner {
	position: relative;
	background-size: cover;
	background-position: center;
	overflow: hidden;
	/* border-radius intentionally removed — use Custom CSS */
}

.spp-banner-inner {
	position: relative;
	z-index: 1;
	background: rgba(0,0,0,.5);
}

.spp-layout-banner .spp-title,
.spp-layout-banner .spp-excerpt,
.spp-layout-banner .spp-content {
	color: #fff;
}

/* --------------------------------------------------------------------------
   Responsive helpers
   -------------------------------------------------------------------------- */

@media ( max-width: 600px ) {
	.spp-row:not(.spp-row--compact) {
		flex-direction: column;
	}

	.spp-layout-card-horizontal .spp-image,
	.spp-layout-card-horizontal-rev .spp-image {
		flex: 0 0 auto;
		max-width: 100%;
	}
}


/* --------------------------------------------------------------------------
   Image Settings — applied via .spp-image wrapper classes & CSS variables
   -------------------------------------------------------------------------- */

/* Aspect ratio: img fills the wrapper completely */
.spp-img-ratio {
	overflow: hidden;
}

.spp-img-ratio img.spp-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Object-fit overrides */
.spp-img-fit-contain img.spp-img {
	object-fit: contain;
	background: #f5f5f5;
}

.spp-img-fit-fill img.spp-img {
	object-fit: fill;
}

/* Hover effects — transitions on the img */
.spp-img-hover-zoom,
.spp-img-hover-fade,
.spp-img-hover-grayscale,
.spp-img-hover-brightness,
.spp-img-hover-pan {
	overflow: hidden;
}

.spp-img-hover-zoom img.spp-img,
.spp-img-hover-fade img.spp-img,
.spp-img-hover-grayscale img.spp-img,
.spp-img-hover-brightness img.spp-img,
.spp-img-hover-pan img.spp-img {
	transition: transform .45s ease, filter .45s ease, opacity .35s ease;
	will-change: transform, filter, opacity;
}

/* Zoom In */
.spp-img-hover-zoom:hover img.spp-img {
	transform: scale(1.08);
}

/* Fade Out */
.spp-img-hover-fade:hover img.spp-img {
	opacity: .55;
}

/* Grayscale to Color */
.spp-img-hover-grayscale img.spp-img {
	filter: grayscale(100%);
}
.spp-img-hover-grayscale:hover img.spp-img {
	filter: grayscale(0%);
}

/* Brightness Lift */
.spp-img-hover-brightness:hover img.spp-img {
	filter: brightness(1.18) saturate(1.1);
}

/* Slow Pan */
.spp-img-hover-pan img.spp-img {
	transform: scale(1.08) translateX(-3%);
	transition: transform 6s ease;
}
.spp-img-hover-pan:hover img.spp-img {
	transform: scale(1.08) translateX(3%);
}

/* Color overlay via CSS custom properties set inline */
.spp-img-overlay {
	position: relative;
}

.spp-img-overlay::after {
	content: '';
	position: absolute;
	inset: 0;
	background-color: var(--spp-img-overlay, transparent);
	opacity: var(--spp-img-overlay-opacity, 0);
	pointer-events: none;
	border-radius: inherit;
	transition: opacity .3s ease;
}

/* --------------------------------------------------------------------------
   ACF Fields
   -------------------------------------------------------------------------- */

/* Wrapper for ACF fields placed in the image section.
   Set position:relative on .spp-image and use position:absolute on
   .spp-image-acf (or individual .spp-acf-image-field) to overlay content. */
.spp-image {
	position: relative;
}

.spp-image-acf {
	/* By default renders below the image in normal flow.
	   Override via Custom CSS to position over the image, e.g.:
	   .spp-image-acf { position: absolute; bottom: 0; left: 0; width: 100%; } */
}

.spp-acf-image-field {
	/* Individual image-section ACF field — override as needed */
}

.spp-acf-field {
	line-height: 1.6;
}

.spp-acf-label {
	display: inline-block;
	font-weight: 600;
	margin-right: .35em;
}

.spp-acf-field .spp-acf-img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* --------------------------------------------------------------------------
   Action Button
   -------------------------------------------------------------------------- */

/* No default styles — use the wrapper class and anchor class fields,
   then style via Custom CSS or your theme's Global CSS. */


/* Loop video clips (card layouts) */
.spp-image video.spp-video {
	display: block;
	width: 100%;
	height: auto;
}
.spp-img-ratio video.spp-video {
	height: 100%;
	object-fit: cover;
}
