/* Bigham Agency — article skin for Castle Roads issues.
 * Styles the block editor's output (Figma "Single Article", 52:327) in two
 * places with the same rules:
 *   - the site: the Single Post template's Post Content widget, CSS class
 *     `bigham-article` (enqueued on single posts by Post_Editor);
 *   - the block editor canvas: `.editor-styles-wrapper .is-root-container`,
 *     so Paul writes in the published typography.
 * Every value is a CSS Manager token.
 *
 * Map (Figma → block):
 *   body text, Text Large     → paragraph, list
 *   subhead, H4 size          → Heading H2 (H3 → H5 size)
 *   pull-quote, H4 italic     → Pullquote and Quote blocks
 *   figure + caption          → Image block with caption
 *   blocks 24px apart (space-4); a subhead adds space-3 above (Figma padding);
 *   a quote carries space-3 above and below (Figma padding).
 *
 * Allowed exceptions (see references/token-system.md):
 *   - 0.2em underline offset on links, 1.25em list indent (typographic,
 *     relative to the type).
 *
 * Specificity: the scope is two classes, so `.elementor-kit-N h2` /
 * `.elementor-kit-N a` and the block library (one class) lose without !important.
 */

/* --- Text --- */

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) {
	font-family: var(--font-family-secondary);
	font-size: var(--font-size-text-large);
	font-weight: var(--font-weight-regular);
	line-height: var(--line-height-text-large);
	color: var(--theme-text);
}

/* Flow: no element margins, one gap between blocks. The front end may or may
 * not wrap the content in .elementor-widget-container. */
:is(.elementor-widget.bigham-article, .elementor-widget.bigham-article > .elementor-widget-container, .editor-styles-wrapper .is-root-container) > * {
	margin-block: 0;
}

:is(.elementor-widget.bigham-article, .elementor-widget.bigham-article > .elementor-widget-container, .editor-styles-wrapper .is-root-container) > * + * {
	margin-block-start: var(--space-4);
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) :is(p, li) {
	font-family: var(--font-family-secondary);
	font-size: var(--font-size-text-large);
	line-height: var(--line-height-text-large);
	color: var(--theme-text);
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) :is(strong, b) {
	font-weight: var(--font-weight-bold);
}

/* --- Headings --- */

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--font-family-primary);
	font-weight: var(--font-weight-regular);
	color: var(--theme-heading);
	text-wrap: balance;
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) :is(h1, h2) {
	font-size: var(--font-size-h4);
	line-height: var(--line-height-h4);
	letter-spacing: var(--tracking-normal);
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) :is(h3, h4, h5, h6) {
	font-size: var(--font-size-h5);
	line-height: var(--line-height-h5);
	letter-spacing: var(--tracking-h5);
}

:is(.elementor-widget.bigham-article, .elementor-widget.bigham-article > .elementor-widget-container, .editor-styles-wrapper .is-root-container) > * + :is(h1, h2, h3, h4, h5, h6) {
	margin-block-start: calc(var(--space-4) + var(--space-3));
}

/* --- Links --- */

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--theme-accent);
	text-decoration-thickness: var(--border-width-main);
	text-underline-offset: 0.2em;
	transition: text-decoration-color var(--duration-fast) var(--ease-standard);
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) a:is(:hover, :focus-visible) {
	color: inherit;
	text-decoration-color: currentColor;
}

/* --- Lists --- */

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) :is(ul, ol) {
	padding-inline-start: 1.25em;
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) li + li,
:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) li > :is(ul, ol) {
	margin-block-start: var(--space-2);
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) li::marker {
	color: var(--theme-accent);
}

/* --- Quotes (Pullquote and Quote blocks look the same: Figma pull-quote) --- */

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) :is(.wp-block-pullquote, .wp-block-quote) {
	margin-inline: 0;
	padding: var(--space-3) 0;
	border: 0;
	text-align: start;
	font-size: inherit;
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) .wp-block-pullquote blockquote {
	margin: 0;
	padding: 0;
	border: 0;
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) :is(.wp-block-pullquote, .wp-block-quote) p {
	margin: 0;
	font-family: var(--font-family-primary);
	font-size: var(--font-size-h4);
	font-style: italic;
	font-weight: var(--font-weight-regular);
	line-height: var(--line-height-h4);
	letter-spacing: var(--tracking-quote);
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) :is(.wp-block-pullquote, .wp-block-quote) p + p {
	margin-block-start: var(--space-3);
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) :is(.wp-block-pullquote, .wp-block-quote) cite {
	display: block;
	margin-block-start: var(--space-3);
	font-family: var(--font-family-secondary);
	font-size: var(--font-size-text-small);
	font-style: normal;
	font-weight: var(--font-weight-medium);
	line-height: var(--line-height-text-small);
	color: var(--theme-text);
}

/* --- Images (figure + caption) --- */

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) .wp-block-image {
	margin-inline: 0;
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) .wp-block-image img {
	display: block;
	max-inline-size: 100%;
	block-size: auto;
	border-radius: var(--radius-main);
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) :is(.wp-block-image, .wp-block-embed) :is(figcaption, .wp-element-caption) {
	margin: var(--space-2) 0 0;
	font-family: var(--font-family-secondary);
	font-size: var(--font-size-text-small);
	font-style: normal;
	font-weight: var(--font-weight-medium);
	line-height: var(--line-height-text-small);
	text-align: start;
	color: var(--theme-text);
}

/* --- Separator --- */

:is(.elementor-widget.bigham-article, .elementor-widget.bigham-article > .elementor-widget-container, .editor-styles-wrapper .is-root-container) > .wp-block-separator {
	block-size: 0;
	max-inline-size: none;
	margin-block: var(--space-6);
	border: 0;
	border-block-start: var(--border-width-main) solid var(--theme-border);
	background: none;
	opacity: 1;
}

/* --- Embeds (YouTube, Vimeo) --- */

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) .wp-block-embed {
	margin-inline: 0;
}

:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) .wp-block-embed.wp-embed-aspect-16-9 iframe {
	display: block;
	inline-size: 100%;
	block-size: auto;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-main);
}

@media (prefers-reduced-motion: reduce) {
	:is(.elementor-widget.bigham-article, .editor-styles-wrapper .is-root-container) a {
		transition: none;
	}
}
