/* Adventskalender – Frontend */
.dma-kalender {
	--dma-bg: #f6efe6;
	--dma-tuer: #ffffff;
	--dma-akzent: #a8452f;
	--dma-text: #2f2a26;
	--dma-spalten: 6;
	--dma-radius: 14px;
	background: var(--dma-bg);
	color: var(--dma-text);
	padding: clamp(14px, 3vw, 32px);
	border-radius: calc(var(--dma-radius) + 6px);
	box-sizing: border-box;
}
/* Hintergrundbild mit Schleier */
.dma-kalender.hat-hintergrund {
	position: relative;
	isolation: isolate;
	background: var(--dma-bg) var(--dma-bild) center / cover no-repeat;
	overflow: hidden;
}
.dma-kalender.hat-hintergrund::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--dma-bg);
	opacity: var(--dma-schleier, .3);
	z-index: -1;
	pointer-events: none;
}

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

.dma-hinweis {
	margin: 0 0 16px;
	padding: 10px 14px;
	background: #fff4d6;
	border-left: 4px solid #d9a400;
	border-radius: 6px;
	font-size: 14px;
}

.dma-raster {
	display: grid;
	grid-template-columns: repeat(var(--dma-spalten), minmax(0, 1fr));
	gap: clamp(8px, 1.6vw, 18px);
}
@media (max-width: 1024px) { .dma-raster { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .dma-raster { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Türchen */
.dma-tuer {
	position: relative;
	aspect-ratio: 1 / 1;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	perspective: 900px;
	font: inherit;
	color: inherit;
	-webkit-tap-highlight-color: transparent;
}
.dma-tuer:focus-visible { outline: 3px solid var(--dma-akzent); outline-offset: 3px; border-radius: var(--dma-radius); }

.dma-tuer__flaeche,
.dma-tuer__klappe {
	position: absolute;
	inset: 0;
	border-radius: var(--dma-radius);
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Was hinter der Tür liegt */
.dma-tuer__flaeche {
	background: color-mix(in srgb, var(--dma-akzent) 14%, var(--dma-tuer));
	background-size: cover;
	background-position: center;
	box-shadow: inset 0 2px 8px rgba(0, 0, 0, .12);
	font-weight: 700;
	font-size: clamp(16px, 2.4vw, 24px);
	color: var(--dma-akzent);
}
.dma-tuer__flaeche.hat-bild span { display: none; }

/* Die Klappe */
.dma-tuer__klappe {
	flex-direction: column;
	gap: 4px;
	background: var(--dma-tuer);
	border: 2px dashed color-mix(in srgb, var(--dma-akzent) 45%, transparent);
	box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
	transform-origin: left center;
	transition: transform .7s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease;
	backface-visibility: hidden;
	z-index: 1;
}
.dma-tuer__zahl {
	font-size: clamp(22px, 3.6vw, 40px);
	font-weight: 700;
	line-height: 1;
	color: var(--dma-akzent);
}
.dma-tuer__schloss { color: var(--dma-text); opacity: .35; }
.is-offen .dma-tuer__schloss { display: none; }

.dma-tuer.is-offen:hover .dma-tuer__klappe { transform: rotateY(-14deg); box-shadow: 4px 4px 12px rgba(0, 0, 0, .14); }
.dma-tuer.is-geoeffnet .dma-tuer__klappe { transform: rotateY(-105deg); box-shadow: none; }
.dma-tuer.is-zu { cursor: not-allowed; }
.dma-tuer.is-zu .dma-tuer__klappe { opacity: .85; }

/* Heutiges Türchen */
.dma-tuer.is-heute .dma-tuer__klappe {
	border-style: solid;
	border-color: var(--dma-akzent);
	animation: dma-puls 2.4s ease-in-out infinite;
}
.dma-tuer.is-heute.is-geoeffnet .dma-tuer__klappe { animation: none; }
@keyframes dma-puls {
	0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--dma-akzent) 40%, transparent); }
	50%      { box-shadow: 0 0 0 8px color-mix(in srgb, var(--dma-akzent) 0%, transparent); }
}

/* Wackeln bei geschlossenem Türchen */
.dma-tuer.is-wackeln .dma-tuer__klappe { animation: dma-wackeln .45s ease; }
@keyframes dma-wackeln {
	0%, 100% { transform: rotate(0); }
	25% { transform: rotate(-3deg); }
	75% { transform: rotate(3deg); }
}

/* Fenster */
.dma-dialog {
	width: min(680px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	padding: 0;
	border: 0;
	border-radius: 18px;
	background: var(--dma-tuer);
	color: var(--dma-text);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
	overflow: auto;
}
.dma-dialog::backdrop { background: rgba(30, 25, 20, .55); backdrop-filter: blur(2px); }
.dma-dialog[open] { animation: dma-rein .3s ease; }
@keyframes dma-rein { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.dma-dialog__inner { position: relative; padding: clamp(22px, 4vw, 40px); }
.dma-dialog__zu {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--dma-text);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}
.dma-dialog__zu:hover,
.dma-dialog__zu:focus-visible { background: color-mix(in srgb, var(--dma-akzent) 12%, transparent); }
.dma-dialog__tag {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--dma-akzent);
}
.dma-dialog__titel { margin: 0 40px 16px 0; color: var(--dma-text); }
.dma-dialog__inhalt img { max-width: 100%; height: auto; border-radius: 10px; }
.dma-dialog__inhalt iframe { max-width: 100%; }
.dma-dialog.is-laedt .dma-dialog__inhalt { opacity: .4; }

@media (prefers-reduced-motion: reduce) {
	.dma-tuer__klappe,
	.dma-dialog[open],
	.dma-tuer.is-heute .dma-tuer__klappe,
	.dma-tuer.is-wackeln .dma-tuer__klappe { animation: none; transition: none; }
}

/* Newsletter-Box im Türchen */
.dma-cta {
	margin-top: 28px;
	padding: 20px 22px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--dma-akzent) 9%, var(--dma-tuer));
	border-left: 4px solid var(--dma-akzent);
}
.dma-cta__text { margin: 0 0 14px; }
.dma-cta__button {
	display: inline-block;
	padding: 12px 22px;
	border-radius: 999px;
	background: var(--dma-akzent);
	color: #fff !important;
	font-weight: 700;
	text-decoration: none !important;
	transition: transform .15s ease, filter .15s ease;
}
.dma-cta__button:hover,
.dma-cta__button:focus-visible { filter: brightness(1.08); transform: translateY(-1px); }

