/*
Theme Name: Kokoomus
Author: Kokoomus
Description: Shared editable block theme for two campaign sites.
Version: 0.1.5
Requires at least: 7.1
Requires PHP: 8.3
License: GPL-2.0-or-later
Text Domain: kokoomus
*/

html { scroll-behavior: smooth; }
body { min-width: 320px; }
.wp-site-blocks { overflow-wrap: anywhere; }
.wp-block-site-title a { color: inherit; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .wp-block-site-title a:hover { text-decoration: underline; } }
.wp-block-navigation a { text-decoration: none; }
header.wp-block-template-part a, footer.wp-block-template-part a { color: inherit; }
:where(a, button, input, textarea, select, .wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close):focus-visible {
  outline: 2px solid var(--wp--preset--color--focus);
  outline-offset: 3px;
}
.wp-block-post-featured-image img { display: block; width: 100%; height: auto; }
@media (max-width: 599px) {
  h1 { font-size: clamp(2.25rem, 10vw, 3.5rem); }
  h2 { font-size: clamp(1.75rem, 7vw, 2.5rem); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

:root {
  --kokoomus-gutter: clamp(1rem, 4vw, 3rem);
  --kokoomus-section-gap: clamp(3rem, 7vw, 6rem);
  --kokoomus-reading-width: 46rem;
  --kokoomus-touch-target: 2.75rem;
  --kokoomus-control-border: color-mix(in srgb, var(--wp--preset--color--text) 60%, var(--wp--preset--color--surface));
}
.wp-site-blocks :is(a, button, input, textarea, select) { touch-action: manipulation; }
.wp-block-columns > .wp-block-column { min-width: 0; }
.wp-site-blocks :is(h1, h2, h3, h4) { overflow-wrap: anywhere; text-wrap: balance; }
.wp-site-blocks :is(ul, ol) { box-sizing: border-box; }
@media (hover: hover) and (pointer: fine) {
  .wp-site-blocks :is(p, li) > a:not(.wp-block-button__link, .wp-block-navigation-item__content):hover { text-decoration: underline; }
}
.wp-site-blocks img { max-width: 100%; height: auto; }
.wp-site-blocks main { min-width: 0; }
.wp-site-blocks main > .wp-block-post-content { margin-block-start: 0; }
.wp-site-blocks a { text-underline-offset: .18em; text-decoration-thickness: .08em; }

/* Native Site Editor parts and responsive navigation. */
header.wp-block-template-part .wp-block-group.alignfull,
footer.wp-block-template-part .wp-block-group.alignfull {
  padding-inline: var(--kokoomus-gutter);
}
header.wp-block-template-part .wp-block-group.alignfull { padding-block: .9rem; }
header.wp-block-template-part .wp-block-group.alignfull > .wp-block-group {
  max-width: var(--wp--style--global--wide-size);
  margin-inline: auto;
}
header.wp-block-template-part a,
footer.wp-block-template-part a { color: inherit; }
header.wp-block-template-part .wp-block-site-title {
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  line-height: 1.15;
}
header.wp-block-template-part .wp-block-navigation { margin-inline-start: auto; }
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
  text-decoration: underline;
  text-underline-offset: .3em;
}
@media (hover: hover) and (pointer: fine) {
  .wp-block-navigation .wp-block-navigation-item__content:hover { text-decoration: underline; text-underline-offset: .3em; }
}
.wp-block-navigation__responsive-container.is-menu-open {
  background: var(--wp--preset--color--brand);
  color: var(--wp--preset--color--on-brand);
  padding: var(--kokoomus-gutter);
}
footer.wp-block-template-part .wp-block-columns {
  gap: clamp(1.5rem, 5vw, 4rem);
  max-width: var(--wp--style--global--wide-size);
  margin-inline: auto;
}
footer.wp-block-template-part .wp-block-list { padding-inline-start: 1.2em; }
footer.wp-block-template-part h3 { color: inherit; }

/* Shared sections use the active Global Styles variation. */
.kokoomus-section,
.mats-section { padding-block: var(--kokoomus-section-gap); }
.kokoomus-section > :first-child,
.mats-section > :first-child { margin-block-start: 0; }
.kokoomus-section > :last-child,
.mats-section > :last-child { margin-block-end: 0; }
.kokoomus-prose,
.mats-content.layout-text {
  max-width: min(100% - 2 * var(--kokoomus-gutter), 72ch);
  margin-inline: auto;
}
.kokoomus-prose p,
:where(.mats-content p) { line-height: 1.7; }
.kokoomus-surface-accent {
  background: var(--wp--preset--color--surface-alt);
}
.mats-content.has-blue-background { padding-inline: var(--kokoomus-gutter); }
:where(.mats-content.has-blue-background a) { color: inherit; }
.mats-content.is-centered { text-align: center; }
.mats-content.layout-imageLeft .wp-block-columns { flex-direction: row-reverse; }
.mats-content .wp-block-columns {
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
}
.mats-content .wp-block-image img { display: block; }

/* Cover text stays readable over either site's photographs. */
.kokoomus-hero,
:where(.mats-hero) { isolation: isolate; min-height: clamp(26rem, 55vw, 43rem); }
.mats-hero .wp-block-cover__inner-container,
.kokoomus-hero .wp-block-cover__inner-container {
  z-index: 2;
  width: min(100% - 2 * var(--kokoomus-gutter), var(--wp--style--global--wide-size));
  margin-inline: auto;
  padding-block: clamp(3rem, 9vw, 8rem);
}
.mats-hero .wp-block-cover__inner-container > *,
.kokoomus-hero .wp-block-cover__inner-container > * { max-width: 42rem; }
:where(.mats-hero) :where(h1, p, a:not(.wp-block-button__link)) { color: var(--wp--preset--color--on-brand); }
.mats-hero h1 { font-size: clamp(2.8rem, 7vw, 6rem); line-height: 1.02; }
:where(.mats-hero-overline) {
  font-family: var(--wp--preset--font-family--ui);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mats-hero .wp-block-buttons { margin-block-start: 2rem; }
.mats-hero .wp-block-button__link {
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--on-brand);
}
.wp-block-button__link,
.kokoomus-contact-form button {
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease, filter .18s ease;
}
@media (hover: hover) and (pointer: fine) {
  .wp-block-button__link:hover,
  .kokoomus-contact-form button:not(:disabled):hover {
    filter: brightness(.94);
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgb(0 0 0 / .18);
  }
  .wp-block-button__link:active,
  .kokoomus-contact-form button:not(:disabled):active {
    transform: translateY(0);
    box-shadow: none;
  }
}
.wp-block-button__link { min-height: 44px; box-sizing: border-box; }
.kokoomus-contact-form button:disabled { cursor: wait; opacity: .65; }
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }

