/* O2 Cookie Consent — banner, preferences dialog, cookie button, placeholders, policy tables.
   Colours and sizes come from CSS variables printed from the settings. */

.efcc-banner, .efcc-modal, .efcc-float, .efcc-placeholder {
	/* --efcc-border, --efcc-muted, --efcc-surface, --efcc-tint and
	   --efcc-primary-hover are computed from the brand colours in PHP and
	   printed on :root, so they work without color-mix() support too. */
	font-size: var(--efcc-font);
	line-height: 1.5;
	color: var(--efcc-text);
	box-sizing: border-box;
}
.efcc-banner *, .efcc-modal *, .efcc-placeholder * { box-sizing: border-box; }
.efcc-banner[hidden], .efcc-modal[hidden], .efcc-float[hidden] { display: none !important; }

/* —— buttons —— */
.efcc-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; margin: 0; padding: 10px 20px;
	border: 2px solid var(--efcc-primary); border-radius: calc(var(--efcc-radius) * .8);
	font: inherit; font-weight: 700; line-height: 1.2; letter-spacing: 0; text-transform: none;
	cursor: pointer; white-space: nowrap; transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.efcc-btn--primary { background: var(--efcc-primary) !important; color: var(--efcc-primary-text) !important; }
.efcc-btn--primary:hover { box-shadow: 0 4px 14px color-mix(in srgb, var(--efcc-primary) 40%, transparent); }
.efcc-btn--secondary { background: transparent !important; color: var(--efcc-primary) !important; }
.efcc-btn--secondary:hover { background: color-mix(in srgb, var(--efcc-primary) 8%, transparent) !important; }
/* "Link" weight: the control a visitor's law does not require to look like
   "Accept all". Plain underlined text in the banner's own colour — so its
   contrast is whatever the body text already passes — in a fraction of the
   space, but still a real <button> with a real focus ring and a target big
   enough for WCAG 2.2 SC 2.5.8. */
.efcc-btn--link {
	min-height: 0; padding: 6px 2px; border: 0 !important;
	background: none !important; color: var(--efcc-text) !important;
	font-weight: 500; font-size: .94em;
	text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
	white-space: normal; border-radius: 4px;
}
.efcc-btn--link:hover { text-decoration-thickness: 2px; color: var(--efcc-primary) !important; }
.efcc-btn--link + .efcc-btn--link { margin-left: 2px; }
.efcc-btn:focus-visible, .efcc-float:focus-visible, .efcc-cat__toggle:focus-visible, .efcc-modal__close:focus-visible {
	outline: 3px solid var(--efcc-primary); outline-offset: 2px;
}
/* Capital letters on every button, never on one only. Links are left alone:
   they are not buttons, and small uppercase text is harder to read. */
.efcc-buttons--upper .efcc-btn:not(.efcc-btn--link) { text-transform: uppercase; letter-spacing: .03em; }
/* "Equal prominence": every choice looks the same (ICO guidance). */
.efcc-buttons--equal .efcc-btn--secondary:not(.efcc-btn--link) { background: var(--efcc-primary) !important; color: var(--efcc-primary-text) !important; }
/* "Balanced": "Reject all" stays exactly as visible as "Accept all" (ICO, EDPB);
   only the buttons that open or save detailed choices are a lighter shade. */
