/**
 * Chalet Joli – Gestaltung für Website und Editor.
 * Farben, Schriften und Grundtypografie stehen in theme.json.
 * Hier steht, was die Blöcke selbst nicht abbilden: Kopf über dem Bild,
 * überlappende Titel, Galerien, Karussell, Diashow, Tabs, Akkordeon.
 * Umbrüche wie im alten Elementor-Layout: Handy bis 767 px, Tablet bis 1024 px.
 */

/* ---------- Grundlagen ---------- */

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

body {
	margin: 0;
	-webkit-font-smoothing: antialiased;
}

.wp-site-blocks > *,
.cj-inhalt > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

h1, h2, h3, h4, h5, h6 {
	text-wrap: balance;
}

p {
	margin-block-end: 0;
}

:where(.wp-block-columns) {
	margin-bottom: 0;
}

img {
	max-width: 100%;
	height: auto;
}

/* ---------- Kopf ---------- */

.cj-kopfbereich {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
}

.admin-bar .cj-kopfbereich {
	top: 32px;
}

.cj-kopf {
	background-image: linear-gradient(180deg, rgba(11, 42, 32, 0.69) 0%, rgba(11, 42, 32, 0) 100%);
	padding: 0;
}

.cj-kopf nav.cj-navi-links,
.cj-kopf nav.cj-navi-rechts {
	flex: 0 0 44%;
}

.cj-kopf .cj-logo {
	flex: 0 0 10%;
	display: flex;
	justify-content: center;
	margin: 10px 0;
	padding: 0 10px;
}

.cj-kopf .cj-logo img {
	width: 100% !important;
	max-width: 150px;
	height: auto;
}

.cj-kopf .wp-block-navigation-item__content {
	padding: 13px 20px;
	color: var(--wp--preset--color--champagner);
}

.cj-kopf nav.cj-navi-links .wp-block-navigation__container,
.cj-kopf nav.cj-navi-rechts .wp-block-navigation__container {
	flex: 1 1 auto;
	flex-wrap: wrap;
	row-gap: 0;
}

.cj-kopf nav.cj-navi-links .wp-block-navigation__container {
	justify-content: flex-end;
}

.cj-kopf nav.cj-navi-rechts .wp-block-navigation__container {
	justify-content: flex-start;
}

.cj-kopf nav.cj-navi-mobil {
	display: none;
}

/* Mobiles Menü (Vollbild) */
.cj-navi-mobil .wp-block-navigation__responsive-container-open svg,
.cj-navi-mobil .wp-block-navigation__responsive-container-close svg {
	width: 24px;
	height: 24px;
	fill: var(--wp--preset--color--champagner);
}

.cj-navi-mobil .wp-block-navigation__responsive-container.is-menu-open {
	padding: 3vw;
	background-color: var(--wp--preset--color--dunkelgruen);
}

.cj-navi-mobil .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	box-sizing: border-box;
	min-height: calc(100vh - 6vw);
	border: 1px solid var(--wp--preset--color--champagner);
	padding: 200px 4vw 4vw !important;
	background: url("../bilder/logo-menue.svg") center 40px / 150px auto no-repeat;
	justify-content: flex-start !important;
	align-items: center !important;
	width: 100%;
}

.cj-navi-mobil .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: center !important;
	justify-content: flex-start !important;
	width: 100%;
	gap: 0;
}

.cj-navi-mobil .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	align-items: center !important;
	justify-content: center;
	width: 100%;
}

.cj-navi-mobil .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 20px;
	font-weight: 600;
	padding: 13px 20px;
}

.cj-navi-mobil .wp-block-navigation__responsive-container-close {
	top: calc(3vw + 12px);
	right: calc(3vw + 12px);
}

/* ---------- Kopfbilder und überlappende Titel ---------- */

.wp-block-cover.cj-kopfbild {
	padding: 0;
}

.wp-block-cover.cj-kopfbild .wp-block-cover__inner-container {
	display: none;
}

.is-style-ueberlappend {
	position: relative;
	z-index: 2;
}

.cj-titelbereich {
	position: relative;
	/* Eigener Block-Kontext: Sonst rutscht der negative Abstand des Titels
	   (Margin-Collapse) auf den ganzen Bereich, und die Fläche deckt das Bild ab,
	   statt dass nur der Titel hineinragt. */
	display: flow-root;
}

.cj-min-50vh {
	min-height: 50vh;
}

/* Diashow (Kopfbild der Zimmerseite) */
.wp-block-gallery.is-style-diashow {
	display: block !important;
	position: relative;
	height: 75vh;
	margin: 0 !important;
	overflow: hidden;
	gap: 0 !important;
}

.wp-block-gallery.is-style-diashow > figure.wp-block-image {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100%;
	margin: 0 !important;
	opacity: 0;
	transition: opacity 0.5s ease;
}

.wp-block-gallery.is-style-diashow > figure.wp-block-image:first-child,
.wp-block-gallery.is-style-diashow.cj-laeuft > figure.ist-aktiv {
	opacity: 1;
}

.wp-block-gallery.is-style-diashow.cj-laeuft > figure:first-child:not(.ist-aktiv) {
	opacity: 0;
}

.wp-block-gallery.is-style-diashow > figure img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	flex: none;
}

