/*!
 * SmartUpWorld Post Slider 1.1.0 — front-end styles
 * License: GPLv2 or later
 *
 * Every rule is scoped to .suwps-slider. Properties that themes commonly
 * restyle on headings, links, images and buttons carry !important so the
 * slider looks the same on every theme. Colours are CSS variables: change
 * them in Post Slider → Settings, or override the variables in your theme.
 */

/* ── Variables & wrapper ────────────────────────────────────────────────── */

.suwps-slider {
	--suwps-accent: #9b6b3a;
	--suwps-more-bg: rgba(255, 255, 255, 0.18);
	--suwps-more-text: #fff;
	--suwps-more-hover-bg: var(--suwps-accent);
	--suwps-arrow-bg: rgba(255, 255, 255, 0.55);
	--suwps-arrow-icon: #333;
	--suwps-dot: #8c8c8c;
	--suwps-gap: 20px;
	--suwps-card-height: 320px;

	position: relative;
	clear: both;
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	margin: 0;
	padding: 50px 0 30px;
}

.suwps-slider *,
.suwps-slider *::before,
.suwps-slider *::after {
	box-sizing: border-box;
}

.suwps-slider .suwps-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ── Section header (optional) ──────────────────────────────────────────── */
/* Title and subtitle keep the theme's own text colours, so they stay readable on any background. */

.suwps-slider .suwps-header {
	margin: 0 0 36px;
	text-align: center;
}

.suwps-slider .suwps-eyebrow {
	display: table;
	margin: 0 auto 16px;
	padding: 6px 18px;
	border-radius: 50px;
	background: var(--suwps-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.5;
	text-transform: uppercase;
}

.suwps-slider .suwps-title {
	display: block;
	margin: 0 0 12px !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	font-size: 48px !important;
	font-weight: 700 !important;
	letter-spacing: normal !important;
	line-height: 1.25 !important;
	text-align: center !important;
	text-transform: none !important;
}

.suwps-slider .suwps-title--underline::after {
	content: "";
	display: block;
	width: 52px;
	height: 3px;
	margin: 10px auto 0;
	border-radius: 2px;
	background: linear-gradient(to right, transparent, var(--suwps-accent), transparent);
}

.suwps-slider .suwps-subtitle {
	max-width: 640px;
	margin: 14px auto 0 !important;
	padding: 0 !important;
	font-size: 15px !important;
	line-height: 1.6 !important;
}

/* ── Carousel frame ─────────────────────────────────────────────────────── */

.suwps-slider .suwps-carousel {
	position: relative;
	width: 100%;
	container-type: inline-size;
}

.suwps-slider .suwps-stage {
	position: relative;
}

.suwps-slider .suwps-viewport {
	overflow: hidden;
}

/* Before the script loads: a native, swipeable row. Same layout, so nothing jumps. */
.suwps-slider:not(.is-ready) .suwps-viewport {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.suwps-slider:not(.is-ready) .suwps-viewport::-webkit-scrollbar {
	display: none;
}

.suwps-slider .suwps-track {
	display: flex;
	margin: 0;
	margin-inline-start: calc(var(--suwps-gap) * -1);
	padding: 0;
	backface-visibility: hidden;
	touch-action: pan-y pinch-zoom;
}

.suwps-slider .suwps-slide {
	flex: 0 0 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	padding-inline-start: var(--suwps-gap);
	scroll-snap-align: start;
}

/* Cards per view follow the slider's own width, not the window's. */
@container (min-width: 600px) {
	.suwps-slider .suwps-slide {
		flex-basis: 50%;
	}
}

@container (min-width: 900px) {
	.suwps-slider .suwps-slide {
		flex-basis: 33.3333%;
	}
}

@supports not (container-type: inline-size) {
	@media (min-width: 600px) {
		.suwps-slider .suwps-slide {
			flex-basis: 50%;
		}
	}

	@media (min-width: 900px) {
		.suwps-slider .suwps-slide {
			flex-basis: 33.3333%;
		}
	}
}

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

.suwps-slider .suwps-card {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: var(--suwps-card-height);
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden;
	border: 0 !important;
	border-radius: 0;
	background: #111 !important;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
	transition: box-shadow 0.3s ease;
}

.suwps-slider .suwps-card:hover,
.suwps-slider .suwps-card:focus-within {
	box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
}

.suwps-slider .suwps-card-media {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: -1;
	overflow: hidden;
}

/* Image shading, as in the design … */
.suwps-slider .suwps-card-media::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 45%, rgba(0, 0, 0, 0.1) 100%);
}

/* … and a little deeper on hover. */
.suwps-slider .suwps-card-media::before {
	content: "";
	position: absolute;
	z-index: 1;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.33) 0%, rgba(0, 0, 0, 0.23) 50%, rgba(0, 0, 0, 0.09) 100%);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.suwps-slider .suwps-card:hover .suwps-card-media::before,
