/**
 * Lux Campaigns — public stylesheet.
 * All custom properties exposed at the root so admins can override
 * via inline style without touching this file.
 */

.lxc-campaigns {
	--lxc-bg: #ffffff;
	--lxc-text: #111111;
	--lxc-muted: #6b7280;
	--lxc-subtle: #f3f4f6;
	--lxc-border: #e5e7eb;
	--lxc-card-bg: #ffffff;
	--lxc-card-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
	--lxc-card-shadow-hover: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
	--lxc-radius: 12px;
	--lxc-radius-sm: 8px;
	--lxc-radius-lg: 16px;
	--lxc-accent: var(--lxc-accent-override, #E11D48);
	--lxc-accent-contrast: #ffffff;
	--lxc-modal-shadow: 0 20px 50px rgba(0,0,0,0.20);

	max-width: 1200px;
	margin: 0 auto;
	padding: 32px 16px 64px;
	color: var(--lxc-text);
	font-family: inherit;
	box-sizing: border-box;
}
.lxc-campaigns *,
.lxc-campaigns *::before,
.lxc-campaigns *::after { box-sizing: border-box; }

.lxc-campaigns__header {
	margin-bottom: 20px;
}
.lxc-campaigns__title {
	font-size: clamp(24px, 4vw, 32px);
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0 0 4px;
	color: var(--lxc-text);
}

/* ---------- Tabs ---------- */
.lxc-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 24px;
}
.lxc-tab {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: 1px solid var(--lxc-border);
	border-radius: 999px;
	padding: 10px 20px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--lxc-muted);
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.lxc-tab:hover {
	color: var(--lxc-text);
	border-color: #c8cbd2;
}
.lxc-tab:focus-visible {
	outline: 2px solid var(--lxc-accent);
	outline-offset: 2px;
}
.lxc-tab.is-active {
	color: var(--lxc-text);
	border-color: var(--lxc-text);
	background: transparent;
	font-weight: 600;
}

/* ---------- Panels & grid ---------- */
.lxc-panel[hidden] { display: none !important; }

.lxc-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}
.lxc-empty {
	color: var(--lxc-muted);
	font-size: 14px;
	padding: 20px 0;
	margin: 0;
}

/* ---------- Card ---------- */
.lxc-card {
	display: flex;
	flex-direction: column;
	background: var(--lxc-card-bg);
	border: 1px solid var(--lxc-border);
	border-radius: var(--lxc-radius);
	overflow: hidden;
	box-shadow: var(--lxc-card-shadow);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.lxc-card:hover {
	box-shadow: var(--lxc-card-shadow-hover);
	transform: translateY(-1px) scale(1.004);
}
.lxc-card__media {
	aspect-ratio: 3 / 2;
	background: var(--lxc-subtle);
	overflow: hidden;
}
.lxc-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.lxc-card__media-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #c0c4cc;
}
.lxc-card__date {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--lxc-subtle);
	color: var(--lxc-muted);
	font-size: 13px;
	padding: 10px 16px;
	border-top: 1px solid var(--lxc-border);
}
.lxc-card__date svg { flex-shrink: 0; opacity: 0.85; }
.lxc-card__body {
	padding: 16px 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
}
.lxc-card__title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--lxc-text);
}
.lxc-card__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 500;
	color: var(--lxc-text);
	text-decoration: underline;
	text-underline-offset: 3px;
	margin-top: auto;
	align-self: flex-start;
	cursor: pointer;
}
.lxc-card__link:hover { color: var(--lxc-accent); }
.lxc-card__link:focus-visible { outline: 2px solid var(--lxc-accent); outline-offset: 2px; }
.lxc-card__link svg { transition: transform 0.18s ease; }
.lxc-card__link:hover svg { transform: translateX(2px); }

/* ---------- Modal ---------- */
.lxc-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 32px 20px;
	overflow-y: auto;
}
.lxc-modal[aria-hidden="false"] {
	display: flex;
	animation: lxc-fade 0.18s ease both;
}
.lxc-modal__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.55);
	z-index: 0;
}
.lxc-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 720px;
	background: #ffffff;
	border-radius: var(--lxc-radius-lg);
	box-shadow: var(--lxc-modal-shadow);
	overflow: hidden;
	transform: scale(0.96);
	opacity: 0;
	animation: lxc-pop 0.20s ease 0.05s forwards;
	max-height: calc(100vh - 64px);
	display: flex;
	flex-direction: column;
	margin: auto;
}
@keyframes lxc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lxc-pop {
	to { transform: scale(1); opacity: 1; }
}
body .lxc-campaigns .lxc-modal__close,
body .lxc-campaigns button.lxc-modal__close,
.lxc-campaigns .lxc-modal__close {
	position: absolute !important;
	top: 12px !important;
	right: 12px !important;
	z-index: 5 !important;
	width: 36px !important;
	height: 36px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	border-radius: 50% !important;
	background: rgba(255,255,255,0.95) !important;
	background-color: rgba(255,255,255,0.95) !important;
	border: 1px solid var(--lxc-border) !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	color: var(--lxc-text) !important;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 0 !important;
	box-shadow: 0 1px 4px rgba(0,0,0,0.10) !important;
	overflow: visible !important;
	font: inherit !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}
