/* Sweven Off-Plan Listings. Fonts inherit from the theme; colour comes from the accent setting. */
.swo {
	--swo-accent: #1f3a5f;
	--swo-ink: #1a1d21;
	--swo-muted: #5f6670;
	--swo-line: #e3e5e8;
	--swo-soft: #f5f6f7;
	--swo-surface: #ffffff;
	--swo-scale: 1;
	font: inherit;
	line-height: 1.5;
	color: var(--swo-ink);
}

/* Font chosen in settings wins over the theme's heading and paragraph fonts. */
.swo.swo-has-font,
.swo.swo-has-font *:not(.dashicons):not([class*="icon"]) {
	font-family: var(--swo-font) !important;
}
/* Themes often give paragraphs and lists large line heights; keep the cards tight. */
.swo p, .swo dt, .swo dd, .swo li, .swo td, .swo th { line-height: 1.45; }
.swo *, .swo *::before, .swo *::after { box-sizing: border-box; }

/* ---------- Currency ---------- */
.swo .swo-usd { display: none; }
.swo[data-cur="usd"] .swo-usd { display: inline; }
.swo[data-cur="usd"] .swo-aed { display: none; }
.swo-cur {
	display: inline-flex;
	border: 1px solid var(--swo-line);
	border-radius: 6px;
	overflow: hidden;
}
.swo-cur button {
	font: inherit;
	font-size: calc(0.85rem * var(--swo-scale));
	padding: 8px 12px;
	border: 0;
	background: var(--swo-surface);
	color: var(--swo-muted);
	cursor: pointer;
}
.swo-cur button[aria-pressed="true"] { background: var(--swo-accent); color: #fff; }

/* ---------- Filters ---------- */
.swo-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 16px;
	margin: 0 0 24px;
	padding: 0 0 20px;
	border-bottom: 1px solid var(--swo-line);
}
.swo-filters label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: calc(0.85rem * var(--swo-scale));
	color: var(--swo-muted);
	flex: 1 1 160px;
	max-width: 240px;
}
.swo-filters select {
	font: inherit;
	font-size: calc(0.95rem * var(--swo-scale));
	color: var(--swo-ink);
	padding: 10px 12px;
	border: 1px solid var(--swo-line);
	border-radius: 6px;
	background: var(--swo-surface);
}
.swo-bar-end { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.swo-count { margin: 0; font-size: calc(0.9rem * var(--swo-scale)); color: var(--swo-muted); }

/* ---------- Cards ---------- */
.swo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
	gap: 32px 24px;
}
.swo-card { display: flex; flex-direction: column; background: var(--swo-surface); }
.swo-card[hidden] { display: none; }
.swo-media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 8px;
	background: #eef0f2;
}
.swo-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}
.swo-card:hover .swo-media img { transform: scale(1.03); }
.swo-media-fallback {
	display: flex;
	align-items: flex-end;
	height: 100%;
	padding: 16px;
	font-size: calc(1.1rem * var(--swo-scale));
	font-weight: 600;
	color: #fff;
	background: var(--swo-accent);
}
.swo-flag {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 10px;
	font-size: calc(0.8rem * var(--swo-scale));
	font-weight: 600;
	color: var(--swo-ink);
	background: #fff;
	border-radius: 4px;
}
.swo-body { display: flex; flex-direction: column; flex: 1; padding: 14px 2px 0; }
.swo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.swo-logo {
	width: 44px;
	height: 44px;
	object-fit: contain;
	border: 1px solid var(--swo-line);
	border-radius: 6px;
	background: #fff;
	padding: 3px;
	flex: none;
}
.swo-name { margin: 0 0 4px; font-size: calc(1.2rem * var(--swo-scale)); line-height: 1.3; }
.swo-name a, .swo-media, .swo-g { color: inherit; text-decoration: none !important; }
.swo-name a:hover { color: var(--swo-accent); }
.swo-where { margin: 0 0 12px; font-size: calc(0.95rem * var(--swo-scale)); color: var(--swo-muted); }
.swo-dev { display: block; margin-top: 2px; font-size: calc(0.85rem * var(--swo-scale)); }
.swo-price { margin: 0 0 12px; font-size: calc(1.35rem * var(--swo-scale)); font-weight: 700; color: var(--swo-accent); }
.swo-from { font-size: calc(0.85rem * var(--swo-scale)); font-weight: 400; color: var(--swo-muted); }
.swo-facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 20px;
	margin: 0 0 16px;
	padding: 12px 0 0;
	border-top: 1px solid var(--swo-line);
}
.swo-facts div, .swo-keyfacts div, .swo-side-facts div { margin: 0; }
.swo-facts dt { font-size: calc(0.78rem * var(--swo-scale)); color: var(--swo-muted); margin: 0; }
.swo-facts dd { font-size: calc(0.92rem * var(--swo-scale)); font-weight: 600; margin: 2px 0 0; }
.swo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: auto; }