/* Themes, publication cards, article lists, and quotations. */
.mats-campaign-promises .wp-block-columns,
.kokoomus-themes .wp-block-columns { gap: 1.25rem; align-items: stretch; }
:where(.mats-campaign-promises .wp-block-column),
.kokoomus-spotlight,
:where(.mats-publication),
:where(.mats-publication-card),
:where(.mats-tweet-card),
.kokoomus-articles .wp-block-post {
  background: var(--wp--preset--color--surface);
  border: 0;
  border-radius: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: none;
}
.mats-activity-feed .mats-publication,
.mats-publications .mats-publication,
.mats-activity-feed .mats-tweet-card,
.mats-publications .mats-tweet-card {
  padding-block: clamp(1.25rem, 3vw, 2rem);
}
:where(.mats-promise-icon) { color: var(--wp--preset--color--accent); font-size: 2rem; line-height: 1; }
.mats-activity-feed .wp-block-post-template,
.mats-publications .wp-block-post-template,
.kokoomus-articles .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.25rem;
  list-style: none;
  padding: 0;
}
.mats-publication-card h3,
.mats-tweet-card h3 { margin-block-start: 0; }
:where(.mats-publication-meta),
:where(.mats-tweet-date) { color: var(--wp--preset--color--text-muted); font-size: .9rem; }
:where(.mats-testimonials .wp-block-quote),
.kokoomus-testimonials .wp-block-quote {
  background: var(--wp--preset--color--surface);
  border: 0;
  border-radius: 0;
  margin-inline: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
}
:where(.mats-testimonials .wp-block-quote cite),
.kokoomus-testimonials .wp-block-quote cite {
  color: var(--wp--preset--color--text-muted);
  font-style: normal;
  font-weight: 700;
}
.mats-testimonials .wp-block-quote img {
  width: 4rem;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

/* Free contact form: native labels, fields, feedback, and focus. */
.kokoomus-contact-form { max-width: 40rem; }
.kokoomus-contact-form p { margin-block: 0 1.25rem; }
.kokoomus-contact-form label { display: block; font-weight: 700; margin-block-end: .35rem; }
.kokoomus-contact-form input:not([type="checkbox"]),
.kokoomus-contact-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  padding: .65rem .8rem;
  border: 2px solid var(--kokoomus-control-border);
  border-radius: 0;
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--text);
  font: inherit;
}
.kokoomus-contact-form textarea { resize: vertical; }
form.kokoomus-contact-form :is(input, textarea)[aria-invalid="true"] { border-color: var(--wp--preset--color--focus); }
.kokoomus-contact-form label:has(input[type="checkbox"]) { min-height: var(--kokoomus-touch-target); cursor: pointer; }
.kokoomus-contact-form input:focus,
.kokoomus-contact-form textarea:focus { border-color: var(--wp--preset--color--focus); }
.kokoomus-contact-form label:has(input[type="checkbox"]) {
  display: flex;
  align-items: start;
  gap: .65rem;
  font-weight: 400;
}
.kokoomus-contact-form input[type="checkbox"] { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; margin: .2rem 0 0; }
.kokoomus-contact-form label:has(input[type="checkbox"]) > span { min-width: 0; }
.kokoomus-contact-form button {
  min-height: 3rem;
  border: 0;
  border-radius: 0;
  padding: .7rem 1.5rem;
  background: var(--wp--preset--color--brand);
  color: var(--wp--preset--color--on-brand);
  font-family: var(--wp--preset--font-family--ui);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}
