/* --- 全体のスタイル --- */
body {
    background-color: #f0f0f0; /* 背景を薄いグレーに */
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0;
    padding: 20px;
    color: #333;
}

/* --- コンテンツを中央に寄せるためのコンテナ --- */
.container {
    max-width: 900px; /* 最大幅を指定 */
    margin: 0 auto;   /* 中央揃え */
}

/* --- てがろぐ全体のタイトル --- */
.main-title {
    text-align: center;
    font-size: 2.5em;
    color: #444;
    margin-bottom: 40px;
}

/* --- 日記一つ分のカード --- */
.post-card {
    background-color: #ffffff;
    border-radius: 8px; /* 角を丸くする */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); /* 影をつけて立体感を出す */
    overflow: hidden; /* 画像の角丸を反映させるため */
    margin-bottom: 30px;
}

/* --- カードのヘッダー（タイトル） --- */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 10px 25px;
}

.post-title {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0;
}

/* --- 投稿日 --- */
.post-date {
    font-size: 0.9em;
    color: #888;
    padding: 0 25px;
    text-align: right; /* ★ この行を追加 */
}

/* --- 本文 --- */
.post-content {
    padding: 20px 25px;
    line-height: 1.7;
}

/* --- 本文内の画像を調整（最終確定版 v2） --- */

/* (A) まず、すべての画像リンクに、PCでの最大幅と中央揃えを設定 */
.post-content a.imagelink {
    display: block;
    margin: 1.5em auto;
    max-width: 450px; /* PCでの最大幅をここで決める */
    text-align: center;
}

/* (A)の続き。中の画像は、親の枠に合わせて伸縮し、高さ制限も持つ */
.post-content a.imagelink img {
    max-width: 100%;   /* 親の枠(↑)より大きくならないようにする（スマホ対応） */
    max-height: 500px; /* 縦長の画像は、この高さが最大 */
    width: auto;
    height: auto;
    aspect-ratio: auto;
}

/* (B) 次に、1枚目の画像リンクだけを「大きいサイズ」の箱に上書き */
.post-content a.imagelink:first-of-type {
    width: calc(100% + 50px);
    margin-left: -25px;
    max-width: none;
    max-height: none;
    margin-top: 1em;
    margin-bottom: 1em;
}

/* (C) 最後に、1枚目の画像自体も「大きいサイズ」になるよう上書き（最重要！） */
.post-content a.imagelink:first-of-type img {
    max-width: none;
    max-height: none;
    width: 100%;
}

/* --- 本文内のリンクのスタイル --- */
.post-content a {
    color: #c5a4c5;
    font-weight: bold;
    text-decoration: underline;
}

.post-content a:hover {
    color: #5c485c;
}

/* --- ページナビゲーション（HOMEに戻るボタンなど） --- */
.navigation {
    text-align: center;
    margin-top: 40px;
}

.navigation a {
    display: inline-block;
    padding: 12px 40px;
    font-weight: bold;
    color: #555;
    text-decoration: none;
    border: 2px solid #ccc;
    border-radius: 50px;
    transition: all 0.3s;
    margin: 0 5px;
}

.navigation a:hover {
    background-color: #555;
    color: #fff;
    border-color: #555;
}

/* --- スマホ表示用の調整 --- */
@media only screen and (max-width: 767px) {
  body {
    padding: 10px;
  }
  .post-header,
  .post-date,
  .post-content {
    padding-left: 15px;
    padding-right: 15px;
  }
  .post-content {
    font-size: 15px;
  }
}



/* --- 「Powered by」表記のスタイル --- */
.poweredby {
    text-align: center; /* 文字を中央揃えにする */
    font-size: 0.8em;   /* 文字サイズを少し調整 */
    color: #888;       /* 文字色を少し薄くする */
    margin-top: 20px;   /* 上の管理ボタンとの間隔を空ける */
    width: 100%;        /* 親要素の幅いっぱいに広げて中央揃えを確実にする */
}

/* --- 「Powered by」のリンク色を調整 --- */
.poweredby a,
.poweredby a:visited {
    color: #c5a4c5; /* リンクの文字色を薄いピンクに */
    text-decoration: underline; /* 下線を維持 */
}

/* --- 「Powered by」のリンクにマウスカーソルを合わせたときの色 --- */
.poweredby a:hover {
    color: #5c485c; /* 少し濃い色に変化させる */
}


.navigation > div:last-child {
    margin-top: 10px; /* 上の行との間隔を10px空ける */
}

/* --- 「New!」マークのスタイル --- */
.new-mark {
    color: #e54747;
    font-weight: bold;
    font-size: 0.9em;
    margin-left: 8px;
    display: inline-block; /* 改行されずに横に並ぶようにする */
}

/* --- サブタイトルのスタイル --- */
.sub-title {
    text-align: center; /* 文字を中央に配置 */
    font-size: 1.1em;   /* 文字サイズを指定 */
    color: #777;       /* 文字色を少し薄いグレーに */
    margin-top: -30px;  /* 上のメインタイトルとの間隔を詰める */
    margin-bottom: 40px;/* 下のコンテンツとの間隔を空ける */
}




/* 「続きを読む」の中にある画像のサイズを正しく設定する */
.post-content .readmorearea a.imagelink {
  width: auto;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

.post-content .readmorearea a.imagelink img {
  width: auto;
  max-width: 100%;
}


/* YouTube動画がはみ出さないように調整 */
.post-content iframe {
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}