/* ---------- Buttons and links ---------- */
.swo-btn {
	display: inline-block;
	padding: 11px 18px;
	font-size: calc(0.95rem * var(--swo-scale));
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	color: #fff !important;
	background: var(--swo-accent);
	border: 1px solid var(--swo-accent);
	border-radius: 6px;
	text-decoration: none !important;
}
.swo-btn:hover { filter: brightness(1.12); }
.swo-btn-ghost { color: var(--swo-accent) !important; background: transparent; }
.swo-btn-ghost:hover { background: var(--swo-soft); filter: none; }
.swo-btn-block { display: block; width: 100%; margin-top: 10px; }
.swo-link { font-size: calc(0.9rem * var(--swo-scale)); color: var(--swo-accent); }
.swo a:focus-visible, .swo button:focus-visible, .swo select:focus-visible {
	outline: 2px solid var(--swo-accent);
	outline-offset: 2px;
}
.swo-empty { color: var(--swo-muted); }
.swo-admin-error { padding: 12px 16px; border-left: 4px solid #b42318; background: #fef3f2; }

/* =========================================================
 * Project page
 * ======================================================= */
.swo-project { padding: 24px 0 64px; }
.swo-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.swo-crumbs { font-size: calc(0.88rem * var(--swo-scale)); color: var(--swo-muted); margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.swo-crumbs a { color: var(--swo-muted); }

.swo-ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 0 0 20px; }
.swo-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.swo-badge {
	font-size: calc(0.78rem * var(--swo-scale));
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 4px;
	background: var(--swo-soft);
	color: var(--swo-muted);
}
.swo-badge-strong { background: var(--swo-accent); color: #fff; }
.swo-title { margin: 0; font-size: calc(clamp(1.8rem, 3.6vw, 2.6rem) * var(--swo-scale)); line-height: 1.15; }
.swo-sub { margin: 8px 0 0; font-size: calc(1.05rem * var(--swo-scale)); color: var(--swo-muted); }
.swo-ph-logo {
	width: 72px;
	height: 72px;
	object-fit: contain;
	border: 1px solid var(--swo-line);
	border-radius: 8px;
	padding: 6px;
	background: #fff;
	flex: none;
}

/* Gallery: one large photo, four small. */
.swo-gallery {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	grid-template-rows: repeat(2, 1fr);
	gap: 8px;
	height: clamp(280px, 46vw, 520px);
	margin: 0 0 40px;
	border-radius: 10px;
	overflow: hidden;
}
.swo-g { position: relative; display: block; overflow: hidden; background: #eef0f2; }
.swo-g img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.swo-g:hover img { transform: scale(1.03); }
.swo-g-main { grid-row: 1 / 3; }
.swo-g-hidden { display: none; }
.swo-gallery-single { grid-template-columns: 1fr; }
.swo-gallery-three { grid-template-columns: 2fr 1fr; }
.swo-gallery-three .swo-g:nth-child(n+4) { display: none; }
.swo-gallery-single .swo-g:not(.swo-g-main) { display: none; }
.swo-g-more {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	text-align: center;
	font-weight: 600;
	color: #fff;
	background: rgba(15, 20, 28, .55);
}

/* Two columns: content and enquiry card. */
.swo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
.swo-sec { margin: 0 0 44px; }
.swo-sec h2 { font-size: calc(1.45rem * var(--swo-scale)); margin: 0 0 18px; }
.swo-sec h3 { font-size: calc(1.1rem * var(--swo-scale)); margin: 22px 0 8px; }

.swo-keyfacts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 0;
	margin: 0;
	border-top: 1px solid var(--swo-line);
}
.swo-keyfacts div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--swo-line); }
.swo-keyfacts dt { font-size: calc(0.82rem * var(--swo-scale)); color: var(--swo-muted); margin: 0; }
.swo-keyfacts dd { font-size: calc(1rem * var(--swo-scale)); font-weight: 600; margin: 4px 0 0; }

