/* Spurwing Accommodation Catalogue — frontend block/shortcode styles.
   v1.6.0: the compact "premium" presentation that the retired Premium UI
   companion plugin used to force over this stylesheet with !important is
   now the stylesheet itself. Every rule is scoped under .spw-acm-*; no
   !important, no element selectors, theme tokens with fallbacks. Width is
   left to the theme's constrained layout (no forced container).

   v1.6.2: ~12% more compact card. Measured on the real Greater Kruger page
   (1920px, 3 columns, 615px cards): 597px + 48px row gap -> 523px + 40px.
   Two causes were found on staging. (1) The page's own global styles
   (".sw-kruger p { margin-block: 0 20px }", ".sw-kruger h3 { margin: 0 0
   16px; font-size: clamp(23px, 2.2vw, 29px) }") outrank this sheet's
   single-class rules, so the meta line, descriptor and "View stay" link
   each carried a 20px paragraph margin and the title rendered at 29px
   instead of 23px — the rhythm below never actually applied. The card
   text rules are therefore written as ".spw-acm-catalogue .spw-acm-card__*"
   (two classes) so they win on specificity alone: still scoped, still no
   !important. (2) The rhythm itself is tightened slightly: 16:10 -> 1.618:1
   (golden-ratio) image, 13px -> 12px image-to-meta, 9px -> 8px title-to-descriptor,
   descriptor line-height 1.55 -> 1.5, 12px -> 10px descriptor-to-link,
   row gap 34-48px -> 30-40px. Nothing is hidden; 44px targets, focus
   states and reduced-motion are unchanged. */