.kokoomus-contact-feedback {
  background: var(--wp--preset--color--surface);
  padding: 1rem;
}
.kokoomus-contact-feedback--error { border-color: var(--wp--preset--color--accent); }

/* WordPress inserts the block theme skip link before .wp-site-blocks. */
#wp-skip-link:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100000;
  padding: .65rem 1rem;
  background: var(--wp--preset--color--brand);
  color: var(--wp--preset--color--on-brand);
  outline: 2px solid var(--wp--preset--color--focus);
  outline-offset: 3px;
}
/* Two-tone focus stays visible on light surfaces and photographs alike. */
:where(a, button, input, textarea, select):focus-visible {
  outline-color: var(--wp--preset--color--brand);
  box-shadow: 0 0 0 2px var(--wp--preset--color--surface);
}
:where(main [id], .kokoomus-contact-form-wrap) { scroll-margin-block-start: 1rem; }

@media (max-width: 781px) {
  .mats-content.layout-imageLeft .wp-block-columns { flex-direction: column; }
  .mats-hero .wp-block-cover__inner-container { padding-block: 4rem; }
  .mats-hero.wp-block-cover::before {
    background: color-mix(in srgb, var(--wp--preset--color--brand) 75%, transparent);
  }
}
@media (max-width: 599px) {
  .mats-section, .kokoomus-section { padding-block: 2.5rem; }
  footer.wp-block-template-part .wp-block-columns { gap: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .wp-block-button__link,
  .kokoomus-contact-form button { transition: none; transform: none; }
  .wp-block-button__link:hover,
  .kokoomus-contact-form button:not(:disabled):hover { transform: none; }
}

/* Mats: match the original campaign site's square, spacious Tailwind layout. */
/* Mats typography and page colors come from its Global Styles variation. */
:where(body.kokoomus-site-mats) :where(.wp-site-blocks > *, main > *) { margin-block-start: 0; }

/* The overlay scrolls with the hero so it cannot cover later content. */
body.kokoomus-site-mats > .wp-site-blocks { position: relative; }
body.kokoomus-site-mats > .wp-site-blocks > header.wp-block-template-part {
  position: absolute;
  inset: 0 0 auto;
  z-index: 50;
  background: transparent;
}
/* Text and publication pages reserve real space for navigation. */
body.kokoomus-site-mats:not(:has(main .mats-hero)) > .wp-site-blocks > header.wp-block-template-part {
  position: relative;
  background: var(--wp--preset--color--surface);
}
:where(body.kokoomus-site-mats > .wp-site-blocks > header.wp-block-template-part > .wp-block-group) {
  background: transparent;
  color: var(--wp--preset--color--brand);
  padding: 1.5rem 2rem;
}
body.kokoomus-site-mats header.wp-block-template-part .wp-block-group.alignfull > .wp-block-group {
  max-width: 1216px;
}
:where(body.kokoomus-site-mats header .wp-block-site-title) { margin: 0; }
:where(body.kokoomus-site-mats header .wp-block-navigation) { gap: 1.5rem; }
:where(body.kokoomus-site-mats header .wp-block-navigation a) { color: var(--wp--preset--color--brand); }
.kokoomus-site-mats:has(.mats-hero-highImpact) header :where(.wp-block-site-title, .wp-block-navigation a) {
  color: var(--wp--preset--color--on-brand);
}
.kokoomus-site-mats:has(.mats-hero-highImpact) header .wp-block-navigation__responsive-container-open { color: var(--wp--preset--color--on-brand); }
body.kokoomus-site-mats .wp-block-navigation__responsive-container.is-menu-open {
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--brand);
}
body.kokoomus-site-mats header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { color: var(--wp--preset--color--brand); }
body.kokoomus-site-mats .is-menu-open .wp-block-navigation-item__content { display: flex; align-items: center; min-height: var(--kokoomus-touch-target); }

