/**
 * Netherby Consent front-end styles.
 * Colours are supplied as CSS custom properties by the plugin.
 */

.nhcc,
.nhcc * {
	box-sizing: border-box;
}

.nhcc[hidden],
.nhcc-banner[hidden],
.nhcc-settings-button[hidden],
.nhcc-dialog [hidden] {
	display: none !important;
}

.nhcc-banner {
	position: fixed;
	z-index: 99999;
	background: var(--nhcc-surface, #fffffa);
	color: var(--nhcc-text, #333333);
	border-top: 3px solid var(--nhcc-accent, #a67a4e);
	box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.1);
	border-radius: var(--nhcc-radius, 1.2rem);
	padding: 20px;
	max-width: 430px;
	font-family: var(--nhcc-body-font, 'Sen', sans-serif);
	font-size: 15px;
	line-height: 1.55;
}

.nhcc-banner--bottom-left {
	left: 20px;
	bottom: 20px;
}

.nhcc-banner--bottom-right {
	right: 20px;
	bottom: 20px;
}

.nhcc-banner--bottom-bar {
	left: 0;
	right: 0;
	bottom: 0;
	max-width: none;
	border-radius: 0;
	border-top: 3px solid var(--nhcc-accent, #a67a4e);
	padding: 18px 28px;
}

.nhcc-banner--centre {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-width: 540px;
	width: calc(100% - 32px);
}

.nhcc-banner__inner {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.nhcc-banner--bottom-bar .nhcc-banner__inner {
	flex-direction: row;
	align-items: center;
	gap: 24px;
	max-width: 1400px;
	margin: 0 auto;
}

.nhcc-banner__logo {
	max-width: 160px;
	height: auto;
	display: block;
}

.nhcc-banner__title {
	margin: 0 0 6px;
	font-family: var(--nhcc-heading-font, 'BegumSans', sans-serif);
	font-weight: 400;
	font-size: 20px;
	line-height: 1.3;
	color: var(--nhcc-text, #333333);
}

.nhcc-banner__text {
	margin: 0;
}

.nhcc-banner__text a,
.nhcc-banner__links a,
.nhcc-dialog a {
	color: var(--nhcc-primary, #19414d);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.nhcc-banner__links {
	margin: 8px 0 0;
	font-size: 13px;
	color: #5b5b5b;
}

.nhcc-banner__links span {
	margin: 0 4px;
}

.nhcc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Accept and reject should carry equal visual weight. */
.nhcc-banner__actions .nhcc-btn--primary,
.nhcc-banner__actions .nhcc-btn--secondary {
	flex: 1 1 0;
}

.nhcc-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 10px 16px;
	border-radius: var(--nhcc-button-radius, 0.25rem);
	border: 1px solid transparent;
	font-family: var(--nhcc-body-font, 'Sen', sans-serif);
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nhcc-btn--primary {
	background: var(--nhcc-primary, #19414d);
	color: var(--nhcc-surface, #fffffa);
	border-color: var(--nhcc-primary, #19414d);
}

.nhcc-btn--primary:hover,
.nhcc-btn--primary:focus {
	background: var(--nhcc-primary-hover, #12313a);
	border-color: var(--nhcc-primary-hover, #12313a);
}

.nhcc-btn--secondary {
	background: transparent;
	color: var(--nhcc-primary, #19414d);
	border-color: var(--nhcc-primary, #19414d);
}

.nhcc-btn--secondary:hover,
.nhcc-btn--secondary:focus {
	background: rgba(25, 65, 77, 0.08);
}

.nhcc-btn--link {
	background: transparent;
	color: var(--nhcc-primary, #19414d);
	border-color: transparent;
	text-decoration: underline;
	text-underline-offset: 3px;
	padding-left: 4px;
	padding-right: 4px;
}

.nhcc-btn:focus-visible,
.nhcc-dialog__close:focus-visible,
.nhcc-open-settings:focus-visible,
.nhcc-settings-button:focus-visible {
	outline: 3px solid var(--nhcc-accent, #a67a4e);
	outline-offset: 2px;
}

.nhcc-settings-button {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 99998;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 14px;
	border-radius: 999px;
	border: 1px solid var(--nhcc-primary, #19414d);
	background: var(--nhcc-surface, #fffffa);
	color: var(--nhcc-primary, #19414d);
	font-family: var(--nhcc-body-font, 'Sen', sans-serif);
	font-size: 14px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	cursor: pointer;
}

.nhcc-open-settings {
	appearance: none;
	background: transparent;
	border: 0;
	padding: 0;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* Dialog / drawer */
.nhcc-dialog {
	position: fixed;
	inset: 0 0 0 auto;
	margin: 0;
	padding: 0;
	width: 100%;
	max-width: 420px;
	height: 100%;
	max-height: 100%;
	border: 0;
	background: var(--nhcc-surface, #fffffa);
	color: var(--nhcc-text, #333333);
	box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.1);
	font-family: var(--nhcc-body-font, 'Sen', sans-serif);
	font-size: 15px;
	line-height: 1.55;
	transform: translateX(100%);
	transition: transform 0.3s ease;
}

.nhcc-dialog[open] {
	transform: translateX(0);
}

.nhcc-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.nhcc-dialog__form {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow-y: auto;
	padding: 24px;
	margin: 0;
}

.nhcc-dialog__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 8px;
}

.nhcc-dialog__header h2 {
	margin: 0;
	font-family: var(--nhcc-heading-font, 'BegumSans', sans-serif);
	font-weight: 400;
	font-size: 24px;
	line-height: 1.25;
}

.nhcc-dialog__close {
	appearance: none;
	background: transparent;
	border: 0;
	font-size: 28px;
	line-height: 1;
	padding: 0 4px;
	cursor: pointer;
	color: var(--nhcc-text, #333333);
}

.nhcc-dialog__intro,
.nhcc-dialog__links {
	margin: 0 0 16px;
}

.nhcc-categories {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 18px;
}

.nhcc-category {
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	padding-top: 14px;
}

.nhcc-category__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.nhcc-category__label {
	font-weight: 600;
	color: var(--nhcc-text, #333333);
	cursor: pointer;
}

.nhcc-category__description {
	margin: 6px 0 0;
	font-size: 14px;
	color: #555;
}

.nhcc-switch {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	width: 46px;
	height: 26px;
}

.nhcc-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
	z-index: 2;
}

.nhcc-switch input:disabled {
	cursor: not-allowed;
}

.nhcc-switch__track {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: #cfcfcf;
	transition: background-color 0.2s ease;
}

.nhcc-switch__track::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s ease;
}

.nhcc-switch input:checked + .nhcc-switch__track {
	background: var(--nhcc-primary, #19414d);
}

.nhcc-switch input:checked + .nhcc-switch__track::after {
	transform: translateX(20px);
}

.nhcc-switch input:focus-visible + .nhcc-switch__track {
	outline: 3px solid var(--nhcc-accent, #a67a4e);
	outline-offset: 2px;
}

.nhcc-dialog__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: auto;
	padding-top: 18px;
}

.nhcc-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.nhcc-noscript {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	background: #19414d;
	color: #fffffa;
	padding: 14px 20px;
	font-family: 'Sen', sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

/* Cookie table shortcode */
.nhcc-cookie-table-wrap {
	overflow-x: auto;
	margin: 1.5em 0;
}

.nhcc-cookie-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95em;
}

.nhcc-cookie-table caption {
	text-align: left;
	font-weight: 600;
	padding: 0 0 0.5em;
}

.nhcc-cookie-table th,
.nhcc-cookie-table td {
	text-align: left;
	vertical-align: top;
	padding: 0.6em 0.8em;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.nhcc-cookie-table th {
	background: rgba(25, 65, 77, 0.06);
	font-weight: 600;
}

.nhcc-cookie-table td code {
	white-space: nowrap;
}

@media (max-width: 640px) {
	.nhcc-banner {
		left: 0 !important;
		right: 0;
		bottom: 0;
		max-width: none;
		width: 100%;
		border-radius: 0;
		padding: 16px;
	}

	.nhcc-banner--centre {
		top: 0;
		transform: none;
		left: 0;
		max-height: 100%;
		overflow-y: auto;
	}

	.nhcc-banner--bottom-bar .nhcc-banner__inner {
		flex-direction: column;
		align-items: stretch;
	}

	.nhcc-banner__actions .nhcc-btn {
		flex: 1 1 auto;
	}

	.nhcc-settings-button {
		left: 12px;
		bottom: 12px;
	}

	.nhcc-dialog {
		max-width: none;
	}
}

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