/* Gruppen-Stile: Schritt, Slider, Person, Zeitleiste, Link-Karte, Trauerfeier-Karte, Glas, Merkmal. */

/* Schritt-Karte (Todesfall). Nummer per CSS-Zähler, Hover blau. */
.is-style-step {
	position: relative;
	min-height: 230px;
	padding: 26px 24px;
	gap: 10px !important;
	border-radius: 18px;
	background: var(--wp--preset--color--sand);
	counter-increment: step;
	transition: background .25s, color .25s, transform .25s, box-shadow .25s;
}

.is-style-step::before {
	content: counter(step);
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
	color: var(--wp--preset--color--blue);
	font-size: 15px;
	font-weight: 700;
}

.is-style-step > * {
	margin: 0 !important;
}

/* Auf grauer Sektion hebt sich die Karte weiß ab. */
.is-style-section-sand .is-style-step {
	background: var(--wp--preset--color--base);
}

.is-style-step h3 {
	font-size: 19.5px;
}

.is-style-step p {
	flex: 1;
	color: var(--wp--preset--color--muted);
	font-size: 16px;
}

.is-style-step:hover,
.is-style-step:focus-within {
	background: var(--wp--preset--color--blue);
	color: #fff;
	transform: translateY(-3px);
	box-shadow: 0 20px 40px -22px rgba(14, 65, 148, .7);
}

.is-style-step:hover h3,
.is-style-step:focus-within h3 {
	color: #fff;
}

.is-style-step:hover p,
.is-style-step:focus-within p {
	color: #cfdcf6;
}

.is-style-step:hover::before,
.is-style-step:focus-within::before {
	background: rgba(255, 255, 255, .15);
	box-shadow: none;
	color: #fff;
}

.is-style-step:hover .is-style-number .wp-block-button__link,
.is-style-step:focus-within .is-style-number .wp-block-button__link {
	border-color: rgba(255, 255, 255, .55);
	color: #fff;
}

.is-style-step:hover .is-style-number .wp-block-button__link:hover,
.is-style-step:focus-within .is-style-number .wp-block-button__link:hover {
	border-color: #fff;
	background: #fff;
	color: var(--wp--preset--color--blue);
}

/* Textlink in der Schritt-Karte („Zum Vortrag →“, Startseite Vorsorge): HIMML-Blau,
   auf der blauen Hover-Fläche weiß. Der Link spannt sich über die ganze Karte. */
.is-style-step .himml-more-link {
	margin-top: auto;
}

.is-style-step .himml-more-link a {
	color: var(--wp--preset--color--blue);
	transition: color .25s;
}

.is-style-step .himml-more-link a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.is-style-step:hover .himml-more-link a,
.is-style-step:focus-within .himml-more-link a {
	color: #fff;
	text-decoration: underline;
}

.is-style-step:focus-within {
	--himml-focus: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.is-style-step {
		transition: none;
	}

	.is-style-step:hover,
	.is-style-step:focus-within {
		transform: none;
	}
}

/* Slider: waagerecht scrollend, rastet ein. Pfeile ergänzt inc/blocks.php. */
.himml-rail-wrap {
	position: relative;
}

.is-style-rail {
	align-items: flex-start !important;
	--n: 2.2;
	--g: 16px;
	--bleed: var(--wp--style--root--padding-left, 20px);
	gap: var(--g) !important;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	margin-inline: calc(var(--bleed) * -1) !important;
	padding: 4px var(--bleed);
	scroll-padding-inline: var(--bleed);
}

.is-style-rail::-webkit-scrollbar {
	display: none;
}

.is-style-rail > * {
	flex: 0 0 calc((100% - (var(--n) - 1) * var(--g)) / var(--n)) !important;
	margin: 0 !important;
	scroll-snap-align: start;
}

@media (min-width: 560px) {
	.is-style-rail {
		--n: 3.4;
		--g: 18px;
	}
}

@media (min-width: 900px) {
	.is-style-rail {
		--n: 4.4;
	}
}