/* The home hero is a light-blue split layout, not an image overlay. */
:where(.mats-hero-mediumImpact) {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  background: var(--wp--preset--color--pale);
  overflow: hidden;
}
.mats-hero-mediumImpact .mats-hero-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: min(100%, 1280px);
  max-width: 1280px !important;
  min-height: 100vh;
  margin: 0 auto !important;
  padding-inline: 1rem;
  box-sizing: border-box;
}
:where(.mats-hero-mediumImpact .mats-hero-copy) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 6rem 2rem 2rem 0;
  background: var(--wp--preset--color--pale);
}
.mats-hero-mediumImpact .mats-hero-copy > * { max-width: 36rem; }
:where(.mats-hero-mediumImpact .mats-hero-overline) {
  margin: 0;
  color: var(--wp--preset--color--ink);
  font-family: var(--wp--preset--font-family--body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: uppercase;
}
:where(.mats-hero-mediumImpact h1) {
  margin: .75rem 0 0;
  color: var(--wp--preset--color--brand);
}
.mats-hero-mediumImpact h1 {
  font-size: 2.25rem;
  line-height: 1;
}
:where(.mats-hero-mediumImpact .mats-hero-copy > p:not(.mats-hero-overline, .mats-hero-brand)) {
  margin: 1.5rem 0 0;
  color: var(--wp--preset--color--body-muted);
  font-size: 1.125rem;
  line-height: 1.5;
}
.mats-hero-mediumImpact .wp-block-buttons { margin: 2rem 0 0; gap: 1rem; }
.mats-hero-mediumImpact .wp-block-button__link {
  min-height: var(--kokoomus-touch-target);
  padding: .5rem 1rem;
  border-radius: 0;
  background: var(--wp--preset--color--brand);
  color: var(--wp--preset--color--on-brand);
  font-family: var(--wp--preset--font-family--body);
  font-size: .875rem;
  font-weight: 500;
}
.mats-hero-mediumImpact .is-style-outline > .wp-block-button__link {
  border: 1px solid var(--wp--preset--color--brand);
  background: transparent;
  color: var(--wp--preset--color--brand);
}
:where(.mats-hero-mediumImpact .mats-hero-brand) {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 2.5rem 0 0;
  color: var(--wp--preset--color--brand);
  font-size: 1.125rem;
  font-weight: 700;
}
.mats-hero-mediumImpact .mats-hero-brand::before {
  content: '';
  width: 28px;
  height: 28px;
  flex: none;
  background: url('./assets/mats-ruiskukka.webp') center / contain no-repeat;
}
.mats-hero-mediumImpact .mats-hero-media {
  min-width: 0;
  max-width: none;
  height: 100vh;
  margin: 0;
}
.mats-hero-mediumImpact .mats-hero-media figure,
.mats-hero-mediumImpact .mats-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}
.mats-hero-mediumImpact .mats-hero-media img { object-fit: cover; object-position: center; }
@media (min-width: 768px) {
  .mats-hero-mediumImpact h1 { font-size: 3.75rem; }
  .mats-hero-mediumImpact .mats-hero-copy > p:not(.mats-hero-overline, .mats-hero-brand),
  .mats-hero-mediumImpact .mats-hero-brand { font-size: 1.25rem; }
}
@media (min-width: 1024px) {
  .mats-hero-mediumImpact .mats-hero-grid { padding-inline: 2rem; }
}
.mats-hero-highImpact.wp-block-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  height: auto;
  padding-block: 8rem 3rem;
}
.mats-hero-highImpact.wp-block-cover::before { display: none; }
.mats-hero-highImpact .wp-block-cover__inner-container {
  width: min(100% - 2rem, 36.5rem);
  margin: auto;
  padding: 0;
  text-align: center;
}
.mats-hero-highImpact .wp-block-cover__inner-container > * { max-width: none; }
:where(.mats-hero-highImpact h1) { color: var(--wp--preset--color--on-brand); }
:where(.mats-hero-highImpact p) { color: var(--wp--preset--color--on-brand); }
.mats-hero-highImpact h1 { margin: 0 0 1rem; font-size: clamp(2.25rem, 5vw, 3.75rem); }
.mats-hero-highImpact p { font-size: 1.125rem; }

