/* Inherits theme fonts and colours; accent follows the block theme's primary colour when present. */
.res {
	--res-accent: var(--wp--preset--color--primary, var(--wp--preset--color--vivid-cyan-blue, #2563eb));
	--res-muted: color-mix(in srgb, currentColor 60%, transparent);
	--res-line: color-mix(in srgb, currentColor 14%, transparent);
	--res-surface: color-mix(in srgb, currentColor 4%, transparent);
	--res-radius: 14px;
	container-type: inline-size;
}

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

.res-filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	align-items: end;
	padding: 16px;
	margin-bottom: 24px;
	border: 1px solid var(--res-line);
	border-radius: var(--res-radius);
	background: var(--res-surface);
}
.res-filters label { display: grid; gap: 4px; font-size: .8rem; color: var(--res-muted); }
.res-filters select, .res-filters input {
	width: 100%;
	padding: 9px 10px;
	font: inherit;
	font-size: .95rem;
	color: inherit;
	background: transparent;
	border: 1px solid var(--res-line);
	border-radius: 8px;
}
.res-filters button, .res-button {
	display: inline-block;
	padding: 10px 18px;
	font: inherit;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	color: #fff;
	background: var(--res-accent);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: filter .15s;
}
.res-filters button:hover, .res-button:hover { filter: brightness(1.1); color: #fff; }

.res-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
	gap: 24px;
}
.res-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	border: 1px solid var(--res-line);
	border-radius: var(--res-radius);
	transition: transform .2s, box-shadow .2s;
}
.res-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px -12px rgb(0 0 0 / .25); color: inherit; }
.res-card__image { position: relative; aspect-ratio: 3 / 2; background: var(--res-surface); }
.res-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 10px;
	font-size: .75rem;
	font-weight: 600;
	color: #fff;
	background: var(--res-accent);
	border-radius: 999px;
}
.res-card__body { display: grid; gap: 6px; padding: 16px 18px 18px; }
.res-card__meta { margin: 0; font-size: .85rem; color: var(--res-muted); }
.res-card__title { margin: 0; font-size: 1.1rem; line-height: 1.35; }
.res-card__facts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 8px 0 0; }
.res-card__facts div { display: grid; }
.res-card__facts dt { font-size: .75rem; color: var(--res-muted); }
.res-card__facts dd { margin: 0; font-weight: 600; }
.res-empty { padding: 40px; text-align: center; color: var(--res-muted); }
.res-pagination { margin-top: 32px; display: flex; gap: 8px; justify-content: center; }
.res-pagination .page-numbers { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--res-line); text-decoration: none; }
.res-pagination .current { background: var(--res-accent); color: #fff; border-color: transparent; }

.res-gallery {
	position: relative;
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	grid-template-rows: repeat(2, minmax(0, 1fr));
	gap: 8px;
	aspect-ratio: 16 / 7;
	margin-bottom: 32px;
	overflow: hidden;
	border-radius: var(--res-radius);
}
.res-gallery__item { display: block; overflow: hidden; background: var(--res-surface); }
.res-gallery__item:first-child { grid-row: span 2; }
.res-gallery__item:nth-child(n+6) { display: none; }
.res-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.res-gallery__item:hover img { transform: scale(1.03); }
.res-gallery__more {
	position: absolute;
	right: 12px;
	bottom: 12px;
	padding: 6px 12px;
	font-size: .85rem;
	font-weight: 600;
	color: #fff;
	background: rgb(0 0 0 / .6);
	border-radius: 8px;
	pointer-events: none;
}
@container (max-width: 640px) {
	.res-gallery { grid-template-columns: 1fr; grid-template-rows: none; aspect-ratio: 3 / 2; }
	.res-gallery__item:not(:first-child) { display: none; }
}

.res-single__layout { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
@container (max-width: 820px) { .res-single__layout { grid-template-columns: 1fr; } }
.res-single h2 { margin: 36px 0 12px; font-size: 1.25rem; }
.res-keyfacts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 1px;
	margin: 16px 0 8px;
	overflow: hidden;
	background: var(--res-line);
	border: 1px solid var(--res-line);
	border-radius: var(--res-radius);
}
.res-keyfacts div { display: grid; gap: 2px; padding: 14px 16px; background: var(--wp--preset--color--base, Canvas); }
.res-keyfacts span { font-size: .8rem; color: var(--res-muted); }
.res-keyfacts strong { font-size: 1.2rem; }
.res-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 32px; margin: 0; }
.res-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--res-line); }
.res-facts dt { color: var(--res-muted); }
.res-facts dd { margin: 0; font-weight: 500; text-align: right; }
.res-features { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.res-features li { padding: 6px 12px; font-size: .9rem; background: var(--res-surface); border: 1px solid var(--res-line); border-radius: 999px; }
.res-features li::before { content: "✓ "; color: var(--res-accent); font-weight: 700; }
.res-documents { padding-left: 1.2em; }
.res-contact {
	position: sticky;
	top: 24px;
	display: grid;
	gap: 6px;
	padding: 22px;
	border: 1px solid var(--res-line);
	border-radius: var(--res-radius);
	background: var(--res-surface);
}
.res-contact p { margin: 0; }
.res-contact__label { font-size: .8rem; color: var(--res-muted); }
.res-contact__name { font-size: 1.1rem; font-weight: 600; }
.res-contact__position { color: var(--res-muted); }
.res-contact__line { color: inherit; }
.res-contact .res-button { margin-top: 10px; }

.res-lightbox { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 0; border: 0; background: rgb(0 0 0 / .92); color: #fff; }
.res-lightbox::backdrop { background: transparent; }
.res-lightbox figure { display: grid; place-items: center; height: 100%; margin: 0; padding: 48px 64px; }
.res-lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; }
.res-lightbox figcaption { margin-top: 12px; text-align: center; opacity: .8; }
.res-lightbox button { position: absolute; padding: 12px 16px; font-size: 1.6rem; line-height: 1; color: #fff; background: rgb(255 255 255 / .1); border: 0; border-radius: 999px; cursor: pointer; }
.res-lightbox button:hover { background: rgb(255 255 255 / .2); }
.res-lightbox [data-close] { top: 16px; right: 16px; }
.res-lightbox [data-prev] { left: 16px; top: 50%; transform: translateY(-50%); }
.res-lightbox [data-next] { right: 16px; top: 50%; transform: translateY(-50%); }
