/* ========================================
   Article Layout CSS
   Für Blog-Style Artikel-Seiten
   ======================================== */

/* ========================================
   BASE ARTICLE LAYOUT
   ======================================== */

.article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ========================================
   SECTION SEPARATOR
   ======================================== */

.section-separator {
    margin: 4rem 0;
    text-align: center;
    position: relative;
}

.section-separator::before {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--primary, #1e40af), transparent);
    margin: 0 auto;
}

.section-separator-text {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: var(--bg-light, #f8fafc);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary, #475569);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .article-layout {
        grid-template-columns: 280px 1fr;
        gap: 4rem;
    }
}

.article-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .article-sidebar {
        display: block;
        position: sticky;
        top: 120px;
        align-self: start;
    }
}

.article-main {
    max-width: 100%;
}

@media (min-width: 768px) {
    .article-main {
        max-width: 720px;
    }
}

/* ========================================
   TYPOGRAPHY FOR READABILITY
   ======================================== */

.article-main {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text, #1e293b);
}

.article-main h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text, #1e293b);
}

.article-main h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text, #1e293b);
}

.article-main h4 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text, #1e293b);
}

.article-main p {
    margin-bottom: 1.5rem;
}

.article-main strong {
    font-weight: 600;
    color: var(--text, #1e293b);
}

.article-main em {
    font-style: italic;
}

/* ========================================
   ARTICLE HERO SECTION
   ======================================== */

.article-hero {
    background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.35)),
        url('../../website_header_background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    color: white;
    padding: 120px 0 60px;
    margin-bottom: 3rem;
}

.article-hero .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.article-hero-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.article-hero-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .article-hero {
        padding: 100px 0 40px;
        background-attachment: scroll;
    }
    
    .article-hero-title {
        font-size: 2rem;
    }
}

