/*
 * Content Base – component styles. Design tokens (colours, fonts, sizes) live in theme.json;
 * everything here references them via --wp--preset--* custom properties.
 */

:root {
	--mbn-radius: 20px;
	--mbn-radius-small: 10px;
}

/* ---------- Header ---------- */
.mbn-header .wp-block-navigation a { color: var(--wp--preset--color--muted-light); text-decoration: none; }
.mbn-header .wp-block-navigation a:hover,
.mbn-header .wp-block-navigation .current-menu-item > a,
.mbn-header .wp-block-navigation [aria-current="page"] { color: var(--wp--preset--color--base); box-shadow: inset 0 -2px 0 var(--wp--preset--color--primary); }
.mbn-header .wp-block-site-title a { text-decoration: none; }
/* Light plate behind the logo so dark or transparent PNGs stay visible on the dark header. */
.mbn-header .wp-block-site-logo img { background-color: #fff; border-radius: 10px; padding: 2px 5px; }
.mbn-header .wp-block-navigation__responsive-container.is-menu-open a { box-shadow: none; font-size: 20px; }

/* ---------- Hero ---------- */
.mbn-hero { margin-block-start: 0 !important; }
.mbn-hero .wp-block-post-terms a,
.mbn-kicker { color: var(--wp--preset--color--primary); text-decoration: none; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.mbn-hero h1 { margin-block: 12px 20px; }
.mbn-hero .wp-block-post-date a { color: inherit; text-decoration: none; }
.mbn-hero .wp-block-group.has-small-font-size p { margin: 0; }
/* Leave room for an overlapping featured image when one follows the hero. */
.mbn-hero:has(+ .wp-block-post-featured-image) { padding-bottom: 120px !important; }
/* Narrower hero text, left-aligned with the hero content edge instead of centred. */
.mbn-hero > h1, .mbn-hero > .mbn-hero-lead { margin-left: max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important; }
.mbn-hero > h1 { max-width: 860px; }
.mbn-hero > .mbn-hero-lead { max-width: 620px; }
.mbn-hero mark { background: none; color: var(--wp--preset--color--primary); }

/* ---------- Featured image overlapping the hero ---------- */
.wp-block-post-featured-image.is-style-overlap { max-width: 1000px !important; margin-top: -88px !important; margin-bottom: 48px; position: relative; }
.wp-block-post-featured-image.is-style-overlap img { border-radius: 16px; box-shadow: 0 24px 48px rgba(0, 0, 0, .18); }

/* ---------- Buttons ---------- */
.wp-block-button.is-style-ghost .wp-block-button__link { background: transparent; color: currentColor; box-shadow: inset 0 0 0 2px #3f3f46; }
.wp-block-button__link:hover { filter: brightness(1.1); }

/* ---------- Numbered post list ---------- */
.wp-block-post-template.is-style-numbered { counter-reset: mbn-n; border-top: 2px solid var(--wp--preset--color--contrast); gap: 0; }
.wp-block-post-template.is-style-numbered > li { counter-increment: mbn-n; display: grid; grid-template-columns: 80px 1fr 220px; gap: 24px; align-items: center; padding: 24px 0; margin: 0; border-bottom: 1px solid var(--wp--preset--color--border); }
.wp-block-post-template.is-style-numbered > li::before { content: counter(mbn-n, decimal-leading-zero); font-size: 40px; font-weight: 800; letter-spacing: -.04em; color: var(--wp--preset--color--primary); }
.wp-block-post-template.is-style-numbered > li:not(:has(.wp-block-post-featured-image)) { grid-template-columns: 80px 1fr; }
.is-style-numbered .mbn-item-text > * { margin-block: 4px; }
.is-style-numbered .wp-block-post-terms a { text-decoration: none; }
.is-style-numbered .wp-block-post-title { margin: 4px 0; }
.is-style-numbered .wp-block-post-title a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.is-style-numbered .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }
.is-style-numbered .wp-block-post-featured-image { margin: 0; }
.wp-block-query-pagination { margin-top: 32px; }

/* ---------- Hero block (mbn/hero) ---------- */
.mbn-hero-block { margin-block-start: 0 !important; padding: 72px var(--wp--style--root--padding-right, 16px) 88px var(--wp--style--root--padding-left, 16px); background: var(--wp--preset--color--dark); color: var(--wp--preset--color--base); }
.mbn-hero-block__inner { max-width: var(--wp--style--global--wide-size); margin-inline: auto; }
.mbn-hero-block__title { max-width: 900px; margin: 12px 0 20px; color: inherit; font-size: var(--wp--preset--font-size--xx-large); font-weight: 800; letter-spacing: -.035em; line-height: 1.08; }
.mbn-hero-block__accent { display: block; color: var(--wp--preset--color--primary); }
.mbn-hero-block__intro { max-width: 620px; margin: 0 0 28px; color: var(--wp--preset--color--muted-light); font-size: var(--wp--preset--font-size--large); line-height: 1.6; }
.mbn-hero-block__buttons { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero image (optional): text and image side by side. */
.mbn-hero-block--has-image .mbn-hero-block__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.mbn-hero-block__image { margin: 0; }
.mbn-hero-block__image img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 24px 48px rgba(0, 0, 0, .3); }

/* ---------- Page intro (hand-written excerpt below the page title) ---------- */
.mbn-explicit-excerpt { color: var(--wp--preset--color--muted-light); font-size: var(--wp--preset--font-size--large); line-height: 1.6; }
.mbn-explicit-excerpt p { margin: 0; }

/* ---------- Post list block (mbn/post-list) ---------- */
.mbn-postlist { margin-block: 64px; }
.mbn-postlist__heading { margin: 0 0 24px; font-size: var(--wp--preset--font-size--x-large); }
.mbn-postlist a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.mbn-postlist a:hover { color: var(--wp--preset--color--primary); }
.mbn-postlist .mbn-kicker { margin: 0; }
.mbn-postlist__excerpt { margin: 0; color: var(--wp--preset--color--muted); }
.mbn-postlist__featured { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; margin-bottom: 64px; }
.mbn-postlist__featured-image img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; box-shadow: 0 24px 48px rgba(0, 0, 0, .18); }
.mbn-postlist__featured-title { margin: 8px 0 12px; font-size: var(--wp--preset--font-size--x-large); }
.mbn-postlist__featured .mbn-postlist__excerpt { color: var(--wp--preset--color--contrast); }
.mbn-postlist__list { counter-reset: mbn-postlist; margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--wp--preset--color--contrast); }
.mbn-postlist__item { counter-increment: mbn-postlist; display: grid; grid-template-columns: 80px 1fr 220px; gap: 24px; align-items: center; margin: 0; padding: 24px 0; border-bottom: 1px solid var(--wp--preset--color--border); }
.mbn-postlist__item::before { content: counter(mbn-postlist, decimal-leading-zero); color: var(--wp--preset--color--primary); font-size: 40px; font-weight: 800; letter-spacing: -.04em; }
.mbn-postlist__item:not(:has(.mbn-postlist__item-image)) { grid-template-columns: 80px 1fr; }
.mbn-postlist__item-title { margin: 4px 0; font-size: var(--wp--preset--font-size--large); }
.mbn-postlist__item .mbn-postlist__excerpt { font-size: var(--wp--preset--font-size--small); }
.mbn-postlist__item-image img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }

