/* =============================================================
 * Referenzen — ibelsa Layout
 * Addon-CSS für Referenzen-Plugin
 * Nutzt das vorhandene ibelsa Designsystem als Grundlage.
 * ============================================================= */


/* =============================================================
   Wrapper
   ============================================================= */

.referenzen-wrapper {
	width: 100%;
	max-width: var(--ib-max-wide);
	margin-inline: auto;
	padding-inline: var(--ib-section-x);
	color: var(--ib-c-night);
}


/* =============================================================
   Filter
   ============================================================= */

.referenzen-filter {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: var(--ib-gap-sm);
	align-items: end;
	margin: 0 0 clamp(28px, 4vw, 44px);
	padding: clamp(20px, 3vw, 32px);
	border-radius: var(--ib-r-2xl);
	background: #fff;
	border: 1px solid var(--ib-c-border);
	box-shadow: var(--ib-shadow-sm);
}

.referenzen-filter-group {
	display: flex;
	flex-direction: column;
	gap: 7px;
	min-width: 0;
}

.referenzen-filter-group label {
	display: block;
	font-size: var(--ib-text-xs);
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: lowercase;
	color: var(--ib-c-muted);
	margin: 0;
}

.referenzen-filter input,
.referenzen-filter select {
	width: 100%;
	min-height: 48px;
	padding: 0 14px;
	border: 1px solid var(--ib-c-border);
	border-radius: var(--ib-r-md);
	background: #fff;
	color: var(--ib-c-night);
	font: inherit;
	font-size: var(--ib-text-sm);
	line-height: 1.2;
	outline: none;
	box-shadow: none;
	transition:
		border-color var(--ib-trans),
		box-shadow var(--ib-trans),
		background-color var(--ib-trans);
}

.referenzen-filter input:focus,
.referenzen-filter select:focus {
	border-color: var(--ib-c-teal);
	box-shadow: 0 0 0 4px rgba(43, 169, 199, .16);
}

.referenzen-filter input::placeholder {
	color: rgba(28, 24, 37, .42);
}

.referenzen-filter-actions {
	display: flex;
	align-items: end;
	gap: 10px;
	min-width: 0;
}

.referenzen-filter-submit,
.referenzen-filter-reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 20px;
	border-radius: var(--ib-r-pill);
	border: 2px solid transparent;
	font-family: inherit;
	font-size: var(--ib-text-sm);
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	text-decoration: none !important;
	white-space: nowrap;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition:
		background-color var(--ib-trans),
		color var(--ib-trans),
		border-color var(--ib-trans),
		box-shadow var(--ib-trans),
		transform var(--ib-trans),
		filter var(--ib-trans);
}

.referenzen-filter-submit {
	background: var(--ib-c-pink);
	border-color: var(--ib-c-pink);
	color: #fff;
	box-shadow: var(--ib-shadow-pink);
}

.referenzen-filter-submit:hover {
	filter: brightness(.96) saturate(1.05);
	transform: translateY(-1px);
}

.referenzen-filter-reset {
	background: transparent;
	border-color: var(--ib-c-border);
	color: var(--ib-c-night);
}

.referenzen-filter-reset:hover {
	background: var(--ib-c-night);
	border-color: var(--ib-c-night);
	color: #fff;
	transform: translateY(-1px);
}

.referenzen-filter-submit:focus-visible,
.referenzen-filter-reset:focus-visible {
	outline: 3px solid rgba(255, 45, 176, .28);
	outline-offset: 4px;
}


/* =============================================================
   Meta
   ============================================================= */

.referenzen-meta {
	margin: 0 0 1rem;
	font-size: var(--ib-text-sm);
	font-weight: 600;
	color: var(--ib-c-muted);
}


/* =============================================================
   Grid
   ============================================================= */

.referenzen-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
	gap: var(--ib-gap);
}


/* =============================================================
   Card
   ============================================================= */

.referenz-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--ib-r-xl);
	background: #fff;
	border: 1px solid var(--ib-c-border);
	box-shadow: var(--ib-shadow-xs);
	transition:
		transform var(--ib-trans),
		box-shadow var(--ib-trans),
		border-color var(--ib-trans);
}