.efcc-buttons--balanced .efcc-btn[data-efcc="reject"]:not(.efcc-btn--link) { background: var(--efcc-primary) !important; color: var(--efcc-primary-text) !important; }
.efcc-buttons--balanced .efcc-btn[data-efcc="manage"]:not(.efcc-btn--link), .efcc-buttons--balanced .efcc-btn[data-efcc="save"]:not(.efcc-btn--link) {
	background: color-mix(in srgb, var(--efcc-primary) 16%, #ffffff) !important;
	border-color: color-mix(in srgb, var(--efcc-primary) 38%, #ffffff);
	color: color-mix(in srgb, var(--efcc-primary) 78%, #000000) !important;
}
.efcc-buttons--balanced .efcc-btn[data-efcc="manage"]:not(.efcc-btn--link):hover, .efcc-buttons--balanced .efcc-btn[data-efcc="save"]:not(.efcc-btn--link):hover {
	background: color-mix(in srgb, var(--efcc-primary) 26%, #ffffff) !important;
}

/* —— banner —— */
.efcc-banner {
	position: fixed; z-index: var(--efcc-z); background: var(--efcc-bg);
	box-shadow: var(--efcc-shadow); border: 1px solid var(--efcc-border);
}
.efcc-banner--bar { left: 0; right: 0; bottom: 0; border-width: 1px 0 0; }
.efcc-banner--bar .efcc-banner__inner {
	max-width: var(--efcc-max); margin: 0 auto; padding: 18px 24px;
	display: flex; align-items: center; gap: 24px;
}
.efcc-banner--box-left, .efcc-banner--box-right {
	bottom: 20px; width: min(460px, calc(100vw - 32px)); border-radius: var(--efcc-radius);
}
.efcc-banner--box-left { left: 20px; }
.efcc-banner--box-right { right: 20px; }
.efcc-banner--center {
	left: 50%; top: 50%; transform: translate(-50%, -50%);
	width: min(560px, calc(100vw - 32px)); border-radius: var(--efcc-radius);
}
.efcc-banner--box-left .efcc-banner__inner, .efcc-banner--box-right .efcc-banner__inner, .efcc-banner--center .efcc-banner__inner { padding: 22px; }
.efcc-banner__text { flex: 1 1 auto; min-width: 0; }
.efcc-banner__title { margin: 0 0 4px; font-weight: 700; font-size: 1.1em; }
.efcc-banner__message { margin: 0; }
.efcc-banner__message a, .efcc-modal a { color: var(--efcc-primary); text-decoration: underline; }
.efcc-banner__buttons { display: flex; flex-wrap: wrap; gap: 10px; flex: 0 0 auto; }
.efcc-banner--box-left .efcc-banner__buttons, .efcc-banner--box-right .efcc-banner__buttons, .efcc-banner--center .efcc-banner__buttons { margin-top: 16px; }
.efcc-banner--box-left .efcc-btn, .efcc-banner--box-right .efcc-btn, .efcc-banner--center .efcc-btn { flex: 1 1 auto; }
/* Links keep their natural width in every layout: taking less room is the
   whole point of them. In the stacked layouts they share one line. */
.efcc-banner__buttons .efcc-btn--link { flex: 0 0 auto; }
.efcc-banner__buttons { align-items: center; }

/* —— grey overlay while the banner waits for a choice ——
   Not a cookie wall: "Accept all" and "Reject all" both close it. */
.efcc-overlay { display: none; }
.efcc-banner--overlay:not([hidden]) + .efcc-overlay {
	display: block; position: fixed; inset: 0; z-index: calc(var(--efcc-z) - 2);
	background: rgba(17, 24, 39, .55);
}
html.efcc-banner-open:has(.efcc-banner--overlay:not([hidden])) { overflow: hidden; }

/* —— preferences dialog —— */
.efcc-modal { position: fixed; inset: 0; z-index: calc(var(--efcc-z) + 1); display: flex; align-items: center; justify-content: center; padding: 16px; }
.efcc-modal__backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .55); }
.efcc-modal__dialog {
	position: relative; width: min(680px, 100%); max-height: calc(100vh - 32px);
	display: flex; flex-direction: column; background: var(--efcc-bg); border-radius: var(--efcc-radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3); outline: none;
}
.efcc-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--efcc-border); }
.efcc-modal__head h2 { margin: 0; font-size: 1.25em; line-height: 1.3; color: var(--efcc-text); }
.efcc-modal__close {
	width: 40px; height: 40px; min-height: 0; padding: 0 !important; border: 0; border-radius: 8px;
	background: transparent !important; color: var(--efcc-text) !important; font-size: 1.8em; line-height: 1; cursor: pointer;
}
.efcc-modal__body { padding: 16px 20px; overflow-y: auto; overscroll-behavior: contain; }
.efcc-modal__foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--efcc-border); }
html.efcc-modal-open { overflow: hidden; }

