/* Design "Petrol & Koralle": DOTNET-Lexikon.de in Petrol, Entwickler-Lexikon.de in Koralle.
   Farbmodi: "Lexikon Light" und "Developer Dark". Ohne Wahl des Besuchers gilt die Systemeinstellung des Browsers.
   Brand: html[data-brand], Modus: html[data-theme] (Cookie dnl-theme). */

:root {
 --accent: #0A7A7A;
 --on-accent: #FFFFFF;
 --bg: #F3F3F6;
 --panel: #FFFFFF;
 --side: #EAEAF0;
 --text: #22222B;
 --muted: #5E5E6E;
 --line: #D5D5DE;
 --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
 color-scheme: light;
}

:root[data-brand="ent"] {
 --accent: #C2410C;
}

/* Developer Dark: ausdrücklich gewählt */
:root[data-theme="dark"] {
 --accent: #4FD1C5;
 --on-accent: #14141A;
 --bg: #14141A;
 --panel: #1B1B23;
 --side: #101015;
 --text: #E4E4EC;
 --muted: #A2A2B5;
 --line: #2E2E3B;
 color-scheme: dark;
}

:root[data-theme="dark"][data-brand="ent"] {
 --accent: #FF9166;
}

/* Developer Dark: Systemeinstellung des Browsers, solange der Besucher nichts gewählt hat */
@media (prefers-color-scheme: dark) {
 :root:not([data-theme="light"]) {
  --accent: #4FD1C5;
  --on-accent: #14141A;
  --bg: #14141A;
  --panel: #1B1B23;
  --side: #101015;
  --text: #E4E4EC;
  --muted: #A2A2B5;
  --line: #2E2E3B;
  color-scheme: dark;
 }

 :root:not([data-theme="light"])[data-brand="ent"] {
  --accent: #FF9166;
 }
}

/*---------------------------------------------- Grundlagen */

*, *::before, *::after {
 box-sizing: border-box;
}

html {
 -webkit-text-size-adjust: 100%;
}

body {
 margin: 0;
 background: var(--bg);
 color: var(--text);
 font-family: var(--font);
 font-size: 16px;
 line-height: 1.6;
}

a {
 color: var(--accent);
}

a:hover {
 text-decoration: underline;
}

a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
 outline: 3px solid var(--accent);
 outline-offset: 2px;
}

img {
 max-width: 100%;
 height: auto;
}

.skip-link {
 position: absolute;
 left: -9999px;
 top: 0;
 background: var(--accent);
 color: var(--on-accent);
 padding: 10px 16px;
 z-index: 100;
}

.skip-link:focus {
 left: 0;
}

/*---------------------------------------------- Kopfleiste */

.topbar {
 background: var(--side);
 border-bottom: 1px solid var(--line);
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 gap: 8px 20px;
 padding: 6px 16px;
}

.brand {
 font-weight: 700;
 font-size: 17px;
 text-decoration: none;
 color: var(--accent);
 padding: 8px 4px;
}

.brand:hover {
 text-decoration: none;
}

.nav {
 margin: 0;
 padding: 0;
 list-style: none;
 display: flex;
 flex-wrap: wrap;
 gap: 2px;
}

.nav a {
 display: inline-flex;
 align-items: center;
 min-height: 44px;
 padding: 0 12px;
 border-radius: 6px;
 font-size: 15px;
 text-decoration: none;
 color: var(--text);
}

.nav a:hover {
 background: var(--panel);
}

.nav .active a {
 background: var(--panel);
 color: var(--accent);
 font-weight: 700;
}

.search {
 flex: 1 1 220px;
 max-width: 420px;
 margin-left: auto;
 display: flex;
 align-items: center;
 gap: 8px;
 background: var(--panel);
 border: 1px solid var(--line);
 border-radius: 6px;
 padding: 0 8px 0 12px;
}

.search-icon {
 display: inline-flex;
 flex: none;
 color: var(--accent);
}

.search input {
 flex: 1;
 min-width: 0;
 height: 42px;
 border: 0;
 background: transparent;
 color: var(--text);
 font: inherit;
 font-size: 15px;
}

.search input:focus-visible {
 outline-offset: 0;
}

.search button, .theme-switch button {
 cursor: pointer;
 font: inherit;
 font-size: 13px;
 font-weight: 600;
 color: var(--text);
}

.search button {
 height: 32px;
 padding: 0 12px;
 background: var(--side);
 border: 1px solid var(--line);
 border-radius: 4px;
}