.wp-block-gallery.is-style-diashow.cj-verlauf-dunkelgruen::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background-image: linear-gradient(180deg, rgba(11, 42, 32, 0) 0%, var(--wp--preset--color--dunkelgruen) 100%);
	opacity: 0.5;
	pointer-events: none;
}

/* ---------- Galerien ---------- */

/* Mauerwerk: Bilder in Spalten, jedes in voller Höhe.
   Ohne JavaScript als CSS-Spalten; mit JavaScript als Raster, damit die
   Reihenfolge wie bisher zeilenweise von links nach rechts läuft. */
.wp-block-gallery.is-style-mauerwerk {
	display: block !important;
	column-gap: 10px;
	column-count: 2;
}

.wp-block-gallery.is-style-mauerwerk.columns-3 {
	column-count: 3;
}

.wp-block-gallery.is-style-mauerwerk.cj-raster {
	display: grid !important;
	grid-template-columns: repeat(var(--cj-spalten, 2), minmax(0, 1fr));
	grid-auto-rows: 1px;
	column-gap: 10px;
	row-gap: 0;
	align-items: start;
}

.wp-block-gallery.is-style-mauerwerk.cj-raster > figure.wp-block-image {
	margin: 0 !important;
}

.wp-block-gallery.is-style-mauerwerk > figure.wp-block-image {
	display: block;
	width: 100% !important;
	margin: 0 0 10px !important;
	break-inside: avoid;
}

.wp-block-gallery.is-style-mauerwerk > figure.wp-block-image img,
.cj-galerie-rahmen > figure.wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--wp--preset--color--champagner);
	box-sizing: border-box;
}

.cj-galerie-rahmen > figure.wp-block-image img {
	height: 100%;
}

/* Abdunkeln beim Darüberfahren wie bisher */
.wp-block-gallery.is-style-mauerwerk > figure.wp-block-image,
.cj-galerie-rahmen > figure.wp-block-image {
	position: relative;
}

.wp-block-gallery.is-style-mauerwerk > figure.wp-block-image::after,
.cj-galerie-rahmen > figure.wp-block-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.8s;
	pointer-events: none;
}

.wp-block-gallery.is-style-mauerwerk > figure.wp-block-image:hover::after,
.cj-galerie-rahmen > figure.wp-block-image:hover::after {
	opacity: 1;
}

/* Karussell (Zimmer) */
.wp-block-gallery.is-style-karussell {
	display: block !important;
	position: relative;
	overflow: hidden;
	margin: 0 !important;
	height: 100%;
}

.wp-block-gallery.is-style-karussell .cj-karussell-bahn,
.wp-block-gallery.is-style-karussell:not(.cj-laeuft) {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: 0 !important;
}

.wp-block-gallery.is-style-karussell .cj-karussell-bahn {
	height: 100%;
	transition: transform 0.5s ease;
}

.wp-block-gallery.is-style-karussell figure.wp-block-image {
	flex: 0 0 100% !important;
	width: 100% !important;
	margin: 0 !important;
}

.wp-block-gallery.is-style-karussell figure.wp-block-image img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	min-height: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.cj-karussell-pfeil {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-top: -28px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--champagner);
	cursor: pointer;
	text-transform: none;
	letter-spacing: 0;
}

.cj-karussell-pfeil svg {
	width: 30px;
	height: 40px;
	fill: currentColor;
	stroke: none;
}

.cj-karussell-pfeil:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -4px;
}

.cj-karussell-zurueck {
	left: 0;
}

.cj-karussell-weiter {
	right: 0;
}

.cj-zimmerkarte + .cj-zimmerkarte .cj-karussell-pfeil {
	color: var(--wp--preset--color--champagner);
}

/* Im Editor alle Bilder von Karussell und Diashow zeigen */
.editor-styles-wrapper .wp-block-gallery.is-style-diashow,
.editor-styles-wrapper .wp-block-gallery.is-style-karussell {
	display: flex !important;
	flex-wrap: wrap !important;
	height: auto;
	gap: 6px !important;
	overflow: visible;
}

.editor-styles-wrapper .wp-block-gallery.is-style-diashow > figure.wp-block-image,
.editor-styles-wrapper .wp-block-gallery.is-style-karussell figure.wp-block-image {
	position: relative !important;
	inset: auto;
	opacity: 1;
	flex: 0 0 calc(25% - 6px) !important;
	width: calc(25% - 6px) !important;
	height: auto;
}

.editor-styles-wrapper .wp-block-gallery.is-style-diashow > figure img,
.editor-styles-wrapper .wp-block-gallery.is-style-karussell figure img {
	height: auto !important;
	aspect-ratio: 3 / 2;
}

/* ---------- Zimmerkarten ---------- */

.cj-zimmerkarte {
	gap: 0 !important;
}

.cj-zimmerkarte > .wp-block-column {
	display: flex;
	flex-direction: column;
}

.cj-zimmerkarte .cj-zimmerkasten {
	flex: 1 1 auto;
	color: var(--wp--preset--color--dunkelgruen);
}

.cj-zimmerkasten .wp-block-buttons,
.cj-zimmerkasten .wp-block-button {
	width: 100%;
}

/* Rundgang: je Raum zwei Bilder nebeneinander, auch am Handy höchstens zwei Spalten */
.wp-block-gallery.cj-raeume {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px !important;
}