.efcc-cat { border: 1px solid var(--efcc-border); border-radius: calc(var(--efcc-radius) * .8); margin: 0 0 10px; }
.efcc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.efcc-cat__toggle {
	display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 4px 0 !important; border: 0;
	background: transparent !important; color: var(--efcc-text) !important; font: inherit; font-weight: 700; cursor: pointer; text-transform: none; letter-spacing: 0;
}
.efcc-chevron { width: 8px; height: 8px; border-right: 2px solid var(--efcc-primary); border-bottom: 2px solid var(--efcc-primary); transform: rotate(-45deg); transition: transform .2s ease; }
.efcc-cat__toggle[aria-expanded="true"] .efcc-chevron { transform: rotate(45deg); }
.efcc-cat__body { padding: 0 14px 12px; }
.efcc-cat__body[hidden] { display: none; }
.efcc-cat__body p { margin: 0 0 8px; }
.efcc-always { font-size: .85em; font-weight: 700; color: var(--efcc-primary); }
.efcc-sub { font-weight: 700; margin-top: 8px !important; }
.efcc-services { list-style: none; margin: 0 0 8px; padding: 0; }
.efcc-services li { padding: 8px 0; border-top: 1px solid var(--efcc-border); }
.efcc-service { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.efcc-service small { opacity: .75; }
.efcc-service__purpose { margin: 4px 0 0 !important; font-size: .9em; opacity: .85; }
.efcc-cookies summary { cursor: pointer; font-weight: 700; color: var(--efcc-primary); }
.efcc-cookies table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: .85em; }
.efcc-cookies th, .efcc-cookies td { padding: 6px 8px; border: 1px solid var(--efcc-border); text-align: left; vertical-align: top; }
.efcc-consent-id { font-size: .85em; opacity: .8; }

/* —— switches —— */
.efcc-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: 0 0 auto; }
.efcc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.efcc-switch__ui { width: 44px; height: 24px; border-radius: 999px; background: #c3c4c7; position: relative; transition: background-color .15s ease; }
.efcc-switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease; }
.efcc-switch input:checked + .efcc-switch__ui { background: var(--efcc-primary); }
.efcc-switch input:checked + .efcc-switch__ui::after { transform: translateX(20px); }
.efcc-switch input:focus-visible + .efcc-switch__ui { outline: 3px solid var(--efcc-primary); outline-offset: 2px; }
.efcc-switch--small .efcc-switch__ui { width: 36px; height: 20px; }
.efcc-switch--small .efcc-switch__ui::after { width: 14px; height: 14px; }
.efcc-switch--small input:checked + .efcc-switch__ui::after { transform: translateX(16px); }

/* —— cookie button —— */
.efcc-float {
	position: fixed; bottom: 18px; z-index: calc(var(--efcc-z) - 1);
	width: 52px; height: 52px; min-height: 0; padding: 0 !important; display: flex; align-items: center; justify-content: center;
	border: 1px solid var(--efcc-border); border-radius: 50%; background: var(--efcc-bg) !important;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease;
}
.efcc-float--left { left: 18px; }
.efcc-float--right { right: 18px; }
.efcc-float:hover { transform: rotate(-12deg) scale(1.06); box-shadow: 0 8px 26px rgba(0, 0, 0, .24); }
.efcc-float--mono { color: var(--efcc-text); }

