/* Cookie consent banner — Al Giardino degli Etruschi */
:root {
	--cc-bg: #fffaf6;
	--cc-text: #1f2937;
	--cc-muted: #4b5563;
	--cc-border: #e7d6cb;
	--cc-accent: #a9532f;
	--cc-accent-hover: #8c4224;
	--cc-accent-text: #fff;
	--cc-track: #cbd5e1;
	--cc-shadow: 0 -6px 30px rgba(31, 41, 55, .18);
}

.cc-banner {
	position: fixed;
	z-index: 10000;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	width: calc(100% - 32px);
	max-width: 760px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	box-sizing: border-box;
	padding: 24px 28px 20px;
	background: var(--cc-bg);
	color: var(--cc-text);
	border: 1px solid var(--cc-border);
	border-top: 4px solid var(--cc-accent);
	border-radius: 10px;
	box-shadow: var(--cc-shadow);
	font-family: "Quicksand", "Libre Franklin", system-ui, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
}
.cc-banner[hidden] { display: none; }

.cc-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--cc-text);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}
.cc-close:hover { background: rgba(0, 0, 0, .06); }

.cc-title {
	margin: 0 32px 8px 0;
	font-family: inherit;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	color: var(--cc-text);
}
.cc-text { margin: 0 0 16px; color: var(--cc-muted); }
.cc-text a { color: var(--cc-accent); text-decoration: underline; font-family: inherit; font-size: inherit; font-weight: 600; letter-spacing: 0; text-transform: none; }

.cc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
}
.cc-btn {
	flex: 0 1 auto;
	min-width: 130px;
	padding: 10px 18px;
	border: 2px solid var(--cc-accent);
	border-radius: 6px;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}
/* "Rifiuta" e "Accetta tutti" hanno identico aspetto (pari evidenza, Garante 2021) */
.cc-btn--primary { background: var(--cc-accent); color: var(--cc-accent-text); }
.cc-btn--primary:hover { background: var(--cc-accent-hover); border-color: var(--cc-accent-hover); color: var(--cc-accent-text); }
.cc-btn--ghost { background: transparent; color: var(--cc-accent); }
.cc-btn--ghost:hover { background: rgba(169, 83, 47, .08); color: var(--cc-accent-hover); }
.cc-btn[hidden] { display: none; }

.cc-banner :focus-visible,
.cc-placeholder :focus-visible {
	outline: 3px solid #d4af37;
	outline-offset: 2px;
}

/* preferences */
.cc-prefs { margin: 0 0 16px; border-top: 1px solid var(--cc-border); padding-top: 12px; }
.cc-prefs[hidden] { display: none; }
.cc-prefs__title { margin: 0 0 8px; font-family: inherit; font-size: 16px; font-weight: 700; text-transform: none; color: var(--cc-text); }
.cc-cat { padding: 10px 0; border-bottom: 1px solid var(--cc-border); }
.cc-cat:last-child { border-bottom: 0; }
.cc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-cat__name { font-weight: 700; }
.cc-cat__always { font-size: 13px; color: var(--cc-muted); }
.cc-cat__desc { margin: 4px 0 0 52px; font-size: 14px; color: var(--cc-muted); }

.cc-switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.cc-switch input { position: absolute; opacity: 0; width: 40px; height: 22px; margin: 0; cursor: pointer; }
.cc-switch__track {
	position: relative;
	flex: none;
	width: 40px;
	height: 22px;
	border-radius: 11px;
	background: var(--cc-track);
	transition: background-color .15s;
}
.cc-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transition: transform .15s;
}
.cc-switch input:checked + .cc-switch__track { background: var(--cc-accent); }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(18px); }
.cc-switch input:disabled + .cc-switch__track { opacity: .55; }
.cc-switch input:focus-visible + .cc-switch__track { outline: 3px solid #d4af37; outline-offset: 2px; }

/* placeholder for blocked embeds */
.cc-placeholder {
	box-sizing: border-box;
	padding: 20px;
	border: 1px dashed var(--cc-accent);
	border-radius: 8px;
	background: var(--cc-bg);
	color: var(--cc-text);
	text-align: center;
	font-size: 15px;
}
.cc-placeholder[hidden] { display: none; }
.cc-placeholder p { margin: 0 0 12px; }
.cc-placeholder__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* persistent footer link */
.cc-footer-link {
	display: block;
	padding: 8px 16px 16px;
	text-align: center;
}
.cc-footer-link button {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 14px;
	text-decoration: underline;
	cursor: pointer;
}

@media (max-width: 600px) {
	.cc-banner { bottom: 0; width: 100%; border-radius: 10px 10px 0 0; padding: 20px 16px 16px; font-size: 14px; }
	.cc-actions { flex-direction: column-reverse; }
	.cc-btn { width: 100%; }
	.cc-cat__desc { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.cc-btn, .cc-switch__track, .cc-switch__track::after { transition: none; }
}
