/*
 * assets/style.css
 * -----------------------------------------------------------------------------
 * Zentrales CSS für Frontend und Adminbereich.
 *
 * HIER FINDEST DU SCHNELL:
 * - :root Farben / Abstände / Radien
 * - Frontend-Layout
 * - Navigation links / oben
 * - Inhaltsformatierung
 * - Adminbereich
 */

:root {
  --bg-1: #fff;
  --bg-2: #666;
  --panel: #fff;
  --panel-2: #fff7ea;
  --line: #c3c3c3;
  --text: #2a2218;
  --text-soft: #fff;
  --accent: #7b4d7e;
  --accent-strong: #fff;
  --accent-soft: #666;
  --success-bg: #eaf8ef;
  --success-text: #24653a;
  --error-bg: #fff0f0;
  --error-text: #9d2d2d;
  --shadow: 0 12px 30px rgba(62, 35, 13, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --maxw: 1300px;
  --nav-width: 300px;
}

* { box-sizing: border-box; }
html { font-size: 1em; }
body {
  margin: 0;
  font-family: Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  line-height: 1.5;
  max-width: 100%;
  overflow-x: auto;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 0 auto;}
code, pre {
  font-family: Consolas, Monaco, 'Courier New', monospace;
}

.site-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
}

.cms-content .center {
  text-align: center;
}

.cms-content .rahmen {
  max-width: max-content;
  margin: 16px auto;
  padding: 7px;
  border: 2px solid #2a91cf;
  border-radius: 8px;
  background: transparent;
  font-style:italic;
  text-align: center;
}