/* Campaign sections use 1280px containers and 64px gaps from RenderBlocks. */
main > .entry-content > .mats-section {
  width: min(100%, 1280px);
  max-width: 1280px !important;
  margin: 4rem auto;
  padding: 0 2rem;
  box-sizing: border-box;
}
.mats-section > * { max-width: none !important; }
.mats-campaign-promises > h2,
.mats-testimonials > h2 { margin: 0 0 2.5rem; text-align: center; }
.mats-campaign-promises .wp-block-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin: 0;
}
:where(.mats-campaign-promises .wp-block-column) {
  margin: 0;
  padding: 1.5rem;
  border: 0;
  border-radius: 0;
  background: var(--wp--preset--color--pale);
  box-shadow: none;
  text-align: center;
}
.mats-campaign-promises .wp-block-column h3 { margin: 0 0 .5rem; }
.mats-campaign-promises .wp-block-column p { margin: 0; line-height: 1.5; }
main > .entry-content > .mats-content.has-blue-background {
  width: 100%;
  max-width: none !important;
  margin-inline: 0;
  padding: 4rem max(var(--kokoomus-gutter), calc((100% - 1216px) / 2));
  background: var(--wp--preset--color--pale);
  color: var(--wp--preset--color--brand);
}
:where(.mats-content.has-blue-background) :where(a, h2) { color: inherit; }
.mats-content.layout-text > :is(p, ul, ol, blockquote, .wp-block-heading) {
  max-width: var(--kokoomus-reading-width) !important;
  margin-inline: auto;
  text-align: left;
}
.mats-content.layout-text > :is(ul, ol) { padding-inline-start: 1.5rem; }
.mats-content.layout-text > .wp-block-heading { line-height: 1.3; }
.mats-content.layout-text > h1 { font-size: clamp(2rem, 4vw, 3rem); }
.mats-content.layout-text > h2 { font-size: clamp(1.5rem, 3vw, 1.875rem); margin-block: 2.5rem 1rem; }
.mats-content .wp-block-columns {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: center;
  gap: 2rem;
  max-width: 1216px !important;
  margin: 0 auto;
}
.mats-content.layout-imageLeft .wp-block-columns { flex-direction: initial; }
.mats-content.layout-imageLeft .wp-block-columns > .wp-block-column:first-child { order: 2; }
.mats-content.layout-imageLeft .wp-block-columns > .wp-block-column:nth-child(2) { order: 1; }
.mats-content .wp-block-column { min-width: 0; }
.mats-content .wp-block-image img { display: block; width: 100%; height: auto; border-radius: 0; }
.mats-content.has-sign .wp-block-columns > .wp-block-column:first-child::after,
.mats-content.has-sign.layout-text::after {
  content: '';
  display: block;
  width: 80px;
  height: 60px;
  margin-top: 2rem;
  background: url('./assets/mats-sign.png') left center / contain no-repeat;
}

