/*
 * site-kit.css — the styles that pair with the shared SiteKit + SiteSearch
 * libraries (assets/js/site-kit.js, assets/js/search.js). Load it after the
 * host site's own stylesheet:
 *
 *   <link rel="stylesheet" href=".../style.css">
 *   <link rel="stylesheet" href=".../site-kit.css">
 *
 * Everything here is driven by the host's design tokens (--bg, --card,
 * --border, --text, --muted, --accent, --accent-strong, --accent-tint,
 * --on-accent, --shadow, --radius, --font-mono), so it inherits the host's
 * look. The host owns the base tokens and its own "light"/"dark" — this file
 * only adds the extra, non-brand palettes below.
 */

/* ============================================================
 * Extra themes — universal palettes, not tied to any one site's brand.
 * Each is a full override of the token set. Add the ids to your
 * SiteKit.theme({ themes: [...] }) list to expose them in the menu.
 * ============================================================ */

/* "Sepia" — warm paper with a serif body, easy on the eyes for long reads. */
html[data-theme="sepia"] {
  --bg: #F1E7D0;
  --card: #FBF3DF;
  --border: #E0D2B4;
  --text: #433729;
  --muted: #76654C;
  --accent: #A05F2A;
  --accent-strong: #834B1E;
  --accent-tint: #EAD9BC;
  --on-accent: #FBF3DF;
  --shadow: 0 6px 24px rgba(67, 55, 42, 0.12);
  --font-body: Georgia, "Iowan Old Style", "Times New Roman", serif;
  color-scheme: light;
}

/* "Solarized Light" — the light half of Ethan Schoonover's palette. */
html[data-theme="solarized-light"] {
  --bg: #FDF6E3;
  --card: #F4EEDC;
  --border: #E3DCC4;
  --text: #4A5C63;
  --muted: #606E6E;
  --accent: #217D76;
  --accent-strong: #196E67;
  --accent-tint: rgba(42, 161, 152, 0.14);
  --on-accent: #FDF6E3;
  --shadow: 0 6px 24px rgba(88, 110, 117, 0.12);
  color-scheme: light;
}

/* "Nord Light" — the Nord project's "Snow Storm" greys + a darker Frost accent. */
html[data-theme="nord-light"] {
  --bg: #E5E9F0;
  --card: #ECEFF4;
  --border: #D3DAE6;
  --text: #2E3440;
  --muted: #4C566A;
  --accent: #4E6E97;
  --accent-strong: #446187;
  --accent-tint: rgba(94, 129, 172, 0.13);
  --on-accent: #ECEFF4;
  --shadow: 0 6px 24px rgba(46, 52, 64, 0.12);
  color-scheme: light;
}

/* "Gruvbox Light" — retro warm, the light "hard" background. */
html[data-theme="gruvbox-light"] {
  --bg: #F9F5D7;
  --card: #F2E5BC;
  --border: #E4D5A8;
  --text: #3C3836;
  --muted: #70645A;
  --accent: #AF3A03;
  --accent-strong: #8F2F02;
  --accent-tint: rgba(175, 58, 3, 0.10);
  --on-accent: #F9F5D7;
  --shadow: 0 6px 24px rgba(60, 56, 54, 0.12);
  color-scheme: light;
}

