/*
 * Mierlo voor Mierlo — Global visual contract
 * Canonical site-wide MvM presentation layer.
 * Saved in the child theme on 27 August 2026.
 *
 * Scope: public MvM shell, native WordPress/news surfaces and MvM components.
 * Deliberately does not restyle the internals of PeepSo, Ultimate Member,
 * Elementor, PostX or wpForo; those integrations keep their own component CSS.
 */

:root {
  --mvm-blue: #1966AE;
  --mvm-blue-700: #114F8B;
  --mvm-blue-800: #0C3D68;
  --mvm-blue-050: #EEF6FC;
  --mvm-ink: #17212B;
  --mvm-muted: #3F5060;
  --mvm-surface: #FFFFFF;
  --mvm-surface-soft: #F4F7FA;
  --mvm-border: #C9D7E3;
  --mvm-focus: #E89713;
  --mvm-radius-sm: 10px;
  --mvm-radius-md: 14px;
  --mvm-radius-lg: 18px;
  --mvm-radius-xl: 22px;
  --mvm-shadow-soft: 0 8px 26px rgba(23, 33, 43, .07);
  --mvm-shadow-card: 0 12px 34px rgba(23, 33, 43, .065);
  --mvm-content: 1280px;
}

body.dark,
body[data-mvm-theme="dark"],
body.mvm-header-dark,
html[data-theme="dark"] body {
  --mvm-blue: #8BC7FB;
  --mvm-blue-700: #AED8FA;
  --mvm-blue-800: #D2E9FB;
  --mvm-blue-050: #203447;
  --mvm-ink: #F3F7FA;
  --mvm-muted: #C3CFD8;
  --mvm-surface: #17222D;
  --mvm-surface-soft: #101820;
  --mvm-border: #3B5061;
  --mvm-shadow-soft: 0 8px 26px rgba(0, 0, 0, .20);
  --mvm-shadow-card: 0 12px 34px rgba(0, 0, 0, .22);
}

/* Base content canvas. Header/footer keep their existing dedicated contracts. */
main#content,
.mvm-site-shell {
  color: var(--mvm-ink);
}

body:not(.dark):not([data-mvm-theme="dark"]):not(.mvm-header-dark) main#content {
  background: var(--mvm-surface);
}

main#content :where(
  .mvm-home,
  .mvm-theme1-lab,
  .mvm-page,
  .mvm-listing,
  .mvm-single-article,
  .mvm-event-page,
  .mvm-public-home,
  .mg-blog-post-box
) :where(h1,h2,h3,h4,h5,h6) {
  color: var(--mvm-ink);
  -webkit-text-fill-color: var(--mvm-ink);
  text-transform: none;
  text-wrap: balance;
}

main#content :where(
  .mvm-home,
  .mvm-theme1-lab,
  .mvm-page,
  .mvm-listing,
  .mvm-single-article,
  .mvm-event-page,
  .mvm-public-home,
  .mg-blog-post-box
) :where(.mvm-muted,.mvm-meta,.mvm-card-meta,.mvm-list-meta,.entry-meta,.post-meta) {
  color: var(--mvm-muted) !important;
  -webkit-text-fill-color: var(--mvm-muted) !important;
}

main#content :where(
  .mvm-home,
  .mvm-theme1-lab,
  .mvm-page,
  .mvm-listing,
  .mvm-single-article,
  .mvm-event-page,
  .mvm-public-home,
  .mg-blog-post-box
) a {
  text-underline-offset: 3px;
}

/* Shared section language from the homepage. */
main#content :where(
  .mvm-theme1-section-head,
  .mvm-section-head,
  .mvm-listing-head,
  .mvm-page-head
) {
  color: var(--mvm-ink);
}

main#content :where(
  .mvm-theme1-eyebrow,
  .mvm-eyebrow,
  .mvm-listing-kicker,
  .mvm-theme1-event-kicker,
  .mvm-today-eyebrow,
  .mvm-today-kicker,
  .mvm-source-section__eyebrow,
  .mvm-reading-summary__eyebrow
) {
  color: var(--mvm-blue) !important;
  -webkit-text-fill-color: var(--mvm-blue) !important;
  font-weight: 800 !important;
  letter-spacing: .075em;
}

