/*
 * Post body typography — every element WordPress can emit, styled per design 6c.
 * Loaded on the front end (scoped to .entry-content) and in the editor (the post-content area),
 * so what you write looks like what gets published. Selectors are deliberately a notch more specific
 * than core's layout rules (`:root :where(.is-layout-flow) > *`), which would otherwise zero the spacing.
 */

:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) {
  --c-motif-bullet: url("../motifs/badge_08.webp");
  --c-separator: url("../motifs/divider_13.webp");
  --c-note-icon: url("../motifs/diya_04.webp");
  font: 400 1.125rem/1.7 "Newsreader", Georgia, serif;
  color: var(--text);
}
.editor-styles-wrapper { background: var(--surface); }

.entry-content.entry-content > *,
.editor-styles-wrapper .wp-block-post-content.wp-block-post-content > * { margin-block: 1.375rem 0; }
.entry-content.entry-content > :first-child,
.editor-styles-wrapper .wp-block-post-content.wp-block-post-content > :first-child { margin-top: 0; }
.entry-content { max-width: 38.75rem; margin-inline: auto; }

:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) :is(p, li) a,
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) figcaption a { color: var(--accent); border-bottom: .0625rem dotted var(--accent); text-decoration: none; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) :is(p, li) a:hover { color: var(--hover); border-bottom-color: var(--hover); }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) strong { font-weight: 600; color: var(--head); }

:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) :not(pre) > code,
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) kbd {
  font: 500 .875rem "JetBrains Mono", ui-monospace, monospace; background: var(--bg);
  padding: .125rem .375rem; border-radius: .3125rem; border: .0625rem solid var(--line);
}

/* headings */
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) :is(h1, h2, h3, h4, h5, h6) { color: var(--head); scroll-margin-top: 1rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) h2 { margin-top: 2.75rem; font: 400 2.125rem/1.15 "Instrument Serif", Georgia, serif; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) h3 { margin-top: 2rem; font: 400 1.625rem/1.2 "Instrument Serif", Georgia, serif; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) h4 { margin-top: 2rem; font: 600 1.25rem/1.3 "Manrope", sans-serif; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) h5 { margin-top: 1.5rem; font: 600 1rem/1.35 "Manrope", sans-serif; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) h6 { margin-top: 1.375rem; font: 600 .6875rem/1.4 "JetBrains Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.entry-content.entry-content :is(h2, h3) + * { margin-top: .875rem; }
.entry-content.entry-content h4 + * { margin-top: .625rem; }
.entry-content.entry-content h5 + * { margin-top: .5rem; }
.entry-content.entry-content h6 + * { margin-top: .375rem; }

/* lists: numbers stay numbers, bullets become the small motif */
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) ol { padding-left: 1.625rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) ul { padding-left: 0; list-style: none; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) :is(ol, ul) > li + li { margin-top: .375rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) ul > li { position: relative; padding-left: 1.625rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) ul > li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: .875rem; height: .875rem;
  background: var(--c-motif-bullet) center / contain no-repeat;
}
.entry-content.entry-content :is(ul, ol) :is(ul, ol) { margin-top: .375rem; }
.entry-content.entry-content p + :is(ul, ol) { margin-top: .75rem; }

/* quotes */
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) blockquote,
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-quote { margin: 2.25rem 0 0; padding: .375rem 0 .375rem 1.5rem; border-left: .1875rem solid var(--accent); }
.entry-content.entry-content blockquote + * { margin-top: 2.25rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) blockquote p { margin: 0; font: italic 1.625rem/1.35 "Instrument Serif", Georgia, serif; color: var(--head); }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) blockquote p + p { margin-top: .75rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) blockquote cite { display: block; margin-top: .625rem; font: normal 500 .75rem "Manrope", sans-serif; color: var(--muted); }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-pullquote { border: 0; padding: 1.5rem 0; border-block: .0625rem solid var(--gold); text-align: center; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-pullquote blockquote { border: 0; padding: 0; margin: 0; }

/* code */
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) pre,
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-code {
  margin-top: 1rem; padding: 1.125rem 1.25rem; border-radius: .75rem; border: 0;
  background: var(--code-bg); color: var(--code-text);
  font: 400 .8125rem/1.6 "JetBrains Mono", ui-monospace, monospace; overflow: auto; white-space: pre;
}
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) pre code { font: inherit; background: none; border: 0; padding: 0; color: inherit; white-space: pre; overflow-wrap: normal; }

