/**
 * Fruit Warrior consent interface.
 */

.fw-consent[hidden],
.fw-consent [hidden] {
	display: none !important;
}

html.fw-consent-is-open {
	overflow: hidden;
}

.fw-consent,
.fw-consent * {
	box-sizing: border-box;
}

/* The banner shows on every page, so it follows the site's container surface
   and ink rather than keeping a cream of its own. Fallbacks repeat the theme
   values so the plugin still looks right if the theme is ever swapped. */
.fw-consent {
	--fwc-cream: var(--fw-surface, #faedc8);
	--fwc-yellow: var(--fw-yellow-500, #f9ca12);
	--fwc-green: var(--fw-green-900, #3e5928);
	--fwc-brown: var(--fw-ink, #5f4647);
	--fwc-muted: var(--fw-grey, #645a5a);
	font-family: var(--fw-font-body, system-ui, sans-serif);
	color: var(--fwc-brown);
}

.fw-consent__banner {
	position: fixed;
	z-index: 100000;
	inset: auto 15px 15px;
	border: 2px solid var(--fwc-brown);
	background: var(--fwc-cream);
	box-shadow: 0 1.25rem 4rem rgba(62, 89, 40, 0.28);
}

.fw-consent__banner-inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(36rem, 0.8fr);
	gap: 1.5rem 2rem;
	align-items: end;
	width: min(100%, 1440px);
	margin-inline: auto;
	padding: clamp(1.25rem, 3vw, 2rem);
}

.fw-consent h2,
.fw-consent h3,
.fw-consent p {
	margin-top: 0;
}

.fw-consent h2,
.fw-consent h3 {
	font-family: var(--fw-font-display, system-ui, sans-serif);
}

/* Large headings green, small category sub-headings brown — same rule as
   the rest of the site. */
.fw-consent h2 {
	color: var(--fw-heading, #3e5928);
}

.fw-consent h3 {
	color: var(--fwc-brown);
}

.fw-consent__intro h2 {
	margin-bottom: 0.45rem;
	font-size: clamp(1.65rem, 3vw, 2.5rem);
	line-height: 1;
}

.fw-consent__intro > p {
	max-width: 74ch;
	margin-bottom: 0.6rem;
	line-height: 1.5;
}

.fw-consent__legal {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 0 !important;
	font-size: 0.9rem;
}

.fw-consent a,
.fw-consent__link-button {
	color: var(--fwc-green);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.fw-consent__actions {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.75rem;
}

.fw-consent button {
	min-height: 3rem;
	padding: 0.7rem 1rem;
	border: 2px solid var(--fwc-brown);
	border-radius: 0;
	background: var(--fwc-brown);
	color: var(--fwc-cream);
	font: 700 1rem/1.2 var(--fw-font-body, system-ui, sans-serif);
	cursor: pointer;
}

.fw-consent button:hover {
	border-color: var(--fwc-green);
	background: var(--fwc-green);
	color: var(--fwc-cream);
}

.fw-consent button:disabled {
	cursor: wait;
	opacity: 0.65;
}

.fw-consent button:focus-visible,
.fw-consent a:focus-visible,
.fw-consent input:focus-visible,
.fw-consent summary:focus-visible,
.fw-footer__privacy-button:focus-visible {
	outline: 3px solid var(--fwc-yellow, #f9ca12) !important;
	outline-offset: 3px;
}

.fw-consent__status {
	grid-column: 1 / -1;
	min-height: 1.2em;
	margin: 0;
	font-size: 0.85rem;
	font-weight: 700;
}

.fw-consent__modal {
	position: fixed;
	z-index: 100001;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 1rem;
}

.fw-consent__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(32, 22, 13, 0.72);
}

.fw-consent__dialog {
	position: relative;
	width: min(48rem, 100%);
	max-height: min(90vh, 54rem);
	overflow: auto;
	padding: clamp(1.25rem, 4vw, 2.5rem);
	border: 2px solid var(--fwc-brown);
	background: var(--fwc-cream);
	box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.35);
}

.fw-consent__dialog-header {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	justify-content: space-between;
	padding-bottom: 1.25rem;
	border-bottom: 2px solid var(--fwc-brown);
}

.fw-consent__eyebrow {
	margin-bottom: 0.25rem;
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.fw-consent__dialog-header h2 {
	margin-bottom: 0;
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	line-height: 1;
}

.fw-consent__local-measurement {
	padding: 1.25rem 0;
	border-bottom: 2px solid var(--fwc-brown);
}

.fw-consent__local-measurement h3 {
	margin-bottom: 0.3rem;
	font-size: 1.2rem;
}

.fw-consent__local-measurement > p {
	margin-bottom: 0;
	line-height: 1.45;
}

.fw-consent__local-measurement > button {
	margin-top: 1rem;
}

.fw-consent .fw-consent__close {
	flex: 0 0 3rem;
	width: 3rem;
	padding: 0;
	font-size: 1.8rem;
}

.fw-consent__category {
	padding: 1.25rem 0;
	border-bottom: 1px solid rgba(95, 70, 71, 0.45);
}

.fw-consent__category-heading {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 1rem;
	align-items: center;
}

.fw-consent__category h3 {
	margin-bottom: 0.25rem;
	font-size: 1.2rem;
}

.fw-consent__category p {
	margin-bottom: 0;
	line-height: 1.45;
}

.fw-consent__switch {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
}

.fw-consent__switch input {
	position: absolute;
	z-index: 1;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.fw-consent__switch span {
	position: relative;
	display: block;
	width: 3.25rem;
	height: 1.75rem;
	border: 2px solid var(--fwc-brown);
	background: transparent;
	cursor: pointer;
}

.fw-consent__switch span::after {
	content: '';
	position: absolute;
	top: 0.2rem;
	left: 0.2rem;
	width: 1.1rem;
	height: 1.1rem;
	background: var(--fwc-brown);
	transition: transform 160ms ease;
}

.fw-consent__switch input:checked + span {
	background: var(--fwc-yellow);
}

.fw-consent__switch input:checked + span::after {
	transform: translateX(1.5rem);
}

.fw-consent__switch input:disabled + span {
	cursor: not-allowed;
	opacity: 0.65;
}

.fw-consent__switch input:disabled {
	cursor: not-allowed;
}

.fw-consent__service {
	margin-top: 0.85rem;
}

.fw-consent__service summary {
	width: fit-content;
	color: var(--fwc-green);
	font-weight: 800;
	cursor: pointer;
}

.fw-consent__service dl {
	display: grid;
	gap: 0.55rem;
	margin: 0.85rem 0 0;
	font-size: 0.88rem;
}

.fw-consent__service dl > div {
	display: grid;
	grid-template-columns: 8rem minmax(0, 1fr);
	gap: 0.75rem;
}

.fw-consent__service dt {
	font-weight: 800;
}

.fw-consent__service dd {
	margin: 0;
}

.fw-consent__dialog-actions {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.fw-consent .fw-consent__secondary {
	background: transparent;
	color: var(--fwc-brown);
}

.fw-consent .fw-consent__secondary:hover {
	background: var(--fwc-green);
	color: var(--fwc-cream);
}

.fw-consent-media-placeholder {
	display: grid;
	width: min(100%, 56rem);
	min-height: 18rem;
	place-items: center;
	align-content: center;
	padding: clamp(1.5rem, 6vw, 4rem);
	border: 2px solid var(--fw-ink, #5f4647);
	background: var(--fw-surface, #faedc8);
	color: var(--fw-ink, #5f4647);
	text-align: center;
}

.fw-consent-media-placeholder p {
	max-width: 34rem;
	margin: 0 0 0.75rem;
}

.fw-consent-link-button {
	appearance: none;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.fw-footer__privacy {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem 1.25rem;
	align-items: center;
	padding: 0 0 1.75rem;
}

/* Resting colours restated for focus: Astra fills a focused <button> blue,
   and a tap leaves this one focused while the settings dialog opens. */
.fw-footer__privacy-button:focus {
	background: transparent;
	color: var(--fw-on-dark, #efede4);
}

.fw-footer__privacy-button {
	appearance: none;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--fw-on-dark, #efede4);
	font: inherit;
	font-size: 0.82rem;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	cursor: pointer;
}

.fw-footer__privacy-button:hover {
	background: transparent;
	color: var(--fw-yellow-500, #f9ca12);
}

@media (max-width: 900px) {
	.fw-consent__banner-inner {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.fw-consent__banner {
		inset: auto 0 0;
		max-height: 100vh;
		overflow: auto;
	}

	.fw-consent__actions,
	.fw-consent__dialog-actions {
		grid-template-columns: 1fr;
	}

	.fw-consent__service dl > div {
		grid-template-columns: 1fr;
		gap: 0.1rem;
	}

	.fw-footer__privacy {
		align-items: flex-start;
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fw-consent *,
	.fw-consent *::before,
	.fw-consent *::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