/* Canonical cards: same geometry and depth as home. */
main#content :where(
  .mvm-theme1-card,
  .mvm-theme1-together-card,
  .mvm-theme1-event,
  .mvm-theme1-action-card,
  .mvm-more-news-card,
  .mvm-listing-card,
  .mvm-list-card,
  .mvm-public-card,
  .mvm-builder-card,
  .mvm-page-card,
  .mvm-single-article,
  .mvm-event-article,
  .mvm-theme-bundle,
  .mvm-public-section,
  .mvm-facts-card,
  .mvm-anchor-toc,
  .mvm-related,
  .mvm-see-also,
  .mvm-smart-related,
  .mvm-source-section
) {
  background: var(--mvm-surface);
  color: var(--mvm-ink);
  -webkit-text-fill-color: var(--mvm-ink);
  border-color: var(--mvm-border);
  border-radius: var(--mvm-radius-lg);
  box-shadow: var(--mvm-shadow-soft);
}

main#content :where(
  .mvm-theme1-card,
  .mvm-theme1-together-card,
  .mvm-theme1-event,
  .mvm-theme1-action-card,
  .mvm-more-news-card,
  .mvm-listing-card,
  .mvm-list-card,
  .mvm-public-card
):hover {
  border-color: color-mix(in srgb, var(--mvm-blue) 48%, var(--mvm-border));
  box-shadow: var(--mvm-shadow-card);
}

/* Light information panels: dark copy, blue accent. */
main#content :where(
  .mvm-reading-summary,
  .mvm-theme1-community-box,
  .mvm-timeline-toolbar,
  .mvm-timeline-era-nav,
  .mvm-az-letter summary,
  .mvm-theme-dossier-block > summary
) {
  background: var(--mvm-blue-050);
  color: var(--mvm-ink);
  -webkit-text-fill-color: var(--mvm-ink);
  border-color: var(--mvm-border);
}

/* Links and secondary actions. */
main#content :where(
  .mvm-theme1-link,
  .mvm-theme1-card-cta,
  .mvm-today-cta,
  .mvm-read-more,
  .mvm-dossier-content a,
  .mvm-source-section a,
  .mvm-anchor-toc a
) {
  color: var(--mvm-blue);
  -webkit-text-fill-color: var(--mvm-blue);
  font-weight: 700;
}

main#content :where(
  a.mvm-theme1-button,
  .mvm-primary-button,
  .mvm-today-all,
  .mvm-404-actions > a:first-child,
  .mvm-event-page .wpem-theme-button,
  .mvm-event-page .registration_button
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--mvm-blue);
  border-radius: 999px;
  background: var(--mvm-blue);
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(25, 102, 174, .14);
}

main#content :where(
  .mvm-theme1-link,
  .mvm-today-all.mvm-secondary,
  .mvm-404-secondary
) {
  border-radius: 999px;
}

/* Native form language; plugin-owned forms are intentionally excluded. */
main#content :where(
  .mvm-public-search,
  .mvm-header-search-form,
  .mvm-page-card,
  .mvm-single-article,
  .mvm-listing,
  .mvm-event-page
) :where(input[type="text"],input[type="search"],input[type="email"],input[type="url"],input[type="tel"],input[type="number"],textarea,select) {
  min-height: 44px;
  border: 1px solid var(--mvm-border);
  border-radius: var(--mvm-radius-sm);
  background: var(--mvm-surface);
  color: var(--mvm-ink);
  -webkit-text-fill-color: var(--mvm-ink);
  box-shadow: none;
}

main#content :where(
  .mvm-public-search,
  .mvm-page-card,
  .mvm-single-article,
  .mvm-listing,
  .mvm-event-page
) :where(input,textarea,select):focus {
  border-color: var(--mvm-blue);
  outline: 3px solid color-mix(in srgb, var(--mvm-blue) 18%, transparent);
  outline-offset: 1px;
}

/* Quotes and editorial callouts follow the home light-card language. */
main#content blockquote {
  margin-inline: 0;
  padding: 20px 22px;
  border: 0;
  border-left: 4px solid var(--mvm-blue);
  border-radius: 0 var(--mvm-radius-md) var(--mvm-radius-md) 0;
  background: var(--mvm-blue-050);
  color: var(--mvm-ink);
  -webkit-text-fill-color: var(--mvm-ink);
}

main#content blockquote cite {
  color: var(--mvm-blue);
  -webkit-text-fill-color: var(--mvm-blue);
}

/* Tables stay highly readable. */
main#content :where(.mvm-page-card,.mvm-single-article,.mvm-dossier-content,.mvm-event-page) table {
  width: 100%;
  border-collapse: collapse;
  background: var(--mvm-surface);
  color: var(--mvm-ink);
}