.mats-testimonials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.mats-testimonials > h2 { grid-column: 1 / -1; margin-bottom: .5rem; }
:where(.mats-testimonials > .wp-block-quote) {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 1.5rem 1rem;
  min-width: 0;
  margin: 0;
  padding: 1.5rem;
  border: 0;
  border-radius: 0;
  background: var(--wp--preset--color--pale);
}
:where(.mats-testimonials .wp-block-quote > p:first-child) { grid-column: 1 / -1; margin: 0; color: var(--wp--preset--color--brand); }
.mats-testimonials .wp-block-quote > p:nth-child(2) { grid-column: 2; grid-row: 2; align-self: center; margin: 0; min-width: 0; }
:where(.mats-testimonials .wp-block-quote cite) { color: var(--wp--preset--color--brand); font-style: normal; font-weight: 400; }
.mats-testimonials .wp-block-quote figure {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0;
}
.mats-testimonials .wp-block-quote img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* The activity feed is two plain lists separated by light rules. */
.mats-activity-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2rem;
}
.mats-activity-feed > .wp-block-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 2rem;
  grid-column: 1 / -1;
  max-width: none !important;
  margin: 0;
}
.mats-activity-feed > .wp-block-columns > .wp-block-column { min-width: 0; margin: 0; }
.mats-activity-feed > .wp-block-columns h2 { margin: 0 0 1rem; }
.mats-activity-feed > h2 { margin: 0 0 1rem; }
.mats-activity-feed > h2:first-of-type { grid-column: 1; grid-row: 1; }
.mats-activity-feed > h2:nth-of-type(2) { grid-column: 2; grid-row: 1; }
.mats-activity-feed > .wp-block-query:first-of-type { grid-column: 1; grid-row: 2; }
.mats-activity-feed > .wp-block-query:nth-of-type(2) { grid-column: 2; grid-row: 2; }
.mats-activity-feed .wp-block-post-template {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mats-activity-feed .wp-block-post { display: block; margin: 0; }
.mats-activity-feed .wp-block-post + .wp-block-post { border-top: 1px solid var(--wp--preset--color--rule); }
:where(.mats-activity-feed .mats-tweet-card),
:where(.mats-activity-feed .mats-publication) {
  margin: 0;
  padding: 1.5rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
:where(.mats-activity-feed .mats-tweet-card h3),
:where(.mats-activity-feed .mats-publication :is(h2, h3)) {
  margin: 0;
  font-family: var(--wp--preset--font-family--ui);
  font-size: 1.125rem;
  font-weight: 700;
}
:where(.mats-activity-feed .mats-tweet-card p),
:where(.mats-activity-feed .mats-publication p) { margin: .5rem 0 0; font-size: .875rem; }
:where(.mats-activity-feed .mats-tweet-date),
:where(.mats-activity-feed .mats-publication-meta) { color: var(--wp--preset--color--meta); }

.mats-publications .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: none !important;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mats-publications .wp-block-post { min-width: 0; margin: 0; }
.mats-publications .mats-publication {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 1rem;
  border: 0;
  border-radius: 0;
  background: var(--wp--preset--color--pale);
  box-shadow: none;
}
.mats-publications .mats-publication :is(h2, h3) { margin: 0 0 .5rem; font-size: 1.25rem; line-height: 1.3; }
.mats-publications .mats-publication p { margin: 0 0 1rem; font-size: 1rem; line-height: 1.5; }
.mats-publications .mats-publication .mats-publication-meta { margin: auto 0 0; padding-top: 1rem; color: var(--wp--preset--color--meta-dark); font-size: .875rem; }
.mats-publications .wp-block-post > .wp-block-post-content { height: 100%; }
.mats-publications .mats-publication :is(h2,h3) a { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .mats-publications .mats-publication :is(h2,h3) a:hover { text-decoration: underline; } }
.mats-publications .mats-publication :is(h2,h3) a::after { content: ""; position: absolute; inset: 0; }
.mats-publications .mats-publication:has(a:focus-visible) { outline: 2px solid var(--wp--preset--color--brand); outline-offset: 3px; }

.mats-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3rem;
  align-items: start;
}
.mats-form > h2:first-child,
:where(.mats-form > p:first-of-type) {
  grid-column: 1 / -1;
  max-width: 48rem !important;
  margin-inline: auto;
  text-align: center;
}
:where(.mats-form > h2:first-child) { font-size: 2.25rem; margin-block: 0 1rem; }
:where(.mats-form > p:first-of-type) { margin-block: 0 2rem; }
.mats-form > :is(.kokoomus-contact-form-wrap, .wp-block-kokoomus-contact-form) { grid-column: 1; width: 100%; margin: 0; }
.mats-form > figure { grid-column: 2; width: 100%; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; }
.mats-form > figure img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mats-form .kokoomus-contact-form { max-width: none; }
:where(.mats-form .kokoomus-contact-form label) { font-size: .875rem; font-weight: 500; }
.mats-form .kokoomus-contact-form input:not([type='checkbox']),
.mats-form .kokoomus-contact-form textarea {
  min-height: var(--kokoomus-touch-target);
  border: 1px solid var(--kokoomus-control-border);
  border-radius: 0;
  background: var(--wp--preset--color--surface);
}
.mats-form .kokoomus-contact-form :is(input, textarea)[aria-invalid="true"] { border-color: var(--wp--preset--color--focus); }
:where(.mats-form .kokoomus-contact-form button) { border-radius: 0; }

:where(body.kokoomus-site-mats footer.wp-block-template-part > .wp-block-group) {
  background: var(--wp--preset--color--brand);
  color: var(--wp--preset--color--on-brand);
  padding-block: 4rem;
}
.mats-footer-logo { display: block; width: 13rem; max-width: 100%; margin: 0 auto 3rem; }
.mats-footer-logo img { display: block; width: 100%; height: auto; }
footer.wp-block-template-part .mats-footer-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(2rem, 6vw, 5rem);
  max-width: 42rem;
  margin: 0 auto;
}
.mats-footer-columns > .wp-block-column { min-width: 0; margin: 0; }
.mats-footer-columns p { margin: 0 0 .375rem; }
footer.wp-block-template-part .mats-footer-columns .wp-block-list { margin: 0; padding: 0; list-style: none; }
.mats-footer-columns li { margin: 0 0 .375rem; }
.mats-footer-columns a { text-decoration: none; text-underline-offset: .2em; }
@media (hover: hover) and (pointer: fine) { .mats-footer-columns a:hover { text-decoration: underline; text-decoration-thickness: 1px; } }
.mats-footer-columns .wp-block-list a { display: inline-flex; align-items: center; gap: .5rem; min-height: var(--kokoomus-touch-target); }
.mats-footer-columns .wp-block-list a::before {
  content: ''; width: 1rem; height: 1rem; flex: 0 0 1rem;
  background: currentColor; mask: var(--social-icon) center / contain no-repeat;
}
.mats-footer-columns a[href*="instagram.com"] { --social-icon: url('./assets/icons/social-instagram.svg'); }
.mats-footer-columns a[href*="linkedin.com"] { --social-icon: url('./assets/icons/social-linkedin.svg'); }
.mats-footer-columns a[href*="x.com/"], .mats-footer-columns a[href*="twitter.com"] { --social-icon: url('./assets/icons/social-twitter.svg'); }
.mats-footer-columns a[href*="facebook.com"] { --social-icon: url('./assets/icons/social-facebook.svg'); }
body.kokoomus-site-mats .wp-site-blocks > footer { margin-block-start: 0; }

