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

body {
  /* Dynamic Wavy Background replaces this gradient, base color is set in .bg-lines */
  color: #1a1a1a;
  
  /* Bold font choice per anforderung.md */
  font-family: 'Besley', 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.75;
  margin: 0;
  padding: 0;

  /* Custom SVG crosshair cursor */
  cursor: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 12H22M12 2V22' stroke='%23aa0000' stroke-width='1.5' stroke-linecap='square'/%3E%3C/svg%3E") 12 12, auto;
}

/* Base background layer behind the wavy lines */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background-color: #f7f7f3;
}

/* The extremely thin waving lines - Performance Optimized Layered SVG Parallax */
.bg-lines {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: 
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M0,10 Q25,0 50,10 T100,10' fill='none' stroke='%23a0a0a0' stroke-width='0.4' opacity='0.35'/%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M0,10 Q25,20 50,10 T100,10' fill='none' stroke='%23808080' stroke-width='0.35' opacity='0.25'/%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M0,10 Q25,0 50,10 T100,10' fill='none' stroke='%23b0b0b0' stroke-width='0.5' opacity='0.4'/%3E%3C/svg%3E");
  background-size: 150px 17px, 210px 23px, 90px 11px;
  animation: waveDrift 45s linear infinite;
}

@keyframes waveDrift {
  0%   { background-position: 0px 0px, 0px 0px, 0px 0px; }
  100% { background-position: 3150px 0px, -3150px 0px, 3150px 0px; }
}

a { 
  color: #1a1a8c; 
  text-decoration: underline; 
  /* Pointer cursor custom SVG */
  cursor: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 12H22M12 2V22' stroke='%231a1a8c' stroke-width='2.5' stroke-linecap='square'/%3E%3Crect x='9' y='9' width='6' height='6' fill='%231a1a8c'/%3E%3C/svg%3E") 12 12, pointer;
}
a:hover { color: #aa0000; }
a:visited { color: #4a1a7a; }

.site-title {
  text-decoration: none;
  color: #111;
}
.site-title:hover {
  color: #aa0000;
  text-decoration: none;
}

/* WIDER WRAPPER - Text ist nicht mehr zu schmal */
#wrapper {
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

#header {
  text-align: center;
  padding-bottom: 0.75rem;
}

#header h1 {
  font-size: 34px;
  font-weight: 700;
  margin: 0 0 0.3rem;
  letter-spacing: -0.5px;
}

#header .tagline {
  font-style: italic;
  font-size: 16px;
  color: #777;
  margin: 0 0 0.75rem;
}

#nav {
  text-align: center;
  font-size: 15px;
  margin-bottom: 0.25rem;
}

#nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

#nav a { margin: 0; }

hr {
  border: none;
  border-top: 2px solid #aaa;
  margin: 1.5rem 0;
}

/* LAYOUT WITH WIDER MAIN CONTENT */
#layout {
  display: flex;
  gap: 3.5rem;
  align-items: flex-start;
}

#main   { flex: 1; min-width: 0; }
#sidebar { width: 220px; flex-shrink: 0; font-size: 14px; }

.post-card { margin-bottom: 0.5rem; }

.post-card h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}

.post-card h2 a {
  text-decoration: none;
  color: #1a1a8c;
}

.post-card h2 a:hover {
  color: #aa0000;
  text-decoration: underline;
}

.post-card .meta {
  font-size: 14px;
  color: #888;
  margin-bottom: 0;
}

/* Base styles for post content */
.gh-content h1, .gh-content h2, .gh-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}
.gh-content h1 { font-size: 28px; }
.gh-content h2 { font-size: 24px; }
.gh-content h3 { font-size: 20px; }

.gh-content p {
    margin-bottom: 1.5rem;
    font-size: 17px;
    line-height: 1.8;
}

.gh-content img {
    max-width: 85%;
    height: auto;
    border: 1px solid #c2c2c2;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.08);
    margin: 1.25rem auto;
    display: block;
}

.gh-content figure {
    margin: 1.25rem auto;
    text-align: center;
}

.gh-content figcaption {
    font-size: 14px;
    color: #777;
    margin-top: 0.5rem;
    text-align: center;
    font-style: italic;
}

.gh-content blockquote {
    border-left: 3px solid #bbb;
    margin: 1.5rem 0;
    padding: 0.2rem 0 0.2rem 1.25rem;
    color: #666;
    font-style: italic;
}

.sbox {
  background: rgba(245, 245, 243, 0.85);
  border: 1px solid #ccc;
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
  box-shadow: 2px 2px 0px transparent;
  transition: box-shadow 0.2s;
}

.sbox:hover {
  box-shadow: 2px 2px 0px rgba(0,0,0,0.05);
}

.sbox h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0 0 0.75rem;
  color: #333;
  border-bottom: 1px dotted #ccc;
  padding-bottom: 0.4rem;
}

.sbox ul {
  margin: 0;
  padding-left: 1.2rem;
}

.sbox ul li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.sbox p { margin: 0; line-height: 1.5; }

#footer {
  text-align: center;
  font-size: 14px;
  color: #888;
  margin-top: 2rem;
  line-height: 1.6;
}

#footer a { color: #777; text-decoration: none; border-bottom: 1px dotted #999; }
#footer a:hover { color: #aa0000; border-bottom-color: #aa0000; }

.pagination {
    margin-top: 2.5rem;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

/* Navigation Lists fixes for injected ghost ul/li structure */
.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav li {
    margin: 0;
}

.nav a {
    text-decoration: none;
    color: #444;
}

.nav a:hover {
    color: #aa0000;
    text-decoration: underline;
}

@media (max-width: 768px) {
  #layout { flex-direction: column; }
  #sidebar { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .sbox { margin-bottom: 0; }
}

@media (max-width: 500px) {
  #sidebar { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { 
  .bg-lines svg { display: none; } 
}

/* Koenig Editor required classes */
.kg-width-wide {
    max-width: 110%;
    width: 110%;
    margin-left: -5%;
}

.kg-width-full {
    max-width: 100vw;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.kg-width-full img, .kg-width-wide img {
    width: 100%;
    height: auto;
}

/* Koenig Bookmark Cards Fix */
.kg-bookmark-card {
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.05);
    margin: 2rem 0;
    text-align: left; /* Fixes inherit from generic figure centering */
    border-radius: 4px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.kg-bookmark-card img {
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: inherit;
    min-height: 140px;
    text-align: left;
}

.kg-bookmark-container:hover {
    text-decoration: none;
    background: #fafaf8;
}

.kg-bookmark-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    padding: 1.5rem;
    overflow: hidden;
}

.kg-bookmark-title {
    font-weight: 600;
    font-size: 18px;
    line-height: 1.3;
    color: #111;
}

.kg-bookmark-description {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    margin-top: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    font-size: 13px;
    color: #888;
}

.kg-bookmark-icon {
    width: 22px !important;
    height: 22px !important;
    margin-right: 8px !important;
    display: inline-block !important;
}

.kg-bookmark-thumbnail {
    position: relative;
    min-width: 33%;
    max-width: 33%;
    overflow: hidden;
    background-color: #fafbfc;
    border-left: 1px solid #f0f0f0;
}

.kg-bookmark-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border: none !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
    max-width: none !important;
}

@media (max-width: 650px) {
    .kg-bookmark-container {
        flex-direction: column;
    }
    .kg-bookmark-thumbnail {
        width: 100%;
        max-width: 100%;
        min-height: 180px;
        order: 1;
    }
    .kg-bookmark-content {
        order: 2;
    }
}