.spw-acm-catalogue {
	--spw-acm-charcoal: var(--spurwing-charcoal, #171816);
	--spw-acm-olive: var(--spurwing-olive, #72733a);
	--spw-acm-olive-dark: var(--spurwing-olive-dark, #50522d);
	--spw-acm-cream: var(--spurwing-off-white, #f7f4ec);
	--spw-acm-stone: var(--spurwing-stone, #ddd8cc);
	--spw-acm-muted: #6b695f;
	--spw-acm-line: rgba(23, 24, 22, 0.14);
	--spw-acm-radius: 6px;
	width: 100%;
	color: var(--spw-acm-charcoal);
}

/* Filters */
.spw-acm-filters {
	display: grid;
	grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto;
	gap: 10px 12px;
	align-items: end;
	padding: 0 0 22px;
	margin: 0 0 28px;
	border-bottom: 1px solid var(--spw-acm-line);
}

.spw-acm-filter {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.spw-acm-filter > span {
	font-size: 10px;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	font-weight: 650;
	color: var(--spw-acm-muted);
}

.spw-acm-filter select {
	width: 100%;
	min-height: 44px;
	border: 1px solid rgba(23, 24, 22, 0.2);
	border-radius: 4px;
	background: #fff;
	padding: 0 34px 0 12px;
	font-size: 13px;
	color: var(--spw-acm-charcoal);
}

.spw-acm-filter select:focus-visible,
.spw-acm-filter-submit:focus-visible,
.spw-acm-filter-reset:focus-visible,
.spw-acm-card a:focus-visible,
.spw-acm-pagination a:focus-visible {
	outline: 3px solid var(--spw-acm-olive);
	outline-offset: 2px;
}

.spw-acm-filter-submit {
	min-height: 44px;
	border: 1px solid var(--spw-acm-olive);
	border-radius: 4px;
	background: var(--spw-acm-olive);
	color: #fff;
	padding: 0 20px;
	font-size: 12px;
	font-weight: 650;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease;
}

.spw-acm-filter-submit:hover {
	background: var(--spw-acm-charcoal);
	border-color: var(--spw-acm-charcoal);
}

.spw-acm-filter-reset {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--spw-acm-charcoal);
	text-decoration: none;
}

/* Result count */
.spw-acm-results-head {
	display: flex;
	justify-content: flex-end;
	margin: 0 0 24px;
}

.spw-acm-filters + .spw-acm-results-head {
	margin-top: -9px; /* tuck the count under the filter rule only when filters are shown. */
}

.spw-acm-results-head p {
	margin: 0;
	color: var(--spw-acm-muted);
	font-size: 12px;
}

/* Grid: 3 / 2 / 1 */
.spw-acm-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: clamp(20px, 2vw, 30px);
	row-gap: clamp(30px, 3vw, 40px);
	align-items: start;
}

/* Card */
.spw-acm-card {
	margin: 0;
	min-width: 0;
}

.spw-acm-card__image {
	display: block;
	aspect-ratio: 1.618 / 1;
	overflow: hidden;
	border-radius: var(--spw-acm-radius);
	background: #ebe7dc;
	text-decoration: none;
}

.spw-acm-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.spw-acm-card:hover .spw-acm-card__image img {
	transform: scale(1.02);
}

.spw-acm-card__image-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #ece8de, #ded9cb);
}

.spw-acm-catalogue .spw-acm-card__body {
	padding: 12px 2px 0;
}

.spw-acm-catalogue .spw-acm-card__meta {
	margin: 0 0 7px;
	font-size: 10px;
	line-height: 1.45;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--spw-acm-muted);
}

.spw-acm-catalogue .spw-acm-card__title {
	margin: 0 0 8px;
	font-size: clamp(18px, 1.55vw, 23px);
	line-height: 1.13;
	font-weight: 650;
	letter-spacing: -0.025em;
}

.spw-acm-card__title a {
	color: var(--spw-acm-charcoal);
	text-decoration: none;
}

.spw-acm-catalogue .spw-acm-card__descriptor {
	margin: 0;
	color: #5d5b55;
	line-height: 1.5;
	font-size: 14px;
}

.spw-acm-catalogue .spw-acm-card__link {
	margin: 10px 0 0;
	line-height: 1.3;
}

.spw-acm-card__link a {
	color: var(--spw-acm-olive-dark);
	font-size: 13px;
	line-height: 1.3;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid rgba(114, 115, 58, 0.45);
	padding-bottom: 2px;
}

.spw-acm-card__link a:hover {
	color: var(--spw-acm-olive);
}

/* Pagination */
.spw-acm-pagination {
	margin: 38px 0 0;
}

.spw-acm-pagination ul {
	display: flex;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
}

.spw-acm-pagination li {
	margin: 0;
}

.spw-acm-pagination a,
.spw-acm-pagination span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
	padding: 0 13px;
	border: 1px solid var(--spw-acm-stone);
	border-radius: 4px;
	text-decoration: none;
	color: var(--spw-acm-charcoal);
	background: #fff;
}

.spw-acm-pagination .current {
	background: var(--spw-acm-charcoal);
	border-color: var(--spw-acm-charcoal);
	color: #fff;
}

.spw-acm-empty {
	padding: 36px 0;
	border-top: 1px solid var(--spw-acm-stone);
}

@media (prefers-reduced-motion: reduce) {
	.spw-acm-card__image img,
	.spw-acm-filter-submit {
		transition: none;
	}
	.spw-acm-card:hover .spw-acm-card__image img {
		transform: none;
	}
}

@media (max-width: 980px) {
	.spw-acm-filters {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.spw-acm-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.spw-acm-filters {
		grid-template-columns: 1fr;
	}
	.spw-acm-grid {
		grid-template-columns: 1fr;
		gap: 28px;
	}
	.spw-acm-card__image {
		aspect-ratio: 4 / 3;
	}
	.spw-acm-catalogue .spw-acm-card__title {
		font-size: 22px;
	}
	.spw-acm-results-head {
		justify-content: flex-start;
		margin-top: 0;
	}
}

/* v1.8.0: the catalogue is an in-page anchor (#spw-catalogue). A filter or page change lands the
   visitor back here; keep the landing clear of any fixed header and make the focused count quiet. */
.spw-acm-catalogue {
	scroll-margin-top: clamp(72px, 10vh, 120px);
}
.spw-acm-results-count:focus {
	outline: none;
}
.spw-acm-results-count:focus-visible {
	outline: 2px solid var(--spw-acm-olive);
	outline-offset: 4px;
	border-radius: 2px;
}
.spw-acm-results-page {
	color: var(--spw-acm-muted);
}