.wp-block-gallery.cj-raeume > figure.wp-block-image {
	width: 100% !important;
	margin: 0 !important;
}

.wp-block-gallery.cj-raeume > figure.wp-block-image img {
	display: block;
	width: 100%;
	height: 100%;
}

/* Rundgang: Raumnamen als goldene Bildunterschrift */
.wp-block-gallery.cj-raeume > figure.wp-block-image figcaption.wp-element-caption {
	z-index: 1;
	padding: 40px 16px 14px;
	background: linear-gradient(180deg, rgba(11, 42, 32, 0) 0%, rgba(11, 42, 32, 0.85) 100%);
	color: var(--wp--preset--color--champagner);
	font-family: var(--wp--preset--font-family--geograph);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 2px;
	text-align: left;
	text-transform: uppercase;
	text-shadow: none;
}

/* ---------- Knöpfe ---------- */

.wp-block-button .wp-block-button__link {
	transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.cj-zimmerkasten .wp-block-button__link {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 16px;
	border: 1px solid var(--wp--preset--color--champagner);
	color: var(--wp--preset--color--champagner);
}

.cj-knopf-dunkelgruen .wp-block-button__link {
	background-color: var(--wp--preset--color--dunkelgruen);
	color: var(--wp--preset--color--champagner);
}

.cj-knopf-dunkelgruen .wp-block-button__link:is(:hover, :focus) {
	background-color: var(--wp--preset--color--bordeaux);
}

.cj-knopf-champagner .wp-block-button__link {
	background-color: var(--wp--preset--color--bordeaux);
	color: var(--wp--preset--color--champagner);
	margin-top: 10px;
}

.cj-knopf-champagner .wp-block-button__link:is(:hover, :focus) {
	background-color: transparent;
}

/* ---------- Rahmen (Bild oder Video in Champagner-Linie) ---------- */

.is-style-rahmen {
	border: 1px solid var(--wp--preset--color--champagner);
	box-sizing: border-box;
	width: 100%;
}

.is-style-rahmen > .wp-block-image,
.is-style-rahmen > .wp-block-video {
	width: 100%;
	margin: 0;
}

.is-style-rahmen > .wp-block-image img,
.is-style-rahmen video {
	display: block;
	width: 100%;
	height: auto;
}

.cj-rahmen-spalte {
	display: flex;
	flex-direction: column;
	justify-content: space-evenly;
}

.cj-musterflaeche .wp-block-image {
	margin: 0;
}

.cj-breite-1400 {
	padding-left: max(5vw, calc((100% - 1400px) / 2)) !important;
	padding-right: max(5vw, calc((100% - 1400px) / 2)) !important;
}

/* ---------- Tabs (Region) ---------- */

.cj-tabs .wp-block-tab-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	border: 0;
}

.cj-tabs .wp-block-tab-list button {
	margin: 0 0 -1px;
	padding: 20px 25px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--wp--preset--color--champagner);
	font-family: var(--wp--preset--font-family--geograph);
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 1px;
	line-height: 1;
	text-transform: uppercase;
	cursor: pointer;
}

.cj-tabs .wp-block-tab-list button[aria-selected="true"] {
	border-color: var(--wp--preset--color--champagner);
	border-bottom-color: var(--wp--preset--color--dunkelgruen);
	background-color: var(--wp--preset--color--dunkelgruen);
	position: relative;
	z-index: 1;
}

.cj-tabs .wp-block-tab-panels {
	border: 1px solid var(--wp--preset--color--champagner);
	background-color: var(--wp--preset--color--dunkelgruen);
}

.cj-tabs .wp-block-tab-panel {
	padding: 20px;
	color: var(--wp--preset--color--champagner);
	font-weight: 600;
	letter-spacing: 1px;
}

.cj-tabs .wp-block-tab-panel p {
	margin: 0;
}

/* ---------- Akkordeon (Preise) ---------- */

.cj-akkordeon {
	display: flex;
	flex-direction: column;
	gap: 16px;
	color: var(--wp--preset--color--champagner);
}

.cj-akkordeon .wp-block-accordion-item {
	margin: 0;
}

.cj-akkordeon .wp-block-accordion-heading {
	margin: 0;
	font-family: var(--wp--preset--font-family--geograph);
	font-size: 1rem;
	line-height: 1.5;
	text-transform: none;
}

.cj-akkordeon .wp-block-accordion-heading__toggle {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--wp--preset--color--champagner);
	background: transparent;
	color: var(--wp--preset--color--champagner);
	font: inherit;
	text-transform: none;
	letter-spacing: 0;
}

.cj-akkordeon .wp-block-accordion-panel {
	padding: 10px 10px 0;
}

/* ---------- Zahlenkompass ---------- */

/* Auf warmem Weiß: Gestaltung des Plugins (grüne Schrift, champagnerfarbene Felder) */
.cj-zahlenkompass {
	color: var(--wp--preset--color--dunkelgruen);
}

/* ---------- Textseiten ---------- */

.cj-textseite .cj-titelbild {
	margin: 0;
}

.cj-textseite .cj-titelbild img {
	display: block;
	width: 100%;
	height: auto;
}

.cj-textseite:not(:has(.cj-titelbild)) {
	padding-top: 140px;
}

/* Spalten mit Hintergrund ohne den Standard-Innenabstand von WordPress */
.wp-block-columns.has-background:not([style*="padding"]) {
	padding: 0;
}

