/* Crackers Compliance — Frontend Structural CSS
   Colors, fonts, spacing come from inline CSS custom properties
   generated per-site in includes/class-design.php. This file only
   provides layout/structure so it stays cache-friendly. */

.ccomp-notice,
.ccomp-notice * {
	box-sizing: border-box;
}

.ccomp-notice {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 999999;
	width: 100%;
	max-width: 100vw;
}

.ccomp-notice[hidden] {
	display: none !important;
}

/* Bottom fixed bar (default) */
.ccomp-notice.ccomp-position-bottom {
	bottom: 0;
}
.ccomp-notice.ccomp-position-top {
	top: 0;
}

.ccomp-notice-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
}

.ccomp-notice-content {
	flex: 1 1 320px;
	min-width: 0;
}

.ccomp-notice-title {
	margin: 0 0 6px;
	word-wrap: break-word;
}

.ccomp-notice-text {
	word-wrap: break-word;
}

.ccomp-notice-text p {
	margin: 0 0 8px;
}
.ccomp-notice-text p:last-child {
	margin-bottom: 0;
}

.ccomp-notice-action {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

.ccomp-notice-button {
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
	white-space: nowrap;
}

.ccomp-anim-subtle .ccomp-notice-button:hover {
	transform: translateY(-1px);
}

@keyframes ccomp-pulse {
	0% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2); }
	70% { box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
	100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.ccomp-btn-icon {
	display: inline-block;
	width: 14px;
	height: 14px;
	position: relative;
}
.ccomp-icon-check::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 3px;
	width: 8px;
	height: 4px;
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
}
.ccomp-icon-arrow::before {
	content: "\2192";
}

/* Card layout: floats above bottom-right, doesn't span full width */
.ccomp-layout-card {
	width: auto;
	right: 0;
	left: auto;
}
.ccomp-layout-card .ccomp-notice-inner {
	flex-direction: column;
	align-items: flex-start;
}

/* Center popup */
.ccomp-overlay {
	position: fixed;
	inset: 0;
	z-index: 999998;
	background: rgba(0, 0, 0, 0.6);
}
.ccomp-overlay[hidden] {
	display: none !important;
}

.ccomp-type-popup {
	position: fixed;
	top: 50%;
	left: 50%;
	right: auto;
	bottom: auto;
	transform: translate(-50%, -50%);
	width: 92%;
	max-width: 560px;
}
.ccomp-type-popup .ccomp-notice-inner {
	flex-direction: column;
	align-items: stretch;
	text-align: left;
}
.ccomp-type-popup .ccomp-notice-action {
	justify-content: flex-end;
	margin-top: 12px;
}

/* Mobile responsive layout (compact, content-driven, no blank space) */
@media (max-width: 767px) {
	.ccomp-notice {
		width: 100%;
		max-width: 100vw;
		height: auto;
		min-height: 0;
	}

	.ccomp-notice.ccomp-position-bottom {
		bottom: 0;
		bottom: env(safe-area-inset-bottom, 0px);
		z-index: 1000001;
	}

	/* Controlled offset when fixed mobile bottom navigation is present */
	body:has(.site-mobile-navbar, .klb-mobile-bottom) .ccomp-notice.ccomp-position-bottom {
		bottom: 57px;
		bottom: calc(var(--mobile-nav-height, 57px) + env(safe-area-inset-bottom, 0px));
	}

	.ccomp-notice-inner,
	.ccomp-notice .ccomp-notice-inner {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		height: auto;
		min-height: 0;
		padding: 16px 18px;
		gap: 10px;
	}

	.ccomp-notice-content,
	.ccomp-notice .ccomp-notice-content {
		flex: 0 1 auto;
		width: 100%;
		height: auto;
		min-height: 0;
	}

	.ccomp-notice-title,
	.ccomp-notice .ccomp-notice-title {
		margin: 0 0 6px;
		font-size: 16px;
		line-height: 1.3;
		word-wrap: break-word;
	}

	.ccomp-notice-text,
	.ccomp-notice .ccomp-notice-text {
		font-size: 13px;
		line-height: 1.5;
		word-wrap: break-word;
	}

	.ccomp-notice-text p,
	.ccomp-notice .ccomp-notice-text p {
		margin: 0 0 6px;
	}

	.ccomp-notice-text p:last-child,
	.ccomp-notice .ccomp-notice-text p:last-child {
		margin-bottom: 0;
	}

	.ccomp-notice-action,
	.ccomp-notice .ccomp-notice-action {
		flex: 0 0 auto;
		width: 100%;
		margin-top: 6px;
		display: flex;
		justify-content: flex-start;
	}

	.ccomp-notice-button,
	.ccomp-notice .ccomp-notice-button {
		display: inline-flex;
		width: auto;
		min-width: 100px;
		justify-content: center;
		align-items: center;
		padding: 10px 26px;
		font-size: 14px;
		line-height: 1.2;
		height: auto;
		min-height: 38px;
		box-sizing: border-box;
	}

	.ccomp-type-popup {
		width: 94%;
	}
}

/* Tablet responsive layout (lift notice above fixed mobile bottom navbar if present) */
@media (min-width: 768px) and (max-width: 1024px) {
	.ccomp-notice.ccomp-position-bottom {
		bottom: 0;
		bottom: env(safe-area-inset-bottom, 0px);
	}

	body:has(.site-mobile-navbar, .klb-mobile-bottom) .ccomp-notice.ccomp-position-bottom {
		bottom: 57px;
		bottom: calc(var(--mobile-nav-height, 57px) + env(safe-area-inset-bottom, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.ccomp-notice,
	.ccomp-notice-button {
		transition: none !important;
		animation: none !important;
	}
}