.lxc-modal__close:hover { background: #ffffff !important; }
.lxc-modal__close:focus-visible { outline: 2px solid var(--lxc-accent); outline-offset: 2px; }
.lxc-modal__close-x {
	position: relative;
	display: inline-block;
	width: 16px;
	height: 16px;
	pointer-events: none;
}
.lxc-modal__close-x::before,
.lxc-modal__close-x::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
}
.lxc-modal__close-x::before { transform: translateY(-50%) rotate(45deg); }
.lxc-modal__close-x::after  { transform: translateY(-50%) rotate(-45deg); }
.lxc-modal__body { overflow-y: auto; }
.lxc-modal__hero {
	width: 100%;
	aspect-ratio: 16 / 10;
	background: var(--lxc-subtle);
	overflow: hidden;
}
.lxc-modal__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lxc-modal__content { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 16px; }
.lxc-modal__title {
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0;
	color: var(--lxc-text);
}
.lxc-modal__date { color: var(--lxc-muted); font-size: 14px; margin: -8px 0 0; }
.lxc-modal__long { font-size: 15px; line-height: 1.6; color: #1f2937; }
.lxc-modal__long > *:first-child { margin-top: 0; }
.lxc-modal__long > *:last-child { margin-bottom: 0; }

.lxc-coupon {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	border: 2px dashed var(--lxc-border);
	border-radius: var(--lxc-radius-sm);
	background: var(--lxc-subtle);
}
.lxc-coupon__label {
	font-size: 12px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--lxc-muted);
}
.lxc-coupon__code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--lxc-text);
}

.lxc-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 14px 20px;
	border-radius: var(--lxc-radius-sm);
	background: var(--lxc-accent);
	color: var(--lxc-accent-contrast);
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	transition: filter 0.15s ease, transform 0.05s ease;
}
.lxc-cta:hover { filter: brightness(0.94); color: var(--lxc-accent-contrast); }
.lxc-cta:active { transform: translateY(1px); }
.lxc-cta:focus-visible { outline: 2px solid var(--lxc-accent); outline-offset: 2px; }

.lxc-terms {
	border-top: 1px solid var(--lxc-border);
	padding-top: 12px;
}
.lxc-terms__toggle {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	background: transparent;
	border: none;
	font: inherit;
	font-weight: 600;
	font-size: 14px;
	color: var(--lxc-text);
	cursor: pointer;
}
.lxc-terms__toggle:focus-visible { outline: 2px solid var(--lxc-accent); outline-offset: 2px; }
.lxc-terms__chevron { transition: transform 0.2s ease; }
.lxc-terms__toggle[aria-expanded="true"] .lxc-terms__chevron { transform: rotate(180deg); }
.lxc-terms__body[hidden] { display: none; }
.lxc-terms__body {
	font-size: 13px;
	line-height: 1.55;
	color: var(--lxc-muted);
	padding-bottom: 8px;
}

/* Body scroll lock when modal is open. */
body.lxc-modal-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
	.lxc-grid { grid-template-columns: 1fr; gap: 16px; }
	.lxc-campaigns { padding: 20px 12px 48px; }
	.lxc-tabs { gap: 8px; }
	.lxc-tab { padding: 9px 16px; font-size: 13px; }

	/* Modal: smaller, away from edges, leaves room for chat widgets at bottom-right */
	.lxc-modal { padding: 28px 16px 80px; align-items: flex-start; }
	.lxc-modal__dialog {
		border-radius: var(--lxc-radius-lg);
		max-height: calc(100vh - 108px);
		max-width: 100%;
		width: 100%;
		margin: 0 auto;
	}
	/* Cap the hero so it can't eat the whole viewport on tall mobile screens */
	.lxc-modal__hero {
		aspect-ratio: auto;
		max-height: 38vh;
	}
	.lxc-modal__hero img { height: 100%; max-height: 38vh; }
	.lxc-modal__content { padding: 18px 16px 24px; gap: 14px; }
	.lxc-modal__title { font-size: 18px; line-height: 1.3; }
	.lxc-modal__date { font-size: 13px; }
	.lxc-modal__long { font-size: 14px; line-height: 1.55; }
	.lxc-coupon { padding: 12px 14px; gap: 4px; }
	.lxc-coupon__label { font-size: 11px; }
	.lxc-coupon__code { font-size: 17px; }
}
