/* =========================================================
   HQ Background: Layout
   key: single-2col-basic-01
   name: 個別投稿ページ｜2カラム＋関連記事
   group: partial
   type: layout
   layer: single
   value:
   selector:
   ========================================================= */

/* =========================================================
   Single Layout（2col 70:30）
   ========================================================= */

.l-content {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(260px, 3fr);
  gap: 48px;
  align-items: start;
}

.l-main {
  min-width: 0;
}

.l-sidebar {
  min-width: 0;
}

.p-post {
  min-width: 0;
}

.p-post-header {
  margin-bottom: 32px;
}

.p-post-title {
  margin: 0;
  line-height: 1.4;
}

.p-post-categories,
.p-post-date {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.p-post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.p-post-thumbnail {
  margin-bottom: 32px;
}

.p-post-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
}

.p-post-content {
  min-width: 0;
}

.p-post-content > *:first-child {
  margin-top: 0;
}

.p-post-content > *:last-child {
  margin-bottom: 0;
}

.p-post-content img {
  max-width: 100%;
  height: auto;
}

.p-post-content iframe {
  width: 100%;
  max-width: 100%;
}

.p-post-content table {
  width: 100%;
  border-collapse: collapse;
}

.p-post-content ul,
.p-post-content ol {
  padding-left: 1.5em;
}

.p-post-content blockquote {
  margin-left: 0;
  margin-right: 0;
}

.p-post-nav {
  clear: both;
}

/* =========================================================
   Mode / Image State（Common最小）
   ========================================================= */

/* 展示モード：画像と本文を別幅で中央寄せ */
.p-post.is-exhibit .p-post-thumbnail {
  width: min(70%, 640px);
  margin-left: auto;
  margin-right: auto;
  float: none;
}

.p-post.is-exhibit .p-post-content {
  width: min(80%, 720px);
  margin-left: auto;
  margin-right: auto;
}

.p-post.is-exhibit .p-post-thumbnail img,
.p-post.is-exhibit .p-post-content img {
  display: block;
  width: 100%;
  height: auto;
}

/* 縦長記事モード（PC） */
@media (min-width: 961px) {
  .p-post.is-article.is-portrait .p-post-thumbnail {
    float: left;
    width: min(38%, 360px);
    margin: 0 32px 24px 0;
  }

  .p-post.is-article.is-portrait .p-post-header {
    margin-bottom: 24px;
  }

  .p-post.is-article.is-portrait .p-post-content {
    min-width: 0;
    padding-top: 0;
  }

  .p-post.is-article.is-portrait .p-post-content > *:first-child {
    margin-top: 0;
  }
}

/* 横・正方形は通常の縦積み */
.p-post.is-article.is-landscape .p-post-thumbnail,
.p-post.is-article.is-square .p-post-thumbnail {
  float: none;
  width: auto;
}

/* 展示モードは float解除のみ（幅は上で制御） */
.p-post.is-exhibit .p-post-thumbnail {
  float: none;
}

/* 画像なし */
.p-post.is-noimage .p-post-thumbnail {
  display: none;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 960px) {
  .l-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .p-post.is-article.is-portrait .p-post-thumbnail {
    float: none;
    width: auto;
    margin: 0 0 32px;
  }
}