.referenz-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--ib-shadow-lg);
	border-color: rgba(255, 45, 176, .22);
}

.referenz-image-wrapper {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: var(--ib-grey-bg);
}

.referenz-image {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	object-position: center center;
	transition:
		transform var(--ib-trans-slow),
		filter var(--ib-trans-slow);
}

.referenz-card:hover .referenz-image {
	transform: scale(1.045);
	filter: saturate(1.05);
}


/* =============================================================
   Overlay
   ============================================================= */

.referenz-overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	justify-content: flex-start;
	padding: clamp(18px, 2.4vw, 26px);
	box-sizing: border-box;
	color: #fff;
	opacity: 0;
	background:
		linear-gradient(to top, rgba(28, 24, 37, .96), rgba(28, 24, 37, .72) 62%, rgba(28, 24, 37, .42)),
		radial-gradient(circle at 82% 18%, rgba(255, 45, 176, .24), transparent 36%);
	transition: opacity var(--ib-trans);
}

.referenz-image-wrapper:hover .referenz-overlay,
.referenz-overlay:focus-within {
	opacity: 1;
}

.referenz-overlay-content {
	width: 100%;
	text-align: left;
}

.referenz-excerpt {
	margin: 0;
	color: rgba(255, 255, 255, .88);
	font-size: var(--ib-text-sm);
	line-height: 1.55;
}

.referenz-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	margin-top: 14px;
	padding: 0 18px;
	border-radius: var(--ib-r-pill);
	border: 2px solid #fff;
	background: #fff;
	color: var(--ib-c-night);
	font: inherit;
	font-size: var(--ib-text-sm);
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	text-decoration: none !important;
	white-space: nowrap;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition:
		background-color var(--ib-trans),
		color var(--ib-trans),
		transform var(--ib-trans),
		filter var(--ib-trans);
}

.referenz-button:hover {
	filter: brightness(.96);
	transform: translateY(-1px);
}

.referenz-button:focus-visible {
	outline: 3px solid rgba(255, 255, 255, .38);
	outline-offset: 4px;
}


/* =============================================================
   Card Content
   ============================================================= */

.referenz-content {
	display: flex;
	flex-direction: column;
	gap: 7px;
	padding: clamp(18px, 2.6vw, 26px);
	flex: 1;
}

.referenz-title {
	margin: 0;
	font-size: var(--ib-h4);
	line-height: var(--ib-lh-snug);
	letter-spacing: var(--ib-ls-snug);
	font-weight: 800;
	color: var(--ib-c-night);
	text-transform: lowercase;
}

.referenz-zimmer,
.referenz-location,
.referenz-web {
	margin: 0;
	font-size: var(--ib-text-sm);
	line-height: 1.45;
	color: var(--ib-c-muted);
}

.referenz-zimmer {
	display: inline-flex;
	align-items: center;
	width: fit-content;
	margin-top: 4px;
	padding: 6px 11px;
	border-radius: var(--ib-r-pill);
	background: var(--ib-teal-10);
	color: var(--ib-c-night);
	font-weight: 700;
}

.referenz-location {
	color: rgba(28, 24, 37, .68);
}

.referenz-web a,
.referenz-web {
	color: var(--ib-c-pink);
	font-weight: 700;
	text-decoration: none !important;
}

.referenz-web a:hover {
	color: var(--ib-c-violet);
}


/* =============================================================
   Modal
   ============================================================= */

.referenz-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 3vw, 34px);
	background: rgba(28, 24, 37, .78);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	opacity: 0;
	transition: opacity var(--ib-trans);
}

.referenz-modal.active {
	opacity: 1;
}

.referenz-modal-content {
	position: relative;
	width: min(100%, 920px);
	max-height: 90vh;
	overflow-y: auto;
	box-sizing: border-box;
	padding: clamp(24px, 4vw, 44px);
	border-radius: var(--ib-r-2xl);
	background: #fff;
	border: 1px solid rgba(255, 255, 255, .22);
	box-shadow: 0 30px 100px rgba(0, 0, 0, .38);
	color: var(--ib-c-night);
}

.referenz-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--ib-r-pill);
	border: 1px solid var(--ib-c-border);
	background: #fff;
	color: var(--ib-c-night);
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
	transition:
		background-color var(--ib-trans),
		color var(--ib-trans),
		transform var(--ib-trans),
		border-color var(--ib-trans);
}

