/*
 * DeepVibe — palette overrides on top of Quark 2
 * ----------------------------------------------
 * Loaded after theme.css (asset priority 80), so token overrides win without
 * ever needing !important. Quark 2 draws everything from the --q2-* tokens,
 * which makes a full re-theme a matter of redefining a handful of values here.
 *
 * Light: warm paper tones. The content surface (cards) is intentionally
 *        DARKER than the page canvas — reading on it feels like paper rather
 *        than a light box, and the old glare-white is gone.
 * Dark:  soft graphite with a faint cool cast (instead of the near-black
 *        #08090b), gentler surface elevation, deeper gold for filled accents.
 */

/* ---------- Light: warm grays, recessed content ---------- */

:root,
:root[data-theme="light"] {
  --q2-bg: #eeeeee;
  --q2-bg-elev: #d6d6d6;
  --q2-bg-muted: #c7c7c7;

  --q2-text: #2b2721;
  --q2-text-strong: #191612;
  --q2-text-muted: #67615a;

  --q2-border-ring: rgba(74, 63, 46, 0.15);
  --q2-border-strong: rgba(74, 63, 46, 0.24);
  --q2-divider: rgba(74, 63, 46, 0.14);

  /* Slightly deepened gold so links clear WCAG AA on both surfaces
     (#967244 alone lands at 4.0–4.2:1 on the warm background). */
  --q2-link: #7d5f36;
  --q2-accent: #8a683c;

  --q2-nav-bg: rgba(246, 243, 238, 0.82);
  --q2-nav-border: rgba(74, 63, 46, 0.12);

  --q2-shadow-card:
    rgba(60, 48, 30, 0.10) 0 1px 5px -4px, rgba(74, 63, 46, 0.10) 0 0 0 1px,
    rgba(74, 63, 46, 0.07) 0 4px 10px 0;
  --q2-shadow-raised:
    rgba(60, 48, 30, 0.12) 0 1px 5px -4px, rgba(74, 63, 46, 0.12) 0 0 0 1px,
    rgba(74, 63, 46, 0.10) 0 12px 28px -8px;
  --q2-shadow-dropdown:
    rgba(60, 48, 30, 0.12) 0 1px 5px -4px, rgba(74, 63, 46, 0.12) 0 0 0 1px,
    rgba(74, 63, 46, 0.14) 0 16px 32px -12px;

  --pico-form-element-border-color: rgba(74, 63, 46, 0.24);
}

/* The main content card is darker than the canvas — a soft drop shadow is
   all it needs; the hard ring+shadow set from theme.css reads too heavy. */
#body-wrapper > .container > .content-item {
  box-shadow:
    rgba(74, 63, 46, 0.06) 0 1px 2px,
    rgba(74, 63, 46, 0.05) 0 10px 26px -12px;
}

/* ---------- Dark: soft graphite, faint cool cast ---------- */

:root[data-theme="dark"] {
  --q2-bg: #353535;
  --q2-bg-elev: #212121;
  --q2-bg-muted: #515151;

  --q2-text: #f0f1f3;
  --q2-text-strong: #ffffff;
  --q2-text-muted: #a1a5ad;

  --q2-border-ring: rgba(255, 255, 255, 0.10);
  --q2-border-strong: rgba(255, 255, 255, 0.16);
  --q2-divider: rgba(255, 255, 255, 0.09);

  --q2-nav-bg: rgba(21, 17, 14, 0.78);
  --q2-nav-border: rgba(255, 255, 255, 0.06);

  /* Quark 2 lightens the accent 20% toward white in dark mode, which leaves
     white button text at ~2.9:1. Filled accents get the deeper gold instead;
     the lightened mix stays available for links via --q2-link. */
  --q2-accent: #8a683c;
  --q2-accent-contrast: #ffffff;

  --q2-shadow-card:
    rgba(0, 0, 0, 0.60) 0 1px 5px -4px, rgba(255, 255, 255, 0.10) 0 0 0 1px,
    rgba(0, 0, 0, 0.45) 0 4px 12px 0;
  --q2-shadow-raised:
    rgba(0, 0, 0, 0.60) 0 1px 5px -4px, rgba(255, 255, 255, 0.10) 0 0 0 1px,
    rgba(0, 0, 0, 0.55) 0 14px 32px -8px;
  --q2-shadow-dropdown:
    rgba(0, 0, 0, 0.60) 0 1px 5px -4px, rgba(255, 255, 255, 0.10) 0 0 0 1px,
    rgba(0, 0, 0, 0.65) 0 16px 32px -12px;
}

:root[data-theme="dark"] #body-wrapper > .container > .content-item {
  box-shadow:
    rgba(0, 0, 0, 0.30) 0 1px 2px,
    rgba(0, 0, 0, 0.35) 0 10px 30px -10px,
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--q2-text-strong);
  text-decoration: none;
  font-family: var(--pico-font-family-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0;
}
.navbar-brand:hover {
  color: var(--q2-text-strong);
  text-decoration: none;
}
.navbar-brand img,
.navbar-brand svg {
  height: 48px;
  width: auto;
  display: block;
}
.navbar-brand svg,
.navbar-brand svg * {
  fill: var(--q2-text-strong);
}

/* ---------- Pages with sidebar (template: default-sidebar) ---------- */

/* The sidebar layout nests the content one level deeper (.columns > #item),
 * where the theme's .content-item card rules don't reach. Re-apply the card
 * look for that context so the content keeps the same surface as everywhere
 * else on the site. */
#body-wrapper > .container > .columns > #item > .content-item {
  background: var(--q2-bg-elev);
  border-radius: var(--q2-radius-lg);
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3.25rem);
  box-shadow:
    rgba(74, 63, 46, 0.06) 0 1px 2px,
    rgba(74, 63, 46, 0.05) 0 10px 26px -12px;
}
#body-wrapper > .container > .columns > #item > .content-item > :first-child {
  margin-top: 0;
}
#body-wrapper > .container > .columns > #item > .content-item > :last-child {
  margin-bottom: 0;
}
:root[data-theme="dark"] #body-wrapper > .container > .columns > #item > .content-item {
  box-shadow:
    rgba(0, 0, 0, 0.30) 0 1px 2px,
    rgba(0, 0, 0, 0.35) 0 10px 30px -10px,
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ---------- Footer ---------- */

.footer-support .coffee {
  display: inline-block;
  transition: transform 0.18s ease;
}
.footer-support .coffee:hover {
  transform: scale(1.25);
}

/* ---------- Language switcher ---------- */

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.language-switcher a {
  color: var(--q2-text-muted);
  text-decoration: none;
}
.language-switcher a:hover,
.language-switcher a.current {
  color: var(--q2-text-strong);
}
.language-switcher .language-sep {
  color: var(--q2-text-muted);
  opacity: 0.45;
}
.language-switcher-content {
  max-width: 960px;
  margin: 0 auto 0.75rem;
  text-align: right;
}
.language-switcher-item {
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
}

/* ---------- Sidebar Layout ---------- */

.container { max-width: 1200px; padding-inline: clamp(1rem, 4vw, 2rem); }

/* Content allein (ohne Sidebar) */
#body-wrapper > .container > .content-item { max-width: 960px; }

/* Aufteilung mit Sidebar — ab 960px Viewport, darunter gestapelt */
.columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 4vw, 3rem); }
@media (min-width: 960px) {
  .columns.has-sidebar { grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr); }
}

@media (min-width: 960px) {
  .columns.has-sidebar {
    grid-template-columns: minmax(0, 1fr) fit-content(280px);
  }
}