/* ==========================================================================
   Native block adapter (include/native-blocks.php)
   Site sections rebuilt from core blocks carry their original classes, so main.css
   styles them as before. This file covers what native markup changes: images and
   videos inside a <figure>, button links inside a wrapper, list items where the old
   markup had paragraphs, and the editor's narrow content column. Every converted
   section's outer block has the class `mira-native`; rules are scoped to it.
   Loaded after main.css on the page and in the editor canvas.
   ========================================================================== */

/* ---- Editor: sections keep their page layout instead of the editor's centred column ----
   Section roots: full width. Blocks inside: the editor's 840px column limit (`html :where(.wp-block)`) is undone at
   two-element specificity, so any max-width the theme sets on a section's parts (e.g. a 699px image) still wins. */
.editor-styles-wrapper :is(.mira-native, .cl).wp-block {
	max-width: none !important;
}

html body :where(.mira-native, .cl) :where(.wp-block) {
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}

/* The classic editor gives every block 28px above and below (`html :where(.wp-block)`); the page
   doesn't. Two-element specificity: beats that, loses to every real class rule in the sections. */
html body :where(.mira-native, .cl) :where(.wp-block),
html body :where(.mira-native.wp-block, .cl.wp-block) {
	margin-top: 0;
	margin-bottom: 0;
}

/* The editor wraps a Group's children in an extra <div> for classic themes (the page doesn't:
   include/native-blocks.php removes it there). Layout-transparent, so grids and flex rows match. */
.mira-native .wp-block-group__inner-container,
.cl .wp-block-group__inner-container {
	display: contents;
}

/* ---- Buttons: the wrapper carries the button style (.btn-global), its link fills it ---- */
.mira-native .wp-block-button:is([class*="btn-global"], [class*="cta-bar__btn"]) {
	display: inline-flex;
	position: relative;
}

/* The wrapper's padding is part of the button, so the whole shape must be clickable, not just the label. */
.mira-native .wp-block-button:is([class*="btn-global"], [class*="cta-bar__btn"]) > .wp-block-button__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.mira-native .wp-block-button:is([class*="btn-global"], [class*="cta-bar__btn"]) > .wp-block-button__link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: inherit;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: none;
}

/* Cards plan: the old button was a full-width block link. */
.mira-native .bottom-card .wp-block-buttons {
	display: block;
}

.mira-native .bottom-card .wp-block-button[class*="btn-global"] {
	display: flex;
	width: 100%;
}

/* ---- Media: the figure takes the old image/video size, the media fills it ---- */
.mira-native figure.wp-block-image,
.mira-native figure.wp-block-video {
	margin: 0;
}

.mira-native .media-block .image img,
.mira-native .media-block .image-bg img,
.mira-native .media-block .video video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---- Cards plan: the "what's included" list reads like the old paragraphs ---- */
.mira-native .bottom-card .wys ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mira-native .bottom-card .wys li {
	font-weight: 700;
	font-size: 16px;
	line-height: 200%;
}

@media (max-width: 768px) {
	.mira-native .bottom-card .wys li {
		font-size: 14px;
	}
}

/* ---- FAQ (pattern "FAQ"): Details blocks styled like the old accordion rows ---- */
.mira-native.faq-content .acc_faq details.item > summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 20px 4px;
	list-style: none;
	cursor: pointer;
	font-family: "Store Norske Tango", sans-serif;
	font-weight: 700;
	font-size: 20px;
	letter-spacing: -0.01em;
	line-height: 1.3;
	color: #171717;
}

.mira-native.faq-content .acc_faq details.item > summary::-webkit-details-marker {
	display: none;
}