/* ---------- Card grid (mbn/card-grid) ---------- */
.mbn-cards { margin-block: 64px; }
.mbn-cards__heading { margin: 0 0 12px; font-size: var(--wp--preset--font-size--x-large); }
.mbn-cards__intro { max-width: 680px; margin: 0 0 32px; color: var(--wp--preset--color--muted); }
.mbn-cards__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 0; padding: 0; list-style: none; }
.mbn-cards--cols-2 .mbn-cards__list { grid-template-columns: repeat(2, 1fr); }
.mbn-cards--cols-4 .mbn-cards__list { grid-template-columns: repeat(4, 1fr); }
.mbn-card { position: relative; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 24px; border: 1px solid var(--wp--preset--color--border); border-radius: var(--mbn-radius); background: var(--wp--preset--color--base); transition: border-color .15s, box-shadow .15s, transform .15s; }
.mbn-card--linked:hover { border-color: var(--wp--preset--color--contrast); box-shadow: 0 16px 32px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.mbn-card__image { margin-bottom: 8px; }
.mbn-card__image img { display: block; }
.mbn-cards--photo .mbn-card__image { margin: -24px -24px 8px; }
.mbn-cards--photo .mbn-card__image img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--mbn-radius) var(--mbn-radius) 0 0; }
.mbn-cards--icon .mbn-card__image img { width: 56px; height: 56px; object-fit: contain; }
.mbn-card__title { margin: 0; font-size: var(--wp--preset--font-size--large); }
.mbn-card__title a { color: var(--wp--preset--color--contrast); text-decoration: none; }
/* Stretch the title link over the whole card. */
.mbn-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.mbn-card--linked:hover .mbn-card__title a { color: var(--wp--preset--color--primary); }
.mbn-card__text { margin: 0; color: var(--wp--preset--color--muted); font-size: 15px; line-height: 1.55; }
.mbn-card__more { margin-top: auto; padding-top: 8px; color: var(--wp--preset--color--primary); font-size: 15px; font-weight: 800; }

