/* Cookie consent banner and settings dialog (assets/consent.js). */
.finecraft-consent,
.finecraft-consent-dialog {
	--fc-consent-ground: var(--wp--preset--color--primary, #0b152f);
	--fc-consent-text: var(--wp--preset--color--text, #c7d2de);
	--fc-consent-heading: var(--wp--preset--color--white, #fff);
	--fc-consent-link: var(--wp--preset--color--link, #9bb6dc);
	--fc-consent-line: rgb(var(--studio-line-rgb, 222 227 229) / 0.16);
	color: var(--fc-consent-text);
	font-family: var(--wp--preset--font-family--body, inherit);
	font-size: var(--wp--preset--font-size--card, 14px);
	line-height: 1.55;
}

.finecraft-consent {
	position: fixed;
	right: 16px;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	left: 16px;
	z-index: 100000;
	display: flex;
	flex-wrap: wrap;
	gap: 16px 32px;
	align-items: center;
	justify-content: space-between;
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 24px;
	border: 1px solid var(--fc-consent-line);
	border-radius: 16px;
	background: var(--fc-consent-ground);
	box-shadow: 0 12px 40px rgba(5, 7, 15, 0.55);
}

.finecraft-consent[hidden] {
	display: none;
}

.finecraft-consent__text {
	flex: 1 1 420px;
	max-width: 68ch;
}

.finecraft-consent h2,
.finecraft-consent-dialog h2 {
	margin: 0 0 6px;
	color: var(--fc-consent-heading);
	font-family: var(--wp--preset--font-family--display, inherit);
	font-size: var(--wp--preset--font-size--lead, 17px);
	line-height: 1.3;
}

.finecraft-consent p,
.finecraft-consent-dialog p {
	margin: 0;
}

.finecraft-consent a,
.finecraft-consent-dialog a {
	color: var(--fc-consent-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.finecraft-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.finecraft-consent > .finecraft-consent__actions {
	display: grid;
	flex: 1 1 480px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finecraft-consent__button.wp-element-button {
	flex: 1 1 150px;
	min-height: 48px;
	margin: 0;
	padding: 12px 20px;
	font-size: var(--wp--preset--font-size--small, 13px);
	cursor: pointer;
}

.finecraft-consent button:focus-visible,
.finecraft-consent a:focus-visible,
.finecraft-consent-dialog button:focus-visible,
.finecraft-consent-dialog a:focus-visible,
.finecraft-consent-dialog summary:focus-visible,
.finecraft-consent-dialog input:focus-visible {
	outline: 2px solid var(--fc-consent-link);
	outline-offset: 3px;
}

@media (max-width: 600px) {
	.finecraft-consent {
		padding: 18px;
	}

	.finecraft-consent > .finecraft-consent__actions {
		grid-template-columns: 1fr;
		width: 100%;
	}
}

.finecraft-consent-dialog {
	width: min(680px, calc(100vw - 32px));
	max-height: min(85vh, 900px);
	padding: 0;
	border: 1px solid var(--fc-consent-line);
	border-radius: 16px;
	background: var(--fc-consent-ground);
	overflow: auto;
}

.finecraft-consent-dialog::backdrop {
	background: rgba(5, 7, 15, 0.72);
}

.finecraft-consent-dialog__head {
	display: flex;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px 18px 24px;
	border-bottom: 1px solid var(--fc-consent-line);
}

.finecraft-consent-dialog__head h2 {
	margin: 0;
}

.finecraft-consent__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--fc-consent-heading);
	cursor: pointer;
}

.finecraft-consent__close:hover {
	background: rgb(var(--studio-wash-rgb, 255 255 255) / 0.06);
}

.finecraft-consent-dialog__body {
	display: grid;
	gap: 0;
	padding: 0 24px;
}

.finecraft-consent__category {
	padding: 18px 0;
	border-bottom: 1px solid var(--fc-consent-line);
}

.finecraft-consent__switch {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: center;
	min-height: 44px;
}

.finecraft-consent__switch input {
	width: 22px;
	height: 22px;
	margin: 0;
	accent-color: var(--wp--preset--color--accent, #5d80b6);
}

.finecraft-consent__switch label {
	color: var(--fc-consent-heading);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--body, 15px);
	cursor: pointer;
}

.finecraft-consent__badge {
	color: var(--wp--preset--color--text-secondary, #a9bace);
	font-size: var(--wp--preset--font-size--xs, 12px);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.finecraft-consent__category details {
	margin-top: 10px;
}

.finecraft-consent__category summary {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--fc-consent-link);
	cursor: pointer;
}

.finecraft-consent__table {
	overflow-x: auto;
}

.finecraft-consent__table table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--xs, 12px);
}

.finecraft-consent__table th,
.finecraft-consent__table td {
	padding: 8px 10px 8px 0;
	border-bottom: 1px solid var(--fc-consent-line);
	text-align: left;
	vertical-align: top;
}

.finecraft-consent__table th {
	color: var(--wp--preset--color--text-secondary, #a9bace);
	font-weight: 600;
}

.finecraft-consent__table code {
	color: var(--fc-consent-heading);
	font-size: inherit;
	word-break: break-all;
}

.finecraft-consent-dialog > .finecraft-consent__actions {
	position: sticky;
	bottom: 0;
	padding: 16px 24px;
	background: var(--fc-consent-ground);
}

@media (prefers-reduced-motion: no-preference) {
	.finecraft-consent,
	.finecraft-consent-dialog[open] {
		animation: finecraft-consent-in 0.2s ease-out;
	}
}

@keyframes finecraft-consent-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}