@media (min-width: 1200px) {
	.is-style-rail {
		--n: 6;
		margin-inline: 0 !important;
		padding-inline: 0;
		scroll-padding-inline: 0;
	}
}

.himml-rail-nav {
	display: none;
}

@media (min-width: 900px) {
	.himml-rail-nav {
		display: block;
	}
}

.himml-rail-nav__btn {
	position: absolute;
	z-index: 2;
	top: calc(var(--fig-h, 240px) / 2);
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 50%;
	background: rgba(255, 255, 255, .96);
	color: var(--wp--preset--color--ink);
	box-shadow: var(--wp--preset--shadow--soft);
	cursor: pointer;
	transform: translateY(-50%);
	transition: border-color .2s, opacity .25s, visibility .25s;
}

.himml-rail-nav__btn svg {
	fill: currentColor;
}

.himml-rail-nav__btn:hover {
	border-color: var(--wp--preset--color--ink);
}

.himml-rail-nav__btn.is-prev {
	left: -24px;
}

.himml-rail-nav__btn.is-next {
	right: -24px;
}

.himml-rail-nav__btn[disabled] {
	opacity: 0;
	visibility: hidden;
}

/* Person im Slider. */
.is-style-person > * {
	margin: 0 !important;
}

.is-style-person .wp-block-image {
	margin-bottom: 10px !important;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	border-radius: 18px;
	background: #12284f;
}

.is-style-person .wp-block-image img {
	width: 100%;
	height: 100%;
	border-radius: 0;
	object-fit: cover;
	filter: saturate(.9);
	transition: transform .6s var(--himml-ease);
}

.is-style-person:hover .wp-block-image img {
	transform: scale(1.04);
}

.himml-person__name {
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
}

.himml-person__role {
	margin-top: 4px !important;
	color: var(--wp--preset--color--on-night-muted);
	font-size: 15px;
	line-height: 1.4;
}

/* Zeitleiste: Jahreszahlen mit Trennlinien. */
/* Jahreszahlen oben bündig, auch wenn ein Text zweizeilig umbricht
 * (das Flex-Layout von WordPress zentriert sonst senkrecht). */
.is-style-timeline {
	align-items: stretch !important;
	gap: 0 !important;
	margin-top: 16px !important;
	border-top: 1px solid var(--wp--preset--color--line);
}

.is-style-timeline > p {
	flex: 1;
	margin: 0 !important;
	padding: 16px 0 0 12px;
	border-left: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
	font-size: 14px;
}

.is-style-timeline > p:first-child {
	padding-left: 0;
	border-left: 0;
}

.is-style-timeline strong {
	display: block;
	color: var(--wp--preset--color--ink);
	font-size: 21.5px;
	font-weight: 700;
	letter-spacing: -.02em;
}

@media (max-width: 900px) {
	.is-style-timeline > p {
		flex: 1 1 40%;
		margin-bottom: 10px !important;
	}
}

/* Raster mit nur einer oder zwei Link-Karten (z. B. Grabarten nach Bestattungsart):
 * Karten behalten die Breite einer Drittelspalte und stehen mittig statt links. */
@media (min-width: 900px) {
	.is-layout-grid:has(> .is-style-link-card:first-child:nth-last-child(-n + 2)) {
		grid-template-columns: repeat(auto-fit, calc((100% - 2 * 18px) / 3));
		justify-content: center;
	}
}

/* Link-Karte: ganze Karte klickbar über den Link im Text. */
.is-style-link-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--wp--preset--border-radius--large);
	background: var(--wp--preset--color--sand);
	transition: transform .25s, box-shadow .25s;
}

.is-style-link-card > * {
	margin: 0 !important;
}

/* Auf grauer Sektion hebt sich die Karte weiß ab. */
.is-style-section-sand .is-style-link-card {
	background: var(--wp--preset--color--base);
}

/* Im Abfrage-Loop ist das <li> die Rasterzelle: Karte füllt sie, damit alle
 * Karten einer Reihe gleich hoch sind, egal wie lang Titel und Auszug sind. */
.wp-block-post-template > li > .is-style-link-card {
	height: 100%;
}

.is-style-link-card > .himml-link-card__text {
	flex: 1;
}

