/**
 * Themis Consent styles.
 *
 * A slim bar along the bottom of the page in the brand navy, with the
 * theme's square, bold buttons (@mixin button). Colours pull from the
 * theme.json presets with hex fallbacks. Accept and Reject share one style
 * so neither is pushed over the other.
 */

.tcn,
.tcn-embed {
	--tcn-primary:   var(--wp--preset--color--primary,   #2b384a);
	--tcn-secondary: var(--wp--preset--color--secondary, #b59c85);
	--tcn-sand:      var(--wp--preset--color--sand,      #e5e2dd);
	--tcn-white:     var(--wp--preset--color--white,     #ffffff);
}

.tcn {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99999; /* Under the Themis Popup (100000). */
	border-top: 2px solid var(--tcn-secondary);
	background: var(--tcn-primary);
	box-shadow: 0 -6px 24px rgba(20, 24, 33, 0.18);
	color: var(--tcn-white);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	line-height: 1.45;
}

.tcn[hidden] {
	display: none;
}

.tcn__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 2rem;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0.875rem 1.25rem;
}

/* Beats theme.json's ":root :where(p)", which prints after this file. */
.tcn p,
.tcn-embed p {
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: inherit;
	font-weight: 300;
	line-height: inherit;
}

.tcn__text {
	flex: 1 1 420px;
}

.tcn__text a,
.tcn__text a:visited {
	color: var(--tcn-white);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.tcn__text a:hover {
	color: var(--tcn-secondary);
}

/* --- Buttons --- */

.tcn__buttons {
	display: flex;
	flex: 0 1 auto;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.tcn__button {
	min-width: 8.5rem;
	margin: 0;
	padding: 0.625rem 1rem;
	border: 1.5px solid var(--tcn-white);
	border-radius: 0;
	background: transparent;
	color: var(--tcn-white);
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	line-height: 1;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tcn__button:hover {
	border-color: var(--tcn-secondary);
	background: var(--tcn-secondary);
	color: var(--tcn-white);
}

.tcn__link {
	margin: 0 0.5rem 0 0;
	padding: 0.25rem 0;
	border: 0;
	background: none;
	color: var(--tcn-white);
	cursor: pointer;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.tcn__link:hover {
	color: var(--tcn-secondary);
}

.tcn__button[hidden],
.tcn__link[hidden] {
	display: none;
}

.tcn__button:focus-visible,
.tcn__link:focus-visible,
.tcn__choice input:focus-visible {
	outline: 2px solid var(--tcn-secondary);
	outline-offset: 2px;
}

/* --- Customise: expands the bar in place --- */

.tcn__choices {
	display: grid;
	flex: 1 1 100%;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 0.75rem 1.5rem;
	order: -1;
	padding-bottom: 0.875rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.tcn__choices[hidden] {
	display: none;
}

.tcn p.tcn__title {
	grid-column: 1 / -1;
	color: var(--tcn-secondary);
	font-size: var(--wp--preset--font-size--medium, 1rem);
	font-weight: 700;
}

.tcn__choice {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	margin: 0;
	cursor: pointer;
	font-weight: 300;
}

.tcn__choice input[type="checkbox"] {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	-webkit-appearance: auto;
	appearance: auto;
	accent-color: var(--tcn-secondary);
}

.tcn__choice input[disabled] {
	cursor: default;
}

.tcn__choice strong {
	display: block;
	font-weight: 700;
}

@media (max-width: 600px) {

	.tcn__inner {
		gap: 0.75rem;
		padding: 0.75rem 1rem;
	}

	.tcn__buttons {
		flex: 1 1 100%;
	}

	.tcn__link {
		flex: 1 1 100%;
		text-align: left;
	}

	.tcn__button {
		flex: 1 1 0;
		min-width: 0;
	}

	/* Keep a long list of choices from covering the whole screen. */
	.tcn.is-expanded .tcn__choices {
		max-height: 50vh;
		overflow-y: auto;
	}
}

/* --- Map placeholder, in page content --- */

.tcn-embed {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	width: 100%;
	padding: 1.5rem;
	box-sizing: border-box;
	border: 1.5px solid var(--tcn-sand);
	border-radius: 0.5rem;
	background: var(--wp--preset--color--barely-grey, #fafafa);
	text-align: center;
}

.tcn-embed .tcn__button {
	border-color: var(--tcn-primary);
	background: var(--tcn-primary);
}

.tcn-embed .tcn__button:hover {
	border-color: var(--tcn-secondary);
	background: var(--tcn-secondary);
}
