/* 背景色の変更（全体の印象を少し柔らかく） */
body {
    background-color: #f4f4f9; /* 淡いグレーの背景 */
}

/* セクションに余白を追加して視覚的に分かりやすく */
section {
    padding: 30px 20px;
    margin: 20px 0;
    background-color: rgba(255, 255, 255, 0.9); /* 半透明の背景 */
    border-radius: 8px;
}

/* h1 タイトルの中央揃え */
h1 {
    text-align: center;
    margin-top: 20px; /* 上部に少し余白を追加 */
    color: #444444;
}

/* 戻るリンクのスタイル */
a {
    text-decoration: none;
    color: #007BFF;
    font-weight: bold;
}

/* リンクのホバーエフェクトを強化 */
a:hover {
    text-decoration: underline;
    color: #0056b3; /* 少し濃い目の色 */
}

/* コメントセクション */
.comments {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #333;
}

/* グリッドの設定 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
}

/* 画像ホバーエフェクト */
.image-grid img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-grid img:hover {
    transform: scale(1.05); /* 少し拡大 */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); /* 影を強調 */
}

/* モーダルウィンドウのスタイル（画像クリック時に表示される） */
.modal {
    display: none; 
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal:target {
    display: flex; /* モーダルを表示 */
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: white;
    text-decoration: none;
}

.modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

/* セクションごとのスタイル */
section h2 {
    font-size: 1.5rem;
    color: #053b6d;
}

section h3 {
    color: #053b6d;
}

/* 左サイドバー */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background-color: #2f2d2b;
    color: white;
    padding: 20px 10px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

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

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    display: block;
    padding: 5px 10px;
    border-radius: 4px;
}

.sidebar a:hover {
    background-color: #575757;
}

/* コンテンツエリア */
.content {
    margin-left: 270px;
    padding: 20px;
}

/* サイドバー内のエクスパンダーのリンクスタイル */
.sidebar li a {
    padding: 5px 10px;
    font-weight: normal;
}

.sidebar li ul {
    list-style-type: none;
    padding-left: 20px;
}

.date {
    padding-right: 20px; /* 日付とコメントの間隔を10pxに */
}

/* 画像とキャプションを適切に配置 */
.image-item {
    text-align: center;
}

.image-item p {
    margin-top: 5px;
    font-size: 0.9rem;
    color: #555;
}

.profile {
    color: #ffffff; /* 文字色を白に */
    font-size: 16px;
    text-align: center;
    line-height: 1.5;
    font-family: Arial, sans-serif;
    margin-bottom: 20px;
}

.profile h3 {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

.profile p {
    font-size: 14px;
    margin: 2px 0;
}

/* セクション内の画像リンクのスタイル */
.portfolio a {
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

/* 画像リンクにカーソルを合わせた時のエフェクト */
.portfolio a:hover img {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.profile-pic {
    display: block;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: none;
}

/* プロフィール画像の注釈スタイル */
.sidebar .img-caption {
    display: block;      /* 画像の下に回り込ませる */
    font-size: 10px;     /* 最小限のサイズ */
    color: lightblue;
    margin-top: 4px;     /* 画像との微調整（お好みで） */
    margin-bottom: 8px;  /* 下の要素（名前など）との余白 */
    text-align: center;  /* 画像が中央寄せなら合わせる */
}

/* 実行結果画像のスタイル定義 */
.result-img {
    max-width: 100%;    /* 親要素からはみ出さない */
    height: auto;
    border: 1px solid #ccc; /* 薄いグレーの枠線 */
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1); /* 軽い影で浮かせる */
    margin-top: 10px;
}

/* Prism.jsの背景・枠線調整（HTMLから移動） */
pre[class*="language-"] {
    background: #f8f8f8 !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

@media screen and (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 10px;
    }

    .content {
        margin-left: 0;
        padding: 10px;
    }
}
