/* post-template.css */

/* * {
  outline: 1px solid red !important;
} */

/* 記事全体のコンテナ */
.post-container {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  width: 90%;
  margin-top: 7rem;
  margin-bottom: 2rem;
  padding: 0 3rem;
}

/* --- サイドバー（左側） --- */
.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 7rem;
  align-self: start;
  align-items: flex-start;
}

.sidebar-image {
  width: auto;
  height: 150px;
  border-radius: 8px;
}
.post-date {
  font-weight: bold;
  font-size: 30px;
}
.post-update-date {
  font-size: 14px; /* メインの日付よりかなり小さく */
  color: #555; /* 少し薄い色で控えめに */
}
.sidebar-sns a {
  margin-right: 0.5rem;
  text-decoration: underline;
}

/* --- 記事本体（右側） --- */
.post-main-content {
  width: 100%;
}
.post-main-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  margin-bottom: 2rem;
}
.post-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 2rem;
}

/* 外枠のある内容部分 */
.post-body {
  border: 2px solid #d7743b;
  border-radius: 8px;
  padding: 2rem;
  line-height: 1.8;
}

/* 記事本文の中にある画像のスタイル */
.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: 8px;
}

/* callout内の画像のはみ出しを修正する */
.post-body .callout-image {
  max-width: 100%;
  height: auto;
}

/* ブックマーク内の画像スタイルを上書きして、レイアウト崩れを防ぐ */
.post-body .link-bookmark .bookmark-preview img {
  margin: 0;
  border-radius: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-body p {
  margin-bottom: 1rem;
}

/* PCなど、画面幅が広いデバイスでの表示スタイル */
.x-post-container {
  /* twitter-tweetのdata-width="300"に合わせています */
  width: 170px; /* 固定幅 */
}

.youtube-post-container {
  padding-top: 56.25%;
  width: 100%;
  position: relative;
}

.youtube-post-container iframe {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0px;
  left: 0px;
}

/* --- スマホ表示の調整 --- */
@media (max-width: 768px) {
  .post-container {
    grid-template-columns: 1fr;
    width: 100%;
    padding: 0 1rem;
    margin-top: 5rem;
  }

  .post-sidebar {
    position: static;
    order: 2;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0 1rem;
    align-items: center;
  }

  .sidebar-image {
    grid-row: 1 / 4;
    width: 100%;
    max-width: 120px;
    height: auto;
  }
  .post-date {
    grid-column: 2;
    font-size: 25px;
  }
  .sidebar-sns {
    grid-column: 2;
  }

  .post-main-content {
    display: contents;
  }
  .post-main-image {
    order: 1;
    display: block;
    width: 90%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: auto;
    object-fit: initial;
  }

  .post-title {
    order: 3;
    font-size: 35px;
  }
  .post-body {
    order: 4;
  }
}
