/**
 * Foliora: block styles and the Button block.
 *
 * Loaded on every page and in the block editor (add_editor_style), so
 * blocks look the same in posts, pages, widgets and patterns. The block
 * styles are registered in inc/blocks.php ("Styles" panel of each block):
 * Heading "Eyebrow", Group "Card" and "Callout", List "Checkmarks",
 * Button "With arrow", Separator "Short accent". Colours a user picks for a
 * block (has-background, has-text-color) always win over the theme's.
 *
 * @package Foliora
 */

/* ---------- Button block ----------
   The theme's button: accent fill, heading font, 48px tall, the shape set
   in Customizer > General > Buttons. Outline style: a 2px border in the
   text colour. Default text links' underline/padding (default.css) are
   reset because buttons are links. */
.wp-block-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	padding: 12.75px 28px;
	border-radius: var(--foliora-btn-radius, 999px);
	background-image: none;
	font-family: var(--foliora-font-heading);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wp-block-button .wp-block-button__link:not(.has-background) {
	background-color: var(--foliora-accent);
}

.wp-block-button .wp-block-button__link:not(.has-text-color) {
	color: var(--foliora-on-accent);
}

.wp-block-button .wp-block-button__link:not(.has-background):hover,
.wp-block-button .wp-block-button__link:not(.has-background):focus-visible {
	background-color: var(--foliora-accent-hover);
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	padding: 11.5px 26px 10px;
	border: 2px solid currentColor;
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
	background-color: transparent;
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	color: var(--foliora-text);
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover,
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):focus-visible {
	background-color: var(--foliora-surface);
}

/* With arrow: the arrow from the hero's "Read story" button; it nudges
   right on hover. */
.wp-block-button.is-style-foliora-arrow > .wp-block-button__link::after {
	content: "";
	flex: none;
	width: 16px;
	height: 16px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 18 18'%3E%3Cpath fill-rule='evenodd' stroke='%23000' stroke-width='0.25' stroke-linejoin='round' d='M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 18 18'%3E%3Cpath fill-rule='evenodd' stroke='%23000' stroke-width='0.25' stroke-linejoin='round' d='M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.2s ease;
}

.wp-block-button.is-style-foliora-arrow > .wp-block-button__link:hover::after,
.wp-block-button.is-style-foliora-arrow > .wp-block-button__link:focus-visible::after {
	transform: translateX(calc(3px * var(--foliora-dir, 1)));
}

/* RTL: the arrow points the reading way. */
[dir="rtl"] .wp-block-button.is-style-foliora-arrow > .wp-block-button__link::after {
	scale: -1 1;
}

/* ---------- Heading: Eyebrow ----------
   The small label the theme uses above section titles ("From the blog").
   Pull the next block closer so label and title read as one unit. */