/* ---------- Fuß ---------- */

.cj-fuss > .wp-block-group:first-child {
	padding: 20px 10px 0;
}

.cj-fuss .cj-fuss-spalten {
	margin-top: 40px !important;
	padding: 10px 10px 100px;
}


.cj-fuss a {
	color: inherit;
	text-decoration: underline;
}

.cj-fuss h2 {
	margin: 8px 0 16px;
}

.cj-fuss .cj-social {
	gap: 12px;
}

.cj-fuss .cj-social .wp-social-link {
	padding: 0;
}

.cj-fuss .cj-social .wp-social-link a {
	padding: 0;
	text-decoration: none;
}

.cj-fuss .cj-social .wp-social-link svg {
	width: 38px;
	height: 38px;
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
	.wp-block-gallery.is-style-mauerwerk.columns-3 {
		column-count: 2;
	}

	.cj-galerie-rahmen {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cj-galerie-rahmen > figure.wp-block-image {
		width: 100% !important;
	}
}

/* ---------- Handy ---------- */

@media (max-width: 782px) {
	.admin-bar .cj-kopfbereich {
		top: 46px;
	}
}

@media (max-width: 781px) {
	.is-style-mobil-umgekehrt {
		flex-direction: column-reverse;
	}
}

@media (max-width: 767px) {
	.cj-kopf nav.cj-navi-links,
	.cj-kopf nav.cj-navi-rechts {
		display: none;
	}

	.cj-kopf {
		justify-content: center !important;
		position: relative;
	}

	.cj-kopf .cj-logo {
		flex: 0 0 60%;
	}

	.cj-kopf .cj-logo img {
		max-width: 100px;
	}

	.cj-kopf nav.cj-navi-mobil {
		display: flex;
		position: absolute;
		right: 4%;
		top: 0;
		bottom: 0;
		align-items: center;
	}

	.cj-navi-mobil .wp-block-navigation__responsive-container.is-menu-open {
		transform: none;
	}

	.wp-block-cover.cj-start-video {
		min-height: 70vh !important;
	}

	.cj-mobil-unten-40 {
		padding: 0 0 40px !important;
	}

	.cj-mobil-pad-5vw {
		padding: 5vw !important;
	}

	.cj-mobil-galerie {
		padding: 0 5vw 5vw !important;
	}

	.cj-musterflaeche {
		min-height: 40vh !important;
	}

	.is-style-rahmen {
		min-height: 60vh !important;
	}

	.cj-rahmen-spalte {
		min-height: 40vh !important;
	}

	.wp-block-gallery.is-style-mauerwerk,
	.wp-block-gallery.is-style-mauerwerk.columns-3 {
		column-count: 1;
	}

	.cj-galerie-rahmen {
		grid-template-columns: minmax(0, 1fr);
	}

	.cj-fuss-spalten {
		gap: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-gallery.is-style-diashow > figure.wp-block-image,
	.wp-block-gallery.is-style-karussell .cj-karussell-bahn,
	.wp-block-gallery figure::after {
		transition: none;
	}
}

/* ==========================================================
   Typografie (ab 1.3.0): eine Rolle, eine Gestaltung.
   Gilt auch für Inhalte, die schon in der Datenbank stehen.
   Seitentitel h1, Abschnittstitel h2, Kartentitel h3 (Eros) –
   Dachzeile, Einleitung (Saol), Zwischentitel, Fließtext,
   Auszeichnung (Knöpfe, Bildunterschriften, Tabs, Akkordeon).
   ========================================================== */

:root {
	--cj-text: 17px;
	--cj-einleitung: clamp(20px, 1.9vw, 25px);
	--cj-dachzeile: 15px;
	--cj-auszeichnung: 14px;
}

:is(.cj-inhalt, .cj-textseite) :is(p, li) {
	font-size: var(--cj-text);
	line-height: 1.6;
}

:is(.cj-inhalt, .cj-textseite) :is(h1, h2, h3) {
	overflow-wrap: break-word;
	hyphens: manual;
}

/* Lange zentrierte Absätze nicht über die ganze Breite laufen lassen */
.cj-inhalt p.has-text-align-center:not(.has-saol-font-family) {
	max-width: 44em;
	margin-inline: auto;
}

/* Zwischentitel: h4 und Absätze, die nur aus fettem Text bestehen */
:is(.cj-inhalt, .cj-textseite) :is(h4, .cj-zwischentitel) {
	font-family: var(--wp--preset--font-family--geograph);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin-top: 1.8em;
	margin-bottom: 0.3em;
}

:is(.cj-inhalt, .cj-textseite) :is(h4, .cj-zwischentitel):first-child {
	margin-top: 0;
}

.cj-inhalt .cj-zwischentitel strong {
	font-weight: inherit;
}

/* Dachzeile über dem Seitentitel und über Abschnitten */
.cj-inhalt .is-style-ueberlappend > p:first-child,
.cj-inhalt p.has-mittel-font-size:not(.has-saol-font-family) {
	font-family: var(--wp--preset--font-family--geograph);
	font-size: var(--cj-dachzeile) !important;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.25em !important;
	text-transform: uppercase;
	margin-top: 0;
	margin-bottom: 0.8em;
}

/* Einleitung in Saol kursiv, überall gleich groß */
.cj-inhalt p.has-saol-font-family {
	font-size: var(--cj-einleitung) !important;
	line-height: 1.35 !important;
	max-width: 34em;
	margin-inline: auto;
}

/* Kartentitel (Zimmer- und Raumkarten) */
.cj-zimmerkasten :is(h2, h3) {
	font-size: clamp(1.9rem, 3vw, 2.8rem);
	line-height: 0.95;
	margin: 0 0 0.6em;
}

/* Regionsseite: großes Zitat bleibt h3-Größe */
.cj-inhalt .wp-block-column > h3:only-child {
	font-size: clamp(1.9rem, 3.4vw, 3rem);
}

/* Auszeichnung: Knöpfe, Bildunterschriften, Tabs, Akkordeon */
.cj-inhalt :is(.wp-block-button__link, figcaption.wp-element-caption, .wp-block-tab-list button, .wp-block-accordion-heading__toggle) {
	font-family: var(--wp--preset--font-family--geograph);
	font-size: var(--cj-auszeichnung);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.cj-tabs .wp-block-tab-panel {
	font-weight: 400;
	letter-spacing: 0;
}

/* ---------- Raumkarten auf der Startseite (ab 1.3.0) ---------- */

@media (min-width: 782px) {
	.cj-karte-umgekehrt {
		flex-direction: row-reverse;
	}
}

.cj-bereichskarte .cj-zimmerkasten {
	justify-content: center;
}

.cj-bereichskarte .cj-zimmerkasten p {
	max-width: 30em;
	margin-inline: auto;
}

.wp-block-gallery.is-style-karussell figure.wp-block-image img {
	object-position: 50% 40%;
}

.wp-block-gallery.is-style-karussell .cj-karussell-bahn {
	touch-action: pan-y;
	cursor: grab;
}

.wp-block-gallery.is-style-karussell.cj-zieht .cj-karussell-bahn {
	cursor: grabbing;
	transition: none;
}

.wp-block-gallery.is-style-karussell img {
	user-select: none;
	-webkit-user-drag: none;
}

.cj-karussell-pfeil svg {
	filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.55));
}

.cj-karussell-zaehler {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 2;
	padding: 4px 10px;
	background: rgba(11, 42, 32, 0.75);
	color: var(--wp--preset--color--champagner);
	font-family: var(--wp--preset--font-family--geograph);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.4;
	pointer-events: none;
}

.cj-rundgang > .cj-bereichskarte + .cj-bereichskarte {
	margin-top: 20px !important;
}

/* ---------- Startseite: wechselnde Formate (ab 1.3.0) ---------- */

.cj-abschnitt > * + * {
	margin-block-start: 2.2rem;
}

.cj-abschnitt.cj-ohne-oben {
	padding-top: 0 !important;
}

/* Einleitung: oben Text + Hausbild, darunter drei Spalten, zum Schluss ein Satz */
.cj-einleitung .cj-einleitung-oben h2,
.cj-einleitung .cj-einleitung-oben p {
	text-align: left !important;
}

.cj-einleitung .cj-einleitung-oben p.has-saol-font-family {
	margin-inline: 0;
}

.cj-bild-rahmen img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--wp--preset--color--champagner);
	padding: 10px;
}

