/* Base layout of block documents (BlockRenderer, docs/page-builder.md). Linked right after
   mw-site.css and before the design's own stylesheets, so a design can override everything.
   Colours, fonts, radius and buttons come only from the design tokens (MAKEWEB5-36,
   DesignTokens::css() puts :root{--mw-color-*, --mw-font-*, --mw-radius, --mw-button-*} and the
   section presets in front of the design's style.css); the fallbacks below are the defaults.
   The implicit section of a page without a document (style default, spacing none, width normal,
   one column) adds no spacing or background, so such pages look as they did before blocks. */

/* Sections: spacing, width, alignment */
.mw-section { position: relative; padding-top: var(--mw-section-space, 0); padding-bottom: var(--mw-section-space, 0); }
.mw-space-none { --mw-section-space: 0; }
.mw-space-s { --mw-section-space: var(--mw-space-s, 16px); }
.mw-space-m { --mw-section-space: var(--mw-space-m, 32px); }
.mw-space-l { --mw-section-space: var(--mw-space-l, 64px); }
.mw-section-inner { margin-left: auto; margin-right: auto; }
.mw-width-normal > .mw-section-inner { max-width: var(--mw-width-normal, none); }
/* wide: up to --mw-width-wide (never wider than the window), centred on the content column */
.mw-width-wide { margin-left: calc(50% - min(50vw, var(--mw-width-wide, 1400px) / 2)); margin-right: calc(50% - min(50vw, var(--mw-width-wide, 1400px) / 2)); }
/* full: the whole window width; the content stays inside the gutter */
.mw-width-full { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.mw-width-full > .mw-section-inner { padding-left: var(--mw-gutter, 20px); padding-right: var(--mw-gutter, 20px); max-width: var(--mw-width-full, none); }
.mw-align-left { text-align: left; }
.mw-align-center { text-align: center; }
.mw-align-right { text-align: right; }

/* Columns. Layout names are relative widths: 1-2 = one third + two thirds. */
.mw-cols { display: grid; gap: var(--mw-col-gap, 32px); grid-template-columns: minmax(0, 1fr); }
.mw-cols-1 { display: block; }
.mw-cols-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mw-cols-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mw-cols-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mw-cols-1-1-1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mw-cols-1-1-1-1 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mw-col { min-width: 0; }
.mw-col > .mw-block + .mw-block { margin-top: var(--mw-block-gap, 24px); }
/* no outer margins inside blocks (columns line up); zero specificity, and not the page's own content */
:where(.mw-block:not(.mw-block-page-content)) > :where(:first-child) { margin-top: 0; }
:where(.mw-block:not(.mw-block-page-content)) > :where(:last-child) { margin-bottom: 0; }

/* Responsive stacking: 4 columns -> 2 on tablets, everything -> 1 on phones */
@media (max-width: 900px) {
	.mw-cols-1-1-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
	.mw-cols-1-1, .mw-cols-1-2, .mw-cols-2-1, .mw-cols-1-1-1, .mw-cols-1-1-1-1 { grid-template-columns: minmax(0, 1fr); gap: var(--mw-col-gap-mobile, 24px); }
	.mw-space-l { --mw-section-space: var(--mw-space-l-mobile, 40px); }
}

/* Fonts (tokens heading/body; none set = the design's own font). Zero specificity: design rules win. */
:where(.mw-section) { font-family: var(--mw-font-body, inherit); }
:where(.mw-section) :where(h1, h2, h3, h4, h5, h6) { font-family: var(--mw-font-heading, inherit); }

/* Section styles (DesignService::blockStyles()). The token CSS has a rule set per preset of the
   design (.mw-section-style-<name>); these are the fallbacks of the default presets. */
.mw-section-style-light, .mw-section-style-dark, .mw-has-bg { padding-left: var(--mw-section-pad-x, 24px); padding-right: var(--mw-section-pad-x, 24px); }
.mw-section-style-light { background-color: var(--mw-color-light, #f4f5f7); color: var(--mw-color-text, inherit); }
.mw-section-style-dark { background-color: var(--mw-color-dark, #23272b); color: var(--mw-color-light, #f4f5f7); }
.mw-section-style-dark a:not(.mw-button) { color: inherit; }
.mw-has-bg { background-size: cover; background-position: center; }

/* Blocks */
.mw-text-heading { margin: 0 0 .5em; }
.mw-richtext img { max-width: 100%; height: auto; }
.mw-block-error { padding: 8px 12px; border: 1px dashed #b00; color: #b00; font: 14px/1.4 system-ui, sans-serif; }

/* ---- Content blocks (MAKEWEB5-37): heading, image, image_text, hero, cta, cards ----
   Colours, fonts and radius only from the design tokens (--mw-color-*, --mw-font-*, --mw-radius). */
.mw-icon { display: inline-block; width: 1.25em; height: 1.25em; flex: none; vertical-align: -.2em; }
.mw-eyebrow { margin: 0 0 .4em; font-size: .85em; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mw-color-accent, currentColor); }

/* Buttons: <a class="mw-button mw-button-primary|secondary|ghost">. The primary button follows the design's
   button token (--mw-button-*: solid, outline or pill, DesignTokens::css()); on-* = readable text on that colour. */
.mw-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.2em 0 0; }
a.mw-button { display: inline-flex; align-items: center; gap: .5em; padding: .7em 1.3em; border: 2px solid transparent; border-radius: var(--mw-button-radius, var(--mw-radius, 4px));
	font-weight: 600; line-height: 1.2; text-decoration: none; }
a.mw-button-primary { background: var(--mw-button-bg, var(--mw-color-primary, #1d4f7a)); border-color: var(--mw-button-border, var(--mw-color-primary, #1d4f7a));
	color: var(--mw-button-color, var(--mw-color-on-primary, #fff)); }
a.mw-button-primary:hover, a.mw-button-primary:focus-visible { background: var(--mw-button-hover-bg, var(--mw-color-primary, #1d4f7a));
	border-color: var(--mw-button-hover-border, var(--mw-color-primary, #1d4f7a)); color: var(--mw-button-hover-color, var(--mw-color-on-primary, #fff)); }
a.mw-button-secondary { background: var(--mw-color-secondary, #4b5563); border-color: var(--mw-color-secondary, #4b5563); color: var(--mw-color-on-secondary, #fff); }
a.mw-button-ghost { background: transparent; border-color: currentColor; color: inherit; }
a.mw-button:hover, a.mw-button:focus-visible { filter: brightness(1.1); text-decoration: underline; }
a.mw-button-big { padding: .9em 1.6em; font-size: 1.15em; }
.mw-button-label { display: inline-flex; flex-direction: column; }
.mw-button-note { font-size: .7em; font-weight: 400; opacity: .9; }
.mw-arrow { display: inline-block; margin-left: .35em; }

/* heading */
.mw-heading-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; }
.mw-heading-title { margin: 0; font-family: var(--mw-font-heading, inherit); }
.mw-see-all { font-weight: 600; white-space: nowrap; color: var(--mw-color-primary, inherit); }
.mw-heading-intro { margin: .6em 0 0; max-width: 60em; color: var(--mw-color-muted, inherit); }
.mw-align-center .mw-heading-row { justify-content: center; text-align: center; }

/* image */
.mw-figure { margin: 0; }
.mw-figure img, .mw-image-text-media img, .mw-card-media img { display: block; max-width: 100%; height: auto; border-radius: var(--mw-radius, 0); }
.mw-figure[class*="mw-aspect-"] img, .mw-card-media img { width: 100%; object-fit: cover; }
.mw-aspect-16-9 img { aspect-ratio: 16 / 9; }
.mw-aspect-3-2 img { aspect-ratio: 3 / 2; }
.mw-aspect-4-3 img { aspect-ratio: 4 / 3; }
.mw-aspect-1-1 img { aspect-ratio: 1 / 1; }
.mw-aspect-3-4 img { aspect-ratio: 3 / 4; }
.mw-figure figcaption { margin-top: .4em; font-size: .9em; color: var(--mw-color-muted, inherit); }

/* image_text */
.mw-image-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--mw-col-gap, 32px); align-items: center; }
.mw-image-text.mw-no-image { display: block; }
.mw-image-right .mw-image-text-media { order: 2; }
.mw-image-text-media img { width: 100%; }
.mw-image-text-heading { margin: 0 0 .5em; font-family: var(--mw-font-heading, inherit); }
.mw-image-text-body > :first-child { margin-top: 0; }

/* hero: the picture covers the block, the overlay darkens/lightens it for the text */
.mw-hero { position: relative; display: flex; align-items: center; overflow: hidden; isolation: isolate; padding: 48px var(--mw-gutter, 20px);
	background: var(--mw-color-dark, #23272b); color: var(--mw-color-on-dark, #fff); border-radius: var(--mw-hero-radius, 0); }
.mw-hero-s { min-height: 280px; }
.mw-hero-m { min-height: 440px; }
.mw-hero-l { min-height: min(720px, 85vh); }
.mw-hero-image { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.mw-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; }
.mw-hero-has-image.mw-overlay-dark::before { background: linear-gradient(90deg, rgba(0, 0, 0, .7), rgba(0, 0, 0, .25)); }
.mw-hero-has-image.mw-overlay-primary::before { background: var(--mw-color-primary, #1d4f7a); opacity: .7; }
.mw-overlay-light { background: var(--mw-color-light, #f4f3ef); color: var(--mw-color-text, #222); }
.mw-hero-has-image.mw-overlay-light::before { background: var(--mw-color-light, #f4f3ef); opacity: .75; }
.mw-overlay-primary { background: var(--mw-color-primary, #1d4f7a); color: var(--mw-color-on-primary, #fff); }
.mw-hero-inner { position: relative; width: 100%; max-width: var(--mw-width-normal, 1100px); margin: 0 auto; }
.mw-hero-inner > * { max-width: 40em; }
.mw-hero-align-center { text-align: center; }
.mw-hero-align-center .mw-hero-inner > * { margin-left: auto; margin-right: auto; }
.mw-hero-align-center .mw-buttons { justify-content: center; }
.mw-hero-heading { margin: 0 0 .3em; font-family: var(--mw-font-heading, inherit); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; color: inherit; }
.mw-hero-lead { margin: 0; font-size: 1.2em; }
.mw-hero .mw-eyebrow { color: inherit; opacity: .9; }

/* cta */
.mw-cta { position: relative; overflow: hidden; isolation: isolate; padding: 40px var(--mw-gutter, 24px); border-radius: var(--mw-radius, 0);
	background: var(--mw-color-dark, #23272b); color: var(--mw-color-on-dark, #fff); }
.mw-cta-image { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.mw-cta-has-image::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0, 0, 0, .75), rgba(0, 0, 0, .35)); }
.mw-cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; max-width: var(--mw-width-normal, 1100px); margin: 0 auto; }
.mw-cta-text { flex: 1 1 24em; }
.mw-cta-heading { margin: 0 0 .4em; font-family: var(--mw-font-heading, inherit); color: inherit; }
.mw-cta-body { margin: 0; }
.mw-cta .mw-eyebrow { color: inherit; opacity: .9; }

/* cards: '' (cards), features, tiles */
.mw-cards { display: grid; gap: var(--mw-card-gap, 24px); margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mw-cards-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mw-cards-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mw-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--mw-radius, 4px);
	background: var(--mw-color-background, #fff); color: var(--mw-color-text, inherit); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.mw-card-body { padding: 16px 18px 20px; }
.mw-card-icon { padding: 18px 18px 0; color: var(--mw-color-primary, currentColor); }
.mw-card-icon .mw-icon { width: 40px; height: 40px; }
.mw-card-media img { border-radius: 0; }
.mw-card-title { margin: 0 0 .35em; font-family: var(--mw-font-heading, inherit); font-size: 1.15em; }
.mw-card-title a { color: inherit; text-decoration: none; }
.mw-card-linked .mw-card-title a::after { content: ""; position: absolute; inset: 0; } /* the whole card is the link */
.mw-card-linked:hover .mw-card-title a, .mw-card-title a:focus-visible { text-decoration: underline; }
.mw-card-linked:focus-within { outline: 2px solid var(--mw-color-primary, currentColor); outline-offset: 2px; }
.mw-card-text { margin: 0; color: var(--mw-color-muted, inherit); }
.mw-variant-features .mw-card { flex-direction: row; gap: 14px; background: none; box-shadow: none; overflow: visible; color: inherit; }
.mw-variant-features .mw-card-icon { padding: 0; }
.mw-variant-features .mw-card-media { flex: 0 0 72px; }
.mw-variant-features .mw-card-body { padding: 0; }
.mw-variant-features .mw-card-text { color: inherit; opacity: .85; }
.mw-variant-tiles .mw-card { justify-content: flex-end; min-height: 200px; background: var(--mw-color-dark, #23272b); color: var(--mw-color-on-dark, #fff); }
.mw-variant-tiles .mw-card-media { position: absolute; inset: 0; }
.mw-variant-tiles .mw-card-media img { height: 100%; aspect-ratio: auto; }
.mw-variant-tiles .mw-card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0, 0, 0, .75)); }
.mw-variant-tiles .mw-card-body { position: relative; }
.mw-variant-tiles .mw-card-text { color: inherit; }

@media (max-width: 900px) {
	.mw-cards-cols-3, .mw-cards-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
	.mw-image-text, .mw-cards, .mw-cards-cols-2, .mw-cards-cols-3, .mw-cards-cols-4 { grid-template-columns: minmax(0, 1fr); }
	.mw-image-right .mw-image-text-media { order: 0; }
	.mw-hero-m { min-height: 360px; }
	.mw-hero-l { min-height: 480px; }
}
@media (prefers-reduced-motion: no-preference) {
	a.mw-button { transition: filter .15s; }
}

.mw-block-placeholder { padding: 12px; border: 1px dashed #999; color: #666; font: 14px/1.4 system-ui, sans-serif; }

/* Gallery (BlockTypeGallery): ul.mw-gallery also styles the rich-text gallery in mw-site.css */
.mw-gallery-heading, .mw-form-title { margin: 0 0 .5em; font-family: var(--mw-font-heading, inherit); }
.mw-block-gallery .mw-gallery { margin: 0; gap: var(--mw-gallery-gap, 12px); }
.mw-block-gallery .mw-gallery-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mw-block-gallery .mw-gallery-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mw-block-gallery .mw-gallery-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mw-block-gallery .mw-gallery-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mw-block-gallery .mw-gallery-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mw-gallery-link { display: block; }
.mw-gallery-crop img { object-fit: cover; aspect-ratio: 4 / 3; }
.mw-gallery-crop-1-1 img { aspect-ratio: 1 / 1; }
.mw-gallery-crop-3-2 img { aspect-ratio: 3 / 2; }
.mw-gallery-crop-16-9 img { aspect-ratio: 16 / 9; }
.mw-gallery-crop-3-4 img { aspect-ratio: 3 / 4; }
.mw-gallery-more { margin: 1em 0 0; }
@media (max-width: 900px) {
	.mw-block-gallery .mw-gallery-cols-5, .mw-block-gallery .mw-gallery-cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
	.mw-block-gallery .mw-gallery-cols-3, .mw-block-gallery .mw-gallery-cols-4, .mw-block-gallery .mw-gallery-cols-5, .mw-block-gallery .mw-gallery-cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Embed (BlockTypeEmbed): the iframe fills a box of the chosen aspect ratio (or the service's fixed height) */
.mw-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.mw-embed-4-3 { aspect-ratio: 4 / 3; }
.mw-embed-1-1 { aspect-ratio: 1 / 1; }
.mw-embed-21-9 { aspect-ratio: 21 / 9; }
.mw-embed-9-16 { aspect-ratio: 9 / 16; max-width: 420px; }
.mw-embed-fixed { aspect-ratio: auto; }
.mw-embed iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }

/* Article list (article_list, MAKEWEB5-41): cards, list or compact list of articles from other pages */
.mw-alist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--mw-alist-gap, 24px); }
.mw-alist-item { margin: 0; min-width: 0; }
.mw-alist-cards { grid-template-columns: repeat(var(--mw-alist-cols, 3), minmax(0, 1fr)); }
.mw-alist-cols-2 { --mw-alist-cols: 2; }
.mw-alist-cols-3 { --mw-alist-cols: 3; }
.mw-alist-cols-4 { --mw-alist-cols: 4; }
.mw-alist-cards .mw-alist-item { display: flex; flex-direction: column; background: var(--mw-card-bg, transparent); border-radius: var(--mw-radius, 0); overflow: hidden; }
.mw-alist-media { position: relative; }
.mw-alist-image { display: block; }
.mw-alist-image img { display: block; width: 100%; height: auto; object-fit: cover; border-radius: var(--mw-radius, 0); }
.mw-alist-body { padding-top: .75em; }
.mw-alist-title { margin: 0 0 .35em; font-size: 1.15em; }
.mw-alist-title a { text-decoration: none; color: inherit; }
.mw-alist-title a:hover { text-decoration: underline; }
.mw-alist-meta, .mw-alist-ingress, .mw-alist-more { margin: 0 0 .5em; }
.mw-alist-meta { font-size: .9em; opacity: .8; }
.mw-alist-more { margin-bottom: 0; }
/* Date badge: day over short month; on the picture's corner when there is one */
.mw-date-badge { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 3.2em; padding: .35em .5em;
	line-height: 1.1; text-align: center; background: var(--mw-color-primary, #23272b); color: var(--mw-color-on-primary, #fff); border-radius: var(--mw-radius, 4px); margin-bottom: .5em; }
.mw-date-day { font-size: 1.4em; font-weight: 700; }
.mw-date-month { font-size: .75em; text-transform: uppercase; letter-spacing: .05em; }
.mw-alist-media .mw-date-badge { position: absolute; top: 10px; left: 10px; margin: 0; }
/* List and compact: picture (or badge) left, text right */
.mw-alist-list .mw-alist-item, .mw-alist-compact .mw-alist-item { display: flex; gap: 1em; align-items: flex-start; }
.mw-alist-item > .mw-date-badge { flex: none; margin: 0; }
.mw-alist-list .mw-alist-media { flex: 0 0 var(--mw-alist-image-width, 33%); }
.mw-alist-list.mw-alist-image-small .mw-alist-media { flex-basis: var(--mw-alist-image-small, 120px); }
.mw-alist-list .mw-alist-body, .mw-alist-compact .mw-alist-body { padding-top: 0; flex: 1 1 auto; min-width: 0; }
.mw-alist-image-small.mw-alist-cards .mw-alist-image img { max-width: 160px; }
/* Compact: one short row per article */
.mw-alist-compact { gap: .6em; }
.mw-alist-compact .mw-alist-item { gap: .75em; align-items: center; }
.mw-alist-compact .mw-date-badge { font-size: .85em; }
.mw-alist-compact .mw-alist-title { font-size: 1em; margin: 0; }
.mw-alist-compact .mw-alist-meta, .mw-alist-compact .mw-alist-more { margin: 0; }
.mw-alist-empty { margin: 0; font-style: italic; }
.mw-alist-footer { margin: 1em 0 0; }
.mw-heading-row + .mw-alist, .mw-heading-row + .mw-alist-empty { margin-top: 1em; }
@media (max-width: 900px) {
	.mw-alist-cols-4, .mw-alist-cols-3 { --mw-alist-cols: 2; }
}
@media (max-width: 700px) {
	.mw-alist-cards { --mw-alist-cols: 1; }
	.mw-alist-list:not(.mw-alist-image-small) .mw-alist-has-media { flex-direction: column; }
	.mw-alist-list:not(.mw-alist-image-small) .mw-alist-media { flex-basis: auto; width: 100%; }
}
