/*
 * FIX-31 — Complianz cookie banner styling.
 *
 * Complianz (cookiebanner/css/defaults/banner-optout.css) drives almost all of
 * its own look through CSS custom properties declared on :root. We redeclare
 * those same properties on #cmplz-cookiebanner-container / #cmplz-manage-consent
 * instead of :root: custom properties inherit down to every banner element the
 * same way, but a declaration on an ID beats one on :root (a pseudo-class)
 * regardless of which stylesheet the browser loaded first — Complianz enqueues
 * its banner CSS after every theme file, so fighting load order here would be
 * fragile. The few non-variable overrides below (position, radius, empty
 * bullet) use the same #id + .class pairing so they win on specificity, not luck.
 *
 * Team GALLERY's 70-gallery.css is untouched; this file only reaches the
 * Complianz banner and the gallery's two small, already-scoped bug fixes.
 */

#cmplz-cookiebanner-container,
#cmplz-manage-consent {
	--cmplz_banner_width: 420px;
	--cmplz_banner_background_color: var(--paper);
	--cmplz_banner_border_color: var(--rule);
	--cmplz_banner_border_width: 1px 1px 1px 1px;
	--cmplz_banner_border_radius: 0px;
	--cmplz_banner_margin: 10px;
	--cmplz_title_font_size: 19px;
	--cmplz_text_color: var(--tx);
	--cmplz_text_font_size: 15px;
	--cmplz_link_font_size: 14px;
	--cmplz_category_body_font_size: 14px;
	--cmplz_category_header_title_font_size: 14.5px;
	--cmplz_category_header_active_font_size: 12.5px;
	--cmplz_hyperlink_color: var(--river);
	/* Rust is the one action per screen (design language rule); Accept is it. */
	--cmplz_button_accept_background_color: var(--rust);
	--cmplz_button_accept_border_color: var(--rust);
	--cmplz_button_accept_text_color: var(--on-ink);
	--cmplz_button_deny_background_color: transparent;
	--cmplz_button_deny_border_color: var(--tx-3);
	--cmplz_button_deny_text_color: var(--tx);
	--cmplz_button_settings_background_color: transparent;
	--cmplz_button_settings_border_color: var(--rule);
	--cmplz_button_settings_text_color: var(--tx);
	--cmplz_button_border_radius: 0px;
	--cmplz_button_font_size: 15px;
	--cmplz_category_header_always_active_color: var(--river);
	--cmplz_slider_active_color: var(--river);
	--cmplz_slider_inactive_color: var(--clay);
	--cmplz_slider_bullet_color: var(--paper);
	--cmplz-manage-consent-height: 46px;
}

/*
 * Complianz centers the dialog on the viewport (top/left 50%). On a phone
 * that lands the card over whatever is at mid-screen, which on /book/ can be
 * the sticky "Continue" action pinned to the bottom of the viewport
 * (.rhc-mobile-sticky-action, assets/css/phase1.css). Anchoring the banner
 * under the header instead of at center clears that control on every route,
 * at every width, without needing to know where each page's CTA sits.
 */
#cmplz-cookiebanner-container .cmplz-cookiebanner {
	position: fixed;
	top: 96px;
	left: 50%;
	bottom: auto;
	transform: translateX(-50%);
	max-height: calc(100vh - 128px);
	border-radius: 0;
	box-shadow: 0 18px 40px rgba(20, 32, 27, .28);
	font-family: var(--b);
}

#cmplz-cookiebanner-container .cmplz-header {
	grid-template-columns: 1fr auto;
}

#cmplz-cookiebanner-container .cmplz-logo {
	display: none;
}

#cmplz-cookiebanner-container .cmplz-title {
	grid-column-start: 1;
	justify-self: start;
	font-family: var(--d);
	font-weight: 600;
	color: var(--ink);
}

#cmplz-cookiebanner-container .cmplz-close {
	grid-column-start: 2;
	color: var(--tx-3);
}

#cmplz-cookiebanner-container .cmplz-close:hover {
	color: var(--ink);
}

#cmplz-cookiebanner-container .cmplz-divider {
	background: var(--rule);
	height: 1px;
	border: 0;
}

#cmplz-cookiebanner-container .cmplz-message {
	font-family: var(--b);
	line-height: 1.5;
}

#cmplz-cookiebanner-container .cmplz-categories .cmplz-category {
	background: var(--surface);
	border: 1px solid var(--rule);
}

#cmplz-cookiebanner-container .cmplz-buttons .cmplz-btn {
	font-family: var(--b);
	font-weight: 600;
	letter-spacing: .01em;
}

#cmplz-cookiebanner-container .cmplz-buttons .cmplz-btn.cmplz-accept:hover {
	background-color: var(--ink);
	border-color: var(--ink);
}

#cmplz-cookiebanner-container .cmplz-links .cmplz-link {
	text-decoration: underline;
	text-decoration-color: var(--clay);
	text-decoration-thickness: 1.5px;
	text-underline-offset: 3px;
}

#cmplz-cookiebanner-container .cmplz-links .cmplz-link:hover {
	text-decoration-color: currentColor;
}

#cmplz-cookiebanner-container .cmplz-documents ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/*
 * T7c-002 style bug, same shape: when a document type is set to "none"
 * (Impressum here — this is a US studio, no imprint law applies) Complianz's
 * own JS adds cmplz-hidden to the <a> but leaves its <li> in the list, so an
 * empty bullet sits under Cookie Policy / Privacy Statement with nothing next
 * to it. Drop the whole row when its only link is hidden.
 */
#cmplz-cookiebanner-container .cmplz-documents li:has(> a.cmplz-hidden) {
	display: none;
}

@media (max-width: 620px) {
	#cmplz-cookiebanner-container .cmplz-cookiebanner {
		top: 80px;
		width: calc(100vw - 24px);
		max-width: calc(100vw - 24px);
		max-height: calc(100vh - 190px);
	}
}

/* The reopen pill (desktop only — Complianz hides it under 768px itself). */
#cmplz-manage-consent .cmplz-manage-consent {
	font-family: var(--b);
	font-weight: 600;
	box-shadow: 0 10px 24px rgba(20, 32, 27, .22);
}

/* ---------- Gallery: no visible text under pictures ---------- */

/*
 * Owner ruling: nothing renders under the images on /gallery/ or the
 * discipline galleries. Captions already don't render server-side
 * (RiverHouse_Gallery_Page::render_cell and
 * RiverHouse_Discipline_Mixed_Size_Gallery::render_item both omit them) —
 * this is a second, CSS-level guarantee so a caption can never reappear here
 * just because a figcaption gets added back to the markup later. Alt text is
 * untouched: it stays in the alt="" attribute, read by screen readers only.
 */
.rh-gallery__cell figcaption,
.rh-discipline-mixed-gallery__item figcaption {
	display: none !important;
}