.cj-drei {
	margin-top: 4rem !important;
	padding-top: 2.5rem;
	border-top: 1px solid rgba(230, 204, 179, 0.4);
}

.cj-drei p {
	max-width: none !important;
}

/* Text neben Bild ohne Kasten */
.cj-split-text p.has-saol-font-family,
.cj-split-text p {
	margin-inline: 0;
}

.cj-split .cj-split-text h3 {
	font-size: clamp(2.3rem, 5.2vw, 4.75rem);
	line-height: 0.92;
}

/* Bildformate im Karussell */
.wp-block-gallery.is-style-karussell.cj-format-hoch figure.wp-block-image img {
	aspect-ratio: 4 / 5;
}

.wp-block-gallery.is-style-karussell.cj-format-quer figure.wp-block-image img {
	aspect-ratio: 4 / 3;
}

.wp-block-gallery.is-style-karussell.cj-format-band figure.wp-block-image img {
	aspect-ratio: auto;
	height: 78vh !important;
	min-height: 460px;
}

/* Bildband mit Text im Bild (Bar) */
.cj-band {
	position: relative;
}

.cj-band .cj-band-text {
	position: absolute;
	left: 5vw;
	bottom: 5vw;
	z-index: 3;
	max-width: 34rem;
	padding: 2rem 2.4rem;
	background: rgba(11, 42, 32, 0.82);
	border: 1px solid var(--wp--preset--color--champagner);
	margin: 0 !important;
}

.cj-band .cj-band-text h3 {
	font-size: clamp(2.3rem, 4.4vw, 4rem);
	line-height: 0.92;
}

.cj-band .cj-band-text p {
	margin-inline: 0;
}

.cj-band .cj-karussell-zaehler {
	right: 5vw;
	bottom: 5vw;
}

/* Streifen: mehrere Bilder nebeneinander */
.wp-block-gallery.is-style-karussell.cj-streifen figure.wp-block-image {
	flex: 0 0 calc(100% / var(--cj-pro, 3)) !important;
	width: calc(100% / var(--cj-pro, 3)) !important;
	padding-right: 10px;
}