.article-hero-intro {
    font-size: 1.25rem;
    line-height: 1.6;
    font-weight: 300;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.article-hero-meta {
    font-size: 0.875rem;
    opacity: 0.8;
}

.article-hero-meta span {
    margin-right: 1rem;
}

/* ========================================
   TABLE OF CONTENTS
   ======================================== */

.toc {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--primary, #1e40af);
}

.toc-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    color: var(--text, #1e293b);
}

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

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list ul {
    list-style: none;
    padding-left: 1rem;
    margin-top: 0.5rem;
}

.toc-link {
    display: block;
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 0.25rem 0;
    transition: color 0.2s ease;
}

.toc-link:hover {
    color: var(--primary, #1e40af);
}

.toc-link.active {
    color: var(--primary, #1e40af);
    font-weight: 600;
}

/* Mobile TOC - Hidden by default on desktop */
.toc-mobile {
    display: none;
}

@media (max-width: 1023px) {
    /* Hide desktop TOC on mobile */
    .article-sidebar .toc {
        display: none;
    }
    
    /* Show mobile TOC on mobile */
    .toc-mobile {
        display: block;
        margin-bottom: 2rem;
    }
    
    /* Mobile TOC toggle button */
    .toc-mobile-toggle {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: transparent;
        border: none;
        padding: 0;
        margin-bottom: 1rem;
        cursor: pointer;
        font-family: inherit;
    }
    
    .toc-mobile-toggle .toc-title {
        margin-bottom: 0;
    }
    
    .toc-toggle-icon {
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }
    
    .toc-mobile-toggle[aria-expanded="true"] .toc-toggle-icon {
        transform: rotate(180deg);
    }
    
    /* Mobile TOC list - collapsed by default */
    .toc-mobile .toc-list {
        display: none;
        max-height: 0;
        overflow: hidden;
    }
    
    .toc-mobile .toc-list.expanded {
        display: block;
        max-height: none;
        overflow: visible;
    }
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */

.article-section {
    margin-top: 4rem;
    scroll-margin-top: 120px;
}

.article-section:first-child {
    margin-top: 0;
}

.section-intro {
    font-size: 1.125rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

/* ========================================
   HIGHLIGHT BOXES
   ======================================== */

.highlight-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
    color: #0f172a !important; /* Dunkle Textfarbe für bessere Lesbarkeit */
}

.highlight-box p:last-child {
    margin-bottom: 0;
}

.highlight-box strong {
    color: #0f172a !important; /* Sicherstellen, dass fettgedruckter Text auch dunkel ist */
    font-weight: 600;
}

.info-box {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
    color: #0f172a !important; /* Dunkle Textfarbe für bessere Lesbarkeit */
}

.info-box p:last-child {
    margin-bottom: 0;
}

.tip-box {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
    color: #0f172a !important; /* Dunkle Textfarbe für bessere Lesbarkeit */
}

.tip-box p:last-child {
    margin-bottom: 0;
}

.warning-box {
    background: #fed7aa;
    border-left: 4px solid #f97316;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
    color: #0f172a !important; /* Dunkle Textfarbe für bessere Lesbarkeit */
}

.warning-box p:last-child {
    margin-bottom: 0;
}

/* ========================================
   LISTS AND CONTENT ELEMENTS
   ======================================== */

.article-main ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.article-main ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-main ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0.2em; /* Vertikal zur ersten Textzeile ausrichten */
    color: var(--primary, #1e40af);
    font-weight: bold;
    font-size: 1.2em;
    line-height: 1;
}

.article-main ol {
    list-style: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.article-main ol li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.checklist {
    list-style: none !important;
    padding-left: 0;
}

.checklist li {
    position: relative;
    padding-left: calc(2.5rem + 8px) !important;
    margin-bottom: 1rem;
}

.checklist li::before {
    content: "✓" !important;
    position: absolute;
    left: 0;
    top: 0.1em;
    color: #10b981 !important;
    font-weight: bold;
    font-size: 1.3em;
    line-height: 1;
}

.process-list {
    list-style: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.process-list li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

/* Nested unordered lists within process-list */
.process-list li ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.process-list li ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.process-list li ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary, #1e40af);
    font-weight: bold;
    font-size: 1.2em;
}

.article-main blockquote {
    border-left: 4px solid var(--primary, #1e40af);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary, #64748b);
    font-size: 1.125rem;
}

/* ========================================
   TABLES
   ======================================== */

.article-main table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.article-main th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.article-main td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.article-main tr:hover {
    background: #f8fafc;
}

/* Mobile-specific table adjustments */
@media (max-width: 768px) {
    .article-main table {
        font-size: 0.85rem;
    }
    
    .article-main th,
    .article-main td {
        padding: 0.5rem 0.75rem;
    }
}

/* ========================================
   CTA INTEGRATION
   ======================================== */

.article-cta {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 3rem 2rem;
    margin: 4rem 0;
    border-radius: 12px;
    text-align: center;
}

.article-cta h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    margin-top: 0;
}

.article-cta p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.article-cta .cta {
    display: inline-block;
    padding: 1rem 2rem;
    background: white;
    color: var(--primary, #1e40af);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.article-cta .cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.article-cta .cta-primary {
    background: white;
    color: var(--primary, #1e40af);
}

.article-cta .cta-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.article-cta .cta-secondary:hover {
    background: white;
    color: var(--primary, #1e40af);
}

/* Note: .cta-buttons sind jetzt in shared.css */

.article-cta-inline {
    display: inline-block;
    color: var(--primary, #1e40af);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--primary, #1e40af);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}

.article-cta-inline:hover {
    text-decoration-thickness: 3px;
}

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

.reading-width {
    max-width: 720px;
}

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

.text-muted {
    color: var(--text-secondary, #64748b);
}

.spacer-sm {
    margin-top: 1rem;
}

.spacer-md {
    margin-top: 2rem;
}

.spacer-lg {
    margin-top: 4rem;
}

/* Table responsive wrapper utility class */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 1.5rem 0;
    border-radius: 8px;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .article-container {
        padding: 1rem;
        overflow-x: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .article-main {
        font-size: 16px;
        overflow-x: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .article-main h2 {
        font-size: 1.75rem;
    }
    
    .article-main h3 {
        font-size: 1.5rem;
    }
    
    .article-main h4 {
        font-size: 1.125rem;
    }
    
    .article-cta {
        padding: 2rem 1.5rem;
    }
    
    .article-cta h3 {
        font-size: 1.5rem;
    }
}

/* Note: Dropdown navigation styles sind jetzt in shared.css */

/* ========================================
   MOBILE OVERFLOW PREVENTION
   ======================================== */

@media (max-width: 768px) {
    /* Ensure images don't cause horizontal overflow */
    .article-main img {
        max-width: 100%;
        height: auto;
    }
    
    /* Ensure code blocks don't cause horizontal overflow */
    .article-main pre,
    .article-main code {
        overflow-x: auto;
        max-width: 100%;
    }
    
    /* Ensure highlight boxes don't cause horizontal overflow */
    .article-main .highlight-box,
    .article-main .info-box,
    .article-main .tip-box,
    .article-main .warning-box {
        overflow-x: auto;
    }
}
