/**
 * MD2HTML Style Sheet - v1.0.0
 * 마크다운 콘텐츠를 위한 스타일시트
 */

/* 기본 컨테이너 스타일 */
.md2html-content {
    line-height: 1.6;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 헤더 스타일 */
.md2html-header {
    margin-top: 2em;
    margin-bottom: 1em;
    font-weight: 600;
    line-height: 1.25;
    color: #24292e;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.md2html-content h1.md2html-header {
    font-size: 2em;
    border-bottom: 2px solid #eaecef;
    padding-bottom: 0.5em;
}

.md2html-content h2.md2html-header {
    font-size: 1.5em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.md2html-content h3.md2html-header {
    font-size: 1.25em;
    border-bottom: none;
}

.md2html-content h4.md2html-header {
    font-size: 1em;
    border-bottom: none;
}

.md2html-content h5.md2html-header {
    font-size: 0.875em;
    border-bottom: none;
}

.md2html-content h6.md2html-header {
    font-size: 0.85em;
    color: #6a737d;
    border-bottom: none;
}

/* 단락 스타일 */
.md2html-paragraph {
    margin-bottom: 1em;
    margin-top: 0;
}

/* 리스트 스타일 */
.md2html-list {
    margin-top: 0;
    margin-bottom: 1em;
    padding-left: 2em;
}

.md2html-list ul,
.md2html-list ol {
    margin-top: 0;
    margin-bottom: 0;
}

.md2html-list-item {
    margin-bottom: 0.25em;
}

.md2html-list-item:last-child {
    margin-bottom: 0;
}

/* 중첩된 리스트 */
.md2html-list .md2html-list {
    margin-top: 0.25em;
    margin-bottom: 0.25em;
}

/* 코드 스타일 */
.md2html-inline-code {
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier', monospace;
    font-size: 85%;
    padding: 0.2em 0.4em;
    margin: 0;
    color: #e83e8c;
}

.md2html-code-block {
    background-color: #f6f8fa;
    border-radius: 6px;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier', monospace;
    font-size: 85%;
    line-height: 1.45;
    overflow: auto;
    padding: 16px;
    margin: 1em 0;
    border: 1px solid #e1e4e8;
}

.md2html-code-block code {
    background-color: transparent;
    border: 0;
    display: inline;
    line-height: inherit;
    margin: 0;
    max-width: auto;
    overflow: visible;
    padding: 0;
    white-space: pre;
    word-wrap: normal;
    color: #24292e;
}

/* 링크 스타일 */
.md2html-link {
    color: #0366d6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.md2html-link:hover {
    color: #0366d6;
    text-decoration: underline;
}

.md2html-link:visited {
    color: #6f42c1;
}

/* 이미지 스타일 */
.md2html-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 1em 0;
    display: block;
}

/* 테이블 스타일 */
.md2html-table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    margin: 1em 0;
    display: table;
    overflow: auto;
    font-size: 14px;
}

.md2html-table-header {
    background-color: #f6f8fa;
    border: 1px solid #d0d7de;
    padding: 6px 13px;
    font-weight: 600;
    text-align: left;
    color: #24292e;
}

.md2html-table-cell {
    border: 1px solid #d0d7de;
    padding: 6px 13px;
    text-align: left;
}

.md2html-table tr:nth-child(even) {
    background-color: #f6f8fa;
}

.md2html-table tr:hover {
    background-color: #f0f3f6;
}

/* 인용구 스타일 */
.md2html-blockquote {
    border-left: 4px solid #dfe2e5;
    margin: 1em 0;
    padding: 0 1em;
    color: #6a737d;
    background-color: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.md2html-blockquote p {
    margin-bottom: 0.5em;
}

.md2html-blockquote p:last-child {
    margin-bottom: 0;
}

/* 구분선 스타일 */
.md2html-hr {
    border: none;
    border-top: 1px solid #e1e4e8;
    height: 1px;
    margin: 2em 0;
    padding: 0;
}

/* 강조 스타일 */
.md2html-strong {
    font-weight: 600;
    color: #24292e;
}

.md2html-emphasis {
    font-style: italic;
    color: #24292e;
}

.md2html-strikethrough {
    text-decoration: line-through;
    color: #6a737d;
}

/* 코드 하이라이팅 스타일 */
.md2html-code-block .language-javascript,
.md2html-code-block .language-js {
    color: #d73a49;
}

.md2html-code-block .language-python,
.md2html-code-block .language-py {
    color: #005cc5;
}

.md2html-code-block .language-html {
    color: #22863a;
}

.md2html-code-block .language-css {
    color: #6f42c1;
}

.md2html-code-block .language-php {
    color: #d73a49;
}

.md2html-code-block .language-json {
    color: #032f62;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .md2html-content {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .md2html-content h1.md2html-header {
        font-size: 1.8em;
    }
    
    .md2html-content h2.md2html-header {
        font-size: 1.4em;
    }
    
    .md2html-content h3.md2html-header {
        font-size: 1.2em;
    }
    
    .md2html-table {
        font-size: 12px;
    }
    
    .md2html-table-header,
    .md2html-table-cell {
        padding: 4px 8px;
    }
    
    .md2html-code-block {
        font-size: 12px;
        padding: 12px;
    }
    
    .md2html-list {
        padding-left: 1.5em;
    }
}


/* 프린트 스타일 */
@media print {
    .md2html-content {
        color: #000;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .md2html-header {
        color: #000;
        page-break-after: avoid;
    }
    
    .md2html-table {
        page-break-inside: avoid;
    }
    
    .md2html-code-block {
        background-color: #f5f5f5;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .md2html-link {
        color: #000;
        text-decoration: underline;
    }
    
    .md2html-image {
        max-width: 100%;
        page-break-inside: avoid;
    }
}

/* 접근성 향상 */
.md2html-content *:focus {
    outline: 2px solid #0366d6;
    outline-offset: 2px;
}

/* 텍스트 선택 스타일 */
.md2html-content ::selection {
    background-color: #0366d6;
    color: white;
}

/* 스크롤바 스타일 (웹킷 브라우저) */
.md2html-code-block::-webkit-scrollbar {
    height: 8px;
}

.md2html-code-block::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.md2html-code-block::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.md2html-code-block::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 애니메이션 */
.md2html-content {
    animation: md2html-fade-in 0.3s ease-in-out;
}

@keyframes md2html-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 체크박스 스타일 (확장 기능) */
.md2html-checkbox {
    margin-right: 0.5em;
    transform: scale(1.2);
}

/* 수식 스타일 (확장 기능) */
.md2html-math {
    font-family: 'Times New Roman', serif;
    font-style: italic;
}