.wp-block-heading.is-style-foliora-eyebrow {
	margin-bottom: 0.75rem;
	font-family: var(--foliora-font-heading);
	font-size: 12px !important; /* Overrides the heading level's size. */
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.wp-block-heading.is-style-foliora-eyebrow:not(.has-text-color) {
	color: var(--foliora-muted);
}

.wp-block-heading.is-style-foliora-eyebrow + * {
	margin-top: 0 !important;
}

/* ---------- Group: Card and Callout ----------
   Card: the soft panel used for "Browse topics" and the comment form.
   Callout: the quote's accent rule on a tinted panel, for notes and tips.
   Padding set in the block's own settings (inline) still wins. */
/* A group with a background colour gets the same inner space as the Card
   style, so text never touches the coloured edge (padding set on the block
   itself is inline and still wins). */
.wp-block-group.is-style-foliora-card,
.wp-block-group.is-style-foliora-callout,
.wp-block-group.has-background {
	padding: clamp(24px, 4vw, 40px);
}

.wp-block-group.is-style-foliora-card {
	border: 1px solid var(--foliora-line);
	border-radius: calc(20px * var(--foliora-corner-scale, 1));
}

.wp-block-group.is-style-foliora-card:not(.has-background) {
	background-color: var(--foliora-surface);
}

.wp-block-group.is-style-foliora-callout {
	border-inline-start: 4px solid var(--foliora-accent);
	border-radius: 0;
	border-start-end-radius: calc(12px * var(--foliora-corner-scale, 1));
	border-end-end-radius: calc(12px * var(--foliora-corner-scale, 1));
	padding: 24px 28px;
}

.wp-block-group.is-style-foliora-callout:not(.has-background) {
	background-color: var(--foliora-surface);
}

/* Inner blocks: no stray space at the top or bottom of the panel. */
.wp-block-group:is(.is-style-foliora-card, .is-style-foliora-callout, .has-background) > :first-child,
.wp-block-group:is(.is-style-foliora-card, .is-style-foliora-callout, .has-background) > .wp-block-group__inner-container > :first-child {
	margin-top: 0;
}

.wp-block-group:is(.is-style-foliora-card, .is-style-foliora-callout, .has-background) > :last-child,
.wp-block-group:is(.is-style-foliora-card, .is-style-foliora-callout, .has-background) > .wp-block-group__inner-container > :last-child {
	margin-bottom: 0;
}

/* A list that ends the panel: its last item adds no extra space. */
.wp-block-group:is(.is-style-foliora-card, .is-style-foliora-callout, .has-background) :is(ul, ol):last-child > li:last-child {
	margin-bottom: 0;
}

/* ---------- List: Checkmarks ---------- */
.wp-block-list.is-style-foliora-checks {
	padding-inline-start: 0;
	list-style: none;
}

.wp-block-list.is-style-foliora-checks > li {
	position: relative;
	padding-inline-start: 1.75em;
}

.wp-block-list.is-style-foliora-checks > li::before {
	content: "";
	display: block; /* Post text hides list ::before (single.css). */
	position: absolute;
	inset-inline-start: 0;
	top: calc(0.5lh - 0.55em);
	width: 1.1em;
	height: 1.1em;
	background: var(--foliora-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 18 18'%3E%3Cpath fill-rule='evenodd' stroke='%23000' stroke-width='0.6' stroke-linejoin='round' d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 18 18'%3E%3Cpath fill-rule='evenodd' stroke='%23000' stroke-width='0.6' stroke-linejoin='round' d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* A list given its own text colour keeps the ticks in that colour. */
.wp-block-list.is-style-foliora-checks.has-text-color > li::before {
	background: currentColor;
}

/* Nested lists inside a checklist go back to plain bullets. */
.wp-block-list.is-style-foliora-checks ul {
	list-style: disc;
}

/* ---------- Separator: Short accent ----------
   A short bar in the accent colour, for breaking up sections (aligned with
   the text, or centred when the separator is centred). */
.wp-block-separator.is-style-foliora-accent {
	width: 56px;
	max-width: 56px;
	height: 0;
	/* Close to the heading it belongs to (a section line has 2.5em). */
	margin: 20px 0 24px;
	border: 0;
	border-top: 3px solid var(--foliora-accent);
	border-radius: 3px;
	opacity: 1;
}

.wp-block-separator.is-style-foliora-accent.aligncenter,
.has-text-align-center > .wp-block-separator.is-style-foliora-accent {
	margin-inline-start: auto;
	margin-inline-end: auto;
}

/* First in a column or group: no space above. Lead line above a heading:
   the heading follows 20px below, not after a full section gap. */
.wp-block-separator.is-style-foliora-accent:first-child {
	margin-top: 0;
}

.wp-block-separator.is-style-foliora-accent + .wp-block-heading {
	margin-top: 0 !important;
}

.wp-block-separator.is-style-foliora-accent:has(+ .wp-block-heading) {
	margin-bottom: 20px;
}

.wp-block-separator.is-style-foliora-accent.has-background {
	border-top-color: currentColor;
}

/* ---------- Theme colours from the editor's colour picker ----------
   (inc/editor-colors.php) The swatches follow the colour scheme and dark
   mode. A block given a theme background without a text colour gets
   readable text automatically: the contrast colour on Accent, the page
   background colour on the other dark swatches, body text on the light
   ones. Inside such a block, and inside any block with both a background
   and a text colour, headings, bold text and terms take the block's text
   colour, and links on the dark swatches use it too (still underlined). */
/* Classic themes get WordPress's colour classes only for its own default
   colours, so the theme prints the classes for its palette (same form and
   !important as WordPress's). */
.has-foliora-accent-color {
	color: var(--wp--preset--color--foliora-accent) !important;
}

.has-foliora-accent-background-color {
	background-color: var(--wp--preset--color--foliora-accent) !important;
}

.has-foliora-accent-border-color {
	border-color: var(--wp--preset--color--foliora-accent) !important;
}

.has-foliora-link-color {
	color: var(--wp--preset--color--foliora-link) !important;
}

.has-foliora-link-background-color {
	background-color: var(--wp--preset--color--foliora-link) !important;
}

.has-foliora-link-border-color {
	border-color: var(--wp--preset--color--foliora-link) !important;
}

.has-foliora-heading-color {
	color: var(--wp--preset--color--foliora-heading) !important;
}

.has-foliora-heading-background-color {
	background-color: var(--wp--preset--color--foliora-heading) !important;
}

.has-foliora-heading-border-color {
	border-color: var(--wp--preset--color--foliora-heading) !important;
}

.has-foliora-body-color {
	color: var(--wp--preset--color--foliora-body) !important;
}

.has-foliora-body-background-color {
	background-color: var(--wp--preset--color--foliora-body) !important;
}

.has-foliora-body-border-color {
	border-color: var(--wp--preset--color--foliora-body) !important;
}

.has-foliora-muted-color {
	color: var(--wp--preset--color--foliora-muted) !important;
}

.has-foliora-muted-background-color {
	background-color: var(--wp--preset--color--foliora-muted) !important;
}

.has-foliora-muted-border-color {
	border-color: var(--wp--preset--color--foliora-muted) !important;
}

.has-foliora-background-color {
	color: var(--wp--preset--color--foliora-background) !important;
}

.has-foliora-background-background-color {
	background-color: var(--wp--preset--color--foliora-background) !important;
}

.has-foliora-background-border-color {
	border-color: var(--wp--preset--color--foliora-background) !important;
}

.has-foliora-surface-color {
	color: var(--wp--preset--color--foliora-surface) !important;
}

.has-foliora-surface-background-color {
	background-color: var(--wp--preset--color--foliora-surface) !important;
}

.has-foliora-surface-border-color {
	border-color: var(--wp--preset--color--foliora-surface) !important;
}

.has-foliora-border-color {
	color: var(--wp--preset--color--foliora-border) !important;
}

.has-foliora-border-background-color {
	background-color: var(--wp--preset--color--foliora-border) !important;
}

.has-foliora-border-border-color {
	border-color: var(--wp--preset--color--foliora-border) !important;
}

.has-foliora-accent-background-color:not(.has-text-color) {
	color: var(--foliora-on-accent);
}

:is(.has-foliora-link-background-color, .has-foliora-heading-background-color, .has-foliora-body-background-color, .has-foliora-muted-background-color):not(.has-text-color) {
	color: var(--foliora-bg);
}

:is(.has-foliora-background-background-color, .has-foliora-surface-background-color, .has-foliora-border-background-color):not(.has-text-color) {
	color: var(--foliora-body);
}

:is(.has-foliora-accent-background-color, .has-foliora-link-background-color, .has-foliora-heading-background-color, .has-foliora-body-background-color, .has-foliora-muted-background-color, .has-text-color) :is(h1, h2, h3, h4, h5, h6, strong, dt):not(.has-text-color) {
	color: inherit;
}

:is(.has-foliora-accent-background-color, .has-foliora-link-background-color, .has-foliora-heading-background-color, .has-foliora-body-background-color, .has-foliora-muted-background-color):not(.has-link-color) a:not(.wp-element-button):not(.wp-block-button__link) {
	color: inherit;
}

/* Blocks with a background that is not a theme colour (a WordPress default
   colour or a custom one) and no text colour: inc/editor-colors.php marks
   them light or dark, so their text stays readable in light and dark mode. */
.foliora-bg-light {
	color: #1b1e2b;
}

.foliora-bg-dark {
	color: #fff;
}

:is(.foliora-bg-light, .foliora-bg-dark) :is(h1, h2, h3, h4, h5, h6, strong, dt):not(.has-text-color),
:is(.foliora-bg-light, .foliora-bg-dark):not(.has-link-color) a:not(.wp-element-button):not(.wp-block-button__link) {
	color: inherit;
}


/* ---------- Latest Posts block in the sidebar and footer ----------
   Each story reads as a small card: the photo (when it is aligned left or
   right) in its own column so the text never wraps under it, the title in
   the heading font, author and date on one line, then the excerpt and its
   "Read more" link. A size, colour or link colour set on the block wins.
   "Align left/right" stay physical in RTL, as in WordPress (the photo stays
   on the side the user picked). Grid view: at most two columns in these
   narrow areas, one when a column would be under 130px. */
:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts:not([class*="-font-size"]):not([style*="font-size"]) {
	font-size: calc(15px * var(--foliora-text-scale, 1));
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts > li {
	margin: 0;
	font-size: inherit;
	line-height: 1.3; /* = the meta line (13px x 1.5), so a wrapped meta line keeps tight spacing. */
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts.has-text-color > li {
	color: inherit !important; /* The widget lists set a muted !important colour. */
}

.foliora-sidebar .widget .wp-block-latest-posts > li {
	padding-block: 16px;
}

.foliora-footer .widget .wp-block-latest-posts > li {
	padding: 0 0 20px;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts > li:first-child {
	padding-top: 0;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts > li:last-child {
	padding-bottom: 0;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__post-title {
	display: block;
	font-family: var(--foliora-font-heading);
	font-size: calc(1em * var(--foliora-heading-scale, 1));
	line-height: 1.45;
	font-weight: 600;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts:not(.has-link-color) .wp-block-latest-posts__post-title:not(:hover) {
	color: var(--foliora-text);
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts > li:has(> .wp-block-latest-posts__post-author, > .wp-block-latest-posts__post-date) > .wp-block-latest-posts__post-title {
	margin-bottom: 4px;
}

/* Author and date: one line, "by Name · 9 November 2026". */
:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts :is(.wp-block-latest-posts__post-author, .wp-block-latest-posts__post-date) {
	display: inline;
	margin: 0;
	font-size: 0.8667em;
	line-height: 1.5;
	white-space: nowrap; /* A narrow column wraps between author and date, not inside them. */
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts:not(.has-text-color) :is(.wp-block-latest-posts__post-author, .wp-block-latest-posts__post-date) {
	color: var(--foliora-muted);
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__post-author:has(+ .wp-block-latest-posts__post-date)::after {
	content: "\00b7";
	content: "\00b7" / "";
	margin-inline: 6px;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts :is(.wp-block-latest-posts__post-excerpt, .wp-block-latest-posts__post-full-content) {
	margin: 6px 0 0;
	font-size: 0.9333em;
	line-height: calc(1.6 + var(--foliora-leading-adjust, 0));
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts:not(.has-text-color) :is(.wp-block-latest-posts__post-excerpt, .wp-block-latest-posts__post-full-content) {
	color: var(--foliora-body);
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__post-full-content p {
	margin: 0 0 8px;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__post-full-content :is(h1, h2, h3, h4, h5, h6) {
	margin: 12px 0 6px;
	font-family: var(--foliora-font-heading);
	font-size: 1em !important; /* A post's headings would tower over a widget. */
	line-height: 1.4;
	font-weight: 600;
	color: var(--foliora-text);
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__post-full-content :is(img, video, iframe, figure) {
	max-width: 100%;
	height: auto;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__post-full-content > :last-child {
	margin-bottom: 0;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__read-more {
	font-weight: 600;
	white-space: nowrap;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts:not(.has-link-color) .wp-block-latest-posts__read-more {
	color: var(--foliora-link);
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__read-more:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Photo above the text (centred or no alignment, and in grid view). */
:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__featured-image {
	margin: 0 0 12px;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__featured-image a {
	display: block;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__featured-image img {
	display: block;
	border-radius: calc(8px * var(--foliora-corner-scale, 1));
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts__featured-image.aligncenter img {
	margin-inline: auto;
}

/* Photo beside the text (list view, aligned left or right):
   inc/blocks.php wraps the story's text in .foliora-latest-posts__text.
   The photo takes the width set on the block (--foliora-lp-img; 88px when
   none is set), but never more than 40% of the row, so the text keeps room. */
:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts > li:has(> .foliora-latest-posts__text) {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

/* Photo on the end side: right in LTR, or "align left" in RTL. */
:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts > li:has(> .wp-block-latest-posts__featured-image.alignright):has(> .foliora-latest-posts__text),
[dir="rtl"] :is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts > li:has(> .wp-block-latest-posts__featured-image.alignleft):has(> .foliora-latest-posts__text) {
	flex-direction: row-reverse;
}

[dir="rtl"] :is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts > li:has(> .wp-block-latest-posts__featured-image.alignright):has(> .foliora-latest-posts__text) {
	flex-direction: row;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts > li > .wp-block-latest-posts__featured-image:has(+ .foliora-latest-posts__text) {
	flex: none;
	width: min(var(--foliora-lp-img, 88px), 40%);
	margin: 0;
	float: none;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts > li > .wp-block-latest-posts__featured-image:has(+ .foliora-latest-posts__text) img {
	width: 100%;
	object-fit: cover;
}

:is(.foliora-sidebar, .foliora-footer) .widget .foliora-latest-posts__text {
	flex: 1;
	min-width: 0;
}

/* Grid view. */
:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts.wp-block-latest-posts__list.is-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(max(130px, calc((100% - 16px) / 2)), 1fr));
	gap: 24px 16px;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts.wp-block-latest-posts__list.is-grid.columns-1 {
	grid-template-columns: minmax(0, 1fr);
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts.wp-block-latest-posts__list.is-grid > li {
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
}

:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-latest-posts.wp-block-latest-posts__list.is-grid .wp-block-latest-posts__featured-image {
	float: none;
	margin: 0 0 10px;
}

/* ---------- Core blocks in posts and pages ----------
   Found by checking every block of the WordPress test content at 375, 768,
   1024 and 1440px (block test posts, Gutenberg test posts and pages). */

/* Full-width blocks that hold text get side room in line with the site's
   container, so text never touches the screen edges. Photos, covers,
   galleries and embeds still run edge to edge. */
.foliora-article__content > .alignfull:is(.wp-block-columns, .wp-block-group:not(.has-background), p, h1, h2, h3, h4, h5, h6, ul, ol, .wp-block-table, .wp-block-latest-posts, .wp-block-buttons, .wp-block-separator, .wp-block-query, .wp-block-latest-comments) {
	padding-inline: max(var(--bs-gutter-x, 1.5rem), calc((var(--foliora-page-w, var(--foliora-vw, 100vw)) - var(--foliora-container, 1320px)) / 2 + 12px));
}

@media (max-width: 767px) {
	.foliora-article__content > .alignfull:is(.wp-block-columns, .wp-block-group:not(.has-background), p, h1, h2, h3, h4, h5, h6, ul, ol, .wp-block-table, .wp-block-latest-posts, .wp-block-buttons, .wp-block-separator, .wp-block-query, .wp-block-latest-comments) {
		padding-inline: 16px;
	}
}

/* Beside a sidebar a "full width" block is only as wide as the text. */
@media (min-width: 992px) {
	.foliora-article__layout .foliora-article__content > .alignfull:is(.wp-block-columns, .wp-block-group:not(.has-background), p, h1, h2, h3, h4, h5, h6, ul, ol, .wp-block-table, .wp-block-latest-posts, .wp-block-buttons, .wp-block-separator, .wp-block-query, .wp-block-latest-comments) {
		padding-inline: 0;
	}
}

/* Edge-to-edge media have square corners where they meet the screen. */
.foliora-article:not(:has(.foliora-article__layout)) .foliora-article__content > .alignfull:is(.wp-block-image, .wp-block-media-text, .wp-block-cover, .wp-block-embed, .wp-block-video) :is(img, video, iframe),
.foliora-article:not(:has(.foliora-article__layout)) .foliora-article__content > .alignfull.wp-block-cover {
	border-radius: 0;
}

/* Phones: blocks that don't work at half the column (covers with their
   large text, quotes, tables, embeds, galleries) leave the float and take
   the whole width. Floated images keep the half-width rule (single.css). */
@media (max-width: 575px) {
	.foliora-article__content > :is(.alignleft, .alignright):is(.wp-block-cover, .wp-block-quote, blockquote, .wp-block-pullquote, .wp-block-table, .wp-block-embed, .wp-block-gallery, .wp-block-media-text, .wp-block-group, .wp-block-columns) {
		float: none;
		width: auto;
		max-width: none;
		margin-inline: 0;
	}
}

/* Media & Text stacked on a phone: the text lines up with the image
   (WordPress indents it by 8%), unless the block has its own background. */
@media (max-width: 600px) {
	.wp-block-media-text.is-stacked-on-mobile:not(.has-background) > .wp-block-media-text__content {
		padding: 20px 0 0;
	}

	.foliora-article__content > .wp-block-media-text.alignfull.is-stacked-on-mobile:not(.has-background) > .wp-block-media-text__content {
		padding-inline: 16px;
	}
}

/* Query Loop: posts, not a bulleted list. */
.foliora-article__content .wp-block-post-template {
	padding-inline-start: 0;
	margin-inline-start: 0;
	list-style: none;
}

.foliora-article__content .wp-block-post-template > li {
	margin: 0;
	padding: 0;
}

.foliora-article__content .wp-block-post-template:not(.is-layout-grid) > li + li {
	margin-top: 32px;
}

.foliora-article__content .wp-block-post-template > li::before,
.foliora-article__content .wp-block-post-template > li::marker {
	content: none;
}

.foliora-article__content .wp-block-post-template > li > :first-child {
	margin-top: 0;
}

.foliora-article__content .wp-block-post-template .wp-block-post-title {
	margin: 0 0 6px;
}

/* Latest Posts and Latest Comments in a post: no list indent. */
.foliora-article__content :is(.wp-block-latest-posts, .wp-block-latest-comments) {
	padding-inline-start: 0;
	margin-inline-start: 0;
}

/* Latest Posts grids of 3 to 6 columns: at most as many as fit at 180px
   each (3 in the reading column), so titles don't break word by word. */
.foliora-article__content > .wp-block-latest-posts.is-grid:is(.columns-3, .columns-4, .columns-5, .columns-6) {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
	gap: 24px 20px;
}

.foliora-article__content > .wp-block-latest-posts.is-grid:is(.columns-3, .columns-4, .columns-5, .columns-6) > li {
	width: auto;
	margin: 0;
}

/* Comments block (comment template): a list without numbers. */
.wp-block-comment-template,
.wp-block-comment-template ol,
.foliora-article__content .wp-block-comment-template,
.foliora-article__content .wp-block-comment-template ol {
	list-style: none;
}

.wp-block-comment-template,
.foliora-article__content .wp-block-comment-template {
	padding-inline-start: 0;
	margin-inline-start: 0;
}

/* Navigation block in a post or a widget: a menu, so no underlines; the
   drop-downs and the phone overlay take the page colours (WordPress paints
   them white, which is unreadable in dark mode). */
.foliora-article__content .wp-block-navigation {
	font-family: var(--foliora-font-heading);
	font-size: 15px;
	font-weight: 500;
}

.foliora-article__content .wp-block-navigation .wp-block-navigation__container {
	gap: 8px 24px;
}

/* Beats the content link underline (posts.css; content links must be
   underlined, menus are exempt). */
.foliora-article__content .wp-block-navigation a:not(.wp-element-button):not(.wp-block-button__link) {
	padding: 0;
	background-image: none;
	text-decoration: none;
}

.foliora-article__content .wp-block-navigation a:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
	border-color: var(--foliora-line);
	background-color: var(--foliora-bg);
	color: var(--foliora-text);
}

.wp-block-navigation__responsive-container.is-menu-open:not(.has-background) {
	background-color: var(--foliora-bg);
	color: var(--foliora-text);
}

/* Search block: the sidebar's search (field + accent button) everywhere
   else too; "button inside" puts both in one framed field. */
.foliora-article__content .wp-block-search__label:not(.screen-reader-text) {
	display: block;
	margin-bottom: 8px;
	font-family: var(--foliora-font-heading);
	font-size: 14px;
	font-weight: 600;
	color: var(--foliora-text);
}

.foliora-article__content .wp-block-search__inside-wrapper {
	display: flex;
	gap: 8px;
}

.foliora-article__content .wp-block-search__input {
	flex: 1;
	min-width: 0;
	margin: 0;
}

.foliora-article__content .wp-block-search__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 46px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: calc(10px * var(--foliora-corner-scale, 1));
	background: var(--foliora-accent);
	color: var(--foliora-on-accent);
	font-family: var(--foliora-font-heading);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.foliora-article__content .wp-block-search__button:hover {
	background: var(--foliora-accent-hover);
}

.foliora-article__content .wp-block-search__button.has-icon {
	width: 46px;
	padding: 0;
}

.foliora-article__content .wp-block-search__button svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.foliora-article__content .wp-block-search__button-inside .wp-block-search__inside-wrapper {
	padding: 4px;
	border: 1px solid var(--foliora-field);
	border-radius: calc(12px * var(--foliora-corner-scale, 1));
	background: var(--foliora-bg);
}

.foliora-article__content .wp-block-search__button-inside .wp-block-search__inside-wrapper:focus-within {
	border-color: var(--foliora-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--foliora-accent) 18%, transparent);
}

.foliora-article__content .wp-block-search__button-inside .wp-block-search__input {
	height: 38px;
	border: 0;
	box-shadow: none;
}

.foliora-article__content .wp-block-search__button-inside .wp-block-search__button {
	height: 38px;
	border-radius: calc(8px * var(--foliora-corner-scale, 1));
}

/* File block: the file name, then a real (small) theme button. */
.wp-block-file:not(.wp-element-button) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
}

.wp-block-file .wp-block-file__embed {
	flex: 1 1 100%;
}

.wp-block-file .wp-block-file__button,
.foliora-article__content .wp-block-file .wp-block-file__button {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	margin: 0;
	padding: 0 20px;
	border-radius: var(--foliora-btn-radius, 999px);
	background: var(--foliora-accent);
	background-image: none;
	color: var(--foliora-on-accent);
	font-family: var(--foliora-font-heading);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.wp-block-file .wp-block-file__button:hover,
.foliora-article__content .wp-block-file .wp-block-file__button:hover {
	background: var(--foliora-accent-hover);
	color: var(--foliora-on-accent);
}

/* Button block "Squared" style: square, as chosen in the editor. */
.wp-block-button.is-style-squared > .wp-block-button__link {
	border-radius: 0;
}

/* Quote: the accent bar follows the text. Right-aligned text gets it on
   the right, left-aligned on the left (physical sides: the alignment is
   physical, also on RTL sites); centred text gets none (a side bar there
   looks lopsided). */
:is(.foliora-article__content, .comment-content) .wp-block-quote:is(.has-text-align-right, .has-text-align-left) {
	border: 0;
	border-radius: 0;
}

:is(.foliora-article__content, .comment-content) .wp-block-quote.has-text-align-right {
	padding-right: 26px;
	padding-left: 28px;
	border-right: 4px solid var(--foliora-accent);
	border-top-left-radius: calc(12px * var(--foliora-corner-scale, 1));
	border-bottom-left-radius: calc(12px * var(--foliora-corner-scale, 1));
}

:is(.foliora-article__content, .comment-content) .wp-block-quote.has-text-align-left {
	padding-right: 28px;
	padding-left: 26px;
	border-left: 4px solid var(--foliora-accent);
	border-top-right-radius: calc(12px * var(--foliora-corner-scale, 1));
	border-bottom-right-radius: calc(12px * var(--foliora-corner-scale, 1));
}

:is(.foliora-article__content, .comment-content) .wp-block-quote.has-text-align-center {
	padding-inline: 28px;
	border-inline-start: 0;
	border-radius: calc(12px * var(--foliora-corner-scale, 1));
}

/* ---------- Social Icons block in the sidebar and footer ----------
   The sidebar's list styles (15px text, padding, divider lines) shrank the
   icons to 20px, under the 24px touch-target minimum. */
:is(.foliora-sidebar, .foliora-footer) .widget .wp-block-social-links > li {
	padding: 0;
	border: 0;
	font-size: inherit;
}

/* ---------- Quote block in the sidebar and footer ----------
   Was the template's blockquote (fixed light grey, a blue bar, #444 text:
   a white box in dark mode, and two bars on RTL sites). Now a compact
   version of the theme's quote; the tint follows the text colour, so it
   also works on the footer's dark band. */
:is(.foliora-sidebar, .foliora-footer) .widget :is(blockquote, .wp-block-quote) {
	margin: 0;
	padding: 16px 18px;
	border: 0;
	border-inline-start: 4px solid var(--foliora-accent);
	border-radius: 0;
	border-start-end-radius: calc(10px * var(--foliora-corner-scale, 1));
	border-end-end-radius: calc(10px * var(--foliora-corner-scale, 1));
	background: color-mix(in srgb, currentColor 6%, transparent);
	color: inherit;
	font-family: var(--foliora-font-heading);
	font-size: 15px;
	font-style: normal;
	font-weight: 500;
	line-height: 1.5;
}

:is(.foliora-sidebar, .foliora-footer) .widget :is(blockquote, .wp-block-quote)::before {
	display: none;
}

:is(.foliora-sidebar, .foliora-footer) .widget :is(blockquote, .wp-block-quote) p {
	margin: 0;
}

:is(.foliora-sidebar, .foliora-footer) .widget :is(blockquote, .wp-block-quote) cite {
	display: block;
	margin-top: 8px;
	font-family: var(--foliora-font-body);
	font-size: 13px;
	font-style: normal;
	font-weight: 400;
	opacity: 0.8;
}

.foliora-footer--dark .widget :is(blockquote, .wp-block-quote) {
	border-inline-start-color: currentColor;
}

/* ---------- Small fixes from the accessibility check ---------- */
/* Pullquote citation: full strength when the block has its own colours
   (the 75% dimming fell under AA contrast on the solid style). */
.foliora-article__content .wp-block-pullquote:is(.is-style-solid-color, .has-background, .has-text-color) cite,
.foliora-article__content .wp-block-pullquote blockquote.has-text-color cite {
	opacity: 1;
}

/* Links in nested sidebar and footer lists (categories with
   sub-categories, pages with child pages) and the Comments block's author
   / date / reply links: at least 24px tall, the touch-target minimum
   (WCAG 2.5.8). Flat lists already have room enough between rows. */
:is(.foliora-sidebar, .foliora-footer) .widget li li > a,
:is(.foliora-sidebar, .foliora-footer) .widget li:has(> ul, > ol) > a,
.wp-block-comment-template :is(.wp-block-comment-author-name, .wp-block-comment-date, .wp-block-comment-reply-link, .wp-block-comment-edit-link) a {
	display: inline-block;
	min-height: 24px;
}

/* Calendar block: the theme's colours (WordPress paints fixed greys, which
   vanished in dark mode). The sidebar has its own calendar styles. */
.wp-block-calendar table:where(:not(.has-text-color)),
.wp-block-calendar table:where(:not(.has-text-color)) caption {
	color: inherit;
}

.wp-block-calendar table:where(:not(.has-text-color)) :is(th, td) {
	border-color: var(--foliora-line);
}

.wp-block-calendar table:where(:not(.has-background)) th {
	background: var(--foliora-surface);
}

/* Image captions in widgets: the theme's muted text (WordPress uses #555). */
:is(.foliora-sidebar, .foliora-footer) .widget :is(figcaption, .wp-element-caption) {
	color: var(--foliora-muted);
}

/* RTL: WordPress sets direction: ltr on the Media & Text block itself (for
   its image-left/right grid). Its logical "start" offset is then the left
   one, so the wide/full centring (single.css) moved it from the wrong side
   and left it half a column off centre in RTL. Physical offsets here: 50%
   from the right, then the usual RTL shift. */
[dir="rtl"] .foliora-article__content > .wp-block-media-text:is(.alignwide, .alignfull) {
	right: 50%;
	left: auto;
}

/* Beside a sidebar wide/full blocks stay in the column (single.css), so no
   offset there either. */
@media (min-width: 992px) {
	[dir="rtl"] .foliora-article__layout .foliora-article__content > .wp-block-media-text:is(.alignwide, .alignfull) {
		right: auto;
	}
}

/* The full-width page layout keeps "wide" in line with the content. */
[dir="rtl"] .foliora-article.is-full-width .foliora-article__content > .wp-block-media-text.alignwide {
	right: auto;
}


/* ---------- More core blocks in posts and pages ----------
   Found by publishing every block and every pattern (Block Tests posts). */

/* Full-width Group with a background: its text lines up with the site's
   container, like full-width groups without one, instead of running to
   the screen edges. Padding set on the block itself still wins. */
.foliora-article:not(:has(.foliora-article__layout)) .foliora-article__content > .alignfull.wp-block-group.has-background {
	padding-inline: max(40px, calc((var(--foliora-page-w, var(--foliora-vw, 100vw)) - var(--foliora-container, 1320px)) / 2 + 12px));
}

@media (max-width: 767px) {
	.foliora-article:not(:has(.foliora-article__layout)) .foliora-article__content > .alignfull.wp-block-group.has-background {
		padding-inline: 24px;
	}
}

/* Separator with a colour: WordPress draws the line with the chosen
   colour (as a background, or in the text colour); the theme's grey rule
   was drawn over it. */
.wp-block-separator.has-background:not(.is-style-dots) {
	height: 1px;
	border: 0;
}

.wp-block-separator.has-background:not(.is-style-wide):not(.is-style-dots) {
	height: 2px;
}

.wp-block-separator.has-text-color:not(.has-background) {
	border-top-color: currentColor;
}

/* Details: reads as a question that opens, like the Accordion block: the
   summary in the heading font with a plus/minus at the end, a hairline
   between questions. A colour set on the block wins. */
.wp-block-details {
	border-top: 1px solid var(--foliora-line);
	border-bottom: 1px solid var(--foliora-line);
}

.wp-block-details:has(+ .wp-block-details) {
	margin-bottom: 0;
}

.wp-block-details + .wp-block-details {
	margin-top: 0;
	border-top: 0;
}

.wp-block-details.has-background {
	padding-inline: 20px;
	border: 0;
	border-radius: calc(12px * var(--foliora-corner-scale, 1));
}

.wp-block-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-block: 14px;
	list-style: none;
	cursor: pointer;
	font-family: var(--foliora-font-heading);
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.4;
	color: var(--foliora-text);
}

.wp-block-details > summary::-webkit-details-marker {
	display: none;
}

.wp-block-details > summary::after {
	content: "+";
	flex: none;
	width: 1em;
	font-size: 1.3em;
	font-weight: 400;
	line-height: 1;
	text-align: center;
	color: var(--foliora-muted);
}

.wp-block-details[open] > summary::after {
	content: "\2212";
}

.wp-block-details.has-text-color > summary,
.wp-block-details.has-text-color > summary::after,
:is(.foliora-bg-light, .foliora-bg-dark).wp-block-details > summary {
	color: inherit;
}

.wp-block-details > summary:focus-visible {
	outline: 2px solid var(--foliora-link);
	outline-offset: 2px;
	border-radius: 4px;
}

.wp-block-details > :not(summary) {
	margin-top: 0;
	margin-bottom: 14px;
}

/* Tabs: the underline tabs of the product page (shop.css): tab names in the
   heading font, the open one in the heading colour with an accent line,
   on a hairline that runs under all tabs. Scrolls sideways when the names
   don't fit. The panel sits close under the tabs. */
.wp-block-tab-list {
	gap: 28px;
	margin-bottom: 0;
	border-bottom: 1px solid var(--foliora-line);
	overflow-x: auto;
	scrollbar-width: none;
}

.wp-block-tab-list button {
	position: relative;
	flex: none;
	padding: 0 0 12px;
	border: 0;
	background: none;
	font-family: var(--foliora-font-heading);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--foliora-muted);
	white-space: nowrap;
	transition: color 0.2s ease;
}

.wp-block-tab-list button:hover,
.wp-block-tab-list button[aria-selected="true"] {
	color: var(--foliora-text);
}

.wp-block-tab-list button[aria-selected="true"]::before {
	inset-inline: 0;
	bottom: 0;
	width: auto;
	border-bottom: 2px solid var(--foliora-accent);
	border-radius: 2px;
}

.wp-block-tab-list button:focus-visible {
	outline: 2px solid var(--foliora-link);
	outline-offset: -2px;
	border-radius: 4px;
}

.wp-block-tab-list.has-text-color button,
.wp-block-tab-list.has-text-color button[aria-selected="true"]::before {
	color: inherit;
	border-color: currentColor;
}

/* The template's global "section { padding: 50px 0 }" reached the tab
   panels and any Group saved as a <section>. As light as that rule (this
   file loads after it), so padding set on a block still wins. */
:where(.foliora-article__content, .comment-content, .widget) section {
	padding: 0;
}

.wp-block-tab-panel {
	padding-top: 20px;
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-tab-list button {
		transition: none;
	}
}

/* Calendar: the month above the days (Bootstrap puts table captions under
   the table). */
.wp-calendar-table caption {
	caption-side: top;
	padding: 0 0 10px;
	font-family: var(--foliora-font-heading);
	font-weight: 600;
	text-align: center;
	color: inherit;
}

/* An embed WordPress could not load (the provider did not answer) prints
   the bare address: drop the empty video-shaped box above it. */
.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper:not(:has(iframe, object, embed, video, blockquote))::before {
	display: none;
}

