/* ================================
   MODERN MEDIEVAL CSS
   Hochmodernes Design mit mittelalterlicher Seele
   ================================ */

/* Core Styles */
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-size: 1rem;
    line-height: 1.7;
    color: #e8e3d9;
    background: linear-gradient(135deg, #0f0e0d 0%, #1a1814 50%, #0f0e0d 100%);
    background-attachment: fixed;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(201, 166, 107, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 115, 85, 0.03) 0%, transparent 50%),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.015"><path d="M50,10 L90,90 L10,90 Z" stroke="%23c9a66b" stroke-width="0.5" fill="none"/></svg>');
    pointer-events: none;
    z-index: 0;
}

/* ================================
   TYPOGRAPHY & TEXT FORMATTING
   ================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #f4ead5;
    font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
    font-weight: 600;
    letter-spacing: 1.5px;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

h1 {
    border-bottom: 2px solid transparent;
    background: linear-gradient(to right, #c9a66b 0%, transparent 100%) bottom / 100% 2px no-repeat;
    padding-bottom: 1rem;
    font-size: 2.5rem;
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: #c9a66b;
    box-shadow: 0 0 10px rgba(201, 166, 107, 0.5);
}

h2 {
    font-size: 2rem;
    color: #e6d8b9;
}

h3 {
    font-size: 1.5rem;
}

/* Paragraphs & Text Content */
p {
    margin: 1rem 0;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

/* Links */
a {
    color: #d4b183;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

a::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(to right, #c9a66b, #8b7355);
    transition: width 0.3s ease;
}

a:hover {
    color: #f4d9a6;
}

a:hover::before {
    width: 100%;
}

/* Code Blocks */
pre {
    background: rgba(26, 25, 23, 0.8);
    backdrop-filter: blur(10px);
    margin: 1.5rem 0;
    border-radius: 8px;
    border-left: 4px solid #c9a66b;
    color: #e8dcc4;
    border: 1px solid rgba(139, 115, 85, 0.3);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

code {
    font-family: 'Fira Code', 'Courier New', monospace;
    background: rgba(201, 166, 107, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    word-wrap: break-word;
}

pre code {
    background: none;
    padding: 0;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid #c9a66b;
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(to right, rgba(26, 25, 23, 0.6), transparent);
    backdrop-filter: blur(5px);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #e6d8b9;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

blockquote::before {
    content: '\201C';
    position: absolute;
    top: 0;
    left: 1rem;
    font-size: 4rem;
    color: rgba(201, 166, 107, 0.2);
    font-family: Georgia, serif;
    line-height: 1;
}

/* Lists */
ul, ol {
    margin: 1rem 0;
    padding-left: 2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

li {
    margin: 0.5rem 0;
    line-height: 1.7;
}

/* Tables */
table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: rgba(26, 25, 23, 0.4);
    border: 1px solid rgba(201, 166, 107, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(201, 166, 107, 0.1);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

th {
    background: rgba(201, 166, 107, 0.15);
    color: #f4ead5;
    font-weight: 600;
    font-family: 'Cinzel', Georgia, serif;
}

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

tr:hover {
    background: rgba(201, 166, 107, 0.05);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ================================
   UTILITY CLASSES
   ================================ */

.wrapper {
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
    width: 100%;
}

.padding {
    padding: 2rem 0;
}

.left {
    float: left;
}

.right {
    float: right;
}

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

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* ================================
   CONTENT AREA - Proper Width Control
   ================================ */

#body {
    flex: 1 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

#body .wrapper {
    max-width: 1200px;
    width: 100%;
}

/* Content Typography - Lesbare Textbreite */
#body .wrapper > *,
#body .wrapper p,
#body .wrapper h1,
#body .wrapper h2,
#body .wrapper h3,
#body .wrapper h4,
#body .wrapper h5,
#body .wrapper h6,
#body .wrapper ul,
#body .wrapper ol,
#body .wrapper blockquote {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Optimal reading width for long-form content */
#body .wrapper article,
#body .wrapper .content,
#body .wrapper .post-content {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ================================
   ULTRA-MODERN HEADER
   ================================ */
.home-header {
    background: rgba(18, 17, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(218, 165, 32, 0.2);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.home-footer {
    background: rgba(10, 7, 5, 0.95);
    border-top: 1px solid rgba(218, 165, 32, 0.2);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* ================================
   LOGO - Modern & Elegant
   ================================ */

.header .logo {
    font-size: 1.4rem;
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 0.5rem 0;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    order: 1;
    position: relative;
    transition: all 0.3s ease;
}

.header .logo i {
    color: #c9a66b;
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(201, 166, 107, 0.4));
    transition: all 0.3s ease;
}

.header .logo:hover i {
    color: #f4d9a6;
    filter: drop-shadow(0 0 12px rgba(201, 166, 107, 0.6));
    transform: rotate(5deg) scale(1.05);
}

/* ================================
   NAVIGATION - Ultra Modern
   ================================ */

.main-nav {
    display: flex;
    justify-content: flex-end;
    order: 2;
    margin-left: auto;
}

.main-nav ul {
    display: flex;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: center;
}

.main-nav ul li {
    position: relative;
    margin: 0;
}

.main-nav ul li a {
    display: block;
    line-height: 1.5;
    color: #e8e3d9;
    padding: 0.75rem 1.25rem;
    white-space: nowrap;
    border: none;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    background: transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.main-nav ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(201, 166, 107, 0.1), rgba(139, 115, 85, 0.05));
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 6px;
}

.main-nav > ul > li > a {
    background: transparent;
    border: 1px solid transparent;
}

/* Hover Effects - Glassmorphism */
.main-nav ul li:hover > a {
    background: rgba(201, 166, 107, 0.08);
    border-color: rgba(201, 166, 107, 0.2);
    color: #f4ead5;
    transform: translateY(-1px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.main-nav ul li:hover > a::before {
    opacity: 1;
}

/* Active/Selected State */
.main-nav ul li.selected > a {
    background: rgba(201, 166, 107, 0.12);
    color: #f4d9a6;
    border: 1px solid rgba(201, 166, 107, 0.3);
    box-shadow: 
        0 0 20px rgba(201, 166, 107, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-weight: 600;
}

/* Dropdown - Modern Card Style */
.main-nav ul li ul {
    position: absolute;
    background: rgba(18, 17, 15, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    min-width: 220px;
    text-align: left;
    z-index: 999;
    display: none;
    border: 1px solid rgba(201, 166, 107, 0.2);
    border-radius: 8px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(201, 166, 107, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    top: calc(100% + 8px);
    left: 0;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-nav ul li ul li {
    display: block;
    margin: 0;
}

.main-nav ul li ul li a {
    border-bottom: 1px solid rgba(201, 166, 107, 0.1);
    padding: 0.875rem 1.25rem;
    border-radius: 0;
    transition: all 0.2s ease;
}

.main-nav ul li ul li:last-child a {
    border-bottom: none;
}

.main-nav ul li ul li:hover > a {
    background: rgba(201, 166, 107, 0.15);
    padding-left: 1.5rem;
    border-color: transparent;
}

/* Nested Dropdowns */
.main-nav ul li ul ul {
    left: 100%;
    top: -1px;
    margin-left: 8px;
}

/* Child Indicator - Modern Arrow */
.main-nav .has-children > a {
    padding-right: 2.5rem;
    position: relative;
}

.main-nav .has-children > a:after {
    font-family: FontAwesome;
    content: '\f107';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #c9a66b;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.main-nav .has-children:hover > a:after {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.main-nav .has-children .has-children > a:after {
    content: '\f105';
}

/* ================================
   FOOTER - Modern & Elegant
   ================================ */

.footer {
    background: linear-gradient(to top, rgba(15, 14, 13, 0.98), rgba(26, 24, 20, 0.95));
    backdrop-filter: blur(20px);
    color: #c9c4b8;
    border-top: 1px solid rgba(201, 166, 107, 0.2);
    flex-shrink: 0;
    width: 100%;
    margin-top: auto;
    position: relative;
    box-shadow: 
        0 -1px 0 rgba(201, 166, 107, 0.1),
        0 -4px 24px rgba(0, 0, 0, 0.3);
}

.footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #c9a66b 50%, transparent);
    opacity: 0.3;
}

.footer .wrapper {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: rgba(232, 227, 217, 0.7);
    letter-spacing: 0.3px;
}

.footer-sigil {
    font-size: 1.5rem;
    letter-spacing: 0.75rem;
    margin-top: 1rem !important;
    color: #c9a66b;
    opacity: 0.4;
    font-family: 'Cinzel', serif;
    text-shadow: 0 0 10px rgba(201, 166, 107, 0.3);
}

/* ================================
   SCROLLBAR - Modern Design
   ================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    background-color: #12110f;
}

::-webkit-scrollbar-track {
    background: linear-gradient(to bottom, #1a1917, #12110f);
    border-left: 1px solid rgba(201, 166, 107, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #c9a66b, #8b7355);
    border: 2px solid #12110f;
    border-radius: 10px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #f4d9a6, #c9a66b);
    box-shadow: 0 0 10px rgba(201, 166, 107, 0.5);
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 768px) {
    .wrapper {
        padding: 0 1.5rem;
    }
    
    .header .wrapper {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header .logo {
        order: 1;
        margin-right: auto;
        margin-left: 0;
        width: 100%;
        text-align: left;
        font-size: 1.2rem;
    }
    
    .main-nav {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .main-nav ul li a {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .footer .wrapper {
        padding: 1.5rem 1rem;
    }
    
    .footer-sigil {
        font-size: 1.2rem;
        letter-spacing: 0.5rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.95rem;
    }
    
    .wrapper {
        padding: 0 1rem;
    }
    
    .header .logo {
        font-size: 1.1rem;
    }
    
    .main-nav ul li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    blockquote {
        padding: 1rem 1.5rem;
    }
    
    pre {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* ================================
   ACCESSIBILITY & POLISH
   ================================ */

.main-nav ul li a:focus,
.header .logo:focus {
    outline: 2px solid #c9a66b;
    outline-offset: 2px;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Selection Colors */
::selection {
    background-color: rgba(201, 166, 107, 0.3);
    color: #f4ead5;
}

::-moz-selection {
    background-color: rgba(201, 166, 107, 0.3);
    color: #f4ead5;
}