.swo-desc { line-height: 1.7; max-width: 72ch; }
.swo-desc h3:first-child { margin-top: 0; }
.swo-desc p { margin: 0 0 14px; }
.swo-desc.is-collapsed {
	max-height: 380px;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(#000 70%, transparent);
	mask-image: linear-gradient(#000 70%, transparent);
}
.swo-more {
	font: inherit;
	font-weight: 600;
	color: var(--swo-accent);
	background: none;
	border: 0;
	padding: 6px 0;
	cursor: pointer;
	text-decoration: underline;
}

.swo-table-wrap { overflow-x: auto; }
.swo-table { width: 100%; border-collapse: collapse; font-size: calc(0.95rem * var(--swo-scale)); }
.swo-table th, .swo-table td { text-align: left; padding: 14px 12px 14px 0; border-bottom: 1px solid var(--swo-line); vertical-align: middle; }
.swo-table thead th { font-size: calc(0.8rem * var(--swo-scale)); font-weight: 600; color: var(--swo-muted); }
.swo-table tbody th { font-weight: 600; }
.swo-table td:last-child { text-align: right; padding-right: 0; white-space: nowrap; }
.swo-table a { color: var(--swo-accent); font-weight: 600; }
.swo-num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.swo-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.swo-plan { border: 1px solid var(--swo-line); border-radius: 8px; padding: 18px 20px; }
.swo-plan h3 { margin: 0 0 12px; display: flex; justify-content: space-between; gap: 12px; }
.swo-plan h3 span { color: var(--swo-accent); }
.swo-plan ol { list-style: none; margin: 0; padding: 0; }
.swo-plan li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--swo-line); font-size: calc(0.95rem * var(--swo-scale)); }
.swo-plan li strong { font-variant-numeric: tabular-nums; }

.swo-amen {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 14px 20px;
}
.swo-amen li { display: flex; align-items: center; gap: 12px; font-size: calc(0.95rem * var(--swo-scale)); }
.swo-amen img { width: 28px; height: 28px; object-fit: contain; flex: none; }

.swo-map { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--swo-soft); margin: 0 0 10px; }
.swo-map iframe { width: 100%; height: 100%; border: 0; display: block; }

.swo-docs { margin: 0; padding-left: 18px; }
.swo-docs li { margin: 6px 0; }

/* Enquiry card. */
.swo-side { position: sticky; top: 100px; }
.swo-side-card { border: 1px solid var(--swo-line); border-radius: 10px; padding: 24px; background: var(--swo-surface); box-shadow: 0 6px 24px rgba(15, 20, 28, .06); }
.swo-side-label { margin: 0; font-size: calc(0.85rem * var(--swo-scale)); color: var(--swo-muted); }
.swo-side-price { margin: 2px 0 12px; font-size: calc(1.9rem * var(--swo-scale)); font-weight: 700; color: var(--swo-accent); line-height: 1.2; }
.swo-side-facts { margin: 16px 0 8px; padding: 12px 0 0; border-top: 1px solid var(--swo-line); }
.swo-side-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.swo-side-facts dt { color: var(--swo-muted); font-size: calc(0.9rem * var(--swo-scale)); margin: 0; }
.swo-side-facts dd { font-weight: 600; margin: 0; text-align: right; }
.swo-side-fp { display: block; text-align: center; margin-top: 14px; }