/* ---------- Stil: Motiv auf den Türchen ---------- */
.dma-kalender.stil-motiv .dma-raster { position: relative; }
.dma-kalender.stil-motiv .dma-tuer__klappe {
	background-color: var(--dma-tuer);
	background-image: var(--dma-bild);
	background-repeat: no-repeat;
	background-size: cover;
	border: 1px solid rgba(255, 255, 255, .75);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.dma-kalender.stil-motiv .dma-tuer.is-zu .dma-tuer__klappe { opacity: 1; }
.dma-kalender.stil-motiv .dma-tuer__schloss { display: none; }
.dma-kalender.stil-motiv .dma-tuer__zahl {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2em;
	height: 2em;
	border-radius: 50%;
	background: rgba(255, 255, 255, .88);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
	font-size: clamp(14px, 2vw, 22px);
}
.dma-kalender.stil-motiv .dma-tuer.is-heute .dma-tuer__klappe {
	border: 2px solid var(--dma-akzent);
}
.dma-kalender.stil-motiv .dma-tuer.is-heute .dma-tuer__zahl {
	background: var(--dma-akzent);
	color: #fff;
}

/* Newsletter-Formular im Türchen */
.dma-nl-vorlage {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}
.dma-cta--formular .dma-cta__formular { margin-top: 4px; }
.dma-cta--formular .dma-cta__formular > * { max-width: 100% !important; }