main#content :where(.mvm-page-card,.mvm-single-article,.mvm-dossier-content,.mvm-event-page) :where(th,td) {
  padding: 11px 13px;
  border: 1px solid var(--mvm-border);
  color: var(--mvm-ink);
  -webkit-text-fill-color: var(--mvm-ink);
}

main#content :where(.mvm-page-card,.mvm-single-article,.mvm-dossier-content,.mvm-event-page) th {
  background: var(--mvm-blue-050);
  font-weight: 800;
}

/* Strong keyboard accessibility everywhere in the MvM shell. */
main#content :where(
  .mvm-home,
  .mvm-theme1-lab,
  .mvm-page,
  .mvm-listing,
  .mvm-single-article,
  .mvm-event-page,
  .mvm-public-home,
  .mg-blog-post-box
) :where(a,button,input,textarea,select,summary):focus-visible {
  outline: 3px solid var(--mvm-focus) !important;
  outline-offset: 3px !important;
}

/* Never recolor the internals of protected third-party application surfaces. */
main#content :where(
  .ps-page,
  .ps-postbox,
  .ps-stream,
  .ps-dialog,
  .ps-form,
  .um,
  .um-page,
  .wpforo-wrap,
  #wpforo,
  .elementor,
  .elementor-element,
  .ultp-block-wrapper,
  .ultp-wrapper
) {
  --mvm-global-protected-surface: 1;
}

@media (max-width: 680px) {
  main#content :where(
    .mvm-theme1-card,
    .mvm-listing-card,
    .mvm-list-card,
    .mvm-public-card,
    .mvm-page-card,
    .mvm-single-article,
    .mvm-event-article,
    .mvm-theme-bundle,
    .mvm-public-section
  ) {
    border-radius: var(--mvm-radius-md);
  }
}

/* Contrast invariants: light surfaces never inherit white body copy. */
body:not(.dark):not([data-mvm-theme="dark"]):not(.mvm-header-dark) main#content.mvm-home .mvm-theme1-discover .mvm-theme1-section-head p {
  color: var(--mvm-muted) !important;
  -webkit-text-fill-color: var(--mvm-muted) !important;
}

body:not(.dark):not([data-mvm-theme="dark"]):not(.mvm-header-dark) main#content.mvm-home .mvm-theme1-discover-story small {
  color: var(--mvm-blue) !important;
  -webkit-text-fill-color: var(--mvm-blue) !important;
}

body:not(.dark):not([data-mvm-theme="dark"]):not(.mvm-header-dark) main#content.mvm-home .mvm-theme1-discover-story p {
  color: var(--mvm-muted) !important;
  -webkit-text-fill-color: var(--mvm-muted) !important;
}

/* Text over photography remains white; only light cards switch to dark copy. */
body:not(.dark):not([data-mvm-theme="dark"]):not(.mvm-header-dark) main#content.mvm-home .mvm-theme1-discover-photo-copy h3 {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  text-shadow: 0 2px 10px rgba(4, 18, 31, .62) !important;
}

