/**
 * Chenotie Design Notice — meldingsbalk.
 * Geport uit het Nio-snippet, prefix nio-notice → cd-notice.
 * Andere sites forceren de fonts niet: font-family valt terug op
 * inherit/system-ui als Playfair/DM Sans niet door het thema geladen worden.
 */

.cd-notice {
	--cd-notice-groen: #374535;
	--cd-notice-bone: 244, 239, 229;

	position: relative;
	z-index: 10; /* laag; het echte conflict zit hoger, zie hieronder. */
	width: 100%;
	background: var(--cd-notice-groen);
	border-bottom: 1px solid rgba(var(--cd-notice-bone), .14);
	color: rgba(var(--cd-notice-bone), .72);
	font-family: 'DM Sans', system-ui, sans-serif;
	transition: opacity .3s ease;
}

/**
 * Als deze widget ín een Elementor-header is geplaatst (i.p.v. via
 * "automatisch plaatsen" boven de header): die header staat op
 * `position: fixed`, en Elementor geeft élke rij/kolom-wrapper
 * (`.e-con.e-child`) daarbinnen een eigen `z-index: 200`. Onze
 * meldingskolom en de menukolom krijgen dus dezélfde 200 — en bij een
 * gelijke z-index wint simpelweg wie later in de HTML staat, ongeacht wat
 * een dropdown daarbinnen zelf als z-index heeft (die telt alleen binnen
 * zijn eigen kolom). Geverifieerd op nio-driebergen.nl: de meldingskolom
 * kwam later dan de menukolom en overschaduwde zo het uitklapmenu.
 *
 * Fix: die kolom-wrapper terugzetten naar "auto" zodra hij onze widget
 * bevat, zodat hij niet meer meedingt met de menukolom. `:has()` i.p.v.
 * een vaste Elementor-elementid, want die id's zijn auto-gegenereerd en
 * kunnen wijzigen als de header opnieuw wordt opgebouwd.
 */
.e-con.e-child:has(.elementor-widget-cd-notice) {
	z-index: auto !important;
}

.cd-notice__inner {
	min-height: 52px;
	padding: 11px 24px;
	display: flex;
	align-items: center;
	gap: 20px;
}

/* Groepeert label + tekst + knop zodat ze samen uitgelijnd worden, los van
   de sluitknop die altijd op de rand blijft staan. */
.cd-notice__group {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 20px;
	flex: 1;
	min-width: 0;
}

.cd-notice--align-center .cd-notice__group {
	justify-content: center;
}

.cd-notice--align-right .cd-notice__group {
	justify-content: flex-end;
}

.cd-notice__content {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}

.cd-notice__label {
	flex-shrink: 0;
	padding-right: 16px;
	border-right: 1px solid rgba(var(--cd-notice-bone), .18);
	/* .5 gaf ~3.54:1 op de standaardachtergrond, onder de WCAG AA-eis van
	   4.5:1 voor tekst op deze grootte. .65 geeft ~4.81:1. */
	color: rgba(var(--cd-notice-bone), .65);
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: .18em;
	text-transform: uppercase;
	white-space: nowrap;
}

.cd-notice__preview-badge {
	flex-shrink: 0;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(var(--cd-notice-bone), .18);
	color: rgb(var(--cd-notice-bone));
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: help;
}

.cd-notice__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	letter-spacing: .01em;
}

.cd-notice--align-center .cd-notice__text {
	text-align: center;
}

.cd-notice--align-right .cd-notice__text {
	text-align: right;
}

.cd-notice__text strong {
	font-family: 'Playfair Display', Georgia, serif;
	font-style: normal;
	font-weight: 500;
	font-size: 15.5px;
	color: rgb(var(--cd-notice-bone));
}

/* Korte variant, alleen zichtbaar onder 768px. */
.cd-notice__kort {
	display: none;
}

.cd-notice__button {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	padding: 7px 16px;
	border: 1px solid rgba(var(--cd-notice-bone), .35);
	border-radius: 999px;
	color: rgb(var(--cd-notice-bone));
	font-family: 'DM Sans', system-ui, sans-serif;
	font-size: 12.5px;
	font-weight: 500;
	letter-spacing: .01em;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .2s ease, border-color .2s ease;
}

.cd-notice__button:hover {
	background: rgba(var(--cd-notice-bone), .12);
	border-color: rgba(var(--cd-notice-bone), .5);
	color: rgb(var(--cd-notice-bone));
}

.cd-notice__button:focus-visible {
	outline: 1px solid rgba(var(--cd-notice-bone), .6);
	outline-offset: 2px;
}

.cd-notice__close {
	appearance: none;
	border: none;
	background: none;
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	padding: 0 !important;
	margin: 0;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border-radius: 50%;
	color: rgba(var(--cd-notice-bone), .45);
	cursor: pointer;
	transition: color .2s ease, background-color .2s ease;
}

.cd-notice__close:hover {
	color: rgb(var(--cd-notice-bone));
	background: rgba(var(--cd-notice-bone), .08);
}

.cd-notice__close:focus-visible {
	color: rgb(var(--cd-notice-bone));
	outline: 1px solid rgba(var(--cd-notice-bone), .4);
	outline-offset: 2px;
}

.cd-notice__close svg {
	display: block;
}

.cd-notice__editor-note {
	padding: 6px 24px 10px;
	font-size: 12px;
	font-style: italic;
	color: rgba(var(--cd-notice-bone), .6);
	border-top: 1px dashed rgba(var(--cd-notice-bone), .3);
}

@media (max-width: 767px) {
	.cd-notice__inner {
		position: relative;
		min-height: 0;
		padding: 11px 46px 11px 18px;
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	.cd-notice__group {
		flex-direction: column;
		align-items: flex-start;
		width: 100%;
		gap: 10px;
	}
	.cd-notice--align-center .cd-notice__group {
		align-items: center;
	}
	.cd-notice--align-right .cd-notice__group {
		align-items: flex-end;
	}
	/* De rechterpadding hierboven is breder dan de linker (ruimte voor de
	   losstaande sluitknop) — bij "gecentreerd" moet die asymmetrie eruit,
	   anders staat de tekst visueel niet in het midden van de balk maar
	   in het midden van een scheve box. */
	.cd-notice--align-center .cd-notice__inner {
		padding-left: 46px;
	}
	.cd-notice__label,
	.cd-notice__lang {
		display: none;
	}
	.cd-notice__kort {
		display: inline;
	}
	.cd-notice__text {
		font-size: 13px;
		line-height: 1.5;
	}
	.cd-notice__text strong {
		font-size: 14px;
	}
	.cd-notice__button {
		font-size: 12px;
		padding: 6px 14px;
	}
	.cd-notice__preview-badge {
		font-size: 9px;
		padding: 2px 7px;
	}
	.cd-notice__close {
		position: absolute;
		top: 50%;
		right: 8px;
		transform: translateY(-50%);
		width: 28px;
		height: 28px;
		min-width: 28px;
		min-height: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cd-notice,
	.cd-notice__close {
		transition: none;
	}
}
