/*
===========================================
WordPress ブロックエディタ用 投稿ページCSS
===========================================
*/

/* ========================================
   基本設定
======================================== */
.post-content {
  margin: 0 auto;
  padding: 2rem 1rem;
  line-height: 1.8;
  color: #333;
}
.container-fluid {
    background: #eee;
    padding-bottom: 80px;
}
.page-inner {
 background-color: #fff;
 padding-bottom: 80px;
}
/* ========================================
   見出し
======================================== */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.4;
  font-weight: 700;
  color: #222;
}

.post-content h1 {
  font-size: 3rem;
  border-bottom: 3px solid #333;
  padding-bottom: 0.5rem;
}

.post-content h2 {
    font-size: 2.5rem;
    padding-left: 0.75rem;
    border-bottom: solid;
    background-color: #51c4a0;
    color: #fff;
}

.post-content h3 {
  font-size: 2rem;
  border-bottom: 2px solid #51c4a0;
  border-left: solid 5px #51c4a0;
  padding-bottom: 0.3rem;
}

.post-content h4 {
  font-size: 2rem;
}

.post-content h5 {
  font-size: 2rem;
}

.post-content h6 {
  font-size: 2rem;
}

/* ========================================
   段落
======================================== */
.post-content p {
  margin-bottom: 1.5em;
}

/* ========================================
   リスト
======================================== */
.post-content ul,
.post-content ol {
  margin: 1.5em 0;
  padding-left: 2em;
}

.post-content ul li,
.post-content ol li {
  margin-bottom: 0.5em;
  line-height: 1.8;
}

.post-content ul {
  list-style-type: disc;
}

.post-content ol {
  list-style-type: decimal;
}

/* ========================================
   引用
======================================== */
.post-content blockquote,
.wp-block-quote {
  margin: 2em 0;
  padding: 1.5em 1.5em 1.5em 2em;
  border-left: 5px solid #4a90e2;
  background: #f8f9fa;
  font-style: italic;
  color: #555;
}

.wp-block-quote cite {
  display: block;
  margin-top: 1em;
  font-size: 0.9em;
  font-style: normal;
  color: #777;
}

/* ========================================
   画像
======================================== */
.img-fluid {
    margin: 0 auto;
}
.wp-post-image {
    margin: 0 auto;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
    margin: 0 auto;
}

.wp-block-image {
  margin: 2em 0;
  text-align: center;
}

.wp-block-image figcaption {
  margin-top: 0.5em;
  font-size: 0.9em;
  color: #666;
  text-align: center;
}

/* 画像の配置 */
.wp-block-image.alignleft {
  float: left;
  margin: 0.5em 2em 1em 0;
}

.wp-block-image.alignright {
  float: right;
  margin: 0.5em 0 1em 2em;
}

.wp-block-image.aligncenter {
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   ギャラリー
======================================== */
.wp-block-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2em 0;
}

.wp-block-gallery .wp-block-image {
  flex: 1 1 calc(33.333% - 1rem);
  margin: 0;
}

/* ========================================
   テーブル
======================================== */
.post-content table,
.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
  display: block;
}

.post-content table th,
.post-content table td {
  padding: 0.75em 1em;
  border: 1px solid #ddd;
  text-align: left;
}

.post-content table th {
  background: #f5f5f5;
  font-weight: 700;
  color: #333;
}

.post-content table tr:nth-child(even) {
  background: #fafafa;
}

/* ========================================
   コード
======================================== */
.post-content code {
  padding: 0.2em 0.4em;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  color: #c7254e;
}

.post-content pre {
  margin: 2em 0;
  padding: 1.5em;
  background: #282c34;
  border-radius: 4px;
  overflow-x: auto;
  color: #abb2bf;
  line-height: 1.6;
}

.post-content pre code {
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 0.95em;
}

.wp-block-code {
  margin: 2em 0;
}

/* ========================================
   ボタン
======================================== */
.wp-block-button {
  margin: 1.5em 0;
}

.wp-block-button__link {
  display: inline-block;
  padding: 0.75em 2em;
  background: #4a90e2;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  transition: background 0.3s ease;
}

