/* ========================================
   Gutenberg Editor & Front-end Style
   M PLUS Rounded 1c ベース
   ======================================== */

/* ----------------------------------------
   1. 本文（段落）
   ---------------------------------------- */
.entry-content,
.editor-styles-wrapper {
  font-family: Meiryo, 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 160%;
  letter-spacing: -0.74px;
  color: #333;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 段落間マージン */
.entry-content p,
.editor-styles-wrapper p {
  margin-top: 0;
  margin-bottom: 1.6em;
}

/* ----------------------------------------
   2. 見出し（h2〜h4）— h1はテーマ側で設定済み
   ---------------------------------------- */
.entry-content h2,
.editor-styles-wrapper h2 {
  font-family: Meiryo, 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 38px;
  letter-spacing: -0.74px;
  margin-top: 2.4em;
  margin-bottom: 0.8em;
  color: var(--color-primary);
}

.entry-content h3,
.editor-styles-wrapper h3 {
  font-family: Meiryo, 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 34px;
  letter-spacing: -0.74px;
  margin-top: 2em;
  margin-bottom: 0.6em;
  color: var(--color-primary);
}

.entry-content h4,
.editor-styles-wrapper h4 {
  font-family: Meiryo, 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 32px;
  letter-spacing: -0.74px;
  margin-top: 1.6em;
  margin-bottom: 0.4em;
  color: var(--color-primary);
}

.entry-content p,
.editor-styles-wrapper p {
  font-family: Meiryo, 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 160%;
  letter-spacing: -0.74px;
  color: var(--color-black);
}

.entry-content em,
.editor-styles-wrapper em {
  font-style: italic;
}

/* ----------------------------------------
   3. リンク
   ---------------------------------------- */
.entry-content a,
.editor-styles-wrapper a {
  font-family: Meiryo, 'M PLUS Rounded 1c', sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 160%;
  letter-spacing: -0.74px;
  color: var(--color-red);
  text-decoration: underline;
  text-underline-offset: 3px;
  position: relative;
  display: inline-block;
  padding-right: 24px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.entry-content a:after,
.editor-styles-wrapper a:after {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background-image: url('../images/new-window.svg');
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  right: 0;
  top: 7px;
  pointer-events: none;
}

.entry-content a:hover,
.editor-styles-wrapper a:hover {
  color: var(--color-red);
}

.entry-content a:visited {
  color: var(--color-red);
}

/* ----------------------------------------
   4. リスト（ul / ol）
   ---------------------------------------- */
.entry-content ul,
.entry-content ol,
.editor-styles-wrapper ul,
.editor-styles-wrapper ol {
  margin-top: 0;
  margin-bottom: 1.6em;
  padding-left: 1.8em;
}

.entry-content li,
.editor-styles-wrapper li {
  line-height: 160%;
}

/* ネストリスト */
.entry-content li > ul,
.entry-content li > ol,
.editor-styles-wrapper li > ul,
.editor-styles-wrapper li > ol {
  margin-bottom: 0;
}

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

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

/* ----------------------------------------
   5. 引用（blockquote）
   ---------------------------------------- */
.entry-content blockquote,
.editor-styles-wrapper .wp-block-quote {
  margin: 1.6em 0;
  padding: 1.2em 1.6em;
  border-left: 4px solid #ccc;
  background: #f9f9f9;
  font-style: normal;
  color: #555;
}

.entry-content blockquote p:last-child,
.editor-styles-wrapper .wp-block-quote p:last-child {
  margin-bottom: 0;
}

.entry-content blockquote cite,
.editor-styles-wrapper .wp-block-quote cite {
  display: block;
  margin-top: 0.8em;
  font-size: 0.85em;
  color: #888;
}

/* ----------------------------------------
   6. コードブロック / インラインコード
   ---------------------------------------- */
.entry-content code,
.editor-styles-wrapper code {
  font-family: Meiryo, 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.88em;
  background: #f4f4f4;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: #d63384;
}

.entry-content pre,
.editor-styles-wrapper .wp-block-code {
  margin: 1.6em 0;
  padding: 1.2em 1.4em;
  background: #2d2d2d;
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.entry-content pre code,
.editor-styles-wrapper .wp-block-code code {
  background: none;
  color: #f8f8f2;
  padding: 0;
  font-size: 0.85em;
  line-height: 1.7;
}

/* ----------------------------------------
   7. 画像・メディア
   ---------------------------------------- */
.entry-content img,
.editor-styles-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

.wp-block-image img {
  border-radius: 16px;
}

.wp-block-image.is-style-rounded img {
  border-radius: 9999px !important;
}

.wp-block-image.is-style-no-radius img {
  border-radius: 0 !important;
}

.entry-content figure,
.editor-styles-wrapper figure {
  margin: 1.6em 0;
}

.entry-content figcaption,
.editor-styles-wrapper figcaption {
  font-size: 0.8em;
  color: #888;
  text-align: center;
  margin-top: 0.5em;
}

/* 画像回り込み（左寄せ / 右寄せ） */
.entry-content .alignleft,
.editor-styles-wrapper .wp-block-image.is-style-default.alignleft,
.editor-styles-wrapper [data-align="left"] {
  float: left;
  margin: 0.4em 1.6em 1em 0;
  max-width: 50%;
}

.entry-content .alignright,
.editor-styles-wrapper .wp-block-image.is-style-default.alignright,
.editor-styles-wrapper [data-align="right"] {
  float: right;
  margin: 0.4em 0 1em 1.6em;
  max-width: 50%;
}

.entry-content .aligncenter,
.editor-styles-wrapper .wp-block-image.is-style-default.aligncenter,
.editor-styles-wrapper [data-align="center"] {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* 回り込み解除 — 見出し・区切り線で自動クリア */
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content hr {
  clear: both;
}

/* ----------------------------------------
   8. テーブル
   ---------------------------------------- */
.entry-content table,
.editor-styles-wrapper .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.92em;
}

.entry-content th,
.entry-content td,
.editor-styles-wrapper .wp-block-table th,
.editor-styles-wrapper .wp-block-table td {
  padding: 0.7em 1em;
  border: 1px solid #ddd;
  text-align: left;
}

.entry-content th,
.editor-styles-wrapper .wp-block-table th {
  background: #f5f5f5;
  font-weight: 700;
}

.entry-content tbody tr:hover {
  background: #fafafa;
}

/* ----------------------------------------
   9. 区切り線
   ---------------------------------------- */
.entry-content hr,
.editor-styles-wrapper .wp-block-separator {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 2.4em 0;
}

