/*
 * 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; }

/* ---------- 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; }

/* ---------- 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; }

/* ---------- Mobile ---------- */
@media (max-width: 800px) {
	.mbn-hero-block { padding-top: 48px; padding-bottom: 64px; }
	.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; }
}
