/*
 * Illuminati Society — custom color theme
 *
 * The site's theme (Blocksy) drives almost all of its coloring through CSS
 * custom properties (--theme-palette-color-1..8 and friends), so this file
 * re-defines those tokens rather than rewriting any layout/markup. It's
 * loaded last on every page so it wins the cascade over the theme's own
 * generated stylesheet.
 *
 * A handful of header/footer rules set colors directly (not through a
 * token), so those are overridden explicitly below using their original
 * selectors.
 */

:root {
	/* --- brand palette --- */
	--theme-palette-color-1: #c9a227; /* gold — links, buttons, primary accent */
	--theme-palette-color-2: #a6851c; /* deeper gold — hover state */
	--theme-palette-color-3: #2a2730; /* charcoal-slate — body text */
	--theme-palette-color-4: #1c1424; /* deep ink-purple — headings */
	--theme-palette-color-5: #ded2ab; /* warm parchment-gray — borders */
	--theme-palette-color-6: #f3eedf; /* parchment — light section backgrounds */
	--theme-palette-color-7: #faf8f3; /* near-white — lightest backgrounds */
	--theme-palette-color-8: #ffffff; /* white — text on dark surfaces */

	/* --- semantic tokens --- */
	--theme-text-color: var(--theme-palette-color-3);
	--theme-headings-color: var(--theme-palette-color-4);
	--theme-link-initial-color: var(--theme-palette-color-1);
	--theme-link-hover-color: var(--theme-palette-color-2);
	--theme-border-color: var(--theme-palette-color-5);
	--theme-selection-background-color: var(--theme-palette-color-1);
	--theme-selection-text-color: #17161c;
	--theme-button-background-initial-color: var(--theme-palette-color-1);
	--theme-button-background-hover-color: var(--theme-palette-color-2);
	--theme-button-text-initial-color: #17161c;
	--theme-button-text-hover-color: #17161c;

	/* ink surfaces used by the explicit overrides below */
	--brand-ink: #0e0e10;
	--brand-ink-2: #17161c;
	--brand-purple: #1c1424;
	--brand-burgundy: #5c1a2b;
	--brand-parchment: #f3eedf;
}

/* header */
[data-header*="type-1"] .ct-header {
	background-color: var(--brand-ink);
	background-image: none;
}
[data-header*="type-1"] .ct-header [data-row*="middle"] {
	background-color: var(--brand-ink-2);
	background-image: none;
}
[data-header*="type-1"] [data-id="cart"] .ct-cart-content {
	--mini-cart-background-color: var(--brand-purple);
}

/* mobile drawer / search / account modals */
[data-header*="type-1"] #offcanvas .ct-panel-inner,
[data-header*="type-1"] #search-modal,
[data-header*="type-1"] #account-modal {
	background-color: rgba(14, 14, 16, 0.98);
}
[data-header*="type-1"] #account-modal .ct-account-modal {
	background-color: var(--theme-palette-color-8);
}

/* footer */
[data-footer*="type-1"] .ct-footer [data-row*="top"] {
	background-color: var(--brand-burgundy);
}
[data-footer*="type-1"] .ct-footer [data-row*="top"] .widget-title {
	--theme-heading-color: var(--theme-palette-color-1);
}
[data-footer*="type-1"] .ct-footer [data-row*="middle"] {
	background-color: var(--brand-purple);
}
[data-footer*="type-1"] .ct-footer [data-row*="bottom"] {
	background-color: var(--brand-ink);
}
[data-footer*="type-1"] [data-column="widget-area-5"] {
	--theme-text-color: var(--brand-parchment);
}

/* hero slide headings were <div>s (no page had an <h1>); now real h1/h2 tags —
   reset default browser heading margins so the fix is invisible visually */
h1.elementor-slide-heading,
h2.elementor-slide-heading {
	margin: 0 0 15px 0;
}

/* ---------------------------------------------------------------------------
 * Floating language switcher
 *
 * Replaces the old GTranslate widget, which translated in the browser and left
 * every language on one URL. This one is plain links to each language's own
 * page, rendered server-side by src/lib/render-legacy.js — so the translated
 * pages are crawlable and shareable.
 *
 * Rendered as a direct <body> child (see render-legacy.js) so no ancestor
 * transform can capture the fixed position and pin it to the footer.
 * ------------------------------------------------------------------------- */