blockquote {
  position: relative;
  margin: 1.8rem 0;
  padding: 1.2rem 1.4rem 1.2rem 2.2rem; /* links etwas mehr Platz */
  border-left: 4px solid #111;
  background: linear-gradient(135deg, #f7f7f7, #ffffff);
  color: #222;
  font-size: 1.05rem;
  line-height: 1.7;
  font-style: italic;
  border-radius: 0 12px 12px 0;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.06),
    inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

blockquote::before {
  content: "“";
  position: absolute;
  top: 0.9rem;
  left: 0.8rem;
  font-size: 2rem;
  color: #111;
  font-family: Georgia, serif;
  line-height: 1;
}

blockquote p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Frontend-Layout: Navigation links
   -------------------------------------------------------------------------- */
body.layout-left-sidebar .site-shell {
  display: grid;
  grid-template-columns: var(--nav-width) 1fr;
}

/* --------------------------------------------------------------------------
   Frontend-Layout: Navigation oben
   -------------------------------------------------------------------------- */
body.layout-top-nav .site-shell {
  display: block;
}

.site-nav {
  background: linear-gradient(180deg, #000, #333);
  border-right: 1px solid var(--line);
  padding: 26px 18px;
}

.site-nav img {display: block; margin: 0 auto;}


body.layout-top-nav .site-nav {
  border-right: 0;
  border-bottom: 2px solid var(--line);
}

.site-branding {
  margin-bottom: 22px;
}
.site-title {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
}
.site-subtitle {
  color: var(--text-soft);
  margin-top: 4px;
  font-size: 0.96rem;
  font-weight: 500;
  text-align: center;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.layout-top-nav .nav-list {
  flex-direction: row;
  flex-wrap: wrap;
}

.nav-link {
  display: block;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: #3d3d3d;
  font-weight:600;
  margin-bottom: 0px;
}
.nav-link:hover,
.nav-link.is-active {
  background: var(--accent-soft);
  text-decoration: none;
}

.nav-admin-link {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.site-main {
  padding: 28px;
  font-size: 1.2em;
}

.site-main a {color: #0982c8;}

.content-panel {
  background: var(--panel);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.site-footer {
  padding: 18px 4px 40px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Inhaltsformatierung Frontend
   -------------------------------------------------------------------------- */

.cms-content h1 { font-size: 2rem; border-bottom: 5px solid #ffbb02;}
.cms-content h2 { font-size: 1.55rem; margin-top: 32px; font-weight: 600; border-bottom: 3px solid #c3c3c3;}
.cms-content h3 { font-size: 1.2rem; margin-top: 22px; }
.cms-content p,
.cms-content ul,
.cms-content ol { margin: 0 0 16px; }
.cms-content ul,
.cms-content ol { padding-left: 24px; }
.cms-content img.float-left {
  float: left;
  width: min(42%, 320px);
  margin: 6px 20px 14px 0;
  border-radius: 10px;
}
.cms-content img.float-right {
  float: right;
  width: min(42%, 320px);
  margin: 6px 0 14px 20px;
  border-radius: 10px;
}
.cms-content::after {
  content: '';
  display: block;
  clear: both;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 18px 0;
  background: #000;
  overflow: hidden;
  border-radius: 14px;
}
.video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}


/* --------------------------------------------------------------------------
   Seitensuche
   -------------------------------------------------------------------------- */

.nav-search {
  position: relative;
}

.nav-search-results {
  margin-top: 10px;
  display: grid;
  gap: 2px;
}

.search-hit {
  display: block;
  padding: 2px 12px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.08);
}

.search-hit strong {
  display: block;
  margin-bottom: 4px;
}

.search-hit span {
  display: block;
  font-size: 0.92rem;
  line-height: 1.35;
  opacity: 0.88;
}

.search-empty {
  padding: 10px 12px;
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Adminbereich
   -------------------------------------------------------------------------- */
.admin-body {
  background: linear-gradient(180deg, #f7f0e6, #efe4d2);
}

.admin-main button link:hover {#666;}

.admin-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.admin-sidebar {
  padding: 24px 18px;
  background: linear-gradient(180deg, #fff8ef, #f1e8d9);
  border-right: 1px solid var(--line);
}
.admin-sidebar a {color: #333;}
.admin-sidebar h1 {
  margin-top: 0;
  font-size: 1.5rem;
}
.admin-page-list {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  
}
.admin-page-list li + li { margin-top: 8px; }
.admin-page-list a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.admin-page-list a.is-active,
.admin-page-list a:hover {
  background: var(--accent-soft);
  text-decoration: none;
  color: #191919;
}
.admin-sidebar-actions {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.admin-main {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
}

.editor-form,
.upload-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
}
label > span {
  font-weight: 700;
  font-size: 0.96rem;
}

input[type="text"],
input[type="password"],
input[type="file"],
select,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  border: 1px solid #ccbca2;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fffefb;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.editor-textarea {
  min-height: 350px;
  max-height: 400px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  padding: 11px 16px;
  cursor: pointer;
}
button:hover {
  background: #0e71aa;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.editor-toolbar button {
  padding: 9px 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.flash {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #b7e3c4;
}
.flash-error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: #efc4c4;
}

.muted {
  color: var(--text-soft);
}

.generated-code-box textarea,
.help-box textarea,
.help-box pre {
  width: 100%;
  background: #2b231d;
  color: #f8f1df;
  border-radius: 12px;
  padding: 14px;
  overflow: auto;
}

.admin-login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-login-card {
  width: min(100%, 460px);
  background: var(--panel);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 16px;
}
.admin-login-card h1 {
  margin: 0;
}


.nav-sort-form {
  margin-top: 18px;
}

.nav-sort-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.nav-sort-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  cursor: move;
}

.nav-sort-item.dragging {
  opacity: 0.45;
}

.nav-sort-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 10px 8px;
  border-right: 1px solid rgba(255,255,255,.08);
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.8;
  user-select: none;
}

.nav-sort-link {
  display: block;
  flex: 1;
  padding: 1px 12px;
  text-decoration: none;
  color: #191919;
}

.nav-sort-link.is-active {
  outline: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  color: #191919;
}

.nav-sort-label {
  display: block;
  font-weight: 700;
}

.nav-sort-slug {
  display: block;
  margin-top: 4px;
  opacity: 0.7;
  font-size: 0.88rem;
}

.nav-sort-item {
  margin-left: calc(var(--depth, 0) * 18px);
}

.nav-sort-item[data-depth="0"] {
  margin-left: 0;
}

.nav-sort-item[data-depth="1"] {
  margin-left: 18px;
}

.nav-sort-item[data-depth="2"] {
  margin-left: 36px;
}

.nav-sort-item[data-depth="3"] {
  margin-left: 54px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  body.layout-left-sidebar .site-shell,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .site-nav,
  .admin-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .site-main,
  .admin-main,
  .site-nav,
  .admin-sidebar,
  .content-panel {
    padding: 18px;
  }

  .cms-content img.float-left,
  .cms-content img.float-right {
     display: block;
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
    height: auto;
    border-radius: 12px;
    margin: 10px 0 16px;
  }
}


/* -------------------------------------------------------------------------- */
/* Zusätze für Seitenanlage im Admin                                           */
/* -------------------------------------------------------------------------- */
.create-page-form {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
}

.create-page-form .small {
  font-size: .9rem;
  line-height: 1.4;
}


/* --------------------------------------------------------------------------
   Themen-Navigation mit Suche und Unterebenen
   -------------------------------------------------------------------------- */
.nav-search-wrap {
  margin: 0 0 18px;
}
.nav-search-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}
.nav-search-input {
  width: 100%;
  border: 1px solid #ccbca2;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fffefb;
}
.nav-tree {
  gap: 0px;
}

.nav-tree ul {
  display: none;
  list-style: none;
  margin: 6px 0 0 14px;
  padding: 0 0 0 10px;
  border-left: 1px solid rgba(123, 77, 126, 0.18);
}

.nav-tree li {
  margin-bottom: 6px;
}

.nav-tree li.is-open > ul {
  display: block;
}

.nav-tree .nav-link.has-children::after {
  content: '›';
  float: right;
  opacity: 0.5;
}
.admin-page-list small {
  display: block;
  color: black;
  margin-top: 2px;
}
.help-pre {
  white-space: pre-wrap;
  margin: 0;
}

@media (max-width: 900px) {
  body.layout-left-sidebar .site-shell,
  .admin-shell,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .site-nav,
  .admin-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

/* --------------------------------------------------------------------------
   Mobile Burger-Navigation nur für Frontend links
   -------------------------------------------------------------------------- */
.nav-toggle {
  display: none;
}

.nav-overlay {
  display: none;
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  body.layout-left-sidebar .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1400;

    padding: 13px 18px;
    min-height: 48px;

    border: 2px solid #ffbb02;
    border-radius: 999px;

    background: linear-gradient(135deg, #111, #333);
    color: #fff;

    font: inherit;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1;

    cursor: pointer;
    box-shadow:
      0 10px 26px rgba(0, 0, 0, 0.35),
      0 0 0 4px rgba(255, 187, 2, 0.18);

    animation: navTogglePulse 2.4s ease-in-out infinite;
  }

  body.layout-left-sidebar .nav-toggle:hover {
    background: linear-gradient(135deg, #222, #000);
    text-decoration: none;
    transform: translateY(-1px);
  }

  body.layout-left-sidebar .nav-toggle:active {
    transform: translateY(1px);
  }

  body.layout-left-sidebar .nav-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 26px;
    height: 26px;

    border-radius: 50%;
    background: #ffbb02;
    color: #111;

    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1;
  }

  body.layout-left-sidebar .nav-toggle-text {
    letter-spacing: 0.02em;
  }

  body.layout-left-sidebar .site-shell {
    grid-template-columns: 1fr !important;
  }

  body.layout-left-sidebar .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: min(84vw, 320px);
    height: 100dvh;
    z-index: 1500;
    overflow-y: auto;

    transform: translateX(-100%);
    transition: transform 0.25s ease;

    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 22px 16px 28px;

    box-shadow: 14px 0 34px rgba(0, 0, 0, 0.28);
  }

  body.layout-left-sidebar .site-nav.is-open {
    transform: translateX(0);
  }

  body.layout-left-sidebar .nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 1450;
    background: rgba(0, 0, 0, 0.42);
  }

  body.layout-left-sidebar .nav-overlay.is-open {
    display: block;
  }

  body.layout-left-sidebar .site-main {
    width: 100%;
    margin-left: 0;
    padding-top: 82px;
  }

  body.layout-left-sidebar .site-nav img {
    max-width: 250px;
    height: auto;
  }
}

@keyframes navTogglePulse {
  0%, 100% {
    box-shadow:
      0 10px 26px rgba(0, 0, 0, 0.35),
      0 0 0 4px rgba(255, 187, 2, 0.18);
  }

  50% {
    box-shadow:
      0 12px 30px rgba(0, 0, 0, 0.42),
      0 0 0 8px rgba(255, 187, 2, 0.30);
  }
}



#solarImage {
  display: block;
  width: min(100%, 700px);
  height: auto;
  margin: 16px auto;
}


.ad-box {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  margin: 18px auto;
}

.ad-box .adsbygoogle,
.cms-content .adsbygoogle {
  display: block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

@media (max-width: 700px) {
  .ad-box {
    width: 100%;
    max-width: calc(100vw - 36px);
  }

  .ad-box iframe {
    max-width: 100% !important;
  }
}

.button-link {
  display: inline-block;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  padding: 11px 16px;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-strong);
  color: #fff;
  text-decoration: none;
}

pre {
  margin: 1.6rem 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  background: #111;
  color: #f2f2f2;
  border: 1px solid #2b2b2b;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  font-size: 0.95rem;
  line-height: 1.65;
}

pre code {
  display: block;
  font-family: Consolas, Monaco, "Courier New", monospace;
  white-space: pre;
  tab-size: 2;
}

/* Falls dein CMS/Highlighter Klassen ausgibt */
.token.comment,
.token.prolog,
.token.doctype {
  color: #8a8a8a;
}

.token.keyword {
  color: #ffffff;
  font-weight: 700;
}

.token.string {
  color: #d6d6d6;
}

.token.number,
.token.boolean {
  color: #bcbcbc;
}

.token.function {
  color: #eeeeee;
}

.token.operator,
.token.punctuation {
  color: #a8a8a8;
}

.token.selector,
.token.property {
  color: #f5f5f5;
}

@media (max-width: 600px) {
  pre {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
  }
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  
  background: #ffffff;
  color: #222;

  border: 1px solid #d8d8d8;
  border-radius: 12px;
  overflow: hidden;

  box-shadow:
    0 6px 20px rgba(0,0,0,0.05),
    inset 0 0 0 1px rgba(255,255,255,0.4);

  font-size: 0.96rem;
  line-height: 1.5;
}

thead {
  background: linear-gradient(to bottom, #f5f5f5, #ebebeb);
}

thead th {
  padding: 0.9rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #111;

  border-bottom: 1px solid #d0d0d0;
}

tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #ececec;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: #fafafa;
}

tbody tr:hover {
  background: #f1f1f1;
  transition: background 0.18s ease;
}

caption {
  caption-side: top;
  padding-bottom: 0.7rem;

  color: #555;
  font-size: 0.92rem;
  text-align: left;
}

@media (max-width: 700px) {
  table {
    font-size: 0.7rem;
  }

  thead th,
  tbody td {
    padding: 0.5rem 0.6rem;
  }
}