/* —— blocked-content placeholder —— */
.efcc-placeholder {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
	min-height: 220px; width: 100%; padding: 20px; text-align: center;
	background: color-mix(in srgb, var(--efcc-primary) 6%, #f6f7f7); border: 1px dashed color-mix(in srgb, var(--efcc-primary) 45%, transparent);
	border-radius: var(--efcc-radius);
}
.efcc-placeholder__text { max-width: 460px; }

/* —— policy page —— */
.efcc-table-wrap { overflow-x: auto; margin: 0 0 1.5em; }
.efcc-cookie-table { width: 100%; border-collapse: collapse; font-size: .92em; }
.efcc-cookie-table th, .efcc-cookie-table td { padding: 8px 10px; border: 1px solid #dfe3e8; text-align: left; vertical-align: top; }
.efcc-cookie-table th { background: #f6f7f7; }
/* The narrow columns stay narrow so Purpose keeps the room it needs. */
.efcc-cookie-table [data-efcc-col="type"], .efcc-cookie-table [data-efcc-col="party"],
.efcc-cookie-table [data-efcc-col="duration"] { white-space: nowrap; width: 1%; }
.efcc-cookie-table [data-efcc-col="name"] code { word-break: break-all; }
.efcc-inline-button {
	padding: 10px 18px; border: 2px solid var(--efcc-primary, #2563eb); border-radius: 8px;
	background: transparent; color: var(--efcc-primary, #2563eb); font-weight: 700; cursor: pointer;
}

/* —— small screens —— */
@media (max-width: 760px) {
	.efcc-banner--bar .efcc-banner__inner { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
	/* Same order as on desktop, so no choice is pushed to the top. */
	.efcc-banner__buttons { flex-direction: column; }
	.efcc-banner__buttons .efcc-btn { width: 100%; }
	/* On a phone the real buttons stack full width; a link stays small and
	   left-aligned instead of becoming another full-width block. */
	.efcc-banner__buttons .efcc-btn--link { width: auto; align-self: flex-start; padding: 8px 2px; }
	.efcc-banner--box-left, .efcc-banner--box-right { left: 12px; right: 12px; bottom: 12px; width: auto; }
	.efcc-modal { padding: 0; align-items: stretch; }
	.efcc-modal__dialog { max-height: 100vh; height: 100%; border-radius: 0; }
	.efcc-modal__foot .efcc-btn { flex: 1 1 100%; }
	.efcc-float { width: 46px; height: 46px; bottom: 12px; }
	.efcc-float--left { left: 12px; }
	.efcc-float--right { right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.efcc-btn, .efcc-float, .efcc-chevron, .efcc-switch__ui, .efcc-switch__ui::after { transition: none; }
}

/* ——————————————————————————————————————————————————————————————
 * Regime-dependent pieces (shown or hidden by efcc.js)
 * —————————————————————————————————————————————————————————————— */

/* The X on the banner. Only shown where the regime offers one; what it means
   (a refusal in Italy, a dismissal elsewhere) is set by the script. */
.efcc-banner__close {
	position: absolute; top: 8px; right: 10px;
	width: 32px; height: 32px; padding: 0;
	border: 0; border-radius: 50%;
	background: transparent; color: var(--efcc-muted, currentColor);
	font-size: 24px; line-height: 1; cursor: pointer;
}
.efcc-banner__close:hover { background: var(--efcc-surface, rgba(0, 0, 0, .05)); color: var(--efcc-text); }
.efcc-banner__close:focus-visible { outline: 2px solid var(--efcc-focus, currentColor); outline-offset: 2px; }

/* A category the law exempts here: on by default, and the visitor is told so
   rather than being left to wonder why the switch was already set. */
.efcc-always--exempt { font-size: .82em; font-weight: 600; color: var(--efcc-muted); }

/* Which law is being followed. Administrators only. */
.efcc-badge,
.efcc-legal {
	margin: 6px 0 0; font-size: .75em; letter-spacing: .02em;
	color: var(--efcc-muted); text-transform: none;
}
.efcc-banner .efcc-badge { position: absolute; left: 14px; bottom: 2px; }

/* "Your Privacy Choices" — the link title the CCPA regulations prescribe. */
.efcc-choices {
	display: inline-flex; align-items: center; gap: 7px;
	text-decoration: none; cursor: pointer; vertical-align: middle;
}
.efcc-choices:hover span { text-decoration: underline; }
.efcc-choices__icon { flex: 0 0 auto; }

/* Respect a visitor who has asked for less motion or more contrast. */
@media (prefers-contrast: more) {
	.efcc-btn { border-width: 2px; }
	.efcc-banner, .efcc-modal__dialog { border: 2px solid var(--efcc-text); }
}

/* —— right-to-left ————————————————————————————————————————————————
   Set on the banner and the dialog themselves rather than on the page, so an
   Arabic or Hebrew banner reads correctly on a site whose own pages are
   left-to-right, which is the normal case when the language was worked out
   from the visitor rather than from the content. Logical properties do most
   of the work; these are the places that still need telling. */
[dir="rtl"].efcc-banner .efcc-banner__inner,
[dir="rtl"].efcc-modal .efcc-modal__foot { direction: rtl; }
[dir="rtl"].efcc-banner .efcc-banner__close { right: auto; left: 10px; }
[dir="rtl"].efcc-modal .efcc-modal__close { right: auto; left: 10px; }
[dir="rtl"].efcc-banner .efcc-btn--link + .efcc-btn--link { margin-left: 0; margin-right: 2px; }
[dir="rtl"] .efcc-chevron { transform: scaleX(-1); }
[dir="rtl"] .efcc-cookie-table th,
[dir="rtl"] .efcc-cookie-table td { text-align: right; }
[dir="rtl"].efcc-banner .efcc-form--dirty { box-shadow: none; }
/* The switch travels the other way when the language does. */
[dir="rtl"] .efcc-switch__ui::after { left: auto; right: 3px; }
[dir="rtl"] .efcc-switch input:checked + .efcc-switch__ui::after { transform: translateX(-20px); }

/* —— the privacy centre ————————————————————————————————————————————
   A page a visitor lands on to see what they chose. Styled plainly so it sits
   inside the theme's content rather than looking like a widget dropped on it. */
.efcc-centre { margin: 1.5em 0; padding: 20px; border: 1px solid var(--efcc-border); border-radius: var(--efcc-radius); background: var(--efcc-surface); }
.efcc-centre__state { margin: 0 0 12px; font-size: 1.05em; }
.efcc-centre__state span { color: var(--efcc-muted); }
.efcc-centre__cats { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.efcc-centre__cats li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--efcc-border); }
.efcc-centre__cats li:last-child { border-bottom: 0; }
.efcc-centre__name { flex: 1 1 auto; }
.efcc-centre__value { font-weight: 600; }
.efcc-centre__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--efcc-muted); flex: 0 0 auto; }
[data-efcc-on="1"] .efcc-centre__dot { background: var(--efcc-primary); }
[data-efcc-required="1"] .efcc-centre__dot { background: var(--efcc-muted); }
.efcc-centre__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.efcc-centre__law, .efcc-centre__id { margin: 6px 0 0; color: var(--efcc-muted); font-size: .92em; }
.efcc-centre__id code { font-size: .95em; }
.efcc-centre__id small { display: block; margin-top: 2px; }
.efcc-centre__links { margin: 12px 0 0; display: flex; gap: 16px; flex-wrap: wrap; }
.efcc-third-parties td small code { word-break: break-all; }
/* In the block editor the preview has no banner around it, so give the
   buttons their colours from the same tokens the front end uses. */
.efcc-block-preview .efcc-centre { --efcc-primary: #2271b1; --efcc-primary-text: #fff; --efcc-border: #dfe3e8; --efcc-surface: #fff; --efcc-muted: #646970; --efcc-radius: 8px; }
