/**
 * SureDash Extender — lists and quotes in post and comment content.
 *
 * This file is the reason the feature doesn't feel bolted on.
 *
 * SureDash never styles a list inside member content. Every `list-style` rule
 * it ships is scoped to one of its own components (.pfd-menu,
 * .portal-aside-group-list, .portal-comment-list) and there is no rule matching
 * `.portal-post-content ul` at all — the feature these buttons expose was never
 * reachable, so nothing was written for it. Left alone, a list would inherit
 * from whatever theme is active: different indents on different sites, and
 * margins that collapse to nothing under some resets.
 *
 * Worse, the Jodit editing surface inherits separately from the published post,
 * so a member could compose a tidy list and watch it land looking different.
 * Every rule below therefore names `.jodit-wysiwyg` alongside the three content
 * wrappers, which is what keeps composing and reading in step:
 *
 *   .portal-post-content         posts, in feed cards and single view
 *                                (templates/{archive,single,parts}/content.php)
 *   .portal-comment-content      the comment thread
 *                                (inc/functions/functions.php)
 *   .portal-user-comment-content the comment list on a user profile
 *                                (templates/single/comment.php)
 *   .jodit-wysiwyg               the editor
 *
 * Loaded whenever the portal renders, not only while the feature is switched
 * on. wp_kses runs on save rather than on display, so posts written while it
 * was on keep their lists in the database after it is switched off — and those
 * posts should still render properly rather than collapse to unindented text.
 *
 * Sizes are in em so they track the surrounding font size, which differs
 * between a feed card and a comment.
 */

.portal-post-content ul,
.portal-post-content ol,
.portal-comment-content ul,
.portal-comment-content ol,
.portal-user-comment-content ul,
.portal-user-comment-content ol,
.jodit-wysiwyg ul,
.jodit-wysiwyg ol {
	margin-block: 0.75em;
	margin-inline: 0;
	/* Markers sit outside the text column, so wrapped lines stay aligned with
	   the first line rather than tucking under the bullet. */
	padding-inline-start: 1.5em;
	list-style-position: outside;
}

.portal-post-content ul,
.portal-comment-content ul,
.portal-user-comment-content ul,
.jodit-wysiwyg ul {
	list-style-type: disc;
}

.portal-post-content ol,
.portal-comment-content ol,
.portal-user-comment-content ol,
.jodit-wysiwyg ol {
	list-style-type: decimal;
}

.portal-post-content li,
.portal-comment-content li,
.portal-user-comment-content li,
.jodit-wysiwyg li {
	margin: 0;
	padding: 0;
	/* The nav and comment lists are flex containers; a content list must not
	   inherit that if a theme sets it broadly. */
	display: list-item;
}

.portal-post-content li + li,
.portal-comment-content li + li,
.portal-user-comment-content li + li,
.jodit-wysiwyg li + li {
	margin-block-start: 0.25em;
}

/* A nested list is part of its parent item, so it loses the block margin that
   would otherwise open a gap above and below it. */
.portal-post-content li > ul,
.portal-post-content li > ol,
.portal-comment-content li > ul,
.portal-comment-content li > ol,
.portal-user-comment-content li > ul,
.portal-user-comment-content li > ol,
.jodit-wysiwyg li > ul,
.jodit-wysiwyg li > ol {
	margin-block: 0.25em;
}

.portal-post-content li > ul,
.portal-comment-content li > ul,
.portal-user-comment-content li > ul,
.jodit-wysiwyg li > ul {
	list-style-type: circle;
}

.portal-post-content li > ol,
.portal-comment-content li > ol,
.portal-user-comment-content li > ol,
.jodit-wysiwyg li > ol {
	list-style-type: lower-alpha;
}

/* Paragraphs appear inside list items when a member presses Enter inside one.
   Without this the item gains a paragraph's full block margin and the list
   loses its rhythm. */
.portal-post-content li > p,
.portal-comment-content li > p,
.portal-user-comment-content li > p,
.jodit-wysiwyg li > p {
	margin-block: 0;
}

/**
 * Quotes.
 *
 * A rail on the inline-start edge rather than the browser default, which is a
 * 40px indent on both sides and no visual mark at all. `border-inline-start`
 * puts the rail on the correct side in RTL without a second rule — SureDash's
 * own nesting styles use a physical `border-left` and need an RTL override,
 * which is what assets/css/group-nesting.css had to work around.
 */
.portal-post-content blockquote,
.portal-comment-content blockquote,
.portal-user-comment-content blockquote,
.jodit-wysiwyg blockquote {
	margin-block: 0.75em;
	margin-inline: 0;
	padding-block: 0.125em;
	padding-inline: 1em 0;
	border-inline-start: 3px solid var( --portal-border-color, #e2e8f0 );
	color: var( --portal-text-secondary-color, var( --portal-text-color, inherit ) );
	font-style: normal;
}

.portal-post-content blockquote p:first-child,
.portal-comment-content blockquote p:first-child,
.portal-user-comment-content blockquote p:first-child,
.jodit-wysiwyg blockquote p:first-child {
	margin-block-start: 0;
}

.portal-post-content blockquote p:last-child,
.portal-comment-content blockquote p:last-child,
.portal-user-comment-content blockquote p:last-child,
.jodit-wysiwyg blockquote p:last-child {
	margin-block-end: 0;
}

/* Content in a feed card is truncated to a word count, so the first block can
   arrive already inside a list or quote. Dropping the leading margin keeps the
   card's top edge even with cards whose excerpt starts on a paragraph. */
.portal-post-content > ul:first-child,
.portal-post-content > ol:first-child,
.portal-post-content > blockquote:first-child {
	margin-block-start: 0;
}
