/* ======================================
  【PC / SP 共通】  wysiwyg
========================================= */
.wysiwyg {
  --theme-color: #3e79b7;
  line-height: 1.6;
  word-wrap: break-word;
}

.wysiwyg > *:first-child {
  margin-top: 0;
}

.wysiwyg h1,
.wysiwyg h2,
.wysiwyg h3,
.wysiwyg h4,
.wysiwyg h5,
.wysiwyg h6 {
  font-weight: bold;
  color: #333;
  text-align: left;
}

.wysiwyg h1 {
  color: #fff;
  background-color: var(--theme-color);
}
.wysiwyg h2 {
  border-top: 1px solid var(--theme-color);
  border-bottom: 1px solid var(--theme-color);
}
.wysiwyg h3 {
  border-left: 6px solid var(--theme-color);
}
.wysiwyg h4 {
  border-bottom: 1px solid var(--theme-color);
}
.wysiwyg h5 {
  border-bottom: 1px dashed var(--theme-color);
}
.wysiwyg h6 {
  border: 1px dotted var(--theme-color);
  background-color: #fff;
}

.wysiwyg iframe {
  max-width: 100%;
}

.wysiwyg strong {
  font-weight: 700;
}

.wysiwyg em {
  font-style: italic;
}

.wysiwyg img {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
}

/* .wysiwyg figure img {
  margin-top: 24px;
} */

.wysiwyg figure figcaption,
.wysiwyg figure .wp-element-caption {
  text-align: left;
}

/* ======================================
  【PC】  wysiwyg
========================================= */
@media screen and (min-width: 768px), print {
  .wysiwyg {
    margin-bottom: 100px;
    font-size: 16px;
  }

  .wysiwyg h1 {
    margin: 80px 0 20px;
    padding: 12px 24px;
    font-size: 24px;
  }
  .wysiwyg h2 {
    margin: 80px 0 20px;
    padding: 12px;
    font-size: 22px;
  }
  .wysiwyg h3 {
    margin: 80px 0 20px;
    padding: 5px 20px;
    font-size: 20px;
  }
  .wysiwyg h4 {
    margin: 80px 0 20px;
    padding: 0 0 10px;
    font-size: 18px;
  }
  .wysiwyg h5 {
    margin: 80px 0 20px;
    padding: 0 0 10px;
    font-size: 18px;
  }
  .wysiwyg h6 {
    margin: 80px 0 20px;
    padding: 10px;
    font-size: 16px;
  }

  .wysiwyg p {
    min-width: 10px;
    min-height: 15px;
    margin-bottom: 1em;
  }

  .wysiwyg ul,
  .wysiwyg ol {
    margin: 5px 0 20px 3em;
    font-size: 16px;
  }
  .wysiwyg ul {
    list-style-type: disc;
  }
  .wysiwyg ol {
    list-style-type: decimal;
  }
  .wysiwyg ul li,
  .wysiwyg ol li {
    margin-bottom: 8px;
  }
  .wysiwyg li ul,
  .wysiwyg li ol {
    margin-top: 8px;
    margin-bottom: 8px;
  }

  .wysiwyg blockquote,
  .wysiwyg .wp-block-quote {
    width: min(95%, 1000px);
    margin: 0 auto 30px;
    padding: 24px 30px;
    background: #f5f5f5;
    border-left: 4px solid var(--theme-color);
  }
  .wysiwyg blockquote p,
  .wysiwyg .wp-block-quote p {
    margin-bottom: 1em;
    padding-inline: 0;
  }
  .wysiwyg blockquote p:last-of-type,
  .wysiwyg .wp-block-quote p:last-of-type {
    margin-bottom: 0;
  }
  .wysiwyg blockquote cite,
  .wysiwyg .wp-block-quote cite {
    display: block;
    margin-top: 16px;
    padding-inline: 0;
    font-size: 14px;
    font-style: normal;
    color: #333;
  }

  .wysiwyg table {
    margin-bottom: 40px;
    table-layout: fixed;
  }

  .wysiwyg table th,
  .wysiwyg table td {
    margin: 10px 5px;
    padding: 10px;
    border: 1px solid #999;
    font-size: 16px;
  }

  .wysiwyg iframe:not(.wp-embedded-content) {
    display: block;
    width: 800px !important;
    height: 500px !important;
    margin: 0 auto 40px;
  }

  .wysiwyg iframe[src*="youtube.com"] {
    width: min(88%, 760px);
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0 auto 40px;
    display: block;
  }

  .wysiwyg iframe[src*="google.com/maps"] {
    width: 100%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 4 / 3;
    margin: 0 auto 40px;
    display: block;
  }

  .wysiwyg figure {
    margin: 0 auto 20px;
    text-align: center;
  }

  .wysiwyg .is-layout-flex {
    margin-bottom: 40px;
  }

  .wysiwyg hr.wp-block-separator.has-alpha-channel-opacity {
    margin: 40px 0;
  }

  .wysiwyg .wp-embedded-content[src*="/embed/"] {
    display: block;
    width: 88% !important;
    min-width: 600px;
    margin: 3rem auto 4rem;
  }
}