/* media */
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) figure { margin-inline: 0; min-width: 0; }
.entry-content.entry-content figure { margin-top: 1.875rem; }
.entry-content.entry-content figure + * { margin-top: 1.875rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) :is(.wp-block-image, .wp-block-gallery, .wp-block-video, .wp-block-embed) img,
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) video,
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) iframe { border-radius: .625rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) :is(img, video) { max-width: 100%; height: auto; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) figcaption,
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-element-caption {
  margin-top: .5rem; font: 400 .8125rem/1.5 "Manrope", sans-serif; color: var(--muted); text-align: center;
}
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-embed__wrapper iframe { width: 100%; }

/* tables */
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-table { overflow-x: auto; margin-top: 1.125rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) table { width: 100%; border-collapse: collapse; font: 400 .875rem/1.5 "Manrope", sans-serif; min-width: 26.25rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) :is(th, td) { padding: .625rem .75rem; border: 0; border-bottom: .0625rem dotted var(--line); text-align: left; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) :is(th, td):first-child { padding-left: 0; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) :is(th, td):last-child { padding-right: 0; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) thead th { font: 600 .6875rem "Manrope", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: .0625rem solid var(--gold); }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) tbody tr:last-child :is(th, td) { border-bottom: 0; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) tbody th, :is(.entry-content, .editor-styles-wrapper .wp-block-post-content) tbody td:first-child { font-weight: 600; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-table thead,
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-table tfoot { border: 0; }

/* details (FAQ-style) — consecutive ones read as one list */
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) details { border-bottom: .0625rem solid var(--line); padding: .75rem 0; }
.entry-content.entry-content :not(details) + details { margin-top: 1.5rem; border-top: .0625rem solid var(--line); }
.entry-content.entry-content details + details { margin-top: 0; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) summary { cursor: pointer; font: 600 .9375rem/1.4 "Manrope", sans-serif; color: var(--head); }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) details > :not(summary) { margin: .5rem 0 0; font-size: 1rem; }

/* separator → ornament */
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) hr,
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-separator {
  border: 0; height: 1.375rem; margin: 2.5rem auto 0; width: 9.375rem; max-width: 100%; opacity: 1;
  background: var(--c-separator) center / contain no-repeat;
}
.entry-content.entry-content hr + * { margin-top: 2rem; }

/* "Note" group style: gold-edged callout with a diya */
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-group.is-style-note {
  margin-top: 1.875rem; padding: 1rem 1.125rem 1rem 3.75rem; border-radius: .75rem; border: .0625rem solid var(--gold); background: var(--bg) var(--c-note-icon) 1.125rem 1.125rem / auto 1.75rem no-repeat;
  font: 400 .9375rem/1.55 "Manrope", sans-serif;
}
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-group.is-style-note > * { margin: 0; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-group.is-style-note > * + * { margin-top: .5rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-group.is-style-note strong:first-child { color: var(--head); }

/* buttons, files, misc core blocks */
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-button__link,
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-file__button {
  display: inline-flex; padding: .75rem 1.25rem; border-radius: 999px; background: var(--accent); color: var(--cta-text);
  font: 600 .8125rem "Manrope", sans-serif; border: 0; text-decoration: none;
}
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-button__link:hover { background: var(--hover); color: var(--cta-text); }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--accent); border: .0625rem solid var(--accent); }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-file { font: 500 .875rem "Manrope", sans-serif; display: flex; align-items: center; gap: .75rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-verse { font: italic 1.1875rem/1.6 "Instrument Serif", Georgia, serif; white-space: pre-wrap; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .wp-block-preformatted { white-space: pre-wrap; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) mark { background: var(--mark); color: inherit; padding: 0 .125rem; border-radius: .1875rem; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) abbr[title] { text-decoration: underline dotted; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) sup, :is(.entry-content, .editor-styles-wrapper .wp-block-post-content) sub { font-size: .7em; }
:is(.entry-content, .editor-styles-wrapper .wp-block-post-content) .has-drop-cap:not(:focus)::first-letter { font: 400 4.2em/.8 "Instrument Serif", serif; color: var(--accent); margin: .05em .08em 0 0; }
.entry-content.entry-content .alignwide { max-width: 53.75rem; margin-inline: calc((38.75rem - min(53.75rem, 100vw - 2 * var(--pad))) / 2); }
.entry-content.entry-content .alignleft { float: left; margin: .5rem 1.5rem .75rem 0; max-width: 50%; }
.entry-content.entry-content .alignright { float: right; margin: .5rem 0 .75rem 1.5rem; max-width: 50%; }
.entry-content.entry-content .aligncenter { margin-inline: auto; text-align: center; }
.entry-content.entry-content::after { content: ""; display: table; clear: both; }