.mats-footer-columns h3 { color: inherit; font-size: 1.125rem; line-height: 1.5; margin: 0 0 1rem; }

@media (max-width: 767px) {
  .mats-hero-mediumImpact .mats-hero-grid { display: flex !important; flex-direction: column; }
  .mats-hero-mediumImpact .mats-hero-grid { min-height: auto; }
  .mats-hero-mediumImpact .mats-hero-media { height: auto; margin: 0; }
  .mats-hero-mediumImpact .mats-hero-media img { width: 100%; height: auto; }
  :where(.mats-hero-mediumImpact .mats-hero-copy) { padding: 7rem 0 2rem; }
}
@media (max-width: 781px) {
  .mats-campaign-promises .wp-block-columns,
  .mats-testimonials,
  .mats-activity-feed { grid-template-columns: 1fr; }
  .mats-activity-feed > h2:nth-of-type(2),
  .mats-activity-feed > .wp-block-query:nth-of-type(2) { grid-column: 1; grid-row: auto; }
  .mats-content .wp-block-columns { grid-template-columns: 1fr; }
  .mats-content.layout-imageLeft .wp-block-columns > .wp-block-column { order: initial; }
  .mats-content.layout-imageLeft .wp-block-columns { flex-direction: initial; }
  .mats-activity-feed > .wp-block-columns { grid-template-columns: 1fr; }
  .mats-publications .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mats-form { grid-template-columns: 1fr; }
  .mats-form > :is(.kokoomus-contact-form-wrap, .wp-block-kokoomus-contact-form),
  .mats-form > figure { grid-column: 1; }
  .mats-form > figure { margin-top: 2rem; }

  body.kokoomus-site-mats header .wp-block-navigation__responsive-container-open { display: flex; }
  body.kokoomus-site-mats header .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none; }
}
@media (max-width: 599px) {
  footer.wp-block-template-part .mats-footer-columns { grid-template-columns: 1fr; gap: 2rem; }
  body.kokoomus-site-mats > .wp-site-blocks > header.wp-block-template-part > .wp-block-group { padding: 1.5rem 1rem; }
  main > .entry-content > .mats-section { padding-inline: 1rem; }
  main > .entry-content > .mats-content.has-blue-background { padding-inline: 1rem; }
  .mats-hero-mediumImpact h1 { font-size: 2.25rem; }
  .mats-publications .wp-block-post-template { grid-template-columns: 1fr; }
}

/* A reading column with room at narrow viewport edges. */
.kokoomus-single { padding: 3rem 1rem; }
.kokoomus-single > .kokoomus-back-link { margin-block: 0 1.5rem; }
.kokoomus-single .wp-block-post-title { margin-block: 0 1rem; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.25; text-wrap: balance; }
.kokoomus-single .kokoomus-article-meta { margin-block: 0 2rem; gap: .5rem 1rem; font-size: 1rem; }
.kokoomus-article-meta > p { margin: 0; }
.kokoomus-article-meta > p:empty { display: none; }
.kokoomus-single .wp-block-post-content { font-size: 1.125rem; line-height: 1.7; }
.kokoomus-single .wp-block-post-content > * { margin-block: 0 1.25rem; }
.kokoomus-single .wp-block-post-content :is(ul, ol) { padding-inline-start: 1.5rem; }
.kokoomus-single .wp-block-post-content :is(h2, h3, h4) { margin-block-start: 2rem; line-height: 1.3; }
.kokoomus-single .wp-block-post-content figure { margin-inline: 0; }
.kokoomus-single .kokoomus-article-navigation { margin-block-start: 3rem; gap: 1rem; }
.kokoomus-article-navigation a { display: inline-block; padding-block: .5rem; }

