/* ------------------------------------------------------------------
   Single Page
------------------------------------------------------------------ */

:where(.entry-content, .editor-styles-wrapper .is-root-container) {
  --blog-font-size: var(--fz-medium, 1em);
  --blog-line-height: 1.85;
  --blog-surface: #000000ee;
  --blog-text-color: #ffffff;
  --blog-accent: #be202e;
  --blog-mark-bg: #be202d99;
  --blog-mark-text: #ffffff;

  --blog-muted-color: color-mix(in srgb, var(--blog-text-color) 65%, var(--blog-surface));
  --blog-accent-soft: color-mix(in srgb, var(--blog-accent) 12%, var(--blog-surface));
  --blog-border-color: #212121;
  --blog-code-bg: color-mix(in srgb, var(--blog-text-color) 5%, var(--blog-surface));
  --blog-quote-bg: color-mix(in srgb, var(--blog-surface) 85%, #fff9ec);
  --blog-quote-border: color-mix(in srgb, var(--blog-mark-bg) 72%, #ffd566);
  --blog-quote-text: var(--blog-text-color);
  --blog-strong-color: var(--blog-text-color);
  /* --blog-strong-color: color-mix(in srgb, var(--blog-accent) 75%, var(--blog-text-color)); */
  --blog-em-color: color-mix(in srgb, var(--blog-accent) 35%, var(--blog-text-color));
  --blog-h2-bg: color-mix(in srgb, var(--blog-accent) 8%, var(--blog-surface));
  --blog-h2-border: var(--blog-accent);
  --blog-h3-color: color-mix(in srgb, var(--blog-accent) 65%, var(--blog-text-color));
  --blog-radius: 0.5em;
  --blog-heading-spacing: 0.04em;
  --entry-content-font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  --blog-heading-font: inherit;
  --blog-h1-size: 3.15em;
  --blog-h2-size: 1.45em;
  --blog-h3-size: 1.15em;

  background: var(--blog-surface);
  color: var(--blog-text-color);
  /* font-family: var(--entry-content-font); */
  font-family: var(--ff-default, sans-serif);
  font-size: var(--blog-font-size);
  font-weight: var(--fw-medium, 500);
  line-height: var(--blog-line-height);
  letter-spacing: 0.014em;
  max-width: min(90rem, 100vw - min(24rem, 20vw));
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) > *:first-child {
  margin-top: 0;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) > *:last-child {
  margin-bottom: 0;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) h1 {
  margin: 0 0 0.8lh;
  padding-bottom: 0.38em;
  border-bottom: 0.08em solid var(--blog-border-color);
  font-size: var(--blog-h1-size);
  font-family: var(--blog-heading-font);
  line-height: 1.35;
  letter-spacing: var(--blog-heading-spacing);
  color: var(--blog-text-color);
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) h2 {
  margin: 2.2lh 0 0.75lh;
  font-size: var(--blog-h2-size);
  position: relative;
  padding: 0.0em 1.1em 0.0em 1.25em;
  border-left: 0;
  border-radius: 0;
  /* background: color-mix(in srgb, var(--blog-text-color) 88%, #000); */
  color: #fff;
  font-family: var(--blog-heading-font);
  line-height: 1.35;
  letter-spacing: var(--blog-heading-spacing);
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) h3 {
  margin: 1.5lh 0 0.45lh;
  color: var(--blog-h3-color);
  font-size: var(--blog-h3-size);
  padding: 0.1em 0 0.1em 0.9em;
  border-left: 0.24em solid var(--blog-accent);
  background: transparent;
  font-family: var(--blog-heading-font);
  line-height: 1.35;
  letter-spacing: var(--blog-heading-spacing);
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) h4 {
  margin: 1.1lh 0 0.4lh;
  color: var(--blog-h3-color);
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) p {
  margin: 0;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) p + p {
  margin-top: 0.85lh;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) h1 + p,
:where(.entry-content, .editor-styles-wrapper .is-root-container) h2 + p,
:where(.entry-content, .editor-styles-wrapper .is-root-container) h3 + p,
:where(.entry-content, .editor-styles-wrapper .is-root-container) blockquote + p,
:where(.entry-content, .editor-styles-wrapper .is-root-container) ul + p,
:where(.entry-content, .editor-styles-wrapper .is-root-container) ol + p,
:where(.entry-content, .editor-styles-wrapper .is-root-container) hr + p,
:where(.entry-content, .editor-styles-wrapper .is-root-container) pre + p {
  margin-top: 0.75lh;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) a {
  color: var(--blog-text-color);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) a:hover {
  opacity: 0.82;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) strong {
  color: var(--blog-strong-color);
  font-weight: 700;
  background: linear-gradient(transparent 60%, var(--blog-mark-bg) 60%);
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) em,
:where(.entry-content, .editor-styles-wrapper .is-root-container) i {
  color: var(--blog-em-color);
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) mark {
  color: var(--blog-mark-text);
  background: var(--blog-mark-bg);
  padding: 0em 0.28em;
  border-radius: 0.02em;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) :not(pre) > code {
  display: inline-block;
  padding: 0.12em 0.4em;
  border-radius: 0.42em;
  background-color: #252133;
  /* background: var(--blog-accent-soft); */
  color: var(--blog-strong-color);
  font-size: 0.92em;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) blockquote cite {
  display: block;
  margin-top: 0.45lh;
  color: var(--blog-muted-color);
  font-style: normal;
  font-size: 0.92em;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) ul,
:where(.entry-content, .editor-styles-wrapper .is-root-container) ol {
  margin: 0.75lh 0 0;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) ul {
  list-style: none;
  padding-left: 0;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) ol {
  padding-left: 1.35em;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) li + li {
  margin-top: 0.35lh;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) li::marker {
  color: var(--blog-accent);
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) hr {
  margin: 3lh 0;
  border: 0;
  text-align: center;
  border: none !important;
  border-top: 1px solid var(--blog-border-color) !important;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1lh auto;
  border-radius: var(--blog-radius);
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) table {
  width: 100%;
  margin: 1lh 0 0;
  border-collapse: collapse;
  font-size: 0.95em;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) thead {
  border-bottom: 3px solid var(--blog-border-color) !important;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) th,
:where(.entry-content, .editor-styles-wrapper .is-root-container) td {
  padding: 0.7em 0.85em;
  border: 1px solid var(--blog-border-color) !important;
  vertical-align: top;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) th {
  background: var(--blog-accent-soft);
  color: var(--blog-strong-color);
  text-align: left;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) tr:nth-child(even) td {
  background: color-mix(in srgb, var(--blog-text-color) 3%, var(--blog-surface));
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) pre {
  margin: 0.9lh 0 0;
  overflow-x: auto;
  padding: 0.95em 1em;
  border: 0.08em solid var(--blog-border-color);
  border-radius: var(--blog-radius);
  background: var(--blog-code-bg);
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) pre code {
  font-size: 0.92em;
  line-height: 1.7;
}

@media (max-width: 45em) {
  :where(.entry-content, .editor-styles-wrapper .is-root-container) {
    --blog-font-size: 0.96em;
  }
}

/* ------------------------------------------------------------------
   Single Page Accent Variant
------------------------------------------------------------------ */

.editor-styles-wrapper .is-root-container {
  margin-inline: auto;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0.3em;
  background: var(--blog-accent);
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) ul li {
  position: relative;
  padding: 0.4em 0 0.4em 1.4em;
  border-bottom: 1px solid var(--blog-border-color);
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65lh;
  height: 1px;
  width: 0.8rem;
  display: block;
  background-color: var(--blog-accent);
  opacity: 0.8;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) blockquote {
  margin: 2em 0;
  position: relative;
  padding: 1.4em 1.6em;
  border: 0.12em solid var(--blog-quote-border);
  border-left-width: 0.12em;
  border-radius: 0;
  background: var(--blog-quote-bg);
  color: var(--blog-quote-text);
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) blockquote p {
  margin: 0;
  padding-left: 1.2em;
}

:where(.entry-content, .editor-styles-wrapper .is-root-container) blockquote::before {
  content: "\201C";
  position: absolute;
  left: 0.3em;
  top: 1.2rem;
  font-size: 4rem;
  line-height: 0;
  font-family: Georgia, serif;
  color: color-mix(in srgb, var(--blog-accent) 28%, var(--blog-mark-bg));
}