.suwps-slider .suwps-card:focus-within .suwps-card-media::before {
	opacity: 1;
}

/*
 * The photo fills the whole card, cropped to fit. These rules target any image
 * inside the image box, not a class: WebP and lazy-load plugins (Imagify, EWWW,
 * ShortPixel, WebP Express …) wrap the image in <picture> and may move its class.
 */
.suwps-slider .suwps-card-media picture,
.suwps-slider .suwps-card-media img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.suwps-slider .suwps-card-media img {
	object-fit: cover !important;
	object-position: center;
	opacity: 0.92;
	transition: transform 0.5s ease, opacity 0.3s ease;
}

.suwps-slider .suwps-card:hover .suwps-card-media img {
	opacity: 1;
	transform: scale(1.06);
}

.suwps-slider .suwps-card-noimg {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.suwps-slider .suwps-card-noimg svg {
	opacity: 0.3;
}

/* Text area. Its own soft shade keeps every line of text readable (WCAG 1.4.3). */
.suwps-slider .suwps-card-body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	margin: 0;
	padding: 72px 18px 18px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.3) 0, rgba(0, 0, 0, 0.3) calc(100% - 72px), rgba(0, 0, 0, 0.12) calc(100% - 30px), rgba(0, 0, 0, 0) 100%);
	color: #fff;
}

.suwps-slider .suwps-card-cat {
	display: inline-block;
	margin: 0 0 8px;
	padding: 3px 9px;
	border-radius: 4px;
	background: var(--suwps-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.5;
	text-transform: uppercase;
}

.suwps-slider .suwps-card-title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	margin: 0 0 10px !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	color: #fff !important;
	font-size: 18px !important;
	font-weight: 500 !important;
	letter-spacing: normal !important;
	line-height: 1.4 !important;
	text-align: start !important;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
	text-transform: none !important;
	overflow-wrap: anywhere;
}

.suwps-slider .suwps-card-link,
.suwps-slider .suwps-card-link:hover,
.suwps-slider .suwps-card-link:focus,
.suwps-slider .suwps-card-link:visited {
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	color: inherit !important;
	text-decoration: none !important;
	outline: none;
}

/* The title link stretches over the whole card, so the card is one click target. */
.suwps-slider .suwps-card-link::after {
	content: "";
	position: absolute;
	z-index: 2;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

.suwps-slider .suwps-card-link:focus::after,
.suwps-slider .suwps-card-link:focus-visible::after {
	outline: 3px solid #fff;
	outline-offset: -3px;
	box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.7);
}

.suwps-slider .suwps-card-link:focus:not(:focus-visible)::after {
	outline: none;
	box-shadow: none;
}

.suwps-slider .suwps-card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	margin: 0;
	padding: 0;
}

.suwps-slider .suwps-card-author,
.suwps-slider .suwps-card-date {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: rgba(255, 255, 255, 0.82);
	font-size: 12px;
	line-height: 1.2;
}

.suwps-slider .suwps-card-meta svg {
	flex-shrink: 0;
	opacity: 0.8;
}

.suwps-slider .suwps-card-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 12px 0 0;
	padding: 8px 13px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 20px;
	background: var(--suwps-more-bg);
	color: var(--suwps-more-text);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	line-height: 1.6;
	text-transform: uppercase;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	transition: background-color 0.25s ease, border-color 0.25s ease;
}

.suwps-slider .suwps-card-more svg {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.suwps-slider .suwps-card:hover .suwps-card-more,
.suwps-slider .suwps-card:focus-within .suwps-card-more {
	border-color: transparent;
	background: var(--suwps-more-hover-bg);
}

.suwps-slider .suwps-card:hover .suwps-card-more svg {
	transform: translateX(3px);
}

/* ── Arrows ─────────────────────────────────────────────────────────────── */

.suwps-slider .suwps-arrow {
	position: absolute;
	z-index: 3;
	top: 50%;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 15px !important;
	min-width: 0 !important;
	height: 65px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: var(--suwps-arrow-bg) !important;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18) !important;
	color: var(--suwps-arrow-icon) !important;
	font-size: 0 !important;
	line-height: 1 !important;
	text-transform: none !important;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color 0.2s ease, color 0.2s ease;
	visibility: hidden;
}

/* Invisible padding: a 25px-wide click target around the slim 15px tab (WCAG 2.5.8). */
.suwps-slider .suwps-arrow::before {
	content: "";
	position: absolute;
	top: 0;
	right: -5px;
	bottom: 0;
	left: -5px;
}

.suwps-slider .suwps-arrow--prev {
	inset-inline-start: 0;
}

.suwps-slider .suwps-arrow--next {
	inset-inline-end: 0;
}

.suwps-slider .suwps-arrow svg {
	display: block;
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	pointer-events: none;
}

[dir="rtl"] .suwps-slider .suwps-arrow svg {
	transform: scaleX(-1);
}