/* Beitragskarten (Abfrage-Loop): Titel wird beim Überfahren blau, unten rechts
 * ein Pfeil im Kreis, der sanft nach rechts stupst – zeigt: Die Karte ist klickbar. */
.wp-block-post-template .is-style-link-card .himml-link-card__text {
	padding-bottom: 76px;
}

.wp-block-post-template .is-style-link-card .wp-block-post-title a {
	transition: color .2s;
}

.wp-block-post-template .is-style-link-card:is(:hover, :focus-within) .wp-block-post-title a {
	color: var(--wp--preset--color--blue);
}

.wp-block-post-template .is-style-link-card::after {
	content: "";
	position: absolute;
	right: 20px;
	bottom: 20px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background:
		var(--wp--preset--color--blue) center / 16px 16px no-repeat;
	box-shadow: 0 0 0 0 rgba(14, 65, 148, .35);
	pointer-events: none;
	transition: background-color .25s, transform .25s var(--himml-ease);
	animation: himml-card-pulse 2.8s ease-out infinite;
}

/* Pfeil als Maske auf einer eigenen Lage, damit er weiß auf Blau steht. */
.wp-block-post-template .is-style-link-card > .himml-link-card__text::after {
	content: "";
	position: absolute;
	right: 32px;
	bottom: 32px;
	z-index: 1;
	width: 16px;
	height: 16px;
	background: #fff;
	-webkit-mask: url("../../icons/arrow-right.svg") center / contain no-repeat;
	mask: url("../../icons/arrow-right.svg") center / contain no-repeat;
	pointer-events: none;
	animation: himml-card-nudge 2.8s var(--himml-ease) infinite;
}

.wp-block-post-template .is-style-link-card:is(:hover, :focus-within)::after {
	background-color: var(--wp--preset--color--blue-bright);
	transform: scale(1.08);
	animation: none;
}

.wp-block-post-template .is-style-link-card:is(:hover, :focus-within) > .himml-link-card__text::after {
	animation: himml-card-nudge 1s var(--himml-ease) infinite;
}

@keyframes himml-card-pulse {
	0%, 55% {
		box-shadow: 0 0 0 0 rgba(14, 65, 148, .35);
	}

	85%, 100% {
		box-shadow: 0 0 0 10px rgba(14, 65, 148, 0);
	}
}

@keyframes himml-card-nudge {
	0%, 60%, 100% {
		transform: translateX(0);
	}

	75% {
		transform: translateX(4px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-post-template .is-style-link-card::after,
	.wp-block-post-template .is-style-link-card > .himml-link-card__text::after {
		animation: none !important;
	}
}

.is-style-link-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--wp--preset--shadow--soft);
}

.is-style-link-card .wp-block-image,
.is-style-link-card .wp-block-post-featured-image {
	margin: 0;
	overflow: hidden;
	background: var(--wp--preset--color--grey);
}

.is-style-link-card img {
	width: 100%;
	border-radius: 0 !important;
	transition: transform .6s var(--himml-ease);
}

.is-style-link-card:hover img {
	transform: scale(1.04);
}

.is-focus-upper img {
	object-position: 50% 34%;
}

.himml-link-card__text {
	padding: 22px 24px 24px;
}

.himml-link-card__text > * + * {
	margin-block-start: 6px;
}

.himml-link-card__label {
	color: var(--wp--preset--color--blue);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.himml-link-card__title {
	color: var(--wp--preset--color--ink);
	font-size: 21.5px;
	font-weight: 700;
	letter-spacing: -.01em;
	line-height: 1.25;
}

.himml-link-card__desc {
	color: var(--wp--preset--color--muted);
	font-size: 16px;
	line-height: 1.5;
}

.himml-link-card__link {
	margin-top: 8px !important;
	font-size: 16.5px;
}

.himml-link-card__link a,
.is-style-link-card .wp-block-post-title a {
	color: var(--wp--preset--color--blue);
	font-weight: 500;
	text-underline-offset: 4px;
}

.is-style-link-card .wp-block-post-title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.himml-link-card__link a::after,
.is-style-link-card .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

@media (prefers-reduced-motion: reduce) {
	.is-style-link-card {
		transition: none;
	}

	.is-style-link-card:hover {
		transform: none;
	}
}

/* Trauerfeier-Karte. */
.is-style-obit-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 8px 24px -20px var(--wp--preset--color--ink);
	color: var(--wp--preset--color--body);
	transition: border-color .2s, box-shadow .2s, transform .2s;
}