/* ---------- Form section (mbn/form-section) ---------- */
.mbn-formsec { margin-block: 64px 0; padding: 72px var(--wp--style--root--padding-right, 16px) 72px var(--wp--style--root--padding-left, 16px); background: var(--wp--preset--color--dark); color: var(--wp--preset--color--base); }
.mbn-formsec__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; max-width: var(--wp--style--global--wide-size); margin-inline: auto; }
.mbn-formsec__title { margin: 12px 0 20px; color: inherit; font-size: var(--wp--preset--font-size--x-large); }
.mbn-formsec__body { color: var(--wp--preset--color--muted-light); font-size: var(--wp--preset--font-size--large); line-height: 1.6; }
.mbn-formsec__body a { color: var(--wp--preset--color--base); }
.mbn-formsec__points { margin: 24px 0 0; padding: 0; list-style: none; }
.mbn-formsec__points li { position: relative; margin: 0 0 10px; padding-left: 32px; font-weight: 600; }
.mbn-formsec__points li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--wp--preset--color--primary); color: var(--wp--preset--color--base); font-size: 13px; line-height: 22px; text-align: center; }
.mbn-formsec__image { margin: 32px 0 0; }
.mbn-formsec__image img { display: block; width: 100%; height: auto; border-radius: 16px; }
.mbn-formsec__form { padding: 32px; border-radius: var(--mbn-radius); background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast); box-shadow: 0 24px 48px rgba(0, 0, 0, .3); }
.mbn-formsec__form .gform_wrapper { margin-block: 0; }
/* No gap between a form section (block or page form) at the end of the page and the footer: drop the bottom padding
   of main and the root block gap above the footer, only on pages that end with a form section. */
main:has(> .wp-block-post-content > .mbn-formsec:last-child),
main:has(> .mbn-formsec:last-child) { padding-bottom: 0 !important; }
.wp-site-blocks:has(> main > .wp-block-post-content > .mbn-formsec:last-child) > main + .wp-block-template-part,
.wp-site-blocks:has(> main > .mbn-formsec:last-child) > main + .wp-block-template-part { margin-block-start: 0; }

