/*
 * Gutenberg article styles.
 *
 * Front-end rules are scoped to .news-entry__body. Editor-only rules are
 * scoped to .editor-styles-wrapper, and this file is enqueued only for news.
 */

.news-entry__body,
.editor-styles-wrapper {
  --stepup-news-coral: #ec707f;
  --stepup-news-text: #000;
  --stepup-news-line: #dedede;
}

.news-entry__body :where(ul, ol),
.editor-styles-wrapper :where(ul, ol) {
  padding-inline-start: 1.5em;
}

.news-entry__body > :where(ul, ol),
.editor-styles-wrapper > :where(ul, ol) {
  margin-top: 2em;
}

.news-entry__body ul,
.editor-styles-wrapper ul {
  list-style: disc;
}

.news-entry__body ol,
.editor-styles-wrapper ol {
  list-style: decimal;
}

.news-entry__body :where(ul, ol) :where(ul, ol),
.editor-styles-wrapper :where(ul, ol) :where(ul, ol) {
  margin-top: .5em;
}

.news-entry__body :where(li, figcaption, cite, td, th),
.editor-styles-wrapper :where(li, figcaption, cite, td, th) {
  font-size: 1.5rem;
  line-height: 1.8;
}

.news-entry__body :where(p, li, figcaption, cite, td, th) a,
.editor-styles-wrapper :where(p, li, figcaption, cite, td, th) a {
  display: inline;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: opacity .3s ease;
}

.news-entry__body :where(p, li, figcaption, cite, td, th) a:hover,
.news-entry__body :where(p, li, figcaption, cite, td, th) a:focus-visible,
.editor-styles-wrapper :where(p, li, figcaption, cite, td, th) a:hover,
.editor-styles-wrapper :where(p, li, figcaption, cite, td, th) a:focus-visible {
  opacity: .6;
}

.news-entry__body :where(.wp-block-image, .wp-block-gallery, .wp-block-video, .wp-block-embed),
.editor-styles-wrapper :where(.wp-block-image, .wp-block-gallery, .wp-block-video, .wp-block-embed) {
  margin-top: 4.5rem;
}

.news-entry__body .wp-block-image img,
.editor-styles-wrapper .wp-block-image img {
  width: auto;
  height: auto;
  max-width: 100%;
}

.news-entry__body .wp-block-gallery img,
.editor-styles-wrapper .wp-block-gallery img {
  width: 100%;
  height: auto;
}

.news-entry__body figcaption,
.editor-styles-wrapper figcaption {
  margin-top: .8em;
  color: #555;
  text-align: center;
}

.news-entry__body .wp-block-columns,
.editor-styles-wrapper .wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 4.5rem;
}

.news-entry__body .wp-block-column,
.editor-styles-wrapper .wp-block-column {
  flex: 1 1 0;
  min-width: 0;
}

.news-entry__body .wp-block-column > :first-child,
.editor-styles-wrapper .wp-block-column > :first-child {
  margin-top: 0;
}

.news-entry__body :where(.wp-block-quote, .wp-block-pullquote),
.editor-styles-wrapper :where(.wp-block-quote, .wp-block-pullquote) {
  margin-top: 4rem;
  padding: 2.4rem 3rem;
  border-inline-start: 4px solid var(--stepup-news-coral);
  background: #fff5f6;
}

.news-entry__body :where(.wp-block-quote, .wp-block-pullquote) p,
.editor-styles-wrapper :where(.wp-block-quote, .wp-block-pullquote) p {
  margin-top: 0;
}

.news-entry__body :where(.wp-block-quote, .wp-block-pullquote) cite,
.editor-styles-wrapper :where(.wp-block-quote, .wp-block-pullquote) cite {
  display: block;
  margin-top: 1em;
  font-style: normal;
}

.news-entry__body .wp-block-table,
.editor-styles-wrapper .wp-block-table {
  margin-top: 4rem;
  overflow-x: auto;
}

.news-entry__body .wp-block-table table,
.editor-styles-wrapper .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
}

.news-entry__body .wp-block-table :where(th, td),
.editor-styles-wrapper .wp-block-table :where(th, td) {
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--stepup-news-line);
  text-align: start;
  vertical-align: top;
}

.news-entry__body .wp-block-table th,
.editor-styles-wrapper .wp-block-table th {
  background: #fff5f6;
  font-weight: 600;
}

.news-entry__body .wp-block-buttons,
.editor-styles-wrapper .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 4rem;
}

.news-entry__body .wp-block-button__link,
.editor-styles-wrapper .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 5.8rem;
  padding-inline: 3.2rem;
  border: 2px solid var(--stepup-news-coral);
  border-radius: 999px;
  background: var(--stepup-news-coral);
  color: #fff;
  line-height: 1.4;
  text-decoration: none;
  transition:
    background-color .3s ease,
    color .3s ease;
}

.news-entry__body .wp-block-button__link:hover,
.news-entry__body .wp-block-button__link:focus-visible,
.editor-styles-wrapper .wp-block-button__link:hover,
.editor-styles-wrapper .wp-block-button__link:focus-visible {
  background: #fff;
  color: var(--stepup-news-coral);
}

