/* 全ページ共通のモダンなスタイル */


:root {
    --bg-color: #f0f2f5;
    --sidebar-color: #ffffff;
    --primary-color: #007bff;
    --text-color: #1c1e21;
    --accent-gray: #65676b;
    --border-color: #dddfe2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container { display: flex; min-height: 100vh; }

/* サイドバー */
.sidebar {
    width: 250px;
    background: var(--sidebar-color);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    padding: 2rem 1.5rem;
    z-index: 100;
}

.profile h2 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.profile p { color: var(--accent-gray); font-size: 0.9rem; margin-bottom: 2rem; }

.nav-menu ul { list-style: none; padding: 0; }
.nav-menu li { margin-bottom: 0.5rem; }

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
    transition: background 0.2s;
}

.nav-menu a:hover { background: #f2f3f5; }
.nav-menu a.active { background: #e7f3ff; color: var(--primary-color); font-weight: bold; }
.nav-menu i { margin-right: 12px; width: 18px; text-align: center; }

/* メイン */
.main-content {
    margin-left: 250px;
    padding: 3rem;
    width: 100%;
    max-width: 800px;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

/* スマートフォン向け（画面幅768px以下）の調整 */
@media (max-width: 768px) {
    .container {
        flex-direction: column; /* 左右並びを上下並びに変更 */
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .main-content {
        padding: 20px;
        width: 100%;
    }

@media (max-width: 768px) {
    /* メニュー全体のコンテナ */
    .nav-menu ul {
        display: flex !important;
        flex-wrap: nowrap !important;   /* 絶対に改行させない */
        justify-content: space-around;  /* 項目を均等に配置 */
        align-items: center;
        padding: 0 5px !important;      /* 左右の余白を最小限に */
        margin: 15px 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* 各リスト項目 */
    .nav-menu li {
        margin: 0 !important;
        flex: 1; 
        text-align: center;
    }

    /* リンクボタン（アイコンと文字を横並び） */
    .nav-menu a {
        display: inline-flex !important; /* 横並び */
        flex-direction: row !important;  /* 横方向に配置 */
        align-items: center;             /* アイコンと文字の垂直中心を揃える */
        justify-content: center;
        gap: 4px;                        /* アイコンと文字の間隔を狭く */
        
        padding: 8px 2px !important;
        font-size: 0.7rem;               /* 1列に収めるため文字を小さく調整 */
        white-space: nowrap;             /* 改行禁止 */
        text-decoration: none;
    }

    /* アイコンのサイズ調整 */
    .nav-menu a i {
        font-size: 1rem !important;      /* 横並び用にアイコンを少し小さく */
        display: flex;
        align-items: center;
        line-height: 1;
    }
}
    
/* スマートフォン向け（画面幅768px以下）の調整 */


@media (max-width: 768px) {
    /* 1. コンテナ全体の余白をリセット */
    .container {
        display: block; /* もし flex のままであれば block にして上下に並べる */
        width: 100%;
        padding: 0;
        margin: 0;
    }

    /* 2. サイドバーの設定（メニュー） */
    .sidebar {
        width: 100%;
        padding: 20px 0; /* 左右のパディングを 0 にして中央寄せを確実に */
        text-align: center;
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    /* 3. メインコンテンツの設定（ここが右寄りの原因） */
    .main-content {
        width: 100% !important; /* 幅を画面いっぱいに */
        max-width: 100% !important;
        padding: 20px !important; /* 左右に適切な余白（スマホ用）を付ける */
        margin: 0 !important;     /* 外側の余白をリセット */
        box-sizing: border-box;   /* パディングを含めて幅100%にする */
    }

    /* 4. メニューの中央寄せ（念のため再掲） */
    .nav-menu ul {
        display: flex;
        justify-content: center;
        padding: 0;
        margin: 10px 0 0 0;
        list-style: none;
        gap: 15px;
    }
}

/* 画像が画面幅を超えないようにする */
.diary-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 10px 0;
}

@media (max-width: 480px) {
    .doc-header {
        flex-direction: column; /* タイトルと日付を上下に並べる */
        align-items: flex-start;
        gap: 5px;
    }

    .doc-title {
        font-size: 1.1rem; /* スマホでは少しだけ文字を小さく */
    }
}    