/* "Solarized" — Schoonover's dark palette. */
html[data-theme="solarized"] {
  --bg: #002B36;
  --card: #073642;
  --border: #0F4A5A;
  --text: #A6B1B1;
  --muted: #8A9C9E;
  --accent: #2AA198;
  --accent-strong: #4FC4BA;
  --accent-tint: rgba(42, 161, 152, 0.15);
  --on-accent: #002B36;
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* "Nord" — arctic blue-greys with a frost-blue accent. */
html[data-theme="nord"] {
  --bg: #2E3440;
  --card: #3B4252;
  --border: #4A5262;
  --text: #ECEFF4;
  --muted: #A5AFBC;
  --accent: #88C0D0;
  --accent-strong: #A9D6E2;
  --accent-tint: rgba(136, 192, 208, 0.16);
  --on-accent: #2E3440;
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

/* "Night" — a warm dark counterpart to Sepia, serif body, low blue. */
html[data-theme="night"] {
  --bg: #211C16;
  --card: #2A241C;
  --border: #3D3528;
  --text: #DACDB6;
  --muted: #998A70;
  --accent: #C99A5B;
  --accent-strong: #E0B978;
  --accent-tint: rgba(201, 154, 91, 0.14);
  --on-accent: #211C16;
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.55);
  --font-body: Georgia, "Iowan Old Style", "Times New Roman", serif;
  color-scheme: dark;
}

/* "Dracula" — the dark purple palette. */
html[data-theme="dracula"] {
  --bg: #282A36;
  --card: #343746;
  --border: #44475A;
  --text: #F8F8F2;
  --muted: #9BA0BB;
  --accent: #BD93F9;
  --accent-strong: #D6BCFF;
  --accent-tint: rgba(189, 147, 249, 0.16);
  --on-accent: #282A36;
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* "Tokyo Night" — deep blue-black with a soft blue accent. */
html[data-theme="tokyo-night"] {
  --bg: #1A1B26;
  --card: #20222E;
  --border: #2F334D;
  --text: #C0CAF5;
  --muted: #8488A2;
  --accent: #7AA2F7;
  --accent-strong: #A9C4FF;
  --accent-tint: rgba(122, 162, 247, 0.15);
  --on-accent: #1A1B26;
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* "Gruvbox" — retro warm, dark, with a bright-orange accent. */
html[data-theme="gruvbox"] {
  --bg: #282828;
  --card: #32302F;
  --border: #504945;
  --text: #EBDBB2;
  --muted: #A89984;
  --accent: #FE8019;
  --accent-strong: #FF9E52;
  --accent-tint: rgba(254, 128, 25, 0.14);
  --on-accent: #282828;
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* "Rosé Pine" — muted rose on a soft-black ground. */
html[data-theme="rose-pine"] {
  --bg: #191724;
  --card: #1F1D2E;
  --border: #2A2739;
  --text: #E0DEF4;
  --muted: #908CAA;
  --accent: #C4A7E7;
  --accent-strong: #D9C4F5;
  --accent-tint: rgba(196, 167, 231, 0.15);
  --on-accent: #191724;
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* "Programmer" — a terminal/editor look. Needs the host to define --font-mono;
   remaps every text token to it so headings render in mono too. */
html[data-theme="programmer"] {
  --bg: #0A0E14;
  --card: #10151E;
  --border: #1E2A38;
  --text: #C6D0DA;
  --muted: #718093;
  --accent: #3FB950;
  --accent-strong: #56D364;
  --accent-tint: rgba(63, 185, 80, 0.13);
  --on-accent: #04140A;
  --shadow: 0 6px 28px rgba(0, 0, 0, 0.6);
  --font-ui: var(--font-mono);
  --font-body: var(--font-mono);
  color-scheme: dark;
}

/* ============================================================
 * SiteSearch — the dropdown result list. (The header <input> and its
 * container are the host's; this styles what the library renders inside
 * #site-search-results.)
 * ============================================================ */
.site-search__results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden; z-index: 30;
}
.site-search__results a {
  display: block; padding: 9px 14px; text-decoration: none; color: var(--text); font-size: 14px;
  border-top: 1px solid var(--border);
}
.site-search__results a:first-child { border-top: 0; }
.site-search__results a:hover, .site-search__results a:focus { background: var(--bg); }
.site-search__results a.is-active { background: var(--bg); box-shadow: inset 2px 0 0 var(--accent); }
.site-search__hit { display: block; font-weight: 600; }
.site-search__sub {
  display: block; margin-top: 1px; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-search__results mark {
  background: var(--accent-tint); color: var(--accent-strong);
  border-radius: 3px; padding: 0 1px; font-weight: 700;
}
.site-search__tag {
  display: inline-block; margin-right: 4px; padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--accent); color: var(--on-accent); vertical-align: 1px;
}
.site-search__empty { padding: 12px 14px; color: var(--muted); font-size: 14px; }

/* ============================================================
 * SiteKit — the theme menu (built into #theme-menu) and the consent banner.
 * ============================================================ */
.theme-menu { position: relative; flex-shrink: 0; }
.theme-menu__trigger {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  width: 36px; height: 36px; border-radius: 999px; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
}
.theme-menu__trigger svg { width: 18px; height: 18px; }
.theme-menu__panel {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 194px;
  max-height: min(70vh, 460px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; z-index: 30;
}
.theme-menu__group + .theme-menu__group { margin-top: 4px; }
.theme-menu__group-label {
  margin: 6px 10px 3px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}
.theme-menu__group:first-child .theme-menu__group-label { margin-top: 2px; }
.theme-menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--text); font-family: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.theme-menu__item:hover, .theme-menu__item:focus-visible { background: var(--bg); outline: none; }
.theme-menu__label { flex: 1; white-space: nowrap; }
.theme-menu__swatch {
  width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--border);
  flex-shrink: 0; overflow: hidden; display: flex; align-items: flex-end; justify-content: flex-end;
}
.theme-menu__swatch i { width: 10px; height: 10px; border-top-left-radius: 4px; }
.theme-menu__check { width: 16px; height: 16px; color: var(--accent-strong); opacity: 0; flex-shrink: 0; }
.theme-menu__item[aria-checked="true"] .theme-menu__check { opacity: 1; }

.consent-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--card); border-top: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.consent-banner p { margin: 0; font-size: 14px; color: var(--muted); }
.consent-banner a { color: var(--accent-strong); }
.consent-banner__actions { display: flex; gap: 8px; flex-shrink: 0; }