.theme-switch {
 display: flex;
 border: 1px solid var(--line);
 border-radius: 6px;
 overflow: hidden;
}

.theme-switch button {
 min-height: 44px;
 padding: 0 14px;
 background: transparent;
 border: 0;
}

.theme-switch button.on {
 background: var(--accent);
 color: var(--on-accent);
}

/*---------------------------------------------- Rahmen: Themenbaum | Inhalt | Anzeigen */

.shell {
 display: grid;
 grid-template-columns: minmax(0, 1fr);
 align-items: start;
}

.tree {
 order: 2;
 background: var(--side);
 border-top: 1px solid var(--line);
 padding: 16px 0;
 font-size: 15px;
}

.main-col {
 order: 1;
 min-width: 0;
 background: var(--panel);
}

.ads {
 order: 3;
 background: var(--side);
 border-top: 1px solid var(--line);
 padding: 16px;
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
 gap: 18px;
 align-items: start;
}

/* Große Bildschirme: Themenbaum immer links, Anzeigen rechts */
@media (min-width: 1100px) {
 .shell {
  grid-template-columns: 280px minmax(0, 1fr) 270px;
  min-height: calc(100vh - 140px);
 }

 .tree {
  order: 1;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  border-top: 0;
  border-right: 1px solid var(--line);
 }

 .ads {
  order: 3;
  display: flex;
  flex-direction: column;
  border-top: 0;
  border-left: 1px solid var(--line);
  align-self: stretch;
 }
}

/*---------------------------------------------- Themenbaum */

.side-title, .ad-label {
 padding: 0 16px 10px;
 font-size: 12px;
 letter-spacing: 0.1em;
 text-transform: uppercase;
 color: var(--muted);
}

.tree ul {
 margin: 0;
 padding: 0;
 list-style: none;
}

.tree summary {
 display: flex;
 align-items: center;
 min-height: 40px;
 padding: 0 12px 0 4px;
 cursor: pointer;
 font-weight: 500;
 list-style: none;
}

.tree summary a {
 flex: 1;
 display: flex;
 align-items: center;
 align-self: stretch;
 color: inherit;
 text-decoration: none;
}

.tree summary::-webkit-details-marker {
 display: none;
}

.tree-arrow {
 display: flex;
 align-items: center;
 justify-content: center;
 align-self: stretch;
 flex: none;
 width: 30px;
 color: var(--muted);
}

.tree-arrow::before {
 content: "▸";
}

.tree-arrow:hover {
 color: var(--accent);
}

.tree details[open] > summary .tree-arrow::before {
 content: "▾";
}

.tree summary:hover, .tree li li a:hover {
 background: var(--panel);
}

.tree summary.here {
 color: var(--accent);
 font-weight: 700;
 background: var(--panel);
}

.tree li li a {
 display: flex;
 align-items: center;
 min-height: 36px;
 margin-left: 20px;
 padding: 0 12px 0 14px;
 border-left: 2px solid var(--line);
 color: var(--text);
 text-decoration: none;
}

.tree li li a.here {
 color: var(--accent);
 font-weight: 700;
 border-left-color: var(--accent);
}

/*---------------------------------------------- Standort-Tabs */

.tabs {
 background: var(--side);
 border-bottom: 1px solid var(--line);
 display: flex;
 flex-wrap: wrap;
 align-items: flex-end;
 font-size: 15px;
}

.tab {
 display: inline-flex;
 align-items: center;
 min-height: 46px;
 border-right: 1px solid var(--line);
 border-top: 3px solid transparent;
 color: var(--muted);
}

.tab a {
 display: inline-flex;
 align-items: center;
 min-height: 43px;
 padding: 0 8px 0 20px;
 color: var(--muted);
 text-decoration: none;
}

.tab:last-of-type a, .tab:first-of-type a {
 padding-right: 20px;
}

.tab a:hover {
 color: var(--text);
}

.tab[aria-current="page"] {
 background: var(--panel);
 border-top-color: var(--accent);
 margin-bottom: -1px;
}

.tab[aria-current="page"] a {
 color: var(--text);
 font-weight: 600;
}

.tab-close {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 28px;
 height: 28px;
 margin-right: 8px;
 padding: 0;
 border: 0;
 border-radius: 4px;
 background: transparent;
 color: var(--accent);
 font: inherit;
 font-size: 20px;
 line-height: 1;
 cursor: pointer;
}

.tab-close:hover {
 background: var(--line);
 color: var(--text);
}

