/*
 * Finland Documentation Styles
 * Styles for documentation pages with sidebar navigation
 * Version: 1.0
 * Date: 2025-11-19
 */

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.sidebar {
    background: var(--finland-bg-white);
    border-right: 1px solid var(--finland-border-light);
}

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

.sidebar-nav-item {
    margin-bottom: 8px;
}

.sidebar-nav-link {
    display: block;
    padding: 10px 16px;
    color: var(--finland-text-secondary);
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    /* Text overflow protection */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.sidebar-nav-link:hover {
    background: var(--finland-blue-lighter);
    color: var(--finland-blue);
}

.sidebar-nav-link.active {
    background: var(--finland-blue-light);
    color: var(--finland-blue);
    font-weight: 500;
}

/* ============================================
   MOBILE NAVIGATION BAR
   ============================================ */
.mobile-nav-bar {
    display: none;
    background: var(--finland-bg-white);
    padding: 16px;
    border-bottom: 1px solid var(--finland-border-light);
    margin-bottom: 24px;
}

.mobile-nav-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-nav-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--finland-text-primary);
    white-space: nowrap;
}

.mobile-nav-dropdown {
    flex: 1;
}

.mobile-nav-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--finland-border-gray);
    border-radius: 6px;
    font-size: 14px;
    background: var(--finland-bg-white);
    color: var(--finland-text-primary);
    cursor: pointer;
}

/* ============================================
   CONTENT SECTION
   ============================================ */
.content-section {
    margin-bottom: 48px;
}

.content-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--finland-text-primary);
    margin-bottom: 16px;
}

.content-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--finland-text-primary);
    margin-bottom: 12px;
}

.content-section p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--finland-text-secondary);
    margin-bottom: 16px;
}

.content-section ul,
.content-section ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.content-section li {
    font-size: 16px;
    line-height: 1.6;
    color: var(--finland-text-secondary);
    margin-bottom: 8px;
}

/* ============================================
   CODE BLOCKS - OVERFLOW PROTECTION
   ============================================ */
.content-section pre {
    background: #f5f5f5;
    border: 1px solid var(--finland-border-gray);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    /* Overflow protection for code blocks */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
}

.content-section code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    /* Overflow protection for inline code */
    word-break: break-all;
    overflow-wrap: break-word;
}

.content-section pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: block;
    overflow-x: auto;
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

.main-content {
    min-width: 0; /* Prevents overflow in grid */
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .sidebar {
        display: none;
    }

    .mobile-nav-bar {
        display: block;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 24px 16px;
    }

    .content-section h2 {
        font-size: 24px;
    }

    .content-section h3 {
        font-size: 18px;
    }

    .content-section pre {
        padding: 12px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .mobile-nav-bar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-nav-label {
        margin-bottom: 8px;
    }
}
