/*
 * ONEGENT Toolkit – Urlaub & Abwesenheit (Website)
 * Bewusst schlicht: Text, feine Trennlinien, eine Akzentfarbe für Links und
 * den Button. Farben kommen als CSS-Variablen (--oa-*) aus dem Modul, Schrift
 * und Eckenradius von Theme und Toolkit.
 */

.oa-bar[hidden],
.oa-side[hidden],
.oa-tab[hidden],
.oa-inline[hidden],
.oa-contact[hidden],
[data-oa-status][hidden],
[data-oa-normal][hidden] {
	display: none !important;
}

/* Browser ohne <dialog>: geschlossene Popups nicht als Text im Footer zeigen. */
.oa-dialog:not([open]) {
	display: none;
}

.oa-bar,
.oa-box,
.oa-tab {
	--oa-radius: var(--onegent-border-radius-container, 12px);
	--oa-radius-btn: var(--onegent-border-radius-buttons, 6px);
	--oa-line: rgba(127, 127, 127, 0.25);
	font-family: inherit;
	line-height: 1.5;
	box-sizing: border-box;
}

.oa-box *,
.oa-bar * {
	box-sizing: border-box;
}

/* ---------- Gemeinsame Box (seitlich, mittig, Shortcode) ---------- */

.oa-box {
	position: relative;
	overflow: hidden;
	background: var(--oa-box-bg, #fff);
	color: var(--oa-box-text, #1d2327);
	border-radius: var(--oa-radius);
	font-size: 16px;
	text-align: left;
}

.oa-box a {
	color: var(--oa-box-link, inherit);
}

/* Kopf in der Akzentfarbe – gleiche Farben wie die Leiste. */
.oa-head {
	padding: 28px 64px 24px 28px;
	background: var(--oa-bar-bg, #333);
	color: var(--oa-bar-text, #fff);
}

.oa-meta {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: 0.85;
}

.oa-title {
	margin: 0;
	font-size: 1.6em;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.oa-body {
	padding: 24px 28px 28px;
}

.oa-text {
	font-size: 1.0625em;
	line-height: 1.6;
}

.oa-text p {
	margin: 0 0 0.7em;
}

.oa-text p:last-child {
	margin-bottom: 0;
}

/* ---------- Kontakte ---------- */

.oa-contacts {
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
}

.oa-contact {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 14px 0;
	border-top: 1px solid var(--oa-line);
	font-size: 15px;
	line-height: 1.5;
}

.oa-contact:last-child {
	padding-bottom: 0;
}

.oa-contact__type {
	margin-bottom: 2px;
	color: var(--oa-label, #646970);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.oa-contact__name {
	font-size: 1.05em;
}

.oa-contact__line a {
	overflow-wrap: anywhere;
}

.oa-contact__phone {
	font-size: 1.05em;
	font-weight: 600;
}

/* ---------- Button, Schließen ---------- */

.oa-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 24px;
}

.oa-button {
	display: block;
	border: 2px solid var(--oa-accent, #333);
	padding: 13px 20px;
	border-radius: var(--oa-radius-btn);
	background: var(--oa-accent, #333);
	color: var(--oa-on-accent, #fff) !important;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-decoration: none !important;
}

.oa-button:hover {
	opacity: 0.9;
}

/* Weitere Buttons als Umriss, damit der erste der wichtigste bleibt. */
.oa-button--secondary {
	background: transparent;
	color: var(--oa-box-text, #1d2327) !important;
}

.oa-inline .oa-buttons {
	flex-direction: row;
	flex-wrap: wrap;
}

.oa-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--oa-bar-text, #fff);
	cursor: pointer;
}

.oa-close:hover {
	background: rgba(127, 127, 127, 0.25);
}

.oa-bar :focus-visible,
.oa-box :focus-visible,
.oa-tab:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------- Mittig ---------- */

.oa-dialog {
	width: calc(100% - 32px);
	max-width: 520px;
	max-height: calc(100vh - 32px);
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	overflow: visible;
}

.oa-dialog::backdrop {
	background: rgba(0, 0, 0, 0.55);
}

.oa-box--center {
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

/* ---------- Seitlich ---------- */

.oa-side {
	position: fixed;
	left: 20px;
	bottom: calc(20px + var(--oa-bottom-offset, 0px));
	z-index: 996;
	width: 380px;
	max-width: calc(100vw - 40px);
	max-height: calc(100vh - 40px);
	padding: 0;
	box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

.oa-side .oa-scroll {
	max-height: inherit;
	overflow-y: auto;
}

.oa-side .oa-head {
	padding: 20px 56px 18px 22px;
}

.oa-side .oa-title {
	font-size: 1.3em;
}

.oa-side .oa-body {
	padding: 18px 22px 22px;
}

.oa-side .oa-text {
	font-size: 1em;
}

.oa-side .oa-close {
	top: 10px;
	right: 10px;
}

.oa-tab {
	position: fixed;
	left: 20px;
	bottom: calc(20px + var(--oa-bottom-offset, 0px));
	z-index: 996;
	max-width: 260px;
	margin: 0;
	padding: 10px 18px;
	overflow: hidden;
	border: 0;
	border-radius: var(--oa-radius-btn);
	background: var(--oa-bar-bg, #333);
	color: var(--oa-bar-text, #fff);
	font-size: 14px;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* ---------- Leiste ---------- */

.oa-bar {
	position: relative;
	z-index: 1;
	background: var(--oa-bar-bg, #333);
	color: var(--oa-bar-text, #fff);
	font-size: 15px;
}

.oa-bar__inner {
	position: relative;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 52px 0 16px;
}

/* Die ganze Leiste ist ein Knopf und öffnet die Meldung in der Mitte. */
.oa-bar__open {
	display: block;
	width: 100%;
	margin: 0;
	padding: 11px 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1.5;
	text-align: center;
	cursor: pointer;
}

.oa-bar__title {
	font-weight: 700;
}

.oa-bar__range::before {
	content: "·";
	margin: 0 8px;
	opacity: 0.7;
}

.oa-bar__more {
	margin-left: 8px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.oa-bar__open:hover .oa-bar__more {
	text-decoration-thickness: 2px;
}

.oa-bar .oa-close {
	top: 50%;
	right: 8px;
	width: 36px;
	height: 36px;
	transform: translateY(-50%);
}

/* ---------- Shortcode / Bricks-Element ---------- */

.oa-inline {
	box-shadow: 0 0 0 1px var(--oa-line);
}

.oa-inline .oa-head {
	padding-right: 28px;
}

.oa-hours-note {
	margin: 0.75em 0 0;
}

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

@media (max-width: 767px) {
	.oa-bar__inner {
		padding: 0 48px 0 14px;
	}

	.oa-bar__open {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 10px 0;
		text-align: left;
	}

	.oa-bar__main {
		display: flex;
		flex-direction: column;
		min-width: 0;
		line-height: 1.35;
	}

	.oa-bar__range {
		font-size: 13px;
		opacity: 0.9;
	}

	.oa-bar__range::before {
		content: none;
	}

	.oa-bar__more {
		flex: 0 0 auto;
		margin-left: 0;
	}

	/* Seitlich: Karte unten über die ganze Breite, mit Abstand zum Rand wie am
	   Desktop, höchstens halbe Höhe. */
	.oa-side {
		left: 12px;
		right: 12px;
		bottom: calc(12px + var(--oa-bottom-offset, 0px));
		width: auto;
		max-width: none;
		max-height: 50vh;
	}

	/* Runde Floating Buttons rechts bleiben frei. */
	.oa-side.oa-side--fab-column {
		right: 84px;
	}

	.oa-tab {
		left: 12px;
		bottom: calc(12px + var(--oa-bottom-offset, 0px));
	}

	/* Mittig: Bottom Sheet, nicht bildschirmfüllend. */
	.oa-dialog {
		width: 100%;
		max-width: none;
		max-height: 88vh;
		margin: auto 0 0;
	}

	.oa-box--center {
		max-height: 88vh;
		border-radius: var(--oa-radius) var(--oa-radius) 0 0;
	}

	.oa-head {
		padding: 22px 56px 20px 20px;
	}

	.oa-title {
		font-size: 1.35em;
	}

	.oa-body {
		padding: 20px 20px 24px;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.oa-dialog[open] .oa-box,
	.oa-side:not([hidden]) {
		animation: oa-in 0.2s ease-out;
	}

	@keyframes oa-in {
		from {
			opacity: 0;
			transform: translateY(8px);
		}
		to {
			opacity: 1;
			transform: none;
		}
	}
}
