/* ============================================================================
   Equitybase — Gemeinsame Design-Tokens (Single Source of Truth für Farben)
   ----------------------------------------------------------------------------
   Kanonische Palette: "Warmes Creme" (Stand 2026-06-01).
   Diese Datei wird als LETZTES Stylesheet im <head> jeder Live-Seite verlinkt
   und überschreibt damit die seiteneigenen :root-Farbwerte. So sind die Farben
   projektweit identisch, ohne dass in jeder Datei die alten Werte gelöscht
   werden müssen (reversibel: einfach den <link> entfernen).

   Bewusst NICHT hier definiert: --sidebar, --green, --red, --blue u. ä.
   (bleiben seitenspezifisch, z. B. die dunkle Sidebar der Case-Editoren).

   Verlinken mit:
     <link rel="stylesheet" href="/shared/theme.css">
   (absoluter Pfad, funktioniert aus jeder Seitentiefe — Mount liegt auf /)
   ============================================================================ */

:root {
  --bg:     #F7F4EF;   /* Seitenhintergrund — warmes Creme            */
  --card:   #FFFFFF;   /* Karten / Flächen                            */
  --border: #E5E0D8;   /* Rahmen / Trennlinien — warm                 */
  --text:   #1A1A2E;   /* Haupttext                                   */
  --muted:  #8A8580;   /* Sekundärtext / Labels — warmgrau            */
  --accent: #C8692A;   /* Akzent (Terracotta) — projektweit gleich    */
}

/* ----------------------------------------------------------------------------
   Topbar-Suche: nie umbrechen → kein Layout-Shift
   Die Suchleiste hat eine feste Breite; ohne nowrap brach der Text bei knappem
   Platz auf zwei Zeilen und schob die ganze Topbar nach unten. Diese Regeln
   liegen bewusst hier (letztes Stylesheet) und überschreiben die Seitenwerte.
   ---------------------------------------------------------------------------- */
.topbar      { flex-wrap: nowrap; min-height: 52px; }
.top-search  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
               min-width: 0; flex-shrink: 1; }
.top-search svg { flex-shrink: 0; }

/* ----------------------------------------------------------------------------
   Seitentitel projektweit identisch (gleiche Schrift, Größe, Abstände) — damit
   der Wechsel zwischen den einzelnen HTML-Seiten nahtlos wirkt.
   ---------------------------------------------------------------------------- */
.page-title, .view-title, .greeting h2 {
  font-family: var(--font-d, 'DM Serif Display', serif);
  font-size: 24px; font-weight: 400; line-height: 1.2; color: var(--text);
}
.page-sub, .view-sub, .greeting p {
  font-size: 13px; color: var(--muted); margin-top: 4px;
}
/* Einheitlicher oberer Abstand des Inhaltsbereichs (gleiche Titel-Höhe).
   Bewusst nur diese beiden Container — .main wird je Seite unterschiedlich
   genutzt (mal mit, mal ohne eigenes Padding) und daher pro Seite gepflegt. */
#view-feed, .main-inner { padding-top: 24px; }

/* ----------------------------------------------------------------------------
   Spacing-System — feste, projektweit gleiche Abstände.
   Vorher: Karten/Listen mischten 1/8/12/14/18/30px → wirkte beliebig.
   Skala:  Top-Level-Blöcke 24 · Karten-Raster 16 · Listen-Items via Trennlinie.
   ---------------------------------------------------------------------------- */
#view-feed, .main-inner            { gap: 24px; }   /* Abstand großer Blöcke   */
.fav-grid, .case-grid, .newsfeed   { gap: 16px; }   /* Abstand zwischen Karten */
.ticker-group                      { gap: 10px; }   /* Analysen je Ticker      */
/* Newsfeed-Einträge klar getrennt statt 1px-Quetsch */
.nf-items                          { gap: 0; }
.nf-items .nf-item + .nf-item      { border-top: 1px solid var(--border); }

/* ============================================================================
   NEUE TOPBAR (eb-* Namespace) — Stand 2026-06-01
   ----------------------------------------------------------------------------
   Vollbreite Topbar mit Logo, Hover-Nav, Lupe-Suche, Account-Icon.
   Adaptiv: ".eb-top.on-dark" auf dunkle Sektionen (per JS getoggelt).
   Klassen sind bewusst eb-* präfixiert, um nicht mit der alten .topbar/
   .sidebar-Welt zu kollidieren.
   ============================================================================ */
.eb-top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,244,239,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.25s, border-bottom-color 0.25s;
}
.eb-top-inner {
  display: flex; align-items: center;
  height: 46px;
  padding: 0 20px;
  gap: 20px;
  max-width: 1440px; margin: 0 auto;
}
.eb-top .eb-brand,
.eb-top .eb-nav-link,
.eb-top .eb-iconbtn,
.eb-top .eb-search,
.eb-top .eb-search input {
  transition: color 0.25s, background-color 0.25s, border-color 0.25s;
}
.eb-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  color: var(--text);
  white-space: nowrap; flex-shrink: 0;
  text-decoration: none;
  line-height: 1;
}
.eb-brand em { color: var(--accent); font-style: normal; }