.tabs-close-all {
 margin: 0 8px 0 auto;
 align-self: center;
 min-height: 32px;
 padding: 0 12px;
 border: 1px solid var(--line);
 border-radius: 4px;
 background: var(--panel);
 color: var(--text);
 font: inherit;
 font-size: 13px;
 font-weight: 600;
 cursor: pointer;
}

/*---------------------------------------------- Inhalt (auch die HTML-Texte aus der Datenbank) */

.content {
 padding: 28px 28px 40px;
}

.content h2, .content h3 {
 line-height: 1.15;
 letter-spacing: -0.02em;
}

.content h2 {
 margin: 0 0 18px;
 font-size: 44px;
 font-weight: 700;
 letter-spacing: -0.03em;
}

.content h3 {
 margin: 24px 0 12px;
 font-size: 24px;
 font-weight: 600;
}

.content h6 {
 margin: 0 0 14px;
 font-size: 14px;
 font-weight: 400;
 color: var(--muted);
}

.content p {
 margin: 0 0 8px;
 font-size: 17px;
 line-height: 1.7;
}

.content ul, .content ol {
 margin: 0 0 12px;
 padding-left: 22px;
 line-height: 1.6;
}

.content li {
 margin: 0 0 4px;
}

/* Die Texte aus der Datenbank enthalten Absätze in Listenpunkten sowie Leerzeilen (br) hinter Listen. Zwischen normalen Absätzen bleiben sie erhalten. */
.content li > p, .content li > ul, .content li > ol {
 margin: 0;
}

.content ul + br, .content ol + br, .content ul + br + br, .content ol + br + br {
 display: none;
}

.content img {
 border-radius: 6px;
}

.content img[align="right"] {
 float: right;
 margin: 4px 0 14px 24px;
 border: 1px solid var(--line);
 background: var(--side);
}

.content table {
 border-collapse: collapse;
}

.content td, .content th {
 padding: 6px 10px;
 text-align: left;
 font-size: 15px;
 border-bottom: 1px solid var(--line);
}

.content pre, .content code {
 font-family: var(--font);
 background: var(--side);
 border: 1px solid var(--line);
 border-radius: 6px;
}

.content code {
 padding: 1px 5px;
}

.content pre {
 padding: 12px 16px;
 overflow-x: auto;
 line-height: 1.7;
}

.content pre code {
 padding: 0;
 border: 0;
}

.content hr {
 border: 0;
 border-top: 1px solid var(--line);
}

/* Kästen im Inhalt (Fachbücher, Buy me a coffee) */
.dnlbox {
 display: inline-flex;
 flex-wrap: wrap;
 align-items: center;
 gap: 6px 12px;
 margin: 10px 0;
 padding: 10px 18px;
 min-height: 44px;
 border: 1px solid var(--line);
 border-radius: 6px;
 background: var(--side);
 font-weight: 600;
 font-size: 15px;
}

.dnlbox a {
 text-decoration: none;
}

.subtopics {
 clear: both;
 margin-top: 28px;
}

.subtopics h2 {
 margin: 0 0 12px;
 font-size: 26px;
 font-weight: 600;
 letter-spacing: -0.02em;
}

.subtopics ul {
 display: flex;
 flex-wrap: wrap;
 gap: 8px;
 margin: 0;
 padding: 0;
 list-style: none;
}

.subtopics a {
 display: inline-flex;
 align-items: center;
 min-height: 40px;
 padding: 0 14px;
 border: 1px solid var(--line);
 border-radius: 6px;
 background: var(--side);
 font-size: 15px;
 text-decoration: none;
}

.subtopics a:hover {
 border-color: var(--accent);
}

/*---------------------------------------------- Anzeigen */

.ad-group {
 display: flex;
 flex-direction: column;
 gap: 12px;
 width: 100%;
 min-width: 0;
}

.ad-label {
 padding: 0;
}

.ad-label a {
 color: var(--muted);
 text-decoration: none;
}

.ad-card {
 width: 100%;
 display: flex;
 flex-direction: column;
 gap: 8px;
 padding: 12px;
 border: 1px solid var(--line);
 border-radius: 6px;
 background: var(--panel);
 font-size: 14px;
 line-height: 1.5;
}

.ad-card > a:first-child {
 display: flex;
 align-items: center;
 gap: 8px;
 font-weight: 600;
 font-size: 15px;
}

.ad-card > a:first-child svg {
 flex: none;
}

.ad-card p {
 margin: 0;
 color: var(--muted);
}

.ad-card .book-title, .ad-card .book-cover {
 display: block;
}

.ad-card .book-cover img {
 display: block;
 border: 1px solid var(--line);
 border-radius: 4px;
 background: var(--side);
}

