/* RB Projekte – Galerie-Raster (Masonry) + Lightbox, Neumorphismus Gold/Creme */

.rb-projekte {
	--rbp-cream: var(--wp--preset--color--cream, #F6EFE6);
	--rbp-ink: var(--wp--preset--color--ink, #1C2A2E);
	--rbp-dark: #CDBBA3;
	--rbp-light: #FFFFFF;
	--rbp-edge: #E8DBC8;
	--rbp-serif: var(--wp--preset--font-family--serif, Georgia, serif);
	--rbp-sans: var(--wp--preset--font-family--sans, system-ui, sans-serif);
}

/* Symmetrisches Raster: gleich große Kacheln, Reihen von links nach rechts */
.rb-projekte__grid {
	list-style: none;
	margin: 0;
	padding: .5rem 0 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1.1rem, 2.2vw, 1.8rem);
}
.rb-projekte__item {
	position: relative;
	margin: 0;
	animation: rb-projekt-in .5s ease both;
}
.rb-projekte__item[hidden] { display: none; }
.rb-projekte__item { scroll-margin-top: 120px; }
.rb-projekte__item.is-target .rb-projekte__card { border-color: #C99A5C; box-shadow: 0 0 0 4px rgba(201, 154, 92, .45), 10px 10px 22px var(--rbp-dark), -10px -10px 22px var(--rbp-light); }
@keyframes rb-projekt-in { from { opacity: 0; transform: translateY(14px); } }

.rb-projekte__card {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 3px solid var(--rbp-edge);
	border-radius: 20px;
	background: var(--rbp-cream);
	box-shadow: 10px 10px 22px var(--rbp-dark), -10px -10px 22px var(--rbp-light);
	cursor: zoom-in;
	overflow: hidden;
	text-align: left;
	transition: box-shadow .25s ease-in-out;
}
.rb-projekte__card:hover,
.rb-projekte__card:focus-visible { box-shadow: 4px 4px 9px var(--rbp-dark), -4px -4px 9px var(--rbp-light); outline: none; }
.rb-projekte__card:focus-visible { border-color: #C99A5C; }
.rb-projekte__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: 17px;
	transition: transform .7s cubic-bezier(.22, .61, .36, 1);
}
.rb-projekte__card:hover .rb-projekte__img { transform: scale(1.04); }

/* eingedrückte Bildkante + Verlauf für die Beschriftung */
.rb-projekte__card::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: 17px;
	background: linear-gradient(180deg, rgba(20, 14, 8, 0) 55%, rgba(20, 14, 8, .7) 100%);
	box-shadow: inset 5px 5px 12px rgba(45, 28, 10, .45), inset -5px -5px 12px rgba(255, 238, 205, .3);
	pointer-events: none;
}
.rb-projekte__overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	background: rgba(20, 14, 8, .25);
	opacity: 0;
	transition: opacity .3s ease;
}
.rb-projekte__card:hover .rb-projekte__overlay,
.rb-projekte__card:focus-visible .rb-projekte__overlay { opacity: 1; }
.rb-projekte__zoom {
	width: 3.6rem;
	height: 3.6rem;
	border-radius: 50%;
	border: 2px solid #C99A5C;
	background: #B98647 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5M11 8.5v5M8.5 11h5'/%3E%3C/svg%3E") center / 1.4rem no-repeat;
	box-shadow: inset 3px 3px 7px #8F6331, inset -3px -3px 7px #E2B577, 0 8px 20px rgba(0, 0, 0, .3);
	transform: scale(.85);
	transition: transform .3s ease;
}
.rb-projekte__card:hover .rb-projekte__zoom { transform: scale(1); }

.rb-projekte__meta {
	position: absolute;
	left: 1.1rem;
	right: 1.1rem;
	bottom: 1rem;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .6rem;
	padding-right: 7.2rem; /* Platz für „Anfrage“ */
	pointer-events: none;
}
.rb-projekte__title {
	font-family: var(--rbp-serif);
	font-size: 1.15rem;
	line-height: 1.15;
	color: #fff;
	text-shadow: 0 1px 8px rgba(0, 0, 0, .4);
}
.rb-projekte__count {
	position: absolute;
	top: 1rem;
	left: 1rem;
	z-index: 3;
	pointer-events: none;
	padding: .3rem .7rem;
	border-radius: 999px;
	background: rgba(255, 250, 243, .9);
	color: var(--rbp-ink);
	font-family: var(--rbp-sans);
	font-size: .7rem;
	letter-spacing: .06em;
}