.is-style-obit-card > * {
	margin: 0 !important;
}

.is-style-obit-card:hover {
	border-color: var(--wp--preset--color--grey-mid);
	box-shadow: 0 18px 36px -24px var(--wp--preset--color--ink);
	transform: translateY(-3px);
}

.himml-obit-card__image {
	flex: none;
	padding: 22px;
	border-bottom: 1px solid var(--wp--preset--color--line);
	background: #fff;
}

.himml-obit-card__image img {
	border-radius: 0 !important;
}

.himml-obit-card__body {
	flex: 1;
	gap: 0 !important;
	padding: 26px 26px 24px;
	text-align: center;
}

.himml-obit-card__body > * {
	margin: 0 !important;
}

.himml-obit-card__label {
	margin-bottom: 10px !important;
	color: var(--wp--preset--color--blue);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .13em;
	text-transform: uppercase;
}

.is-style-obit-card .wp-block-post-title {
	color: var(--wp--preset--color--ink);
	font-size: 29px;
	letter-spacing: -.02em;
}

.himml-obit-card__date {
	margin-top: 20px !important;
	color: var(--wp--preset--color--ink);
	font-size: 16.5px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.himml-obit-card__time {
	font-size: 16.5px;
	font-variant-numeric: tabular-nums;
}

.himml-obit-card__place {
	margin-top: 14px !important;
	font-size: 15px;
}

.himml-obit-card__address {
	font-size: 15px;
}

.himml-obit-card__action {
	margin-top: auto !important;
	padding-top: 24px;
	color: var(--wp--preset--color--blue) !important;
	font-size: 15px;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.himml-obit-card__action::after {
	content: "";
	position: absolute;
	inset: 0;
}

.is-style-obit-card:hover .himml-obit-card__action {
	text-decoration-thickness: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.is-style-obit-card {
		transition: none;
	}

	.is-style-obit-card:hover {
		transform: none;
	}
}

/* Glasfläche auf Dunkel. */
.is-style-glass {
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: var(--wp--preset--border-radius--x-large);
	background: rgba(255, 255, 255, .06);
}

/* Merkmal mit Icon (Hero). */
.is-style-trust {
	gap: 10px !important;
	color: #d6dff0;
	font-size: 16.5px;
	font-weight: 500;
}

.is-style-trust > * {
	margin: 0 !important;
}

/* Logo-Karte: Siegel, Verbände, Partner. Logo in fester Höhe, darunter Name,
 * Text und Links. Ganze Karte nicht klickbar (mehrere Links). */
.is-style-logo-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 24px 24px 26px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--preset--border-radius--large);
	background: #fff;
	color: var(--wp--preset--color--body);
}

.is-style-logo-card > * {
	margin: 0 !important;
}

.is-style-logo-card > * + * {
	margin-top: 10px !important;
}

.himml-logo-card__logo {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	height: 96px;
	margin-bottom: 10px !important;
}

.himml-logo-card__logo img {
	width: auto !important;
	max-width: 100%;
	max-height: 96px;
	border-radius: 0 !important;
	object-fit: contain;
}

.is-style-logo-card h3 {
	color: var(--wp--preset--color--ink);
	font-size: 19px;
	line-height: 1.3;
}

.himml-logo-card__text {
	font-size: 15.5px;
	line-height: 1.55;
}

.himml-logo-card__links {
	margin-top: auto !important;
	padding-top: 14px;
	font-size: 15.5px;
	line-height: 1.7;
	overflow-wrap: anywhere;
}

.himml-logo-card__links a {
	font-weight: 500;
	text-underline-offset: 4px;
}

