/* POPUP — .db-popup  (inc/popups.php + assets/js/popup.js, RELAUNCH-NOTES §9.120)
   Two layouts from the client's mock-ups (Oct 2026):
     --split  picture left, cream panel right: eyebrow, title, text, button,
              "Vielleicht später"            ("Weihnachtsfeier 2026")
     --cover  picture behind darkened text, e-mail field + button
                                              ("Genuss mit Suchtfaktor.")
   A native <dialog>, so the top layer, the focus trap and Esc come from the
   browser. Colours are the site's tokens, so each brand gets its own. */

html.db-popup-open { overflow: hidden; }

.db-popup {
	--db-popup-w: 780px;
	width: min(var(--db-popup-w), calc(100vw - 32px));
	max-width: none;
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--cream);
	color: var(--ink);
	overflow: auto;
	overscroll-behavior: contain;
}
.db-popup[open] { animation: db-popup-in .28s ease-out; }
.db-popup::backdrop { background: rgba(37, 32, 30, .62); }
@keyframes db-popup-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .db-popup[open] { animation: none; } }

/* close × — 44px hit area, top right */
.db-popup__close-form { position: absolute; top: 12px; right: 12px; z-index: 3; margin: 0; }
.db-popup__close {
	display: grid; place-items: center;
	width: 44px; height: 44px; padding: 0;
	border: 0; border-radius: 50%; background: transparent; color: var(--ink);
	cursor: pointer;
}
.db-popup__close:hover { background: rgba(0, 0, 0, .06); }
.db-popup__close:focus-visible,
.db-popup__later:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.db-popup__media img { display: block; width: 100%; height: 100%; object-fit: cover; }

.db-popup__body { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 56px 40px 40px; }
.db-popup__eyebrow { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.db-popup__title {
	margin: 0;
	font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
	font-size: clamp(1.75rem, 3.6vw, 2.375rem); line-height: 1.05;
	text-wrap: balance;
}
.db-popup__text { font-size: 15px; line-height: 1.65; color: var(--muted); }
.db-popup__text p { margin: 0 0 .75em; }
.db-popup__text p:last-child { margin-bottom: 0; }

:root .db-popup .db-popup__button,
:root .db-popup .db-popup__submit {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 16px 28px; font-size: 15px; letter-spacing: .06em; text-decoration: none;
	border: 0; cursor: pointer;
}
:root .db-popup .db-popup__button:hover,
:root .db-popup .db-popup__submit:hover { filter: brightness(1.06); }
.db-popup__later {
	align-self: center;
	padding: 4px 2px; border: 0; background: none; cursor: pointer;
	font: inherit; font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
	color: var(--ink); text-decoration: underline; text-underline-offset: 5px;
}

/* --- split -------------------------------------------------------------- */
/* display only while open: an author `display` would beat the browser's
   `dialog:not([open]) { display: none }` and show a closed popup inline. */
.db-popup--split[open] { display: grid; grid-template-columns: 1fr 1fr; }
.db-popup--split .db-popup__media { min-height: 100%; }
.db-popup--split .db-popup__body { justify-content: center; }
.db-popup--split .db-popup__button { align-self: stretch; margin-top: 8px; }
.db-popup--split.db-popup--no-media { --db-popup-w: 560px; }
.db-popup--split.db-popup--no-media[open] { grid-template-columns: 1fr; }

/* --- cover -------------------------------------------------------------- */
.db-popup--cover[open] { display: grid; }
.db-popup--cover { --db-popup-w: 640px; min-height: min(480px, calc(100dvh - 32px)); background: var(--ink); color: #fff; }
.db-popup--cover > * { grid-area: 1 / 1; }
.db-popup--cover .db-popup__media { position: relative; }
.db-popup--cover .db-popup__media::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(20, 16, 14, .35) 0%, rgba(20, 16, 14, .72) 55%, rgba(20, 16, 14, .82) 100%);
}
.db-popup--cover .db-popup__body { position: relative; z-index: 1; justify-content: flex-end; padding: 72px 40px 40px; }
.db-popup--cover .db-popup__close { color: #fff; }
.db-popup--cover .db-popup__close:hover { background: rgba(255, 255, 255, .12); }
.db-popup--cover .db-popup__title { font-size: clamp(2rem, 6vw, 3.25rem); color: #fff; }
.db-popup--cover .db-popup__text { color: rgba(255, 255, 255, .86); }
.db-popup--cover .db-popup__later,
.db-popup--cover .db-popup__legal a { color: #fff; }

/* --- newsletter field --------------------------------------------------- */
.db-popup__signup { display: flex; gap: 12px; width: 100%; margin: 8px 0 0; }
.db-popup__email {
	flex: 1 1 auto; min-width: 0;
	padding: 14px 16px; font: inherit; font-size: 15px;
	color: inherit; background: transparent;
	border: 1px solid currentColor; border-radius: 0;
}
.db-popup--cover .db-popup__email { border-color: rgba(255, 255, 255, .6); }
.db-popup__email::placeholder { color: inherit; opacity: .7; }
.db-popup__email:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.db-popup__submit { flex: 0 0 auto; }
.db-popup__submit[disabled] { opacity: .6; cursor: default; }
.db-popup__legal { margin: 0; font-size: 12px; line-height: 1.5; opacity: .8; }
.db-popup__legal a { color: inherit; text-decoration: underline; }
.db-popup__status { margin: 0; font-size: 14px; }
.db-popup__status:empty { display: none; }
.db-popup__status.is-done { font-size: 16px; }
.db-popup__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.db-popup .screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- phones ------------------------------------------------------------- */
@media (max-width: 640px) {
	.db-popup--split[open] { grid-template-columns: 1fr; }
	.db-popup--split .db-popup__media { height: 200px; min-height: 0; }
	.db-popup__body { gap: 14px; padding: 28px 24px 24px; }
	.db-popup--split .db-popup__body { padding-top: 24px; }
	.db-popup--cover .db-popup__body { padding: 72px 24px 24px; }
	.db-popup--split .db-popup__close-form { top: 8px; right: 8px; }
	.db-popup--split .db-popup__close { background: rgba(255, 255, 255, .85); }
	.db-popup__signup { flex-direction: column; }
	:root .db-popup .db-popup__submit { width: 100%; }
}