.wp-block-gallery.cj-pro-3 {
	--cj-pro: 3;
}

.wp-block-gallery.cj-pro-4 {
	--cj-pro: 4;
}

/* Kacheln nebeneinander (Innenhof, Haus & Kapelle) */
.cj-kachel > h3 {
	margin-top: 1.4rem;
}

.cj-kachel > p {
	max-width: 26em;
	margin-inline: auto;
}

/* ---------- FAQ ---------- */

.cj-faq h3 {
	font-size: clamp(1.6rem, 2.4vw, 2.2rem);
	margin: 2.4rem 0 0.6rem;
}

.cj-faq-spalten > .wp-block-column > h3:first-child {
	margin-top: 0;
}

.cj-faq .wp-block-details.cj-frage {
	border-bottom: 1px solid rgba(230, 204, 179, 0.5);
	margin: 0;
	color: var(--wp--preset--color--champagner);
}

.cj-faq .wp-block-details.cj-frage summary {
	position: relative;
	list-style: none;
	padding: 0.95rem 2rem 0.95rem 0;
	font-size: var(--cj-text);
	line-height: 1.4;
	cursor: pointer;
}

.cj-faq .wp-block-details.cj-frage summary::-webkit-details-marker {
	display: none;
}

.cj-faq .wp-block-details.cj-frage summary::after {
	content: "+";
	position: absolute;
	right: 0;
	top: 0.8rem;
	font-size: 1.4rem;
	line-height: 1;
}

.cj-faq .wp-block-details.cj-frage[open] summary::after {
	content: "–";
}

.cj-faq .wp-block-details.cj-frage summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--champagner);
	outline-offset: 2px;
}

.cj-faq .wp-block-details.cj-frage > p {
	margin: 0 0 1.1rem;
	max-width: 36em;
	opacity: 0.9;
}

.cj-faq a {
	text-decoration: underline;
}

@media (max-width: 1024px) {
	.wp-block-gallery.cj-pro-4 {
		--cj-pro: 3;
	}
}

@media (max-width: 781px) {
	.wp-block-gallery.cj-pro-3,
	.wp-block-gallery.cj-pro-4 {
		--cj-pro: 1.3;
	}

	.cj-band .cj-band-text {
		position: static;
		max-width: none;
		border: 0;
		padding: 2rem 5vw;
		background: var(--wp--preset--color--dunkelgruen);
	}

	.wp-block-gallery.is-style-karussell.cj-format-band figure.wp-block-image img {
		height: auto !important;
		min-height: 0;
		aspect-ratio: 4 / 3;
	}

	.cj-band .cj-karussell-zaehler {
		right: 12px;
		bottom: 12px;
	}

	.cj-split .cj-split-text h3 {
		font-size: clamp(2.3rem, 9vw, 3rem);
	}
}

/* Karussell nur in Karten auf volle Spaltenhöhe strecken */
.wp-block-gallery.is-style-karussell {
	height: auto;
}

.cj-karussell-spalte .wp-block-gallery.is-style-karussell {
	height: 100%;
}

/* Titel in Abschnitten groß wie auf der Zimmerseite (Dachzeile, Eros, Saol) */
.cj-abschnitt > h3 {
	font-size: clamp(2.3rem, 5.2vw, 4.75rem);
	line-height: 0.92;
}

/* ---------- Kein Text klebt an einem Bild (ab 1.3.0) ---------- */

.cj-inhalt :is(p, h1, h2, h3, h4, ul, .wp-block-buttons) + :is(.wp-block-gallery, .wp-block-image, .wp-block-video, .is-style-rahmen) {
	margin-top: 2.25rem !important;
}

.cj-inhalt :is(.wp-block-gallery, .wp-block-image, .wp-block-video, .is-style-rahmen) + :is(p, h1, h2, h3, h4, ul, .wp-block-buttons) {
	margin-top: 1.75rem !important;
}

.cj-inhalt .cj-kachel > .wp-block-gallery:first-child {
	margin-top: 0 !important;
}

@media (max-width: 781px) {
	/* Gestapelte Spalten: Luft zwischen Text und Bild; Karten bleiben bündig */
	.cj-inhalt .wp-block-columns:not(.cj-zimmerkarte) {
		row-gap: 2.5rem !important;
	}

	.cj-inhalt .wp-block-columns.cj-drei {
		row-gap: 1.75rem !important;
	}
}

.cj-inhalt :is(p, h2, h3, h4) + .wp-block-columns {
	margin-top: 2.75rem !important;
}

.wp-block-gallery.is-style-diashow.cj-verlauf-dunkelgruen::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background-image: linear-gradient(180deg, rgba(230, 204, 179, 0) 0%, var(--wp--preset--color--dunkelgruen) 100%);
	opacity: 0.5;
	pointer-events: none;
}

.cj-split .is-style-rahmen video {
	display: block;
	width: 100%;
	height: auto;
}

.cj-abschnitt > .wp-block-buttons {
	margin-top: 2rem !important;
}

/* ---------- Bild über die volle Breite mit Textbox (Preise, ab 1.3.4) ---------- */

.wp-block-cover.cj-bildbox {
	align-items: center;
}

.cj-bildbox .cj-bildbox-text {
	max-width: 36rem;
	padding: 2.4rem 2.6rem;
	background: rgba(75, 10, 11, 0.88);
	border: 1px solid var(--wp--preset--color--champagner);
	color: var(--wp--preset--color--champagner);
}

