@charset "UTF-8";

/* ==========================================================================
   【重要】PC・全サイズ共通の強制リセット
   元のテーマが設定しているサイドバー用の余白を、詳細度を上げて打ち消します。
   ========================================================================== */
html body #wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    padding-top: 0;
    padding-bottom: 0;
}

#main { max-width: 100%; }

/* 記事本文コンテナ（PCでの読みやすさ確保） */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 4em 2em;
}

/* ==========================================================================
   モバイル端末調整 (画面幅 1024px 以下)
   ========================================================================== */
@media screen and (max-width: 1024px) {
    #titleBar { display: none !important; }
    
    /* モバイル用に余白を再調整 */
    html body #wrapper { 
        padding-top: 0 !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 2em 1.5em !important; 
    }
    
    /* サイドバー開閉挙動の無効化 */
    body.header-visible #wrapper {
        transform: none !important;
    }
}

/* ==========================================================================
   その他のスタイル
   ========================================================================== */

/* フッター調整 */
#footer { padding: 1em 0 1em 0; }
#footer .container { padding-top: 1em; padding-bottom: 0; }

/* 記事内画像 */
#markdown-content img {
    max-width: 100%; height: auto; display: block; margin: 2em auto;
}

/* コードブロック */
pre {
    margin: 2em 0;
    padding: 0;
    border-radius: 5px;
    overflow-x: auto;
    background: transparent;
}
pre code.hljs {
    display: block;
    padding: 1.5em;
    font-family: Consolas, "Courier New", monospace;
    line-height: 1.5;
    font-size: 0.95em;
    border-radius: 5px;
}

/* インラインコード */
p code, li code {
    background: rgba(0,0,0,0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: inherit;
}

/* 太字(Strong)の装飾 */
#markdown-content p strong,
#markdown-content li strong {
    background: linear-gradient(transparent 60%, rgba(230, 183, 148, 0.5) 60%);
    font-weight: 700;
    color: inherit;
}

/* 数式サイズ & 横スクロール対応 */
.katex { font-size: 1.1em; }
.katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5em 0;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.katex-display::-webkit-scrollbar { height: 6px; }
.katex-display::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }

/* 数式番号制御（JS連携用クラス） */
.katex-display .tag.drop-tag {
    position: relative !important;
    display: block !important;
    right: auto !important;
    text-align: right;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    clear: both;
}

/* 見出しデザイン */
#markdown-content h1 {
    font-size: 2.25em; font-weight: 700; color: #777;
    margin-bottom: 1em; line-height: 1.3;
    border-bottom: 2px solid #f4f4f4; padding-bottom: 0.5em;
}
#markdown-content h2 {
    font-size: 1.75em; font-weight: 700; color: #777;
    margin-top: 2.5em; margin-bottom: 1em;
    border-left: 6px solid #e6b794;
    padding-left: 0.6em;
}
#markdown-content h3 {
    font-size: 1.35em; font-weight: 700; color: #777;
    margin-top: 2em; margin-bottom: 0.8em;
}

/* 引用デザイン */
blockquote { border-left-color: #e6b794 !important; }

/* 戻るボタン調整 */
.closeArea a { border-bottom: none !important; }

/* エラー表示 */
#error-display { color: red; font-weight: bold; padding: 1em; display: none; background: #ffe6e6; border: 1px solid red; margin-bottom: 1em; }

/* 折りたたみ(Details) */
details { margin: 1.5em 0; border: 1px solid #eee; border-radius: 5px; background-color: #fff; transition: all 0.3s ease; }
summary { cursor: pointer; padding: 0.8em 1em; font-weight: 700; color: #777; background-color: #fafafa; border-radius: 5px; list-style: none; outline: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; position: absolute; right: 1em; color: #aaa; font-weight: bold; }
details[open] summary::after { content: '-'; color: #e6b794; }
details[open] summary { border-bottom: 1px solid #eee; border-bottom-left-radius: 0; border-bottom-right-radius: 0; color: #e6b794; }
details > div, details > p, details > ul, details > ol { padding: 1em; margin-bottom: 0; }