/*___________________________
お知らせ本文（ブロックエディタ出力）
フロント（.post-content）と管理画面のブロックエディタ（.editor-styles-wrapper .is-root-container）で共通
___________________________*/

/* 余白：ブロック間は64px、見出し直後とテキスト同士は詰める */
:is(.post-content, .editor-styles-wrapper .is-root-container) > * {
  margin-block: 0;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) > * + * {
  margin-top: 4rem;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) > h2 + * {
  margin-top: 2.5rem;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) > :is(h3, h4) + *,
:is(.post-content, .editor-styles-wrapper .is-root-container) > :is(p, ul, ol) + :is(p, ul, ol) {
  margin-top: 1.5rem;
}

/* テキスト */
:is(.post-content, .editor-styles-wrapper .is-root-container) :is(p, li) {
  color: var(--colorTextMain);
  font-family: var(--familyNotoSans);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.8;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) a {
  color: var(--colorGreen);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (any-hover: hover) {
  :is(.post-content, .editor-styles-wrapper .is-root-container) a:hover {
    text-decoration: none;
  }
}

:is(.post-content, .editor-styles-wrapper .is-root-container) strong {
  font-weight: 700;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) em {
  font-style: italic;
}

/* 見出し */
:is(.post-content, .editor-styles-wrapper .is-root-container) :is(h2, h3, h4) {
  font-family: var(--familyNotoSans);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) h2 {
  color: var(--colorGreen);
  font-size: 1.75rem;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) h3 {
  color: var(--colorTextMain);
  font-size: 1.5rem;
  padding-left: 1.625rem;
  position: relative;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) h3::before {
  content: "";
  background-color: var(--colorGreen);
  border-radius: 50%;
  position: absolute;
  top: calc(0.7em - 0.3125rem);
  left: 0;
  height: 0.625rem;
  width: 0.625rem;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) h4 {
  color: var(--colorTextMain);
  font-size: 1.125rem;
}

/* リスト */
:is(.post-content, .editor-styles-wrapper .is-root-container) :is(ul, ol) {
  list-style: none;
  padding-left: 0;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) li {
  padding-left: 1.5rem;
  position: relative;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) li + li,
:is(.post-content, .editor-styles-wrapper .is-root-container) li > :is(ul, ol) {
  margin-top: 0.5rem;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) ul > li::before {
  content: "";
  background-color: var(--colorGreen);
  border-radius: 50%;
  position: absolute;
  top: calc(0.9em - 0.1875rem);
  left: 0.25rem;
  height: 0.375rem;
  width: 0.375rem;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) ol > li::before {
  content: counter(list-item) ".";
  position: absolute;
  top: 0;
  right: calc(100% - 0.875rem);
  text-align: right;
  white-space: nowrap;
}

/* 画像 */
:is(.post-content, .editor-styles-wrapper .is-root-container) .wp-block-image img {
  border-radius: 1rem;
  height: auto;
  max-width: 100%;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) .wp-block-image:not(.alignleft, .alignright, .aligncenter, .is-resized) img {
  width: 100%;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) figcaption {
  color: var(--colorCaption);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  line-height: 1.8;
  margin-top: 0.5rem;
}

/* 画像とテキストの横並び（メディアとテキスト） */
:is(.post-content, .editor-styles-wrapper .is-root-container) .wp-block-media-text {
  align-items: start;
  column-gap: 3rem;
  grid-template-columns: 1fr 1fr;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) .wp-block-media-text .wp-block-media-text__content {
  padding: 0;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) .wp-block-media-text .wp-block-media-text__content > * + * {
  margin-top: 1.5rem;
}

:is(.post-content, .editor-styles-wrapper .is-root-container) .wp-block-media-text__media img {
  border-radius: 1rem;
}

@media screen and (max-width: 767px) {
  :is(.post-content, .editor-styles-wrapper .is-root-container) > * + * {
    margin-top: 3rem;
  }

  :is(.post-content, .editor-styles-wrapper .is-root-container) > h2 + * {
    margin-top: 2rem;
  }

  :is(.post-content, .editor-styles-wrapper .is-root-container) :is(p, li) {
    font-size: 0.9375rem;
  }

  :is(.post-content, .editor-styles-wrapper .is-root-container) h2 {
    font-size: 1.375rem;
  }

  :is(.post-content, .editor-styles-wrapper .is-root-container) h3 {
    font-size: 1.25rem;
    padding-left: 1.375rem;
  }

  :is(.post-content, .editor-styles-wrapper .is-root-container) h4 {
    font-size: 1.0625rem;
  }

  :is(.post-content, .editor-styles-wrapper .is-root-container) .wp-block-media-text {
    grid-template-columns: 100%;
    row-gap: 1.5rem;
  }

  :is(.post-content, .editor-styles-wrapper .is-root-container) .wp-block-media-text > * {
    grid-column: 1;
    grid-row: auto;
  }
}

/*___________________________
管理画面のブロックエディタのみ
___________________________*/
.editor-styles-wrapper {
  color: var(--colorTextMain);
  font-family: var(--familyNotoSans);
}

.editor-styles-wrapper .is-root-container,
.editor-styles-wrapper .editor-post-title,
.editor-styles-wrapper .wp-block-post-title {
  margin-inline: auto;
  max-width: 67.5rem;
}

.editor-styles-wrapper .is-root-container > .wp-block {
  max-width: none;
}

.editor-styles-wrapper :is(.editor-post-title, .wp-block-post-title) {
  color: var(--colorTextMain);
  font-family: var(--familyNotoSans);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  margin-bottom: 4rem;
}