.cj-bildbox .cj-bildbox-text > * + * {
	margin-top: 0.9rem;
}

.cj-bildbox .cj-bildbox-text h2 {
	font-size: clamp(2.2rem, 4vw, 3.6rem);
	line-height: 0.92;
	margin: 0 0 1rem;
}

.cj-bildbox .cj-bildbox-text p {
	margin-inline: 0;
}

@media (max-width: 781px) {
	/* Am Handy: Foto oben ganz sichtbar, Textbox darunter */
	.wp-block-cover.cj-bildbox {
		display: block;
		min-height: 0 !important;
		padding: 0 !important;
		background: var(--wp--preset--color--bordeaux);
	}

	.wp-block-cover.cj-bildbox .wp-block-cover__image-background {
		position: static;
		display: block;
		width: 100%;
		height: auto;
		aspect-ratio: 3 / 2;
		object-fit: cover;
	}

	.wp-block-cover.cj-bildbox .wp-block-cover__background {
		display: none;
	}

	.wp-block-cover.cj-bildbox .wp-block-cover__inner-container {
		width: 100%;
		padding: 0;
	}

	.cj-bildbox .cj-bildbox-text {
		max-width: none;
		border: 0;
		padding: 2rem 5vw 2.5rem;
		background: var(--wp--preset--color--bordeaux);
	}
}

/* ---------- Fächer statt Akkordeon (Preise, ab 1.3.4) ---------- */

.cj-faecher {
	display: flex;
	gap: 10px;
	height: clamp(480px, 64vh, 640px);
	margin-top: 2.5rem !important;
}

.cj-faecher > .cj-blatt {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	margin: 0 !important;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--champagner);
	background-size: cover;
	background-position: center;
	cursor: pointer;
	transition: flex-grow 0.7s cubic-bezier(0.2, 0.75, 0.2, 1);
	color: var(--wp--preset--color--champagner);
}

.cj-faecher > .cj-blatt::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(11, 42, 32, 0.15) 0%, rgba(11, 42, 32, 0.85) 75%);
	transition: background 0.6s;
}

.cj-faecher > .cj-blatt.ist-offen {
	flex-grow: 5.5;
	cursor: default;
}

.cj-faecher > .cj-blatt.ist-offen::before {
	background: linear-gradient(90deg, rgba(75, 10, 11, 0.92) 0%, rgba(75, 10, 11, 0.8) 55%, rgba(75, 10, 11, 0.25) 100%);
}

.cj-faecher > .cj-blatt:focus-visible {
	outline: 2px solid var(--wp--preset--color--champagner);
	outline-offset: 3px;
}

.cj-blatt .cj-blatt-inhalt {
	position: absolute;
	inset: 0;
	z-index: 1;
	padding: 2rem 2.2rem;
}

/* Titel: zu senkrecht am unteren Rand, offen waagrecht oben */
.cj-blatt .cj-blatt-inhalt > h3 {
	position: absolute;
	left: 1.1rem;
	bottom: 1.4rem;
	margin: 0;
	font-size: clamp(1.6rem, 2.4vw, 2.4rem);
	line-height: 1;
	white-space: nowrap;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	transition: opacity 0.3s;
}

.cj-blatt.ist-offen .cj-blatt-inhalt > h3 {
	position: static;
	writing-mode: horizontal-tb;
	transform: none;
	font-size: clamp(2rem, 3.4vw, 3.2rem);
	margin-bottom: 1.2rem;
}

.cj-blatt .cj-blatt-inhalt > :not(h3) {
	width: min(34rem, 100%);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.35s, transform 0.35s, visibility 0s 0.35s;
}

.cj-blatt.ist-offen .cj-blatt-inhalt > :not(h3) {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.45s 0.3s, transform 0.45s 0.3s, visibility 0s 0.3s;
}

.cj-blatt .cj-blatt-inhalt p {
	margin: 0 0 1rem !important;
	max-width: 32rem;
	text-align: left !important;
}

.cj-blatt-liste {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cj-blatt-liste li {
	padding: 0.35rem 0 0.35rem 1.2rem;
	border-bottom: 1px solid rgba(230, 204, 179, 0.25);
	position: relative;
	font-size: 16px !important;
	line-height: 1.35 !important;
}

.cj-blatt-liste li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.85rem;
	width: 6px;
	height: 6px;
	border: 1px solid currentColor;
	transform: rotate(45deg);
}

.cj-blatt-liste.cj-zweispaltig {
	columns: 2;
	column-gap: 2rem;
	width: min(44rem, 100%) !important;
}

.cj-blatt-liste.cj-zweispaltig li {
	break-inside: avoid;
	font-size: 15px !important;
}

/* Editor: alle Blätter offen untereinander, damit man sie bearbeiten kann */
.editor-styles-wrapper .cj-faecher {
	flex-direction: column;
	height: auto;
}

.editor-styles-wrapper .cj-blatt .cj-blatt-inhalt {
	position: relative;
}

.editor-styles-wrapper .cj-blatt .cj-blatt-inhalt > h3 {
	position: static;
	writing-mode: horizontal-tb;
	transform: none;
}

.editor-styles-wrapper .cj-blatt .cj-blatt-inhalt > :not(h3) {
	opacity: 1;
	visibility: visible;
	transform: none;
}

