/*
 * Penasim Article Styles 0.2.1
 * Front end: scoped to normal single posts.
 * Editor: scoped to the block editor canvas.
 * No JavaScript, remote font, or external asset is loaded.
 */

body.single-post,
.editor-styles-wrapper {
  --penasim-article-navy: #0b2945;
  --penasim-article-green: #1f603e;
  --penasim-article-green-dark: #14472d;
  --penasim-article-ink: #17212b;
  --penasim-article-muted: #5b6670;
  --penasim-article-line: #dce4e9;
  --penasim-article-soft: #f4f7f8;
  --penasim-article-soft-green: #edf6f1;
  --penasim-article-soft-blue: #eef5fa;
  --penasim-article-soft-orange: #fff7e7;
  --penasim-article-orange: #c17a13;
}

body.single-post .post_content,
.editor-styles-wrapper {
  color: var(--penasim-article-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.9;
}

body.single-post .post_content p,
.editor-styles-wrapper p {
  margin-block: 0 1.25em;
}

body.single-post .post_content a,
.editor-styles-wrapper a {
  color: var(--penasim-article-green-dark);
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

body.single-post .post_content a:hover,
body.single-post .post_content a:focus-visible,
.editor-styles-wrapper a:hover,
.editor-styles-wrapper a:focus-visible {
  color: var(--penasim-article-navy);
}

/*
 * SWELL decorates H2/H3 with backgrounds, lines, and pseudo-elements.
 * These stronger, article-only rules replace that decoration with the same
 * navy/green tone used on the custom homepage.
 */
body.single-post .post_content h2,
.editor-styles-wrapper h2.wp-block-heading {
  position: relative !important;
  margin-block: 2.45em .95em !important;
  padding: .08em 0 .08em .78em !important;
  border: 0 !important;
  border-left: 4px solid var(--penasim-article-green) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--penasim-article-navy) !important;
  font-size: clamp(22px, 4.8vw, 29px) !important;
  font-weight: 800 !important;
  line-height: 1.45 !important;
  letter-spacing: -.02em !important;
  text-shadow: none !important;
}

/*
 * Keep root-level headings aligned with the editor's normal content column.
 * Do not override WordPress/SWELL's constrained editor width with full-canvas
 * width or zero inline margins. Wide/full aligned blocks remain untouched.
 */
.editor-styles-wrapper .is-root-container > h2.wp-block-heading:not(.alignwide):not(.alignfull),
.editor-styles-wrapper .is-root-container > h3.wp-block-heading:not(.alignwide):not(.alignfull),
.editor-styles-wrapper .is-root-container > h4.wp-block-heading:not(.alignwide):not(.alignfull),
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h2.wp-block-heading:not(.alignwide):not(.alignfull),
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h3.wp-block-heading:not(.alignwide):not(.alignfull),
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h4.wp-block-heading:not(.alignwide):not(.alignfull) {
  box-sizing: border-box;
  width: 100% !important;
  max-width: var(--wp--style--global--content-size, 900px) !important;
  margin-inline: auto !important;
}

body.single-post .post_content h2::before,
body.single-post .post_content h2::after,
.editor-styles-wrapper h2.wp-block-heading::before,
.editor-styles-wrapper h2.wp-block-heading::after {
  content: none !important;
  display: none !important;
}

body.single-post .post_content h3,
.editor-styles-wrapper h3.wp-block-heading {
  margin-block: 2em .8em !important;
  padding: 0 0 .42em !important;
  border: 0 !important;
  border-bottom: 2px solid var(--penasim-article-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--penasim-article-navy) !important;
  font-size: clamp(19px, 4vw, 23px) !important;
  font-weight: 750 !important;
  line-height: 1.5 !important;
  letter-spacing: -.01em !important;
}

body.single-post .post_content h3::before,
body.single-post .post_content h3::after,
.editor-styles-wrapper h3.wp-block-heading::before,
.editor-styles-wrapper h3.wp-block-heading::after {
  content: none !important;
  display: none !important;
}

body.single-post .post_content h4,
.editor-styles-wrapper h4.wp-block-heading {
  margin-block: 1.7em .65em;
  color: var(--penasim-article-navy);
  font-size: 1.08em;
  font-weight: 750;
}

body.single-post .post_content ul,
body.single-post .post_content ol,
.editor-styles-wrapper ul,
.editor-styles-wrapper ol {
  padding-inline-start: 1.45em;
}

body.single-post .post_content li,
.editor-styles-wrapper li {
  margin-block: .32em;
}

body.single-post .post_content blockquote,
.editor-styles-wrapper blockquote {
  margin: 1.6em 0;
  padding: 1.05em 1.2em;
  border: 0;
  border-left: 4px solid var(--penasim-article-green);
  background: var(--penasim-article-soft);
  color: #34414b;
}

body.single-post .post_content blockquote p:last-child,
.editor-styles-wrapper blockquote p:last-child {
  margin-bottom: 0;
}

body.single-post .post_content .wp-block-image,
.editor-styles-wrapper .wp-block-image {
  margin-block: 1.55em;
}

body.single-post .post_content .wp-block-image img,
.editor-styles-wrapper .wp-block-image img {
  border-radius: 6px;
}

body.single-post .post_content .wp-element-caption,
.editor-styles-wrapper .wp-element-caption {
  margin-top: .55em;
  color: var(--penasim-article-muted);
  font-size: 12px;
  line-height: 1.65;
  text-align: center;
}

body.single-post .post_content .wp-block-table,
.editor-styles-wrapper .wp-block-table {
  margin-block: 1.65em;
  overflow-x: auto;
  border: 1px solid var(--penasim-article-line);
  border-radius: 5px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

body.single-post .post_content .wp-block-table table,
.editor-styles-wrapper .wp-block-table table {
  min-width: 520px;
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  font-size: 14px;
}

body.single-post .post_content .wp-block-table th,
.editor-styles-wrapper .wp-block-table th {
  padding: .75em .9em;
  border: 1px solid #24465f;
  background: var(--penasim-article-navy);
  color: #fff;
  font-weight: 750;
  text-align: left;
  white-space: nowrap;
}

body.single-post .post_content .wp-block-table td,
.editor-styles-wrapper .wp-block-table td {
  padding: .72em .9em;
  border: 1px solid var(--penasim-article-line);
  background: #fff;
  vertical-align: top;
}

body.single-post .post_content .wp-block-table tbody tr:nth-child(even) td,
.editor-styles-wrapper .wp-block-table tbody tr:nth-child(even) td {
  background: var(--penasim-article-soft);
}

/* Optional block-pattern parts. */
body.single-post .post_content .penasim-box,
.editor-styles-wrapper .penasim-box {
  margin-block: 1.55em;
  padding: 1.05em 1.15em;
  border: 1px solid var(--penasim-article-line);
  border-left-width: 4px;
  border-radius: 5px;
  box-shadow: none;
}

body.single-post .post_content .penasim-box > :last-child,
.editor-styles-wrapper .penasim-box > :last-child {
  margin-bottom: 0;
}

body.single-post .post_content .penasim-box__label,
.editor-styles-wrapper .penasim-box__label {
  margin: 0 0 .45em !important;
  color: var(--penasim-article-navy);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
}

body.single-post .post_content .penasim-box--conclusion,
body.single-post .post_content .penasim-box--points,
.editor-styles-wrapper .penasim-box--conclusion,
.editor-styles-wrapper .penasim-box--points {
  border-left-color: var(--penasim-article-green);
  background: var(--penasim-article-soft-green);
}

body.single-post .post_content .penasim-box--caution,
.editor-styles-wrapper .penasim-box--caution {
  border-color: #e9c77f;
  border-left-color: var(--penasim-article-orange);
  background: var(--penasim-article-soft-orange);
}

body.single-post .post_content .penasim-box--caution .penasim-box__label,
.editor-styles-wrapper .penasim-box--caution .penasim-box__label {
  color: #80520f;
}

body.single-post .post_content .penasim-box--supplement,
.editor-styles-wrapper .penasim-box--supplement {
  border-color: #bdd4e3;
  border-left-color: #39769b;
  background: var(--penasim-article-soft-blue);
}

body.single-post .post_content .penasim-box--supplement .penasim-box__label,
.editor-styles-wrapper .penasim-box--supplement .penasim-box__label {
  color: #245978;
}

body.single-post .post_content .penasim-check-list,
.editor-styles-wrapper .penasim-check-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.single-post .post_content .penasim-check-list li,
.editor-styles-wrapper .penasim-check-list li {
  position: relative;
  margin: 0;
  padding: .42em 0 .42em 1.7em;
  border-bottom: 1px dotted #bfd2c6;
}

body.single-post .post_content .penasim-check-list li:last-child,
.editor-styles-wrapper .penasim-check-list li:last-child {
  border-bottom: 0;
}

body.single-post .post_content .penasim-check-list li::before,
.editor-styles-wrapper .penasim-check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: .42em;
  display: grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: var(--penasim-article-green);
  color: #fff;
  font-size: .72em;
  font-weight: 800;
}

body.single-post .post_content .penasim-screenshot,
body.single-post .post_content .wp-block-image.is-style-penasim-screenshot,
.editor-styles-wrapper .penasim-screenshot,
.editor-styles-wrapper .wp-block-image.is-style-penasim-screenshot {
  margin-block: 1.65em;
  padding: 8px;
  border: 1px solid var(--penasim-article-line);
  border-radius: 7px;
  background: var(--penasim-article-soft);
}

body.single-post .post_content .penasim-screenshot img,
body.single-post .post_content .wp-block-image.is-style-penasim-screenshot img,
.editor-styles-wrapper .penasim-screenshot img,
.editor-styles-wrapper .wp-block-image.is-style-penasim-screenshot img {
  width: 100%;
  border-radius: 4px;
}

@media (max-width: 599px) {
  body.single-post .post_content,
  .editor-styles-wrapper {
    font-size: 16px;
    line-height: 1.85;
  }

  body.single-post .post_content h2,
  .editor-styles-wrapper h2.wp-block-heading {
    margin-top: 2.15em !important;
    padding-left: .68em !important;
    font-size: 22px !important;
  }

  body.single-post .post_content h3,
  .editor-styles-wrapper h3.wp-block-heading {
    font-size: 19px !important;
  }

  body.single-post .post_content .penasim-box,
  .editor-styles-wrapper .penasim-box {
    padding: .95em 1em;
  }

  body.single-post .post_content .wp-block-table table,
  .editor-styles-wrapper .wp-block-table table {
    min-width: 480px;
    font-size: 13px;
  }
}