.news-entry__body :where(pre, code),
.editor-styles-wrapper :where(pre, code) {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.news-entry__body pre,
.editor-styles-wrapper pre {
  margin-top: 4rem;
  padding: 2rem;
  overflow-x: auto;
  background: #f5f5f5;
  font-size: 1.4rem;
  line-height: 1.7;
  white-space: pre;
}

.news-entry__body :not(pre) > code,
.editor-styles-wrapper :not(pre) > code {
  padding: .1em .35em;
  background: #f5f5f5;
}

.news-entry__body .wp-block-separator,
.editor-styles-wrapper .wp-block-separator {
  margin-block: 4rem;
  border: 0;
  border-top: 1px solid var(--stepup-news-line);
}

.news-entry__body .page-links,
.editor-styles-wrapper .page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 4rem;
  font-size: 1.5rem;
}

.news-entry__body .page-links > :where(a, .post-page-numbers),
.editor-styles-wrapper .page-links > :where(a, .post-page-numbers) {
  display: inline-flex;
  width: 4rem;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--stepup-news-coral);
  border-radius: 50%;
}

.news-entry__body .page-links > .current,
.editor-styles-wrapper .page-links > .current {
  background: var(--stepup-news-coral);
  color: #fff;
}

.news-entry__body :where(.alignwide, .alignfull),
.editor-styles-wrapper :where(.alignwide, .alignfull) {
  max-width: 100%;
}

.news-entry__body::after,
.editor-styles-wrapper::after {
  display: table;
  clear: both;
  content: "";
}

.news-entry__body :where(.aligncenter, .wp-caption.aligncenter),
.editor-styles-wrapper :where(.aligncenter, .wp-caption.aligncenter) {
  display: block;
  margin-inline: auto;
}

.news-entry__body :where(.alignleft, .wp-caption.alignleft),
.editor-styles-wrapper :where(.alignleft, .wp-caption.alignleft) {
  float: left;
  margin: 0 2rem 2rem 0;
}

.news-entry__body :where(.alignright, .wp-caption.alignright),
.editor-styles-wrapper :where(.alignright, .wp-caption.alignright) {
  float: right;
  margin: 0 0 2rem 2rem;
}

.news-entry__body .wp-caption,
.editor-styles-wrapper .wp-caption {
  max-width: 100%;
}

.news-entry__body :where(.wp-caption-text, .gallery-caption),
.editor-styles-wrapper :where(.wp-caption-text, .gallery-caption) {
  margin-top: .8em;
  color: #555;
  text-align: center;
}

@media (max-width: 767px) {
  .news-entry__body .wp-block-columns {
    flex-direction: column;
  }
}

@media (min-width: 768px) {
  .news-entry__body :where(li, figcaption, cite, td, th) {
    font-size: 2.2rem;
    line-height: 1.8;
  }

  .news-entry__body :where(.wp-block-image, .wp-block-gallery, .wp-block-video, .wp-block-embed),
  .news-entry__body .wp-block-columns {
    margin-top: 8rem;
  }

  .news-entry__body :where(.wp-block-quote, .wp-block-pullquote),
  .news-entry__body .wp-block-table,
  .news-entry__body .wp-block-buttons,
  .news-entry__body .page-links,
  .news-entry__body pre {
    margin-top: 6rem;
  }

  .news-entry__body :where(.wp-block-quote, .wp-block-pullquote) {
    padding: 3rem 4rem;
  }

  .news-entry__body .wp-block-button__link {
    min-height: 8.2rem;
    padding-inline: 5rem;
    font-size: 2.3rem;
  }
}

.editor-styles-wrapper {
  color: var(--stepup-news-text);
  font-family: "Noto Sans JP", sans-serif;
}

.editor-styles-wrapper :where(p, li) {
  font-size: 16px;
  line-height: 1.8;
}

.editor-styles-wrapper h2 {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--stepup-news-coral);
  color: #fff;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.5;
}

.editor-styles-wrapper h2::before {
  flex-shrink: 0;
  width: 24px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.editor-styles-wrapper h3 {
  margin-top: 48px;
  padding-bottom: 8px;
  border-bottom: 2px dashed var(--stepup-news-coral);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.5;
}

.editor-styles-wrapper h4 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 48px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.5;
}

.editor-styles-wrapper h4::before {
  flex-shrink: 0;
  width: 18px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--stepup-news-coral);
  content: "";
}

.editor-styles-wrapper :where(.wp-block-image, .wp-block-gallery, .wp-block-video, .wp-block-embed),
.editor-styles-wrapper .wp-block-columns {
  margin-top: 48px;
}

.editor-styles-wrapper :where(.wp-block-quote, .wp-block-pullquote),
.editor-styles-wrapper .wp-block-table,
.editor-styles-wrapper .wp-block-buttons,
.editor-styles-wrapper pre {
  margin-top: 40px;
}

.editor-styles-wrapper :where(.wp-block-quote, .wp-block-pullquote) {
  padding: 24px 32px;
}

.editor-styles-wrapper :where(li, figcaption, cite, td, th) {
  font-size: 16px;
}

.editor-styles-wrapper .wp-block-table :where(th, td) {
  padding: 12px 16px;
}

.editor-styles-wrapper .wp-block-button__link {
  min-height: 58px;
  padding-inline: 32px;
}

.editor-styles-wrapper pre {
  padding: 20px;
  font-size: 14px;
}