/* Kontakt-Karte: Logo-Karte ohne Logo, Buttons und Link unten bündig. */
.himml-contact-card > .wp-block-buttons {
	margin-top: auto !important;
	padding-top: 14px;
}

.himml-contact-card > .himml-more-link {
	margin-top: 16px !important;
}

/* Blätterbuch (dflip) in voller Breite mit Seitenrand: Es zeigt Doppelseiten im
 * Querformat, seine Höhe folgt der Breite. */
.himml-flipbook.alignfull {
	padding-inline: var(--wp--style--root--padding-left, var(--wp--preset--spacing--40));
}

/* Download-Karte: Logo-Karte mit Dokument-Symbol, Link unten bündig, ganze
 * Karte klickbar über den Link (wie die Link-Karte). */
.himml-download-card {
	position: relative;
	transition: transform .25s var(--himml-ease), box-shadow .25s, border-color .25s;
}

.himml-download-card::before {
	content: "";
	flex: none;
	width: 48px;
	height: 48px;
	margin-bottom: 12px;
	border-radius: var(--wp--preset--border-radius--small);
	background: var(--wp--preset--color--mist);
	transition: background-color .25s;
}

.himml-download-card::after {
	content: "";
	position: absolute;
	top: 36px;
	left: 36px;
	width: 24px;
	height: 24px;
	background: var(--wp--preset--color--blue);
	-webkit-mask: url("../../icons/file.svg") center / contain no-repeat;
	mask: url("../../icons/file.svg") center / contain no-repeat;
	pointer-events: none;
	transition: background-color .25s;
}

.himml-download-card h3 {
	transition: color .2s;
}

.himml-download-card__link {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin-top: auto !important;
	padding-top: 18px;
	font-size: 15.5px;
}

.himml-download-card__link a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--wp--preset--color--blue);
	font-weight: 500;
	text-underline-offset: 4px;
}

.himml-download-card__link a::before {
	content: "";
	width: 16px;
	height: 16px;
	background: currentColor;
	-webkit-mask: url("../../icons/download.svg") center / contain no-repeat;
	mask: url("../../icons/download.svg") center / contain no-repeat;
}

/* !important: Das Plugin „Mimetypes Link Icons“ hängt an PDF-Links per ::after die Dateigröße an. */
.himml-download-card__link a::after {
	content: "" !important;
	position: absolute;
	inset: 0;
}

/* Das Plugin setzt außerdem ein eigenes PDF-Symbol mit Einrückung (padding mit !important); die Karte hat ihr Symbol. */
.himml-download-card__link a.mtli_attachment {
	min-height: 0;
	padding-left: 0 !important;
	background-image: none;
}

.himml-download-card__size {
	color: var(--wp--preset--color--muted);
	font-size: 14px;
}

.himml-download-card:is(:hover, :focus-within) {
	border-color: var(--wp--preset--color--mist);
	box-shadow: var(--wp--preset--shadow--soft);
	transform: translateY(-3px);
}

.himml-download-card:is(:hover, :focus-within)::before {
	background: var(--wp--preset--color--blue);
}

.himml-download-card:is(:hover, :focus-within)::after {
	background: var(--wp--preset--color--base);
}

.himml-download-card:is(:hover, :focus-within) h3 {
	color: var(--wp--preset--color--blue);
}

@media (prefers-reduced-motion: reduce) {
	.himml-download-card {
		transition: none;
	}

	.himml-download-card:is(:hover, :focus-within) {
		transform: none;
	}
}

/* Siegel-Hinweis: kleines Siegel neben Text (Standortseiten). */
.himml-seal {
	gap: clamp(20px, 3vw, 36px) !important;
}

.himml-seal > .wp-block-image {
	flex: none;
	width: clamp(80px, 10vw, 120px);
	margin: 0;
}

.himml-seal > .wp-block-image img {
	border-radius: 0;
}

.himml-seal > .wp-block-group > * + * {
	margin-block-start: 10px;
}

/* Schritte als Reihe (außerhalb der Todesfall-Tabs). */
.himml-step-row {
	counter-reset: step;
	gap: 14px !important;
}
