/* =============================================================
   Bekipedia – basierend auf BE:KI Grade Design System
   Farben: #1e3d73 (Blau), #3a8c68 (Grün), #f0f4f8 (Hintergrund)
   ============================================================= */

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: #1e293b;
  background: #f0f4f8;
}
a { color: #1e3d73; text-decoration: none; }
a:hover { text-decoration: underline; color: #2a4f8f; }
a:visited { color: #3a5a8c; }
button { font-family: inherit; }
mark { background: #d4edda; padding: 0 2px; border-radius: 2px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f0f4f8; }
::-webkit-scrollbar-thumb { background: #c8d0dc; border-radius: 3px; }

/* ---------- Animationen ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .3s ease forwards; }

/* ---------- Top bar ---------- */
#topbar {
  background: #fff;
  border-bottom: 3px solid #1e3d73;
  box-shadow: 0 2px 10px rgba(30, 61, 115, .12);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1400px;
  padding: 10px 24px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1e3d73 !important;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 104px;
  object-fit: contain;
  display: block;
}
.brand-tag {
  font-size: 11.5px;
  color: #6b7a8d;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------- Suche ---------- */
.search { margin-left: auto; display: flex; gap: 6px; flex: 1; max-width: 520px; }
.search input {
  flex: 1;
  padding: 8px 13px;
  font-size: 14px;
  border: 1.5px solid #dde3ec;
  border-radius: 9px;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.search input:focus { border-color: #3a8c68; }
.search button {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: #1e3d73;
  color: #fff;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.search button:hover { background: #2a4f8f; }

/* ---------- Layout ---------- */
#layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  background: #fff;
  border-left: 1px solid #dde3ec;
  border-right: 1px solid #dde3ec;
  min-height: calc(100vh - 148px);
  box-shadow: 0 2px 12px rgba(30, 61, 115, .06);
}

/* ---------- Sidebar ---------- */
#sidebar {
  border-right: 1px solid #eef1f5;
  background: #f4f7fb;
  padding: 16px 12px;
  font-size: 13px;
}
#sidebar h3 {
  font-size: 11px;
  font-weight: 700;
  color: #6b7a8d;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 16px 0 6px 4px;
  border-bottom: 1px solid #dde3ec;
  padding-bottom: 4px;
}
#sidebar h3:first-child { margin-top: 4px; }
#sidebar ul { list-style: none; padding: 0; margin: 0 0 4px 0; }
#sidebar li { padding: 3px 4px; }
#sidebar a { color: #1e3d73; font-size: 13px; }
#sidebar a:hover { color: #3a8c68; }
#sidebar .sidebar-cats li { display: flex; justify-content: space-between; gap: 6px; }
#sidebar .sidebar-cats .count {
  background: #dce6f5;
  color: #1e3d73;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}
.link-btn {
  background: none;
  border: 0;
  color: #1e3d73;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.link-btn:hover { color: #3a8c68; text-decoration: underline; }
.muted { color: #6b7a8d; font-style: italic; }

/* ---------- Content ---------- */
#content {
  padding: 24px 36px 60px 36px;
  min-width: 0;
}
#content:focus { outline: none; }
h1.firstHeading {
  font-size: 26px;
  font-weight: 700;
  color: #1e3d73;
  border-bottom: 2px solid #dde3ec;
  padding-bottom: 8px;
  margin: 0 0 18px 0;
}
h2.section {
  font-size: 18px;
  font-weight: 600;
  color: #1e3d73;
  border-bottom: 1px solid #eef1f5;
  padding-bottom: 5px;
  margin: 28px 0 14px 0;
}
h3.subsection {
  font-size: 15px;
  font-weight: 700;
  color: #1e3d73;
  margin: 18px 0 8px 0;
}
p { margin: .6em 0; }
ul.bullets { padding-left: 24px; }
ul.bullets li { padding: 2px 0; }
code {
  background: #f4f7fb;
  border: 1px solid #dde3ec;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
}

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px 0; align-items: center; }
.toolbar a, .toolbar button {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1.5px solid #dde3ec;
  border-radius: 8px;
  background: #fff;
  color: #1e3d73;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .13s;
}
.toolbar a:hover, .toolbar button:hover {
  border-color: #1e3d73;
  background: #eef2fa;
  text-decoration: none;
}
.toolbar .danger { color: #c0392b; border-color: #f5c6c6; }
.toolbar .danger:hover { background: #fef2f2; border-color: #c0392b; }

/* ---------- Artikel ---------- */
.infobox {
  float: right;
  width: 280px;
  margin: 0 0 16px 20px;
  background: #f4f7fb;
  border: 1.5px solid #dde3ec;
  border-radius: 12px;
  font-size: 13px;
  overflow: hidden;
}
.infobox .ib-header {
  background: #1e3d73;
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 7px 8px;
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.infobox table { width: 100%; border-collapse: collapse; }
.infobox th, .infobox td {
  text-align: left;
  vertical-align: top;
  padding: 6px 10px;
  border-top: 1px solid #eef1f5;
}
.infobox th { width: 40%; font-weight: 600; color: #6b7a8d; background: #f8fafc; font-size: 12px; }
.infobox td a { color: #1e3d73; }

.tag-list, .keyword-list {
  display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 0; margin: 0; list-style: none;
}
.tag-list li, .keyword-list li {
  background: #dce6f5;
  border: 1px solid #b8cce8;
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 12px;
}
.keyword-list li a, .tag-list li a { color: #1e3d73; }

.article-content { max-width: 760px; }
.article-content pre, .article-content .text-dump {
  background: #f4f7fb;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'Consolas', 'Menlo', monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 13px;
  max-height: 540px;
  overflow: auto;
  line-height: 1.6;
}

/* ---------- Suchergebnisse ---------- */
.results { list-style: none; padding: 0; margin: 0; }
.results li {
  padding: 14px 0;
  border-bottom: 1px solid #eef1f5;
}
.results .title { font-size: 17px; font-weight: 600; color: #1e3d73; }
.results .meta { color: #6b7a8d; font-size: 12.5px; margin: 3px 0 5px 0; }
.results .snippet { color: #1e293b; font-size: 13.5px; line-height: 1.6; }
.results .snippet mark { background: #d4edda; border-radius: 2px; }
.results .keywords { font-size: 12px; color: #6b7a8d; margin-top: 4px; }
.pagination { margin: 20px 0; display: flex; gap: 10px; align-items: center; }
.pagination a {
  padding: 6px 14px;
  border: 1.5px solid #dde3ec;
  border-radius: 8px;
  color: #1e3d73;
  font-weight: 500;
  font-size: 13px;
}
.pagination a:hover { background: #eef2fa; border-color: #1e3d73; text-decoration: none; }

/* ---------- Tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.tile {
  background: #fff;
  border: 1.5px solid #dde3ec;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(30, 61, 115, .06);
  transition: all .15s;
}
.tile:hover { border-color: #1e3d73; box-shadow: 0 4px 16px rgba(30, 61, 115, .12); transform: translateY(-1px); }
.tile .title { font-size: 14.5px; font-weight: 700; color: #1e3d73; }
.tile .meta { color: #6b7a8d; font-size: 12px; margin: 4px 0 6px 0; }
.tile .summary { font-size: 13px; color: #334155; line-height: 1.5; }
.tile .keywords { font-size: 12px; color: #3a8c68; margin-top: 6px; font-weight: 500; }

/* ---------- Upload ---------- */
.dropzone {
  border: 2px dashed #b8cce8;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  background: #f4f7fb;
  color: #6b7a8d;
  cursor: pointer;
  transition: all .15s;
}
.dropzone:hover { border-color: #3a8c68; background: #f0faf5; color: #1e293b; }
.dropzone.drag { border-color: #3a8c68; background: #f0faf5; color: #1e293b; }
.upload-list { margin-top: 14px; list-style: none; padding: 0; }
.upload-list li { padding: 4px 0; font-size: 13px; }
.upload-list li.ok  { color: #3a8c68; font-weight: 500; }
.upload-list li.err { color: #c0392b; }

/* ---------- Formular ---------- */
.edit-form {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 16px;
  max-width: 640px;
  margin: 16px 0;
  background: #f4f7fb;
  border: 1.5px solid #dde3ec;
  border-radius: 12px;
  padding: 18px 20px;
}
.edit-form label { padding-top: 8px; color: #6b7a8d; font-size: 13px; font-weight: 600; }
.edit-form input, .edit-form textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #dde3ec;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: #1e293b;
  outline: none;
  transition: border-color .15s;
}
.edit-form input:focus, .edit-form textarea:focus { border-color: #3a8c68; }
.edit-form button[type=submit] {
  padding: 8px 20px;
  background: #3a8c68;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.edit-form button[type=submit]:hover { background: #2d7055; }
.edit-form button[type=button] {
  padding: 8px 14px;
  background: #f0f4f8;
  color: #1e3d73;
  border: 1.5px solid #dde3ec;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- MOTD ---------- */
.motd-card {
  background: linear-gradient(135deg, #eef6f0 0%, #ddf0e8 100%);
  border-left: 4px solid #3a8c68;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 0 0 24px 0;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: 0 2px 8px rgba(58, 140, 104, .1);
}
.motd-quote {
  font-family: Georgia, serif;
  font-size: 36px;
  line-height: 1;
  color: #3a8c68;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: -2px;
}
.motd-body { flex: 1; min-width: 0; }
.motd-tag {
  font-size: 11px;
  color: #2d7055;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 5px;
  font-weight: 600;
}
.motd-text {
  font-style: italic;
  font-size: 15px;
  color: #1e3d73;
  line-height: 1.5;
  font-weight: 500;
}
.motd-actions { margin-top: 8px; }
.motd-refresh {
  background: none;
  border: 0;
  cursor: pointer;
  color: #3a8c68;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  font-family: inherit;
}
.motd-refresh:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
#footer {
  border-top: 2px solid #dde3ec;
  background: #fff;
  margin-top: 0;
  padding: 12px 0;
  font-size: 12px;
  color: #6b7a8d;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.footer-inner span { color: #9ba8bb; font-weight: 500; }

/* ---------- Schlagwortwolke ---------- */
.cloud { line-height: 2.4; max-width: 900px; }
.cloud a { margin-right: 10px; }
.cloud .w1 { font-size: 12px; color: #9ba8bb; }
.cloud .w2 { font-size: 14px; color: #6b7a8d; }
.cloud .w3 { font-size: 16px; color: #1e3d73; }
.cloud .w4 { font-size: 19px; font-weight: 700; color: #1e3d73; }
.cloud .w5 { font-size: 23px; font-weight: 800; color: #3a8c68; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  #layout { grid-template-columns: 1fr; }
  #sidebar { border-right: 0; border-bottom: 1px solid #eef1f5; }
  .infobox { float: none; width: auto; margin: 0 0 16px 0; }
  .topbar-inner { flex-wrap: wrap; }
  .brand-tag { display: none; }
  #content { padding: 16px 16px 40px 16px; }
  .brand-logo { height: 40px; }
}