/* Primary community actions are intentional blue surfaces, never white cards. */
body:not(.dark):not([data-mvm-theme="dark"]):not(.mvm-header-dark) main#content .mvm-theme1-action-card--primary {
  background: linear-gradient(145deg, #1966AE 0%, #114F8B 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

body:not(.dark):not([data-mvm-theme="dark"]):not(.mvm-header-dark) main#content .mvm-theme1-action-card--primary :where(small,h3,p,a) {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* Older accent community cards use the same invariant. */
body:not(.dark):not([data-mvm-theme="dark"]):not(.mvm-header-dark) main#content .mvm-theme1-community-box--accent {
  background: linear-gradient(145deg, #1966AE 0%, #114F8B 100%) !important;
  border-color: transparent !important;
}

body:not(.dark):not([data-mvm-theme="dark"]):not(.mvm-header-dark) main#content .mvm-theme1-community-box--accent :where(h3,p) {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* Placeholders remain readable regardless of legacy stylesheet order. */
body:not(.dark):not([data-mvm-theme="dark"]):not(.mvm-header-dark) :where(input,textarea)::placeholder {
  color: var(--mvm-muted, #465767) !important;
  -webkit-text-fill-color: var(--mvm-muted, #465767) !important;
  opacity: 1 !important;
}

/* ==========================================================================
 * LOCKED GLOBAL INVARIANT — coloured MvM fields always use white foreground.
 * Approved by the owner on 27 August 2026. Do not weaken or remove without
 * fresh explicit owner approval. Light/white information panels are excluded.
 * ======================================================================= */
main#content :where(
  .mvm-blue-surface,
  .has-mvm-blue-background-color,
  .has-primary-background-color,
  .bg-primary,
  .mvm-theme1-action-card--primary,
  .mvm-theme1-community-box--accent,
  .mvm-theme1-agenda-cta,
  .mvm-theme1-event-date,
  .mvm-elementor-section--accent .mvm-elementor-section__inner,
  .mvm-elementor-hero--blue,
  .mvm-elementor-cta--blue,
  .mvm-search-hero,
  .mvm-public-home .mvm-hero,
  .mvm-page .mvm-page-head,
  .mvm-listing .mvm-listing-head,
  .mvm-themes-index .mvm-theme-intro
) {
  background-color: var(--mvm-blue) !important;
  border-color: var(--mvm-blue) !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}

main#content :where(
  .mvm-blue-surface,
  .has-mvm-blue-background-color,
  .has-primary-background-color,
  .bg-primary,
  .mvm-theme1-action-card--primary,
  .mvm-theme1-community-box--accent,
  .mvm-theme1-agenda-cta,
  .mvm-theme1-event-date,
  .mvm-elementor-section--accent .mvm-elementor-section__inner,
  .mvm-elementor-hero--blue,
  .mvm-elementor-cta--blue,
  .mvm-search-hero,
  .mvm-public-home .mvm-hero,
  .mvm-page .mvm-page-head,
  .mvm-listing .mvm-listing-head,
  .mvm-themes-index .mvm-theme-intro
) :where(h1,h2,h3,h4,h5,h6,p,a,span,strong,em,small,li,dt,dd,label,i,svg) {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  fill: currentColor;
}

/* Inline colour protection is intentionally limited to actual blue BACKGROUNDS.
 * A mere inline text colour such as color:#1966AE must never turn descendants white. */
main#content :where(
  [style*="background:#1966AE" i],
  [style*="background: #1966AE" i],
  [style*="background-color:#1966AE" i],
  [style*="background-color: #1966AE" i],
  [style*="background:#114F8B" i],
  [style*="background: #114F8B" i],
  [style*="background-color:#114F8B" i],
  [style*="background-color: #114F8B" i],
  [style*="background:#0F4F88" i],
  [style*="background: #0F4F88" i],
  [style*="background-color:#0F4F88" i],
  [style*="background-color: #0F4F88" i]
) :where(h1,h2,h3,h4,h5,h6,p,a,span,strong,em,small,li,dt,dd,label,i,svg) {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  fill: currentColor;
}

/* Category fields keep their hue but are darkened enough for locked white text. */
main#content .mvm-category-badge {
  background: color-mix(in srgb, var(--mvm-cat, #1966AE) 72%, #000000) !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  border-color: color-mix(in srgb, var(--mvm-cat, #1966AE) 72%, #000000) !important;
}

@media (prefers-reduced-motion: reduce) {
  main#content *,
  main#content *::before,
  main#content *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/*
 * MvM STYLE CONTRACT 2026.08.27-1
 * Human fallback: /MVM-STIJLCONTRACT.txt
 * Machine guard: /mvm-global-visual-lock.php
 * These aliases deliberately do not alter rendering; they freeze the approved
 * reference values in the canonical last-loaded global stylesheet as well.
 */
:root {
  --mvm-contract-blue: #1966AE;
  --mvm-contract-on-colour: #FFFFFF;
  --mvm-contract-ink: #17212B;
  --mvm-contract-muted: #3F5060;
  --mvm-contract-surface: #FFFFFF;
  --mvm-contract-surface-soft: #F4F7FA;
  --mvm-contract-border: #C9D7E3;
  --mvm-contract-focus: #E89713;
  --mvm-contract-content: 1280px;
}

/* Final homepage invariant: primary community card stays MvM blue in light mode. */
body.home:not(.dark):not([data-mvm-theme="dark"]) main#content .mvm-theme1-community-grid > .mvm-theme1-action-card.mvm-theme1-action-card--primary {
  background: linear-gradient(145deg, #1966AE 0%, #114F8B 100%) !important;
  background-color: #1966AE !important;
  background-image: linear-gradient(145deg, #1966AE 0%, #114F8B 100%) !important;
  border-color: #1966AE !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}

body.home:not(.dark):not([data-mvm-theme="dark"]) main#content .mvm-theme1-community-grid > .mvm-theme1-action-card.mvm-theme1-action-card--primary :where(small,h3,p,a,span) {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  opacity: 1 !important;
  visibility: visible !important;
}