.referenz-modal-close:hover {
	background: var(--ib-c-night);
	border-color: var(--ib-c-night);
	color: #fff;
	transform: rotate(6deg);
}

.referenz-modal-close:focus-visible {
	outline: 3px solid rgba(255, 45, 176, .3);
	outline-offset: 4px;
}

.referenz-modal-title {
	max-width: calc(100% - 70px);
	margin: 0 0 1rem;
	font-size: var(--ib-h3);
	line-height: var(--ib-lh-snug);
	letter-spacing: var(--ib-ls-snug);
	font-weight: 800;
	color: var(--ib-c-night);
	text-transform: lowercase;
}

.referenz-modal-image {
	width: 100%;
	max-width: 100%;
	height: auto;
	display: block;
	margin: clamp(18px, 3vw, 28px) 0;
	border-radius: var(--ib-r-xl);
	box-shadow: var(--ib-shadow-sm);
}

.referenz-modal-text {
	color: rgba(28, 24, 37, .72);
	font-size: var(--ib-text-base);
	line-height: var(--ib-lh-base);
}

.referenz-modal-text p:last-child {
	margin-bottom: 0;
}

.referenz-modal-info-heading {
	margin-top: clamp(26px, 4vw, 38px);
	margin-bottom: .75rem !important;
	font-size: var(--ib-text-md);
	font-weight: 800;
	color: var(--ib-c-night);
	text-transform: lowercase;
}


/* =============================================================
   Empty State
   ============================================================= */

.referenzen-empty {
	padding: clamp(32px, 5vw, 56px);
	text-align: center;
	color: var(--ib-c-muted);
	background: #fff;
	border: 1px dashed var(--ib-c-border);
	border-radius: var(--ib-r-2xl);
	font-size: var(--ib-text-base);
	font-weight: 600;
}


/* =============================================================
   Responsive
   ============================================================= */

