/*
 * Interpro Consent — banner, preferences, embed placeholders, policy table.
 *
 * COMPLIANCE NOTE
 * "Accept all" and "Reject all" both use .ic-btn--equal and share a single
 * rule set. They must stay identical in size, colour, weight and shape: a
 * reject control that is harder to see than the accept control is a point of
 * non-compliance. Do not add a modifier that restyles one and not the other.
 */

:root {
	--ic-accent: #e71317;
	--ic-accent-text: #ffffff;
	--ic-text: #2b2b2b;
	--ic-bg: #ffffff;
	--ic-radius: 4px;
	--ic-border: rgba(0, 0, 0, 0.14);
	--ic-muted: rgba(0, 0, 0, 0.62);
	--ic-shadow: 0 -2px 18px rgba(0, 0, 0, 0.18);
}

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

.ic[hidden] {
	display: none !important;
}

.ic {
	position: fixed;
	z-index: 2147483000;
	color: var(--ic-text);
	font-family: "Roboto", Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* Bottom bar */
.ic--bar {
	left: 0;
	right: 0;
	bottom: 0;
}

.ic--bar .ic__panel {
	max-width: 1180px;
	max-height: 90vh;
	overflow-y: auto;
	margin: 0 auto;
	background: var(--ic-bg);
	box-shadow: var(--ic-shadow);
	border-top: 3px solid var(--ic-accent);
	padding: 20px 24px;
}

/* Centred dialog */
.ic--modal {
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ic--modal .ic__panel {
	position: relative;
	width: 100%;
	max-width: 620px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: var(--ic-bg);
	border-radius: var(--ic-radius);
	border-top: 3px solid var(--ic-accent);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	padding: 24px;
}

.ic__overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.ic--modal .ic__panel {
	z-index: 1;
}

.ic__title {
	margin: 0 0 8px;
	font-size: 19px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--ic-text);
}

.ic__body p,
.ic__intro {
	margin: 0 0 10px;
	color: var(--ic-text);
}

.ic__body p:last-child {
	margin-bottom: 0;
}

.ic__links {
	font-size: 14px;
}

.ic__links a {
	color: var(--ic-text);
	text-decoration: underline;
}

.ic__links a:hover,
.ic__links a:focus {
	color: var(--ic-accent);
}

/* ---------------------------------------------------------------- buttons */

.ic__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
	align-items: stretch;
}

.ic-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 12px 22px;
	min-width: 148px;
	min-height: 46px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	letter-spacing: 0.01em;
	border: 2px solid var(--ic-accent);
	border-radius: var(--ic-radius);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

/* Accept all + Reject all. One rule, two buttons, identical weight. */
.ic-btn--equal {
	background: var(--ic-accent);
	color: var(--ic-accent-text);
}

.ic-btn--equal:hover,
.ic-btn--equal:focus {
	background: #000;
	border-color: #000;
	color: #fff;
}

/* Lower-emphasis control for opening the detailed choices. */
.ic-btn--quiet {
	background: transparent;
	color: var(--ic-text);
	border-color: var(--ic-border);
	font-weight: 500;
}

.ic-btn--quiet:hover,
.ic-btn--quiet:focus {
	border-color: var(--ic-text);
}

.ic-btn:focus-visible,
.ic-link:focus-visible,
.ic__switch input:focus-visible + .ic__track {
	outline: 3px solid #0b5fff;
	outline-offset: 2px;
}

.ic-link {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: var(--ic-text);
	text-decoration: underline;
	cursor: pointer;
}

.ic-link:hover {
	color: var(--ic-accent);
}

/* ------------------------------------------------------------- categories */

.ic__cats {
	list-style: none;
	margin: 14px 0 0;
	padding: 0;
	border-top: 1px solid var(--ic-border);
}

.ic__cat {
	margin: 0;
	padding: 14px 0;
	border-bottom: 1px solid var(--ic-border);
}

.ic__cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.ic__cat-title {
	font-weight: 700;
	font-size: 16px;
}

.ic__always {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ic-muted);
	white-space: nowrap;
}

.ic__cat-desc {
	margin: 6px 0 0;
	font-size: 14px;
	color: var(--ic-muted);
}

/* Toggle */
.ic__switch {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	width: 100%;
	cursor: pointer;
}

.ic__switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.ic__track {
	position: relative;
	flex: 0 0 auto;
	width: 52px;
	height: 28px;
	border-radius: 14px;
	background: #c9c9c9;
	transition: background-color 0.15s ease;
}

.ic__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
	transition: transform 0.15s ease;
}

.ic__switch input:checked + .ic__track {
	background: var(--ic-accent);
}

.ic__switch input:checked + .ic__track::after {
	transform: translateX(24px);
}

/* ------------------------------------------------------- blocked embeds */

.ic-placeholder {
	margin: 0 0 12px;
	padding: 18px;
	background: #f4f4f4;
	border: 1px dashed var(--ic-border);
	border-radius: var(--ic-radius);
	font-family: "Roboto", Helvetica, Arial, sans-serif;
	font-size: 15px;
	color: var(--ic-text);
}

.ic-placeholder__text {
	margin: 0 0 12px;
}

.ic-placeholder__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin: 0;
}

iframe[data-ic-blocked="1"] {
	display: none !important;
}

[data-ic-injected] {
	display: contents;
}

/* Floating re-open button */
.ic-fab {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 2147482000;
	padding: 10px 16px;
	font-family: "Roboto", Helvetica, Arial, sans-serif;
	font-size: 14px;
	font-weight: 700;
	color: var(--ic-accent-text);
	background: var(--ic-accent);
	border: 0;
	border-radius: var(--ic-radius);
	cursor: pointer;
}

/* --------------------------------------------------------- policy tables */

.ic-policy__heading {
	margin-top: 1.6em;
}

.ic-policy__tag {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	vertical-align: middle;
	background: #f0f0f0;
	border-radius: 10px;
	color: var(--ic-muted);
}

.ic-policy__tablewrap {
	overflow-x: auto;
	margin: 1em 0 1.5em;
	-webkit-overflow-scrolling: touch;
}

.ic-policy__table {
	width: 100%;
	min-width: 640px;
	border-collapse: collapse;
	font-size: 14px;
}

.ic-policy__table th,
.ic-policy__table td {
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--ic-border);
}

.ic-policy__table thead th {
	background: #f0f0f0;
	font-weight: 700;
	white-space: nowrap;
}

.ic-policy__table code {
	font-size: 13px;
	word-break: break-word;
}

.ic-status {
	font-size: 14px;
	color: var(--ic-muted);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 782px) {
	.ic--bar .ic__panel {
		padding: 16px;
		max-height: 85vh;
		overflow-y: auto;
	}

	.ic__title {
		font-size: 17px;
	}

	.ic__actions {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.ic-btn {
		width: 100%;
		min-width: 0;
	}

	.ic-placeholder__actions .ic-btn {
		width: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ic-btn,
	.ic__track,
	.ic__track::after {
		transition: none;
	}
}

@media (forced-colors: active) {
	.ic-btn--equal,
	.ic-btn--quiet {
		border: 2px solid ButtonText;
	}

	.ic__track {
		border: 1px solid ButtonText;
	}
}