@media (max-width: 781px) {
	/* Am Handy: Fächer untereinander, antippen öffnet */
	.cj-faecher {
		flex-direction: column;
		height: auto;
		gap: 8px;
	}

	.cj-faecher > .cj-blatt {
		flex: none;
		min-height: 96px;
		transition: none;
	}

	.cj-faecher > .cj-blatt::before {
		background: linear-gradient(90deg, rgba(11, 42, 32, 0.85), rgba(11, 42, 32, 0.35));
	}

	.cj-blatt .cj-blatt-inhalt {
		position: relative;
		padding: 1.6rem 5vw;
	}

	.cj-blatt .cj-blatt-inhalt > h3 {
		position: static;
		writing-mode: horizontal-tb;
		transform: none;
		font-size: 2rem;
	}

	.cj-blatt.ist-offen .cj-blatt-inhalt > h3 {
		font-size: 2.2rem;
	}

	.cj-blatt .cj-blatt-inhalt > :not(h3) {
		display: none;
	}

	.cj-blatt.ist-offen .cj-blatt-inhalt > :not(h3) {
		display: block;
	}

	.cj-blatt-liste.cj-zweispaltig {
		columns: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cj-faecher > .cj-blatt,
	.cj-blatt .cj-blatt-inhalt > :not(h3) {
		transition: none !important;
	}
}

/* ---------- Lightbox (ab 1.3.8) ---------- */

.cj-lb-klickbar img,
.wp-block-cover.cj-lb-klickbar,
.cj-faecher > .cj-blatt.ist-offen.cj-lb-fach {
	cursor: zoom-in;
}

.wp-block-cover.cj-lb-klickbar .cj-bildbox-text {
	cursor: auto;
}

.wp-block-cover.cj-lb-klickbar:focus-visible,
.wp-block-gallery.is-style-diashow.cj-lb-klickbar:focus-visible {
	outline: 2px solid var(--wp--preset--color--champagner);
	outline-offset: -6px;
}

.cj-lb-klickbar img:focus-visible {
	outline: 2px solid var(--wp--preset--color--champagner);
	outline-offset: -4px;
}

html.cj-lb-offen,
html.cj-lb-offen body {
	overflow: hidden;
}

.cj-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--dunkelgruen);
	color: var(--wp--preset--color--champagner);
	opacity: 0;
	transition: opacity 0.25s ease;
	overscroll-behavior: contain;
}

.cj-lightbox[hidden] {
	display: none;
}

.cj-lightbox.ist-offen {
	opacity: 1;
}

.cj-lb-buehne {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	touch-action: none;
	cursor: grab;
}

.cj-lb-buehne:active {
	cursor: grabbing;
}

.cj-lb-bahn {
	display: flex;
	height: 100%;
	transition: transform 0.4s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.cj-lb-bahn.ohne-uebergang {
	transition: none;
}

.cj-lb-bahn > figure {
	flex: 0 0 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 64px 88px 8px;
	box-sizing: border-box;
}

.cj-lb-bahn img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border: 1px solid rgba(230, 204, 179, 0.5);
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}

.cj-lb-fuss {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 14px 88px 22px;
	min-height: 58px;
	box-sizing: border-box;
}

.cj-lb-text {
	margin: 0;
	font-family: var(--wp--preset--font-family--saol);
	font-style: italic;
	font-size: 18px;
	line-height: 1.35;
}

.cj-lb-zaehler {
	flex: 0 0 auto;
	font-family: var(--wp--preset--font-family--geograph);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.15em;
}

.cj-lightbox .cj-lb-pfeil {
	position: absolute;
	top: calc(50% - 30px);
	width: 64px;
	height: 64px;
	color: var(--wp--preset--color--champagner);
}

.cj-lightbox .cj-karussell-zurueck {
	left: 12px;
}

.cj-lightbox .cj-karussell-weiter {
	right: 12px;
}

.cj-lightbox .cj-lb-pfeil svg {
	width: 34px;
	height: 44px;
	filter: none;
}

.cj-lb-einzeln .cj-lb-pfeil {
	display: none;
}

.cj-lb-zu {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--champagner);
	cursor: pointer;
}

.cj-lb-zu svg {
	width: 26px;
	height: 26px;
	stroke: currentColor;
	stroke-width: 1.4;
	fill: none;
}

.cj-lightbox button:focus-visible {
	outline: 2px solid var(--wp--preset--color--champagner);
	outline-offset: -2px;
}

@media (max-width: 781px) {
	.cj-lb-bahn > figure {
		padding: 60px 0 0;
	}

	.cj-lb-bahn img {
		border: 0;
	}

	.cj-lb-fuss {
		padding: 12px 5vw 18px;
	}

	.cj-lb-text {
		font-size: 16px;
	}

	/* Am Handy wird gewischt; Pfeile bleiben klein am Rand. */
	.cj-lightbox .cj-lb-pfeil {
		top: auto;
		bottom: 64px;
		width: 48px;
		height: 48px;
	}

	.cj-lightbox .cj-lb-pfeil svg {
		width: 22px;
		height: 30px;
		filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
	}
}

@media (prefers-reduced-motion: reduce) {
	.cj-lightbox,
	.cj-lb-bahn {
		transition: none;
	}
}