@media (max-width: 1180px) {
	.referenzen-filter {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 820px) {
	.referenzen-filter {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.referenzen-filter-actions {
		grid-column: 1 / -1;
	}

	.referenzen-filter-submit,
	.referenzen-filter-reset {
		flex: 1;
	}
}

@media (max-width: 620px) {
	.referenzen-wrapper {
		padding-inline: var(--ib-section-x);
	}

	.referenzen-filter {
		grid-template-columns: 1fr;
		padding: 18px;
		border-radius: var(--ib-r-xl);
	}

	.referenzen-filter-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.referenzen-filter-submit,
	.referenzen-filter-reset {
		width: 100%;
	}

	.referenzen-grid {
		grid-template-columns: 1fr;
	}

	.referenz-overlay {
		position: relative;
		opacity: 1;
		background: var(--ib-c-night);
		padding: 18px;
	}

	.referenz-image-wrapper {
		aspect-ratio: auto;
	}

	.referenz-image {
		height: auto;
	}

	.referenz-card:hover .referenz-image {
		transform: none;
	}

	.referenz-modal {
		padding: 10px;
		align-items: flex-start;
	}

	.referenz-modal-content {
		max-height: calc(100vh - 20px);
		border-radius: 22px;
		padding: 24px;
	}

	.referenz-modal-title {
		font-size: 28px;
	}

	.referenz-modal-close {
		top: 10px;
		right: 10px;
		width: 40px;
		height: 40px;
	}
}


/* =============================================================
   Referenzen Reveal Animation
   Karten klappen beim Laden / nach Suche leicht vertikal auf
   ============================================================= */

.referenzen-wrapper .referenz-card {
	transform-origin: top center;
	will-change: transform, opacity, clip-path;
}

/* Startzustand, wird per JS kurz gesetzt */
.referenzen-wrapper .referenz-card.is-reveal-ready {
	opacity: 0;
	transform: translateY(18px) scaleY(.92);
	clip-path: inset(0 0 22% 0 round var(--ib-r-xl));
}

/* Zielzustand */
.referenzen-wrapper .referenz-card.is-revealed {
	opacity: 1;
	transform: translateY(0) scaleY(1);
	clip-path: inset(0 0 0 0 round var(--ib-r-xl));
	transition:
		opacity .42s var(--ib-ease),
		transform .48s var(--ib-ease),
		clip-path .52s var(--ib-ease);
	transition-delay: var(--referenz-reveal-delay, 0ms);
}

/* Beim Absenden der Suche ganz kurzer Collapse-/Fade-Effekt */
.referenzen-wrapper.is-searching .referenz-card {
	opacity: 0;
	transform: translateY(8px) scaleY(.96);
	clip-path: inset(0 0 14% 0 round var(--ib-r-xl));
	transition:
		opacity .16s ease,
		transform .16s ease,
		clip-path .16s ease;
}

.referenzen-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
	gap: var(--ib-gap);
}

@media (max-width: 920px) {
	.referenzen-grid {
		grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	}
}

@media (max-width: 620px) {
	.referenzen-grid {
		grid-template-columns: 1fr;
	}
}



/* Menschen mit reduzierter Bewegung respektieren 
@media (prefers-reduced-motion: reduce) {
	.referenzen-wrapper .referenz-card,
	.referenzen-wrapper .referenz-card.is-reveal-ready,
	.referenzen-wrapper .referenz-card.is-revealed,
	.referenzen-wrapper.is-searching .referenz-card {
		opacity: 1;
		transform: none;
		clip-path: none;
		transition: none;
	}
}*/




/* =============================================================
   Random-Referenzen als Slider
   Desktop 3 / Tablet 2 / Mobil 1 Karte
   ============================================================= */

.referenzen-wrapper--random {
	overflow: hidden;
}

.referenzen-slider {
	position: relative;
	width: 100%;
}

.referenzen-slider__viewport {
	overflow: hidden;
	width: 100%;
	padding-block: 6px 14px;
	touch-action: pan-y;
}

.referenzen-slider__track {
	display: flex;
	align-items: stretch;
	gap: var(--ib-gap);
	will-change: transform;
	transition: transform .65s var(--ib-ease);
}

.referenzen-slider__slide {
	flex: 0 0 calc((100% - (2 * var(--ib-gap))) / 3);
	min-width: 0;
}

.referenzen-slider__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: clamp(18px, 3vw, 28px);
}

.referenzen-slider__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid var(--ib-c-border);
	border-radius: var(--ib-r-pill);
	background: #fff;
	color: var(--ib-c-night);
	font: inherit;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	box-shadow: var(--ib-shadow-xs);
	transition:
		background-color var(--ib-trans),
		border-color var(--ib-trans),
		color var(--ib-trans),
		transform var(--ib-trans);
}

.referenzen-slider__arrow:hover {
	background: var(--ib-c-pink);
	border-color: var(--ib-c-pink);
	color: #fff;
	transform: translateY(-2px);
}

.referenzen-slider__arrow:focus-visible,
.referenzen-slider__dot:focus-visible {
	outline: 3px solid rgba(255, 45, 176, .28);
	outline-offset: 4px;
}

.referenzen-slider__arrow:disabled {
	display: none;
}

.referenzen-slider__dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 18px;
}

.referenzen-slider__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(28, 24, 37, .22);
	cursor: pointer;
	transition:
		width var(--ib-trans),
		background-color var(--ib-trans),
		transform var(--ib-trans);
}

.referenzen-slider__dot:hover {
	transform: scale(1.18);
	background: rgba(28, 24, 37, .42);
}

.referenzen-slider__dot.is-active {
	width: 28px;
	background: var(--ib-c-pink);
}

.referenzen-slider__status {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.referenzen-slider.has-single-page .referenzen-slider__nav {
	display: none;
}

@media (max-width: 920px) {
	.referenzen-slider__slide {
		flex-basis: calc((100% - var(--ib-gap)) / 2);
	}
}

@media (max-width: 620px) {
	.referenzen-slider__slide {
		flex-basis: 100%;
	}

	.referenzen-slider__track {
		gap: 18px;
	}

	.referenzen-slider__viewport {
		overflow: visible;
	}

	.referenzen-wrapper--random {
		overflow: hidden;
	}
}

@media (prefers-reduced-motion: reduce) {
	.referenzen-slider__track {
		transition: none;
	}
}