/* The blue + / −: two 14px bars; the vertical one fades when the answer opens. */
.mira-native.faq-content .acc_faq details.item > summary::after {
	content: "";
	flex: 0 0 14px;
	height: 14px;
	background:
		linear-gradient(#35A8F3, #35A8F3) center / 14px 1px no-repeat,
		linear-gradient(#35A8F3, #35A8F3) center / 1px 14px no-repeat;
}

.mira-native.faq-content .acc_faq details.item[open] > summary::after {
	background: linear-gradient(#35A8F3, #35A8F3) center / 14px 1px no-repeat;
}

/* Answers: the old .info .container text style. */
.mira-native.faq-content .acc_faq details.item > :not(summary) {
	margin: 0;
	padding: 0 4px 20px;
	font-weight: 400;
	font-size: 16.5px;
	line-height: 1.6;
	color: #555;
}

.mira-native.faq-content .acc_faq details.item > :last-child:not(summary) {
	padding-bottom: 22px;
}

/* ---- CTA bar (patterns "CTA bar" / "CTA bar, stacked") ---- */
/* Every CTA bar on the site is brand blue; native ones default to it. --cta-bg lets the buttons invert
   against it (main.css: the primary button's text and the outlined button's hover use it). */
.mira-native.cta-bar {
	--cta-bg: #35a8f3;
	background-color: var(--cta-bg);
}

/* ---- Steps section (patterns "Steps, image left / right") ---- */
/* The sub-heading and the text link were a <div> and a bare <a>; as paragraphs they'd pick up main.css's
   20px paragraph padding. */
.mira-native .info-block :is(.sub-heading, .steps-link) {
	padding-bottom: 0;
}

/* ---- Pest cards (pattern "Pest cards"): the four-card grid ---- */
/* The card was one <a>. Now the title carries the link and stretches it over the whole card, so the
   tile stays clickable (one link per card, as before); hovering the card still rounds the image box. */
.mira-native .four-card {
	position: relative;
}

.mira-native .four-card .title-card {
	padding-bottom: 0;
	line-height: normal; /* was a <div>; main.css gives paragraphs 1.25 */
}

.mira-native .four-card .title-card a {
	color: inherit;
	text-decoration: none;
}

.mira-native .four-card .title-card a::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* The image box is a square flex box; the figure fills it and the image is contained, as before. */
.mira-native .four-card .img-wrap figure.wp-block-image {
	width: 100%;
	height: 100%;
}

.mira-native .four-card .img-wrap figure.wp-block-image img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: contain;
}

/* ---- Link list (patterns "Service areas" and "Linked list"): items are List items; columns are the List's Style ---- */
/* Columns come from the List's Style (2 / 3 / 4 columns); no Style = the theme's default of 3. */
.mira-link-list.is-style-mira-cols-3 { --cols: 3; }
.mira-link-list.is-style-mira-cols-4 { --cols: 4; }
@media (min-width: 601px) {
  /* as main.css's .mira-link-list--cols-2: two content-width columns, centred as a pair */
  .mira-link-list.is-style-mira-cols-2 { grid-template-columns: repeat(2, max-content); justify-content: center; --col-gap: clamp(4rem, 14vw, 12rem); }
}
.mira-native .mira-link-list > li { margin: 0; text-align: left; }
.mira-native .mira-link-list > li > a,
.mira-native .mira-link-list > li:not(:has(> a)) { display: flex; align-items: baseline; gap: 0.4em; }
.mira-native .mira-link-list > li > a { color: inherit; text-decoration: none; }
/* An unlinked item keeps the arrow's space (hidden), so it lines up with the linked ones. */
.mira-native .mira-link-list > li:not(:has(> a))::before { content: "\2192"; flex: 0 0 auto; visibility: hidden; }
.mira-native .mira-link-list--boxed > li {
  background: rgba(var(--chip-ink), 0.05);
  border: 1px solid rgba(var(--chip-ink), 0.55);
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
}

/* ---- Text block (patterns "Text" and "Text band"): eyebrow + rich text; background is the Group's colour ---- */
/* The eyebrow was a <div>; as a paragraph it would pick up main.css's `.text-block p` (13px, regular, black). */
.mira-native .text-block__eyebrow { padding-bottom: 0; font-size: 16px; font-weight: 700; line-height: 1.4; color: inherit; }
/* Typed alignment beats the theme's centred text-block headings, as the old inline style did. */
.mira-native .text-content .has-text-align-left { text-align: left; }
.mira-native .text-content .has-text-align-center { text-align: center; }
.mira-native .text-content .has-text-align-right { text-align: right; }
/* A typed font size now sits on the block, not a span inside it. Keep the spacing and minimum line height the
   theme's own size gave (main.css sets them in em): headings 20px (14px on phones), body 1.125rem.
   The :is() also matches the editor (which keeps the Group's inner wrapper) and text inside a quote. */
.mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > h2[style*="font-size"] { margin-bottom: 10px; line-height: max(1.3em, 26px); }
.mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > h2[style*="font-size"]:not(:first-child) { margin-top: 40px; }
.mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > :is(p, ul, ol)[style*="font-size"]:not(:last-child) { margin-bottom: 18px; }
.mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > :is(p, ul, ol)[style*="font-size"],
.mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > :is(ul, ol)[style*="font-size"] > li { line-height: max(1.6em, 28.8px); }
.mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > :is(ul, ol)[style*="font-size"] { padding-left: 27px; }
.mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > :is(ul, ol)[style*="font-size"] > li { margin-bottom: 9px; }
.mira-native :is(.text-content, .text-content > .wp-block-group__inner-container) > :first-child { margin-top: 0; }
/* The theme's heading letter-spacing is in em (h2 -0.02em, h1 -0.01em) of the heading's own size, 20px here (h1 and h2 in a
   text block; 14px / 16px on phones). With the size on a span, that small spacing carried over to the big text; keep it. */
.mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > h2[style*="font-size"] { letter-spacing: -0.4px; }
.mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > h1[style*="font-size"] { letter-spacing: -0.2px; }
@media screen and (max-width: 576px) {
  .mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > h2[style*="font-size"] { letter-spacing: -0.28px; }
  .mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > h1[style*="font-size"] { letter-spacing: -0.16px; }
  .mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > h2[style*="font-size"] { margin-bottom: 7px; line-height: max(1.3em, 18.2px); }
  .mira-native :is(.text-content, .text-content > .wp-block-group__inner-container, .text-content > blockquote) > h2[style*="font-size"]:not(:first-child) { margin-top: 28px; }
  .mira-native :is(.text-content, .text-content > .wp-block-group__inner-container) > :first-child { margin-top: 0; }
}

/* ---- List Styles (Styles panel): No bullets; Bullets; 2 / 3 / 4 columns for ordinary lists (link lists: see above) ---- */
ul.wp-block-list.is-style-mira-plain,
ol.wp-block-list.is-style-mira-plain { list-style: none; }
ul.wp-block-list.is-style-mira-bullets { list-style: disc; }
.wp-block-list:is(.is-style-mira-cols-2, .is-style-mira-cols-3, .is-style-mira-cols-4):not(.mira-link-list) { column-gap: 2em; }
.wp-block-list.is-style-mira-cols-2:not(.mira-link-list) { column-count: 2; }
.wp-block-list.is-style-mira-cols-3:not(.mira-link-list) { column-count: 3; }
.wp-block-list.is-style-mira-cols-4:not(.mira-link-list) { column-count: 4; }
.wp-block-list:is(.is-style-mira-cols-2, .is-style-mira-cols-3, .is-style-mira-cols-4):not(.mira-link-list) > li { break-inside: avoid; }
@media (max-width: 576px) {
  .wp-block-list:is(.is-style-mira-cols-3, .is-style-mira-cols-4):not(.mira-link-list) { column-count: 2; }
}

/* A quote inside a text block was a plain <blockquote> with no styling of its own. The theme styles .wp-block-quote as a
   big centred pull quote, so undo that here; the heading inside keeps its usual top margin (2em of the 20px theme size). */
.mira-native .text-content > .wp-block-quote { width: auto; max-width: none; margin: 0; }
.mira-native .text-content > .wp-block-quote p { font-family: inherit; font-weight: inherit; text-align: inherit; letter-spacing: normal; }
.mira-native .text-content > .wp-block-quote > h2:first-child { margin-top: 40px; }
@media screen and (max-width: 576px) {
  .mira-native .text-content > .wp-block-quote > h2:first-child { margin-top: 28px; }
}

/* ---- Article text (pattern "Article text", blog posts): a heading that follows text gets the M gap above it, so every
   article has the same rhythm (replaces pasted blank lines, decided 2026-11-14). Paragraph breaks are each block's own
   bottom margin from the spacing scale. ---- */
.mira-native.left-text .text-content > :is(p, ul, ol, figure, .wp-block-image, .wp-block-buttons, .wp-block-quote) + :is(h1, h2, h3, h4, h5, h6) {
  margin-top: var(--wp--preset--spacing--30);
}