/*---------------------------------------------- Fußzeile */

.footer {
 background: var(--accent);
 color: var(--on-accent);
 font-size: 14px;
 padding: 12px 16px;
 display: flex;
 flex-wrap: wrap;
 gap: 6px 24px;
 justify-content: space-between;
}

.footer a {
 color: var(--on-accent);
}

/*---------------------------------------------- Kleine Bildschirme */

@media (max-width: 640px) {
 .content {
  padding: 20px 16px 32px;
 }

 .content h2 {
  font-size: 34px;
 }

 .search {
  max-width: none;
  margin-left: 0;
 }
}

@media (prefers-reduced-motion: reduce) {
 * {
  scroll-behavior: auto !important;
  transition: none !important;
 }
}

/* Aktualisierungsdatum am Ende eines Eintrags */
.content .updated {
 margin: 0 0 20px;
 font-size: 14px;
 color: var(--muted);
}

/* Überschrift mit Fachbücher-Link rechts daneben */
.title-row {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 justify-content: space-between;
 gap: 12px 24px;
 margin: 0 0 18px;
}

.title-row h2 {
 margin: 0;
}

.book-link {
 display: inline-flex;
 align-items: center;
 gap: 10px;
 min-height: 44px;
 padding: 0 18px;
 border: 1px solid var(--line);
 border-radius: 6px;
 background: var(--side);
 color: var(--text);
 font-size: 15px;
 font-weight: 600;
 text-decoration: none;
}

.book-link svg, .book-link .arrow {
 color: var(--accent);
 flex: none;
}

.book-link:hover {
 border-color: var(--accent);
 text-decoration: none;
}

/* Pfeil vor Verweisen ("siehe auch ...") */
.icon-arrow {
 color: var(--accent);
 vertical-align: -3px;
}

/*---------------------------------------------- Cookie-Hinweis */

.cookie-notice {
 position: fixed;
 left: 0;
 right: 0;
 bottom: 0;
 z-index: 50;
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 gap: 12px 20px;
 padding: 14px 20px;
 background: var(--panel);
 color: var(--text);
 border-top: 3px solid var(--accent);
 box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
 font-size: 15px;
}

.cookie-notice .cookie-icon {
 flex: none;
 color: var(--accent);
}

.cookie-notice p {
 flex: 1 1 360px;
 margin: 0;
 line-height: 1.5;
}

.cookie-notice form {
 margin: 0;
}

.cookie-notice button {
 display: inline-flex;
 align-items: center;
 gap: 8px;
 min-height: 44px;
 padding: 0 20px;
 border: 0;
 border-radius: 6px;
 background: var(--accent);
 color: var(--on-accent);
 font: inherit;
 font-weight: 600;
 cursor: pointer;
}

/*---------------------------------------------- Tooltips (ersetzen die Browser-Tooltips, Hintergrund in der Akzentfarbe) */

.tooltip {
 position: fixed;
 z-index: 100;
 max-width: 340px;
 padding: 8px 12px;
 border-radius: 6px;
 background: var(--accent);
 color: var(--on-accent);
 font-size: 14px;
 font-weight: 500;
 line-height: 1.4;
 box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
 pointer-events: none;
}

.tooltip[hidden] {
 display: none;
}

/*---------------------------------------------- Buchtipps */

.hint {
 font-size: 14px;
 color: var(--muted);
}

/* Mehrspaltiges Gitter: so viele Spalten, wie bei der Breite des Browsers mit mindestens 340 px je Karte hineinpassen */
.book-list {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
 gap: 16px;
 margin: 20px 0 0;
 padding: 0;
 list-style: none;
}

.book-card {
 display: flex;
 gap: 16px;
 min-width: 0;
 padding: 16px;
 border: 1px solid var(--line);
 border-radius: 8px;
 background: var(--side);
}

.book-card-cover {
 flex: none;
 width: 100px;
}

.book-card-cover img {
 display: block;
 width: 100px;
 height: auto;
 border: 1px solid var(--line);
 border-radius: 4px;
 background: var(--side);
}

.book-card-body {
 display: flex;
 flex-direction: column;
 align-items: flex-start;
 gap: 6px;
 min-width: 0;
}

.book-card-title {
 overflow-wrap: anywhere;
 font-size: 17px;
 font-weight: 600;
 line-height: 1.3;
}

.book-card-meta {
 font-size: 14px;
 color: var(--muted);
}

.book-card .book-link {
 margin-top: 6px;
 padding: 8px 14px;
 line-height: 1.3;
}