.suwps-slider .suwps-arrow:hover,
.suwps-slider .suwps-arrow:focus-visible {
	background: var(--suwps-accent) !important;
	color: #fff !important;
}

.suwps-slider .suwps-arrow:focus {
	outline: 2px solid var(--suwps-accent);
	outline-offset: 2px;
}

.suwps-slider .suwps-arrow:focus:not(:focus-visible) {
	outline: none;
}

.suwps-slider .suwps-arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

/* ── Pause button & dots ────────────────────────────────────────────────── */

.suwps-slider .suwps-controls {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	column-gap: 10px;
	min-height: 24px;
	margin: 16px 0 0;
	visibility: hidden;
}

.suwps-slider .suwps-controls--single {
	display: flex;
	justify-content: center;
}

.suwps-slider .suwps-pause {
	display: inline-flex !important;
	grid-column: 1;
	justify-self: end;
	align-items: center;
	justify-content: center;
	width: 24px !important;
	min-width: 0 !important;
	height: 24px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--suwps-accent) !important;
	box-shadow: none !important;
	color: #fff !important;
	font-size: 0 !important;
	line-height: 1 !important;
	cursor: pointer;
}

.suwps-slider .suwps-pause:hover {
	filter: brightness(0.88);
}

.suwps-slider .suwps-pause svg {
	display: block;
	width: 10px;
	height: 10px;
	pointer-events: none;
}

.suwps-slider .suwps-pause .suwps-icon-play,
.suwps-slider .suwps-pause.is-paused .suwps-icon-pause {
	display: none;
}

.suwps-slider .suwps-pause.is-paused .suwps-icon-play {
	display: block;
	margin-inline-start: 1px;
}

.suwps-slider .suwps-dots {
	display: flex;
	flex-wrap: wrap;
	grid-column: 2;
	align-items: center;
	justify-content: center;
}

.suwps-slider .suwps-dot {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: auto !important;
	min-width: 24px !important;
	height: 24px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 8px !important;
	border: 0 !important;
	border-radius: 12px !important;
	background: transparent !important;
	box-shadow: none !important;
	font-size: 0 !important;
	line-height: 1 !important;
	cursor: pointer;
}

.suwps-slider .suwps-dot::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	border-radius: 4px;
	background: var(--suwps-dot);
	transition: width 0.2s ease, background-color 0.2s ease;
}

.suwps-slider .suwps-dot:hover::before {
	background: var(--suwps-accent);
}

.suwps-slider .suwps-dot.is-active::before {
	width: 22px;
	background: var(--suwps-accent);
}

.suwps-slider .suwps-pause:focus,
.suwps-slider .suwps-dot:focus {
	outline: 2px solid var(--suwps-accent);
	outline-offset: 2px;
}

.suwps-slider .suwps-pause:focus:not(:focus-visible),
.suwps-slider .suwps-dot:focus:not(:focus-visible) {
	outline: none;
}

/* ── States ─────────────────────────────────────────────────────────────── */

/* Controls appear once the script is running; their space is reserved from the start. */
.suwps-slider.is-ready .suwps-arrow,
.suwps-slider.is-ready .suwps-controls {
	visibility: visible;
}

/* Everything fits on screen: nothing to slide. */
.suwps-slider.is-static .suwps-arrow,
.suwps-slider.is-static .suwps-controls {
	visibility: hidden;
}

/* ── Small screens ──────────────────────────────────────────────────────── */

@media (max-width: 599px) {
	.suwps-slider {
		--suwps-card-height: 270px;
	}

	.suwps-slider .suwps-title {
		font-size: 35px !important;
	}

	.suwps-slider .suwps-subtitle {
		font-size: 13px !important;
	}

	.suwps-slider .suwps-card-title {
		font-size: 16px !important;
	}
}

/* ── Accessibility preferences ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.suwps-slider .suwps-card,
	.suwps-slider .suwps-card-media img,
	.suwps-slider .suwps-card-media::before,
	.suwps-slider .suwps-card-more,
	.suwps-slider .suwps-card-more svg,
	.suwps-slider .suwps-arrow,
	.suwps-slider .suwps-dot::before {
		transition: none !important;
	}

	.suwps-slider .suwps-card:hover .suwps-card-media img,
	.suwps-slider .suwps-card:hover .suwps-card-more svg {
		transform: none;
	}
}

@media (forced-colors: active) {
	.suwps-slider .suwps-arrow,
	.suwps-slider .suwps-pause {
		border: 1px solid ButtonText !important;
	}

	.suwps-slider .suwps-dot::before {
		background: ButtonText;
	}

	.suwps-slider .suwps-dot.is-active::before {
		background: Highlight;
	}
}

@media print {
	.suwps-slider .suwps-arrow,
	.suwps-slider .suwps-controls {
		display: none !important;
	}
}