.wp-block-button__link:hover {
  background: #357abd;
}

/* ========================================
   カラム
======================================== */
.wp-block-columns {
  display: flex;
  gap: 2rem;
  margin: 2em 0;
}

.wp-block-column {
  flex: 1;
}

/* ========================================
   埋め込みコンテンツ
======================================== */
.wp-block-embed,
.wp-block-embed__wrapper {
  margin: 2em 0;
}

.wp-block-embed iframe {
  max-width: 100%;
}

/* YouTube, Vimeoなどのレスポンシブ対応 */
.wp-block-embed-youtube,
.wp-block-embed-vimeo {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.wp-block-embed-youtube iframe,
.wp-block-embed-vimeo iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ========================================
   区切り線
======================================== */
.post-content hr,
.wp-block-separator {
  margin: 3em auto;
  border: none;
  border-top: 2px solid #e0e0e0;
  max-width: 100px;
}

/* ========================================
   カバー
======================================== */
.wp-block-cover {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2em 0;
  background-size: cover;
  background-position: center;
}

.wp-block-cover__inner-container {
  padding: 2em;
  color: #fff;
  text-align: center;
}

/* ========================================
   リンク
======================================== */
.post-content a {
  color: #4a90e2;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.post-content a:hover {
  color: #357abd;
}

/* ========================================
   その他のブロック
======================================== */
.wp-block-pullquote {
  margin: 2em 0;
  padding: 2em;
  border-top: 4px solid #333;
  border-bottom: 4px solid #333;
  text-align: center;
  font-size: 1.25em;
}

.wp-block-verse {
  font-family: monospace;
  white-space: pre-wrap;
  padding: 1em;
  background: #f5f5f5;
  margin: 2em 0;
}

/* ========================================
   レスポンシブ対応
======================================== */

/* タブレット */
@media screen and (max-width: 768px) {
  .post-content {
    padding: 1.5rem 1rem;
  }



  .wp-block-columns {
    flex-direction: column;
    gap: 1rem;
  }

  .wp-block-image.alignleft,
  .wp-block-image.alignright {
    float: none;
    margin: 1em auto;
    display: block;
  }

  .wp-block-gallery .wp-block-image {
    flex: 1 1 calc(50% - 0.5rem);
  }

  .post-content table,
  .wp-block-table table {
    font-size: 0.9em;
  }
}

/* スマートフォン */
@media screen and (max-width: 480px) {
  .post-content {
    padding: 1rem 0.75rem;
  }

 

  .post-content ul,
  .post-content ol {
    padding-left: 1.5em;
  }

  .post-content blockquote,
  .wp-block-quote {
    padding: 1em 1em 1em 1.5em;
    margin: 1.5em 0;
  }

  .wp-block-gallery .wp-block-image {
    flex: 1 1 100%;
  }

  /* テーブルを縦積みレイアウトに */
  .post-content table,
  .wp-block-table table {
    display: block;
    font-size: 0.9em;
  }

  .post-content table thead {
    display: none;
  }

  .post-content table tbody,
  .post-content table tr,
  .post-content table td {
    display: block;
    width: 100%;
  }

  .post-content table tr {
    margin-bottom: 1.5em;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5em;
    background: #fff;
  }

  .post-content table td {
    text-align: left;
    padding: 0.75em 0.5em;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
  }

  .post-content table td:last-child {
    border-bottom: none;
  }

  .post-content table td:before {
    content: attr(data-label);
    position: absolute;
    left: 0.5em;
    width: 35%;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .wp-block-button__link {
    padding: 0.6em 1.5em;
    font-size: 0.95em;
  }

  .wp-block-cover {
    min-height: 300px;
  }
}

/* ========================================
   印刷用スタイル
======================================== */
@media print {
  .post-content {
    max-width: 100%;
    padding: 0;
  }

  .post-content a {
    text-decoration: none;
    color: #000;
  }

  .wp-block-button__link {
    background: #fff;
    color: #000;
    border: 1px solid #000;
  }
}
