/* diary.css の一番上か最後に追加 */
body{
  background: #52B7B3; /* 他ページと同じ青緑 */
}

/* 日記ページだけコンテンツ幅を細くして左右余白を増やす */
.container{
  width: min(720px, 88vw);
}

/* タグバー */
.tag-bar{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 18px;
}

.tag-btn{
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  font-weight: 900;
  cursor: pointer;
}

.tag-btn[aria-pressed="true"]{
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.32);
}

.tag-btn:hover{
  filter: brightness(1.08);
}

/* 投稿全体 */
.post{
  background: transparent; /* カード感を消す */
  border: none;
  border-top: 1px solid rgba(255,255,255,0.25);
  padding: 22px 0 26px;
  margin: 0;
}

/* 最初の投稿だけ上線を消す */
.post:first-child{
  border-top: none;
}

/* 見出し＋日付 */
.post-head{
  margin-bottom: 8px;
}

.post-title{
  font-size: 17px;
  font-weight: 900;
  coloe: #ffff
}

.post-date{
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.5);
}

/* 本文 */
.post-body{
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.9;
}

/* 本文内の p の間隔を tegalog っぽく */
.post-body p{
  margin: 0 0 0.9em;
}

/* 日記本文内の画像制限 */
.post-body img{
  max-height: 40vh;       /* ← 日記は控えめ */
  max-width: 100%;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 12px auto;      /* 上下に少し余白、中央寄せ */
  border-radius: 8px;     /* 角を少しだけ丸める（好み） */
}

/* タグ（投稿の下） */
.post-tags{
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* タグ見た目 */
.post-tag button{
  all: unset;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 4px 10px;
}

.post-tag button:hover{
  background: rgba(255,255,255,0.12);
}

/* ===== 画像拡大モーダル ===== */

.img-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  z-index: 9999;
  cursor: zoom-out;
}

.img-modal.is-open{
  display: grid;
}

.img-modal img{
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

/* ===== 日記：複数画像グリッド ===== */

.img-grid{
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

/* 2枚 */
.img-grid:has(img:nth-child(2):last-child){
  grid-template-columns: repeat(2, 1fr);
}

/* 3枚：横3分割（空欄が出ない） */
.img-grid:has(img:nth-child(3):last-child){
  grid-template-columns: repeat(3, 1fr);
}

.img-grid:has(img:nth-child(3):last-child) img{
  max-height: 32vh;      /* 3枚横並びだと高さが出やすいので少し抑える */
  object-fit: cover;
}

/* 4枚 */
.img-grid:has(img:nth-child(4):last-child){
  grid-template-columns: repeat(2, 1fr);
}

/* 共通：画像サイズ制御 */
.img-grid img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
}