/* Six native article cards, separate from the narrower reading column. */
.kokoomus-single .kokoomus-related { margin-top: clamp(3rem, 6vw, 5rem); padding-top: 2rem; border-top: 1px solid var(--wp--preset--color--border); }
.kokoomus-related > h2 { margin: 0 0 1.5rem; font-size: var(--wp--preset--font-size--h-2); }
.kokoomus-related .wp-block-post-template { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.kokoomus-related .wp-block-post { min-width: 0; margin: 0; }
.kokoomus-related .kokoomus-blog-card .wp-block-post-title { font-size: 1.25rem; line-height: 1.3; margin: 0 0 .5rem; }
@media (min-width: 640px) { .kokoomus-related .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .kokoomus-related .wp-block-post-template { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

:where(.kokoomus-related .kokoomus-blog-card) { position: relative; height: 100%; box-sizing: border-box; padding: 1rem; background: var(--wp--preset--color--pale, var(--wp--preset--color--canvas)); }
:where(.kokoomus-related .wp-block-post-title a) { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .kokoomus-related .wp-block-post-title a:hover { text-decoration: underline; } }
.kokoomus-related .wp-block-post-title a::after { content: ''; position: absolute; inset: 0; }
.kokoomus-related .kokoomus-blog-card:has(a:focus-visible) { outline: 2px solid var(--wp--preset--color--brand); outline-offset: 3px; }
:where(.kokoomus-related .wp-block-post-excerpt) { margin: 0 0 1rem; font-size: 1rem; line-height: 1.5; }
:where(.kokoomus-related .kokoomus-blog-meta) { margin-top: auto; padding-top: 1rem; gap: .5rem; font-size: .875rem; }
:where(.kokoomus-related .kokoomus-blog-meta > p:empty) { display: none; }

.kokoomus-not-found { box-sizing: border-box; min-height: 50svh; padding: clamp(3rem, 8vw, 6rem) var(--kokoomus-gutter); }
.kokoomus-not-found > * { max-width: var(--kokoomus-reading-width); margin-inline: auto; }
.kokoomus-not-found > h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.2; }
.wp-block-navigation__responsive-container.is-menu-open { overscroll-behavior: contain; }
/* A full-width menu with deliberate gutters and consistent touch targets. */
header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open {
  box-sizing: border-box;
  padding: 1.5rem;
}
header.wp-block-template-part .is-menu-open .wp-block-navigation__responsive-dialog { width: 100%; }
header.wp-block-template-part .is-menu-open .wp-block-navigation__responsive-container-content { align-items: stretch; padding-top: 4rem; }
header.wp-block-template-part .is-menu-open .wp-block-navigation__container { width: 100%; align-items: stretch; gap: .5rem; }
header.wp-block-template-part .is-menu-open .wp-block-navigation-item { width: 100%; }
header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 3rem;
  padding: .75rem 1rem;
  font-size: 1.25rem;
  color: var(--wp--preset--color--brand);
  border-inline-start: 3px solid transparent;
  transition: background-color .16s ease, border-color .16s ease;
}
header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content[aria-current="page"] {
  border-inline-start-color: currentColor;
  background: color-mix(in srgb, currentColor 7%, transparent);
  text-decoration: none;
}
header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content:active {
  background: color-mix(in srgb, currentColor 12%, transparent);
}
header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content:focus-visible {
  outline-offset: -3px;
}
@media (prefers-reduced-motion: reduce) {
  header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content { transition: none; }
}
@media (forced-colors: active) {
  :where(a, button, input, textarea, select):focus-visible { outline: 2px solid Highlight; box-shadow: none; }
  .kokoomus-blog-card:has(a:focus-visible), .mats-publication:has(a:focus-visible) { outline: 2px solid Highlight; }
}

/* Synced number groups must not leave a gap when every badge is hidden. */
body:not(.wp-admin) .kokoomus-candidate-numbers:not(:has(.wp-block-kokoomus-candidate-number)) { display: none; }