.swo-similar { margin-top: 24px; padding-top: 40px; border-top: 1px solid var(--swo-line); }

/* Sticky enquiry bar on phones. */
.swo-mobilebar { display: none; }

/* Lightbox. */
.swo-lb {
	width: 100vw;
	height: 100vh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(10, 12, 16, .94);
}
.swo-lb::backdrop { background: rgba(10, 12, 16, .94); }
.swo-lb[open] { display: flex; align-items: center; justify-content: center; }
.swo-lb img { max-width: calc(100vw - 120px); max-height: calc(100vh - 100px); object-fit: contain; background: #fff; }
.swo-lb button {
	position: absolute;
	font: inherit;
	font-size: calc(2rem * var(--swo-scale));
	line-height: 1;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	color: #fff;
	background: rgba(255, 255, 255, .12);
	cursor: pointer;
}
.swo-lb button:hover { background: rgba(255, 255, 255, .24); }
.swo-lb-close { top: 16px; right: 16px; }
.swo-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.swo-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.swo-lb-count { position: absolute; bottom: 16px; left: 0; right: 0; margin: 0; text-align: center; color: #fff; font-size: calc(0.9rem * var(--swo-scale)); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.swo-layout { grid-template-columns: 1fr; gap: 0; }
	.swo-side { position: static; margin: 0 0 40px; order: -1; }
}
@media (max-width: 700px) {
	.swo-filters label { max-width: none; }
	.swo-bar-end { margin-left: 0; width: 100%; justify-content: space-between; }
	.swo-wrap { padding: 0 16px; }
	.swo-ph-logo { width: 52px; height: 52px; }
	.swo-gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr; height: 420px; }
	.swo-g-main { grid-row: auto; grid-column: 1 / 3; }
	.swo-gallery .swo-g:nth-child(4), .swo-gallery .swo-g:nth-child(5) { display: none; }
	.swo-lb img { max-width: 100vw; max-height: calc(100vh - 140px); }
	.swo-lb-prev, .swo-lb-next { top: auto; bottom: 8px; transform: none; }
	.swo-project { padding-bottom: 96px; }
	.swo-mobilebar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 999;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
		background: var(--swo-surface);
		border-top: 1px solid var(--swo-line);
		box-shadow: 0 -4px 16px rgba(15, 20, 28, .08);
	}
	.swo-mobilebar strong { color: var(--swo-accent); font-size: calc(1.1rem * var(--swo-scale)); }
}
@media (prefers-reduced-motion: reduce) {
	.swo-media img, .swo-g img { transition: none; }
}

/* ---------- Slider (layout="slider") ---------- */
.swo-slider { position: relative; }
.swo-slider-nav { display: flex; justify-content: flex-end; gap: 8px; margin: 0 0 14px; }
.swo-slider-nav[hidden] { display: none; }
.swo-slider-nav button {
	font: inherit;
	font-size: calc(1.6rem * var(--swo-scale));
	line-height: 1;
	width: 44px;
	height: 44px;
	border: 1px solid var(--swo-line);
	border-radius: 50%;
	background: var(--swo-surface);
	color: var(--swo-accent);
	cursor: pointer;
}
.swo-slider-nav button:hover:not(:disabled) { background: var(--swo-accent); color: #fff; border-color: var(--swo-accent); }
.swo-slider-nav button:disabled { opacity: .35; cursor: default; }
.swo-track {
	grid-template-columns: none;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 48px) / 3);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding-bottom: 4px;
}
.swo-track::-webkit-scrollbar { display: none; }
.swo-track > .swo-card { scroll-snap-align: start; }
@media (max-width: 1024px) { .swo-track { grid-auto-columns: calc((100% - 24px) / 2); } }
@media (max-width: 640px) { .swo-track { grid-auto-columns: 85%; } }
@media (prefers-reduced-motion: reduce) { .swo-track { scroll-behavior: auto; } }

/* ---------- View all button ---------- */
.swo-all { text-align: center; margin: 36px 0 0; }
.swo-all .swo-btn { padding: 14px 32px; }