.lang-switcher {
	position: fixed;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	/* above page content, but below the theme's offcanvas/search/account
	   panels (.ct-panel, z-index 99999+) so they still cover it when open */
	z-index: 9999;
	min-width: 150px;
	font-family: Arial, sans-serif;
	font-size: 13px;
	line-height: 1.2;
}

/* Elementor styles every <button> via '.elementor-kit-7 button' (specificity
   0,1,1), which outranks a lone class. Qualifying with the element and the
   parent keeps these rules winning without resorting to !important. */
.lang-switcher button.lang-switcher__current {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 9px 12px;
	border: 1px solid var(--theme-palette-color-5);
	border-right: 0;
	/* gold spine along the screen edge so the tab reads as deliberate, and is
	   easy to spot against both the light body and the dark hero images */
	border-left: 3px solid var(--theme-palette-color-1);
	border-radius: 4px 0 0 4px;
	background: var(--theme-palette-color-8);
	color: var(--theme-palette-color-3);
	font: inherit;
	text-align: left;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	box-shadow: 0 2px 14px rgb(0 0 0 / 28%);
}

.lang-switcher button.lang-switcher__current:hover,
.lang-switcher button.lang-switcher__current:focus-visible {
	background: var(--theme-palette-color-6);
	color: var(--theme-palette-color-4);
}

/* caret; flips when the list is open */
.lang-switcher button.lang-switcher__current::after {
	content: "";
	margin-left: auto;
	border: 4px solid transparent;
	border-top-color: currentColor;
	transform: translateY(2px);
}

.lang-switcher button.lang-switcher__current[aria-expanded="true"]::after {
	transform: translateY(-2px) rotate(180deg);
}

/* Absolutely positioned so opening the list does not change the wrapper's
   height — otherwise the vertically-centred wrapper re-centres and the button
   jumps out from under the cursor (it moved 76px before this). */
.lang-switcher__list {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	width: 100%;
	list-style: none;
	margin: 0;
	padding: 0;
	/* the list hangs below a vertically-centred button, so cap it well inside
	   the lower half of the viewport and scroll the rest */
	max-height: min(45vh, 300px);
	overflow-y: auto;
	border: 1px solid var(--theme-palette-color-5);
	border-right: 0;
	border-radius: 4px 0 0 4px;
	background: var(--theme-palette-color-8);
	box-shadow: 0 2px 14px rgb(0 0 0 / 28%);
}

.lang-switcher__list[hidden] {
	display: none;
}

.lang-switcher .lang-switcher__list a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	color: var(--theme-palette-color-3);
	text-decoration: none;
	white-space: nowrap;
}

.lang-switcher .lang-switcher__list a:hover,
.lang-switcher .lang-switcher__list a:focus-visible {
	background: var(--theme-palette-color-6);
	color: var(--theme-palette-color-4);
}

.lang-switcher img {
	display: block;
	flex: none;
	border-radius: 2px;
}

/* --- interim GTranslate fallback -----------------------------------------
 * Used only until the first translation dictionary exists (see
 * render-legacy.js). GTranslate injects its own markup and grows the element's
 * height when the dropdown opens, which would re-centre this vertically
 * centred wrapper and move the control mid-click. Fixing the wrapper's height
 * and taking the widget out of flow keeps it still, exactly like the static
 * switcher above. */
.lang-switcher--gt {
	height: 38px;
}

.lang-switcher--gt .gt_switcher {
	position: absolute;
	top: 0;
	right: 0;
	width: 150px !important;
	border-left: 3px solid var(--theme-palette-color-1);
	border-radius: 4px 0 0 4px;
	overflow: hidden;
	box-shadow: 0 2px 14px rgb(0 0 0 / 28%);
}

/* GTranslate writes its own inline width/colour rules from the settings object,
   so these need the same weight to land. */
.lang-switcher--gt .gt_switcher .gt_selected,
.lang-switcher--gt .gt_switcher .gt_selected a,
.lang-switcher--gt .gt_switcher .gt_option {
	width: 100% !important;
	box-sizing: border-box !important;
}

.lang-switcher--gt .gt_switcher .gt_selected a {
	height: auto !important;
	padding: 10px 12px !important;
	line-height: 1.2 !important;
}

@media print {
	.lang-switcher {
		display: none;
	}
}