@media screen and (min-width: 768px) and (max-width: 1100px) {
  .wysiwyg .wp-embedded-content[src*="/embed/"] {
    width: 100% !important;
    max-width: 100%;
    margin: 3rem auto 4rem;
  }
}

/* ======================================
      【SP】  wysiwyg
========================================= */
@media screen and (max-width: 767px) {
  .wysiwyg {
    margin-bottom: 15vw;
    font-size: 3.6vw;
  }

  .wysiwyg h1 {
    margin: 12vw 0 4.2vw;
    padding: 3vw;
    font-size: 4.2vw;
  }
  .wysiwyg h2 {
    margin: 12vw 0 4.2vw;
    padding: 3vw;
    font-size: 4.2vw;
  }
  .wysiwyg h3 {
    margin: 12vw 0 4.2vw;
    padding: 1vw 2vw;
    font-size: 4.2vw;
  }
  .wysiwyg h4 {
    margin: 12vw 0 4.2vw;
    padding: 0 0 3vw;
    font-size: 4vw;
  }
  .wysiwyg h5 {
    margin: 12vw 0 4.2vw;
    padding: 0 0 3vw;
    font-size: 3.6vw;
  }
  .wysiwyg h6 {
    margin: 12vw 0 4.2vw;
    padding: 3vw;
    font-size: 3.6vw;
  }

  .wysiwyg p {
    min-width: 3vw;
    min-height: 3vw;
    margin-bottom: 1em;
    /* padding-inline: 1em; */
  }

  .wysiwyg ul,
  .wysiwyg ol {
    margin: 0.2vw 0 4.2vw 8vw;
    font-size: 3.6vw;
  }
  .wysiwyg ul {
    list-style-type: disc;
  }
  .wysiwyg ol {
    list-style-type: decimal;
  }
  .wysiwyg ul li,
  .wysiwyg ol li {
    margin-bottom: 0.8vw;
  }
  .wysiwyg li ul,
  .wysiwyg li ol {
    margin-top: 0.8vw;
    margin-bottom: 0.8vw;
  }

  .wysiwyg blockquote,
  .wysiwyg .wp-block-quote {
    margin: 0 auto 5vw;
    padding: 4vw;
    background: #f5f5f5;
    border-left: 0.4vw solid var(--theme-color);
  }
  .wysiwyg blockquote p,
  .wysiwyg .wp-block-quote p {
    margin-bottom: 1em;
    padding-inline: 0;
  }
  .wysiwyg blockquote p:last-of-type,
  .wysiwyg .wp-block-quote p:last-of-type {
    margin-bottom: 0;
  }
  .wysiwyg blockquote cite,
  .wysiwyg .wp-block-quote cite {
    display: block;
    margin-top: 3vw;
    padding-inline: 0;
    font-size: 3.2vw;
    font-style: normal;
    color: #333;
  }

  .wysiwyg table {
    width: 100% !important;
    /* table-layout: fixed; */
  }

  .wysiwyg table th,
  .wysiwyg table td {
    margin: 0.2vw 0 4.2vw 8vw;
    padding: 3vw;
    border: 0.2vw solid #999;
    font-size: 3.6vw;
  }

  .wysiwyg iframe:not(.wp-embedded-content) {
    width: 100% !important;
    height: 50vw !important;
    margin-bottom: 4vw !important;
  }

  .wysiwyg iframe[src*="youtube.com"] {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin-bottom: 4vw;
    display: block;
  }

  .wysiwyg iframe[src*="google.com/maps"] {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    margin-bottom: 4vw;
    display: block;
  }

  .wysiwyg figure {
    margin: 0 auto 4vw;
    text-align: center;
  }

  .wysiwyg .is-layout-flex {
    margin-bottom: 9.7vw;
  }

  .wysiwyg figure img {
    max-height: 111vw;
  }

  .wysiwyg hr.wp-block-separator.has-alpha-channel-opacity {
    margin: 6vw 0 7vw;
  }

  .wysiwyg .wp-block-table {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.2vw;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .wysiwyg .wp-block-table .has-fixed-layout {
    margin-bottom: 10vw;
    table-layout: auto !important;
  }

  .wysiwyg .wp-embedded-content[src*="/embed/"] {
    display: block;
    width: 100% !important;
    max-width: 100%;
    margin: 0;
  }
}

/*   ギャラリー（WYSIWYG）
-------------------------------------*/
.wysiwyg .gallery-list {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
}

.wysiwyg .wp-block-gallery {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1em !important;
  width: 100%;
}

.wysiwyg .wp-block-gallery .wp-block-image {
  display: flex !important;
  flex-direction: column;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.wysiwyg .wp-block-gallery .wp-block-image a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.wysiwyg .wp-block-gallery .wp-block-image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: center center !important;
}

.wysiwyg .wp-block-gallery .wp-element-caption,
.wysiwyg .wp-block-gallery figcaption {
  min-height: 3.2em;
  margin-top: 0.5em;
  line-height: 1.6;
}

@media screen and (max-width: 781px) {
  .wysiwyg .wp-block-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 2カラム画像 (wysiwig)
-------------------------------------*/
.wysiwyg .wp-block-columns .wp-block-column .wp-block-image {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

.wysiwyg .wp-block-columns .wp-block-column .wp-block-image > figure,
.wysiwyg .wp-block-columns .wp-block-column figure.wp-block-image {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
}

.wysiwyg .wp-block-columns .wp-block-column .wp-block-image > figure > img,
.wysiwyg .wp-block-columns .wp-block-column figure.wp-block-image > img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
}

.wysiwyg
  .wp-block-columns
  .wp-block-column
  .wp-block-image
  > figure
  > .wp-element-caption,
.wysiwyg
  .wp-block-columns
  .wp-block-column
  .wp-block-image
  > figure
  > figcaption,
.wysiwyg
  .wp-block-columns
  .wp-block-column
  figure.wp-block-image
  > .wp-element-caption,
.wysiwyg .wp-block-columns .wp-block-column figure.wp-block-image > figcaption {
  min-height: 0;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 0.5em;
  line-height: 1.6;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed;
  word-break: normal;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: left;
}

.wysiwyg .wp-block-columns .wp-block-column figure.wp-block-image > figcaption:empty,
.wysiwyg
  .wp-block-columns
  .wp-block-column
  figure.wp-block-image
  > .wp-element-caption:empty,
.wysiwyg
  .wp-block-columns
  .wp-block-column
  .wp-block-image
  > figure
  > figcaption:empty,
.wysiwyg
  .wp-block-columns
  .wp-block-column
  .wp-block-image
  > figure
  > .wp-element-caption:empty {
  display: none;
}
