/* Consentry — cookie consent UI. Themeable via --consentry-* variables. */
.consentry {
	--consentry-accent: #C8102E;
	--consentry-accent-text: #ffffff;
	--consentry-bg: #ffffff;
	--consentry-fg: #1a1a1a;
	--consentry-muted: #6a6a6a;
	--consentry-border: #e6e6e6;
	--consentry-radius: 12px;
	position: fixed;
	inset: 0;
	z-index: 99999;
	font-family: inherit;
	color: var(--consentry-fg);
	/* Root is a transparent, transform-free layer so position:fixed children
	   (the modal) center against the viewport, not a transformed banner box. */
	pointer-events: none;
}
.consentry__banner,
.consentry__modal { pointer-events: auto; }
.consentry--dark {
	--consentry-bg: #1c1c1e;
	--consentry-fg: #f4f4f5;
	--consentry-muted: #a1a1aa;
	--consentry-border: #38383b;
}
.consentry[hidden] { display: none; }

/* ---- banner ---- */
.consentry__banner {
	background: var(--consentry-bg);
	border: 1px solid var(--consentry-border);
	box-shadow: 0 12px 40px rgba(0,0,0,.18);
	border-radius: var(--consentry-radius);
	padding: 20px 22px;
	display: flex;
	align-items: center;
	gap: 22px;
}
.consentry__text { flex: 1 1 auto; }
.consentry__heading { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.consentry__body { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--consentry-muted); }
.consentry__body a { color: var(--consentry-accent); text-decoration: underline; }
.consentry__actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; margin-left: auto; }

/* ---- positions ----
   The transform/animation lives on .consentry__banner (a leaf), never on the
   root, so the modal's position:fixed stays relative to the viewport. */
.consentry--bottom-bar .consentry__banner { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); width: min(1100px, calc(100% - 32px)); opacity: 0; transition: opacity .35s ease, transform .35s ease; }
.consentry--bottom-bar.is-visible .consentry__banner { transform: translate(-50%, 0); opacity: 1; }

.consentry--bottom-left .consentry__banner { position: fixed; left: 24px; bottom: 24px; transform: translateY(30px); width: min(420px, calc(100% - 32px)); flex-direction: column; align-items: stretch; opacity: 0; transition: opacity .35s ease, transform .35s ease; }
.consentry--bottom-left.is-visible .consentry__banner { transform: translateY(0); opacity: 1; }

.consentry--center { display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); pointer-events: auto; opacity: 0; transition: opacity .3s ease; }
.consentry--center.is-visible { opacity: 1; }
.consentry--center .consentry__banner { flex-direction: column; align-items: stretch; width: min(560px, calc(100% - 32px)); opacity: 1; }

/* ---- buttons ---- */
.consentry__btn {
	font: inherit; font-size: .88rem; font-weight: 600;
	padding: 10px 18px; border-radius: 999px; cursor: pointer;
	border: 1px solid var(--consentry-border); background: transparent; color: var(--consentry-fg);
	transition: background .15s ease, opacity .15s ease, border-color .15s ease;
}
.consentry__btn:hover { opacity: .85; }
.consentry__btn--primary { background: var(--consentry-accent); color: var(--consentry-accent-text); border-color: var(--consentry-accent); }
.consentry__btn--ghost:hover { border-color: var(--consentry-accent); color: var(--consentry-accent); }

/* ---- preferences modal ---- */
.consentry__modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; }
.consentry__modal[hidden] { display: none; }
.consentry__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.consentry__modal-inner {
	position: relative; z-index: 1;
	background: var(--consentry-bg); color: var(--consentry-fg);
	border-radius: var(--consentry-radius);
	padding: 28px; width: min(540px, calc(100% - 32px));
	max-height: 86vh; overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.consentry__close { position: absolute; top: 14px; right: 16px; border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--consentry-muted); }
.consentry__cats { margin: 18px 0; display: flex; flex-direction: column; gap: 14px; }
.consentry__cat { border: 1px solid var(--consentry-border); border-radius: 10px; padding: 14px 16px; }
.consentry__cat-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.consentry__cat-label { font-weight: 600; font-size: .95rem; }
.consentry__cat-desc { margin: 6px 0 0; font-size: .82rem; line-height: 1.5; color: var(--consentry-muted); }

/* ---- switch ---- */
.consentry__switch { position: relative; flex-shrink: 0; width: 44px; height: 24px; }
.consentry__switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.consentry__slider { position: absolute; inset: 0; background: #c4c4c4; border-radius: 999px; transition: background .2s ease; }
.consentry__slider::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .2s ease; }
.consentry__switch input:checked + .consentry__slider { background: var(--consentry-accent); }
.consentry__switch input:checked + .consentry__slider::before { transform: translateX(20px); }
.consentry__switch input:disabled + .consentry__slider { opacity: .6; cursor: not-allowed; }
.consentry__actions--modal { justify-content: flex-end; }

/* ---- responsive ---- */
@media (max-width: 720px) {
	.consentry__banner { flex-direction: column; align-items: stretch; }
	.consentry__actions { justify-content: stretch; }
	.consentry__btn { flex: 1; text-align: center; }
}
