@charset "UTF-8";

/* =========================================
   記事ページ共通スタイル (article.css)
   ========================================= */

/* 記事全体のコンテナ */
.article-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    background-color: #fff;
}

/* --- 記事ヘッダー（タイトル・日付） --- */
.article-header {
    margin-bottom: 40px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 20px;
}

.article-date {
    color: #666;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 10px;
}

.article-title {
    font-size: 2rem;
    margin: 0;
    line-height: 1.4;
}

/* --- 記事本文の基本設定 --- */
.article-content {
    line-height: 1.8;
    font-size: 1rem;
    color: #333;
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-top: 50px;
    margin-bottom: 20px;
}

.article-content h3 {
    font-size: 1.2rem;
    border-left: 4px solid #333;
    padding-left: 10px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-content a {
    color: #007bff;
    text-decoration: none;
    word-break: break-all;
}

.article-content a:hover {
    text-decoration: underline;
}

.article-content ul, 
.article-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

blockquote {
    background: #f4f4f4;
    border-left: 4px solid #555;
    margin: 1.5em 0;
    padding: 1em;
    color: #555;
}

/* --- ▼▼▼ 今回追加：追記用ボックスのデザイン ▼▼▼ --- */
.update-notice {
    background-color: #fff3cd; /* 薄い黄色 */
    border: 1px solid #ffeeba;
    border-left: 5px solid #ffc107; /* 左側に濃い黄色のアクセント */
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    color: #856404; /* 文字色は少し濃い茶系 */
}

.update-notice strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.05em;
}
/* -------------------------------------------------- */


/* --- リスト・表などの特殊パーツ --- */
.menu-list dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 20px;
    margin-bottom: 1.5em;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.menu-list dt {
    font-weight: bold;
}

.menu-list dd {
    margin: 0;
    text-align: right;
}

/* --- コードブロック（LaTeX記事用） --- */
.code-container {
    margin: 30px 0;
    position: relative;
}

.code-wrapper {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    max-height: 300px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.5s ease;
}

.code-wrapper.expanded {
    max-height: none;
    overflow: visible;
}

.code-wrapper pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.9rem;
}

.code-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to bottom, rgba(245, 245, 245, 0), #f5f5f5);
    pointer-events: none;
}

.code-wrapper.expanded .code-fade {
    display: none;
}

.code-toggle-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.code-toggle-btn:hover {
    background-color: #555;
}

/* =========================================
   ヘッダー被り防止・修正版
   ========================================= */

/* ヘッダーコンテナ：基準点とする */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* 重なりの基準 */
}

/* ナビゲーション（メニュー）を強制的に最前面へ */
.header-container nav {
    position: relative;
    z-index: 9999; /* とにかく一番手前に表示 */
    flex-shrink: 0; /* 縮まないようにする */
}

/* タイトル：幅を制限して、メニューの場所を空ける */
.header-container h1 {
    /* メニューボタンの分（約60px）を引いた幅を最大とする */
    max-width: calc(100% - 60px); 
    
    /* 以下は省略表示の設定 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    
    /* メニューより奥に配置 */
    position: relative;
    z-index: 1; 
    margin: 0; /* 余計な隙間を削除 */
}

/* スマホ・タブレット時の文字サイズ調整 */
@media (max-width: 900px) {
    .header-container h1 {
        font-size: 1.2rem;
    }
}