/* Hauptnav mittig — Hover öffnet Panel */
.eb-nav { display: flex; gap: 2px; flex: 1; }
.eb-nav-item { position: relative; }
.eb-nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font: 500 13.5px/1 'DM Sans', sans-serif;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
.eb-nav-link:hover { color: var(--accent); }
.eb-nav-link.is-active { color: var(--accent); }

.eb-nav-panel {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 300px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 12px 32px rgba(26,26,46,0.08);
  opacity: 0; visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 60;
}
.eb-nav-item:hover .eb-nav-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.eb-nav-panel h5 {
  font-family: 'DM Serif Display', serif;
  font-size: 17px; font-weight: 400;
  color: var(--text); margin: 0 0 6px;
}
.eb-nav-panel p {
  font: 400 13px/1.55 'DM Sans', sans-serif;
  color: var(--muted); margin: 0;
}
.eb-nav-panel a.eb-cta {
  display: inline-block; margin-top: 12px;
  font: 600 13px/1 'DM Sans', sans-serif;
  color: var(--accent);
  text-decoration: none;
}

/* Rechts: Lupe-Suche + Account */
.eb-top-right { display: flex; align-items: center; gap: 6px; }

.eb-search {
  display: flex; align-items: center;
  width: 32px; height: 32px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  overflow: hidden; padding: 0;
  transition: width 0.25s ease, border-color 0.2s, background 0.2s, padding 0.25s;
}
.eb-search:hover, .eb-search:focus-within {
  width: 240px;
  background: var(--card);
  border-color: var(--border);
  padding: 0 12px;
}
.eb-search .eb-lupe {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--text); cursor: pointer;
}
.eb-search input {
  flex: 1; background: transparent; border: 0; outline: 0;
  font: 400 14px/1 'DM Sans', sans-serif;
  color: var(--text);
  width: 0; opacity: 0;
  transition: opacity 0.2s 0.1s, width 0.25s;
  padding: 0;
}
.eb-search:hover input, .eb-search:focus-within input {
  width: 100%; opacity: 1; padding-left: 8px;
}
.eb-search input::placeholder { color: var(--muted); }

.eb-iconbtn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.eb-iconbtn svg { width: 16px; height: 16px; }
.eb-iconbtn:hover { background: var(--card); border-color: var(--border); }
.eb-account { position: relative; }
.eb-account-menu {
  position: absolute; right: 0; top: 36px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; min-width: 200px;
  box-shadow: 0 12px 32px rgba(26,26,46,0.10);
  opacity: 0; visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 60;
}
.eb-account:hover .eb-account-menu,
.eb-account.is-open .eb-account-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.eb-account-menu a {
  display: block; padding: 9px 12px;
  font: 400 13px/1 'DM Sans', sans-serif;
  color: var(--text); border-radius: 6px;
  text-decoration: none;
}
.eb-account-menu a:hover { background: #EFEAE0; }
.eb-account-menu .eb-accent { color: var(--accent); font-weight: 600; }
.eb-account-menu .eb-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* Adaptiv: on-dark */
.eb-top.on-dark {
  background: rgba(26,26,46,0.88);
  border-bottom-color: rgba(255,255,255,0.08);
}
.eb-top.on-dark .eb-brand { color: #F7F4EF; }
.eb-top.on-dark .eb-nav-link { color: #F7F4EF; }
.eb-top.on-dark .eb-nav-link:hover { color: var(--accent); }
.eb-top.on-dark .eb-search .eb-lupe { color: #F7F4EF; }
.eb-top.on-dark .eb-iconbtn { color: #F7F4EF; }
.eb-top.on-dark .eb-iconbtn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}
.eb-top.on-dark .eb-search:hover,
.eb-top.on-dark .eb-search:focus-within {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}
.eb-top.on-dark .eb-search input { color: #F7F4EF; }
.eb-top.on-dark .eb-search input::placeholder { color: rgba(247,244,239,0.5); }

/* Container, der die alte Sidebar ersetzt: volle Breite */
.eb-page {
  max-width: 1320px; margin: 0 auto;
  padding: 24px 32px 64px;
}

@media (max-width: 900px) {
  .eb-top-inner { padding: 0 16px; gap: 12px; }
  /* Nav rutscht unter die Topbar als horizontale Scroll-Leiste */
  .eb-nav {
    order: 99;
    flex-basis: 100%;
    margin: 0 -16px;
    padding: 0 16px 8px;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--border);
  }
  .eb-nav::-webkit-scrollbar { display: none; }
  .eb-top-inner { flex-wrap: wrap; height: auto; padding: 0 16px; }
  .eb-top-inner > .eb-brand,
  .eb-top-inner > .eb-top-right { padding-top: 12px; padding-bottom: 12px; }
  .eb-nav-link { padding: 10px 12px; font-size: 14px; white-space: nowrap; }
  .eb-nav-panel { display: none !important; }   /* Hover-Panels auf Mobile aus */
  .eb-page { padding: 20px 16px 48px; }
}