.rb-projekte__ask {
	position: absolute;
	right: 1rem;
	bottom: .85rem;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .55rem .95rem;
	border: 2px solid #C99A5C;
	border-radius: 999px;
	background: #B98647;
	color: #fff;
	font-family: var(--rbp-sans);
	font-size: .72rem;
	font-weight: 500;
	letter-spacing: .1em;
	text-transform: uppercase;
	text-decoration: none;
	box-shadow: inset 3px 3px 7px #8F6331, inset -3px -3px 7px #E2B577, 0 6px 16px rgba(0, 0, 0, .3);
	transition: box-shadow .2s ease-in-out;
}
.rb-projekte__ask svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rb-projekte__ask:hover,
.rb-projekte__ask:focus-visible { color: #fff; outline: none; box-shadow: inset 2px 2px 5px #8F6331, inset -2px -2px 5px #E2B577, 0 0 0 3px rgba(230, 188, 118, .45); }

.rb-projekte__more-wrap { display: flex; justify-content: center; margin-top: 1rem; }
.rb-projekte__more {
	display: inline-flex;
	align-items: center;
	gap: .8rem;
	padding: 1rem 1.8rem;
	border: 2px solid #C99A5C;
	border-radius: 999px;
	background: #B98647;
	color: #fff;
	font-family: var(--rbp-sans);
	font-size: .85rem;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: inset 4px 4px 10px #8F6331, inset -4px -4px 10px #E2B577;
	transition: box-shadow .2s ease-in-out;
}
.rb-projekte__more:hover { box-shadow: inset 2px 2px 5px #8F6331, inset -2px -2px 5px #E2B577, 2px 2px 5px #8F6331, -2px -2px 5px #E2B577; }
.rb-projekte__more span {
	min-width: 1.8rem;
	padding: .15rem .5rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, .22);
	font-size: .75rem;
}

/* ---------- Lightbox ---------- */
.rb-lightbox {
	width: 100vw;
	height: 100dvh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	overflow: hidden;
}
.rb-lightbox::backdrop { background: rgba(16, 11, 6, .93); } /* ohne Blur: Blur über der ganzen Seite ließ Schatten/Animationen im Hintergrund flackern */
.rb-lightbox[open] { display: grid; grid-template-rows: 1fr auto; animation: rb-lb-in .3s ease; }
@keyframes rb-lb-in { from { opacity: 0; } }
html:has(.rb-lightbox[open]) { overflow: hidden; }

.rb-lightbox__stage {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 0;
	padding: 4.5rem clamp(4rem, 8vw, 7rem) 1rem;
}
.rb-lightbox__img {
	max-width: 100%;
	max-height: calc(100dvh - 11rem);
	width: auto;
	height: auto;
	border-radius: 14px;
	border: 3px solid rgba(232, 219, 200, .5);
	box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
	transition: opacity .25s ease;
}
.rb-lightbox__img.is-loading { opacity: .3; }

.rb-lightbox__btn {
	position: absolute;
	z-index: 2;
	width: 3.4rem;
	height: 3.4rem;
	display: grid;
	place-items: center;
	border-radius: 50%;
	border: 2px solid #C99A5C;
	background: #B98647;
	color: #fff;
	cursor: pointer;
	box-shadow: inset 3px 3px 8px #8F6331, inset -3px -3px 8px #E2B577, 0 10px 24px rgba(0, 0, 0, .4);
	transition: box-shadow .2s ease, opacity .2s;
}
.rb-lightbox__btn:hover,
.rb-lightbox__btn:focus-visible { outline: none; box-shadow: inset 2px 2px 5px #8F6331, inset -2px -2px 5px #E2B577, 0 0 0 3px rgba(230, 188, 118, .45); }
.rb-lightbox__btn svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rb-lightbox__btn[hidden] { display: none; }
.rb-lightbox__prev { left: clamp(.8rem, 2vw, 2rem); top: 50%; translate: 0 -50%; }
.rb-lightbox__next { right: clamp(.8rem, 2vw, 2rem); top: 50%; translate: 0 -50%; }
.rb-lightbox__close { top: 1rem; right: clamp(.8rem, 2vw, 2rem); width: 3rem; height: 3rem; background: rgba(255, 250, 243, .12); border-color: rgba(255, 250, 243, .35); box-shadow: none; }

.rb-lightbox__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: .8rem 1.6rem;
	padding: 1rem 1.5rem 1.6rem;
	font-family: var(--wp--preset--font-family--sans, system-ui, sans-serif);
}
.rb-lightbox__title { font-family: var(--wp--preset--font-family--serif, Georgia, serif); font-size: 1.3rem; }
.rb-lightbox__counter { font-size: .8rem; letter-spacing: .12em; color: rgba(255, 250, 243, .7); }
.rb-lightbox__cta {
	display: inline-flex;
	align-items: center;
	gap: .7rem;
	padding: .8rem 1.4rem;
	border: 2px solid #C99A5C;
	border-radius: 999px;
	background: #B98647;
	color: #fff;
	font-size: .78rem;
	font-weight: 500;
	letter-spacing: .1em;
	text-transform: uppercase;
	text-decoration: none;
	box-shadow: inset 3px 3px 8px #8F6331, inset -3px -3px 8px #E2B577;
}
.rb-lightbox__cta:hover { color: #fff; box-shadow: inset 2px 2px 5px #8F6331, inset -2px -2px 5px #E2B577, 0 0 0 3px rgba(230, 188, 118, .35); }

@media (max-width: 700px) {
	.rb-projekte__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rb-projekte__title { font-size: .95rem; }
	.rb-projekte__count { display: none; }
	.rb-projekte__meta { left: .8rem; right: .8rem; bottom: 3.6rem; padding-right: 0; }
	.rb-projekte__ask { left: .7rem; right: .7rem; bottom: .7rem; justify-content: center; padding: .5rem .6rem; font-size: .66rem; }
	.rb-lightbox__stage { padding: 4rem .6rem .5rem; }
	.rb-lightbox__img { max-height: calc(100dvh - 13rem); }
	.rb-lightbox__prev, .rb-lightbox__next { top: auto; bottom: -3.8rem; translate: none; width: 3rem; height: 3rem; }
	.rb-lightbox__bar { padding-bottom: 5rem; }
}
@media (prefers-reduced-motion: reduce) {
	.rb-projekte__item, .rb-lightbox[open] { animation: none; }
}
