/*
 * Cookie banner and settings window. Source: wordpress/aronex mvp/Home Cookie Banner.dc.html.
 * Desktop: a bar over the bottom edge. Phone: a floating card.
 * Colors and sizes come only from assets/css/tokens.css.
 */

.aronex-consent {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 1100;
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	padding: var(--space-5);
	background: var(--color-bg);
	border-top: 1px solid var(--color-border);
	box-shadow: var(--shadow-card);
	color: var(--color-text);
	font-size: var(--text-sm);
	line-height: var(--leading-caption);
}

/* The attribute hidden must win over display:flex above. */
.aronex-consent[hidden] {
	display: none;
}

.aronex-consent__text {
	margin: 0;
}

.aronex-consent__link {
	color: var(--color-link);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.aronex-consent__actions {
	display: flex;
	gap: var(--space-2);
}

.aronex-consent__actions .aronex-button {
	flex: 1;
}

/* Phone: a card with a gap from the edges */
@media (max-width: 767px) {
	.aronex-consent {
		inset-inline: var(--space-3);
		bottom: var(--space-3);
		border: 1px solid var(--color-border);
		border-radius: var(--radius-lg);
		padding: var(--space-4);
	}
}

@media (min-width: 768px) {
	.aronex-consent {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: var(--space-6);
		padding: var(--space-5) var(--gutter-desktop);
		font-size: var(--text-base);
		line-height: var(--leading-body);
	}

	.aronex-consent__text {
		max-width: 820px;
	}

	.aronex-consent__actions {
		flex: none;
		white-space: nowrap;
	}

	.aronex-consent__actions .aronex-button {
		flex: none;
	}
}

/* Settings window (native <dialog>: focus stays inside, Escape closes it) */
.aronex-consent-modal {
	width: min(560px, calc(100% - 2 * var(--space-4)));
	max-height: calc(100vh - 2 * var(--space-4));
	padding: var(--space-5);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	background: var(--color-bg);
	color: var(--color-text);
	box-shadow: var(--shadow-raised);
	overflow-y: auto;
}

.aronex-consent-modal::backdrop {
	background: var(--color-overlay);
}

.aronex-consent-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
}

.aronex-consent-modal__title {
	margin: 0;
	font-size: var(--text-xl);
	line-height: var(--leading-h3);
}

.aronex-consent-modal__close {
	flex: none;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: var(--radius-md);
	background: none;
	color: var(--color-text);
	font-size: var(--text-xl);
	line-height: 1;
	cursor: pointer;
}

.aronex-consent-modal__close:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 2px;
}

.aronex-consent-modal__intro {
	margin: var(--space-3) 0 var(--space-4);
	color: var(--color-text-muted);
	font-size: var(--text-sm);
	line-height: var(--leading-caption);
}

.aronex-consent-modal__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--color-border);
}

.aronex-consent-modal__item {
	padding: var(--space-4) 0;
	border-bottom: 1px solid var(--color-border);
}

.aronex-consent-modal__label {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	cursor: pointer;
}

.aronex-consent-modal__label input {
	flex: none;
	width: 20px;
	height: 20px;
	accent-color: var(--color-action);
}

.aronex-consent-modal__name {
	font-weight: var(--font-weight-medium);
}

.aronex-consent-modal__desc {
	margin: var(--space-2) 0 0;
	padding-inline-start: calc(20px + var(--space-3));
	color: var(--color-text-muted);
	font-size: var(--text-sm);
	line-height: var(--leading-caption);
}

.aronex-consent-modal__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3);
	margin-top: var(--space-5);
}