/* ---------- Rank Math table of contents ---------- */
.wp-block-rank-math-toc-block { margin-block: 40px; padding: 24px 28px; border: 2px solid var(--wp--preset--color--contrast); border-radius: var(--mbn-radius); }
.wp-block-rank-math-toc-block > h2,
.wp-block-rank-math-toc-block > h3 { margin: 0 0 12px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.wp-block-rank-math-toc-block nav ul,
.wp-block-rank-math-toc-block nav ol { margin: 0; padding-left: 20px; }
.wp-block-rank-math-toc-block nav li { margin: 4px 0; }
.wp-block-rank-math-toc-block nav a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.wp-block-rank-math-toc-block nav a:hover { color: var(--wp--preset--color--primary); text-decoration: underline; }

/* ---------- Comments ---------- */
.mbn-comments { margin-top: 64px; padding: 32px; border-radius: var(--mbn-radius); background: #f4f4f5; border: 1px solid var(--wp--preset--color--border); }
.mbn-comments .wp-block-comments-title,
.mbn-comments .comment-reply-title { margin: 0 0 16px; font-size: var(--wp--preset--font-size--large); }
.mbn-comments .wp-block-comment-template { margin: 0 0 32px; padding: 0; list-style: none; }
.mbn-comments .wp-block-comment-template li { margin: 0 0 16px; padding: 16px 20px; border-radius: var(--mbn-radius-small); background: var(--wp--preset--color--base); }
.mbn-comments .wp-block-comment-template ol { margin-top: 16px; padding-left: 20px; list-style: none; }
.mbn-comments .wp-block-comment-author-name { font-weight: 800; }
.mbn-comments .wp-block-comment-date { color: var(--wp--preset--color--muted); }
.mbn-comments .wp-block-comment-date a, .mbn-comments .wp-block-comment-author-name a { color: inherit; text-decoration: none; }
.mbn-comments .comment-form p { margin: 0 0 16px; }
.mbn-comments .comment-form label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 800; }
.mbn-comments .comment-form input[type="text"],
.mbn-comments .comment-form input[type="email"],
.mbn-comments .comment-form input[type="url"],
.mbn-comments .comment-form textarea {
	width: 100%; box-sizing: border-box; padding: 12px 14px; font: inherit; font-size: 16px;
	background: var(--wp--preset--color--base); border: 2px solid var(--wp--preset--color--border); border-radius: 12px;
}
.mbn-comments .comment-form input:focus,
.mbn-comments .comment-form textarea:focus { outline: none; border-color: var(--wp--preset--color--contrast); }
.mbn-comments .comment-form-cookies-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.mbn-comments .comment-form-cookies-consent label { display: inline; font-weight: 400; }
.mbn-comments .comment-form-cookies-consent input { margin-top: 4px; accent-color: var(--wp--preset--color--primary); }
.mbn-comments .comment-notes, .mbn-comments .logged-in-as { font-size: 14px; color: var(--wp--preset--color--muted); }

/* ---------- Post list "all articles" button ---------- */
.mbn-postlist__more { margin-top: 32px; }

/* ---------- Pros and cons ---------- */
.mbn-proscons { display: grid; grid-template-columns: 1fr 1fr; margin-block: 40px; border: 2px solid var(--wp--preset--color--contrast); border-radius: var(--mbn-radius); overflow: hidden; }
.mbn-proscons > div { padding: 20px 24px; font-size: 15px; }
.mbn-proscons > div + div { border-left: 2px solid var(--wp--preset--color--contrast); }
.mbn-proscons > div:only-child { grid-column: 1 / -1; }
.mbn-proscons h5 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 8px; font-weight: 800; }
.mbn-proscons__pros h5 { color: #16a34a; }
.mbn-proscons__cons h5 { color: var(--wp--preset--color--primary); }
.mbn-proscons ul { margin: 0; padding-left: 18px; }

/* ---------- Tip box ---------- */
.mbn-tip { margin-block: 40px; padding: 24px 28px; border-radius: var(--mbn-radius); background: var(--wp--preset--color--accent); color: var(--wp--preset--color--dark); font-weight: 600; font-size: 18px; line-height: 1.5; }
.mbn-tip--warning { background: var(--wp--preset--color--dark); color: var(--wp--preset--color--base); }
.mbn-tip__label { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.mbn-tip--warning .mbn-tip__label { color: var(--wp--preset--color--accent); }
.mbn-tip p { margin: 4px 0 0; }

/* ---------- Footer ---------- */
.mbn-site-info { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.mbn-site-info ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.mbn-site-info__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.mbn-site-info a { color: var(--wp--preset--color--base); text-decoration: none; }
.mbn-site-info__copy { margin: 0; }

/* ---------- Editor helpers ---------- */
.mbn-block-empty { padding: 16px; border: 1px dashed currentColor; border-radius: 8px; font-size: 14px; opacity: .7; }

/* ---------- Tablet ---------- */
@media (min-width: 801px) and (max-width: 1100px) {
	.mbn-cards--cols-3 .mbn-cards__list,
	.mbn-cards--cols-4 .mbn-cards__list { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Mobile ---------- */
@media (max-width: 800px) {
	.mbn-hero-block { padding-top: 48px; padding-bottom: 64px; }
	.mbn-hero-block--has-image .mbn-hero-block__inner,
	.mbn-formsec__inner { grid-template-columns: 1fr; gap: 32px; }
	.mbn-formsec { padding-block: 48px; }
	.mbn-formsec__form { padding: 20px; }
	.mbn-cards__list,
	.mbn-cards--cols-2 .mbn-cards__list,
	.mbn-cards--cols-4 .mbn-cards__list { grid-template-columns: 1fr; }
	.mbn-postlist__featured { grid-template-columns: 1fr; gap: 16px; }
	/* Numbered lists on mobile: small number, text, small thumbnail on the right. */
	.mbn-postlist__item,
	.wp-block-post-template.is-style-numbered > li { grid-template-columns: 28px 1fr 96px; gap: 12px; align-items: start; padding: 18px 0; }
	.mbn-postlist__item:not(:has(.mbn-postlist__item-image)),
	.wp-block-post-template.is-style-numbered > li:not(:has(.wp-block-post-featured-image)) { grid-template-columns: 28px 1fr; }
	.mbn-postlist__item::before,
	.wp-block-post-template.is-style-numbered > li::before { font-size: 18px; line-height: 1.5; }
	.mbn-postlist__item-image img,
	.is-style-numbered .wp-block-post-featured-image img { aspect-ratio: 1 / 1; border-radius: 8px; }
	.mbn-postlist__item-title,
	.is-style-numbered .wp-block-post-title { font-size: 17px; line-height: 1.3; }
	.mbn-postlist__item .mbn-postlist__excerpt,
	.is-style-numbered .wp-block-post-excerpt { display: none; }
	.mbn-comments { padding: 20px; }
	.mbn-proscons { grid-template-columns: 1fr; }
	.mbn-proscons > div + div { border-left: 0; border-top: 2px solid var(--wp--preset--color--contrast); }
	.wp-block-post-featured-image.is-style-overlap { margin-top: -72px !important; }
}
