/**
 * FILE: public-blocks.css
 * PATH: /assets/css/public-blocks.css
 * TYPE: stylesheet
 *
 * DOEL:
 * - Positioneert publieke componentblocks binnen pagina-, nieuws- en kennisbankcontent.
 * - Hergebruikt uitsluitend tokens en componentclasses uit public-design-system.css.
 * - Stijlt previewfouten zonder publieke content te veranderen.
 * - Geeft showcaseblocks (producthero, kerncijfers, kastverhaal, bento, beheer) de brede containermaat.
 *
 * TABELLEN:
 * - geen
 *
 * API CALLS:
 * - geen
 *
 * DEPENDS ON:
 * - /assets/css/public-design-system.css
 *
 * SIDE EFFECTS:
 * - geen
 */

.wi-block-stack {
  display: grid;
  gap: var(--wi-spacing-6);
  min-width: 0;
}

.wi-block {
  min-width: 0;
}

/* Laat layoutblocks de centrale containerbreedte gebruiken, ook vanuit een smalle prosetekst. */
.wi-block--hero,
.wi-block--cta,
.wi-block--card_grid,
.wi-block--product_hero,
.wi-block--stats,
.wi-block--cabinet_story,
.wi-block--bento,
.wi-block--backstage,
.wi-block--brand_grid,
.wi-block--exploded_scene {
  width: min(var(--wi-container-width), calc(100vw - var(--wi-spacing-6) - var(--wi-spacing-6)));
  max-width: none;
}

/* Showcaseblocks zijn eigen hoofdstukken en krijgen extra lucht boven en onder. */
.wi-block--stats,
.wi-block--cabinet_story,
.wi-block--bento,
.wi-block--backstage {
  margin-block: var(--wi-spacing-8);
}

.wi-block--hero .wi-hero,
.wi-block--hero .wi-mini-hero,
.wi-block--cta .wi-cta,
.wi-block--card_grid .wi-block-card-section {
  width: 100%;
}

.wi-block-hero {
  border-radius: var(--wi-radius-large);
}

.wi-block-hero__inner {
  position: relative;
  padding-block: var(--wi-spacing-10);
}

.wi-block-hero__title {
  max-width: 18ch;
  color: inherit;
  font-size: clamp(2.25rem, 5vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.wi-hero--campaign .wi-block-hero__title {
  margin-inline: auto;
  color: var(--wi-campaign-hero-text);
}

.wi-hero--campaign .wi-block-hero__title::after {
  display: block;
  width: min(4.25em, 16rem);
  height: 0.13em;
  margin: 0.12em auto 0;
  border-radius: var(--wi-radius-pill);
  background: var(--wi-color-brand-red);
  box-shadow: 0.35em 0.1em 0 -0.035em var(--wi-color-brand-red);
  content: '';
  rotate: -2deg;
}

.wi-hero--campaign .wi-eyebrow {
  color: var(--wi-color-brand-red);
}

.wi-block-hero__body > *:last-child {
  margin-block-end: 0;
}

.wi-hero--campaign .wi-block-hero__body {
  margin-block: var(--wi-spacing-7);
}

.wi-hero--campaign .wi-button-group {
  justify-content: center;
}

.wi-block-section-heading--surface,
.wi-block-card-section--surface {
  border: 1px solid var(--wi-color-border);
  /* Concentrisch: binnenradius van de kaarten = deze radius min de marge, aan alle zijden gelijk. */
  border-radius: calc(var(--wi-radius-large) + var(--wi-nested-surface-padding));
  background: var(--wi-public-section-alt);
  padding: var(--wi-nested-surface-padding);
}

.wi-block-section-heading .wi-section-heading,
.wi-block-card-section .wi-section-heading {
  margin-block-end: var(--wi-spacing-7);
}

.wi-block-button-group--center {
  justify-content: center;
}

.wi-block-button-group--end {
  justify-content: flex-end;
}

.wi-block--cta .wi-cta {
  min-height: 11rem;
}

/* Alleen zonder vlak; het vlak houdt rondom dezelfde marge. */
.wi-block-card-section:not(.wi-block-card-section--surface) {
  border-radius: var(--wi-radius-large);
  padding-block: var(--wi-spacing-4);
}

.wi-block--quote {
  max-width: min(42rem, 100%);
}

.wi-block-quote--surface {
  border: 1px solid var(--wi-color-border);
  background: var(--wi-color-surface-container-low);
  color: var(--wi-color-text-primary);
}

.wi-block-quote--surface figcaption {
  color: var(--wi-color-text-secondary);
}

/* Tabellen in tekstblocks volgen de centrale wi-table-opmaak en scrollen horizontaal in hun kader. */
.wi-prose-table {
  overflow-x: auto;
  margin-block: var(--wi-spacing-5);
  border: 1px solid var(--wi-color-border);
  border-radius: var(--wi-radius-large);
  background: var(--wi-color-surface);
}

.wi-prose-table table {
  width: 100%;
  min-width: var(--wi-prose-table-min-width);
  margin: 0;
  border-collapse: collapse;
  font-size: var(--wi-font-size-300);
}

.wi-prose-table th,
.wi-prose-table td {
  border-top: 1px solid var(--wi-color-border);
  padding: var(--wi-spacing-3) var(--wi-spacing-4);
  text-align: start;
  vertical-align: top;
}

.wi-prose-table thead th {
  border-top: 0;
  background: var(--wi-color-surface-container);
  color: var(--wi-color-text-primary);
  font-size: var(--wi-font-size-200);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.wi-prose-table tbody tr:nth-child(even) {
  background: var(--wi-color-surface-container-low);
}

/* Contactformulier: kop en melding binnen dezelfde formulierkaart als de velden. */
.wi-contact-form {
  width: 100%;
  scroll-margin-top: var(--wi-spacing-12);
}

.wi-contact-form__header {
  padding: var(--wi-spacing-7) var(--wi-spacing-7) 0;
}

.wi-contact-form__header h2 {
  margin-block-end: var(--wi-spacing-2);
}

.wi-contact-form__header p {
  margin: 0;
  color: var(--wi-color-text-secondary);
}

.wi-contact-form__alert {
  margin: var(--wi-spacing-5) var(--wi-spacing-7) 0;
}

.wi-contact-form .wi-form__actions {
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.wi-contact-form .wi-form__actions p {
  margin: 0;
  color: var(--wi-color-text-secondary);
}

.wi-field__optional {
  color: var(--wi-color-text-secondary);
  font-weight: 400;
}

/* Honeypot voor bots: buiten beeld, niet bereikbaar met toetsenbord of schermlezer. */
.wi-form-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Persoonsprofielen: ronde foto's; opeenvolgende personen staan in één raster naast elkaar. */
.wi-person-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(var(--wi-person-card-min-width), 100%), 1fr));
  gap: var(--wi-spacing-6);
  width: 100%;
}

.wi-person {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  gap: var(--wi-spacing-4);
  border: 1px solid var(--wi-color-border);
  border-radius: var(--wi-radius-large);
  background: var(--wi-public-card-bg);
  padding: var(--wi-spacing-7) var(--wi-spacing-6);
  text-align: center;
}

.wi-person__photo {
  flex: none;
  width: var(--wi-person-photo-size-large);
  height: var(--wi-person-photo-size-large);
  border: var(--wi-person-photo-ring) solid var(--wi-public-card-bg);
  border-radius: var(--wi-radius-pill);
  box-shadow: 0 0 0 1px var(--wi-color-border-strong);
  object-fit: cover;
  object-position: center top;
}

.wi-person__name {
  margin: 0;
  font-size: var(--wi-font-size-600);
}

.wi-person__role {
  margin: var(--wi-spacing-1) 0 0;
  color: var(--wi-color-text-secondary);
  font-size: var(--wi-font-size-300);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wi-person__bio {
  margin-block-start: var(--wi-spacing-3);
  color: var(--wi-color-text-secondary);
}

.wi-person__bio > *:last-child {
  margin-block-end: 0;
}

.wi-block--rich_text > .wi-prose,
.wi-block--info > .wi-alert,
.wi-block--tip > .wi-alert,
.wi-block--warning > .wi-alert,
.wi-block--faq > .wi-accordion,
.wi-block--download > .wi-download,
.wi-block--video > .wi-video-card {
  width: 100%;
}

.wi-component-media {
  width: 100%;
  margin-inline: auto;
}

.wi-component-media--normal {
  max-width: var(--wi-content-width);
}

.wi-component-media--wide {
  max-width: min(64rem, 100%);
}

.wi-component-media--full {
  max-width: 100%;
}

.wi-component-media--fit-natural img {
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
}

/* Originele verhouding rekt een kleine afbeelding niet op; kaart en onderschrift volgen de beeldbreedte. */
.wi-component-media.wi-component-media--fit-natural {
  width: fit-content;
}

.wi-component-media--fit-natural img {
  width: auto;
  max-width: 100%;
  height: auto;
}

.wi-component-media--fit-contain img {
  object-fit: contain;
  background: var(--wi-color-surface-subtle, #f5f6f8);
}

.wi-component-media--fit-cover img {
  object-fit: cover;
}

.wi-block--faq + .wi-block--faq {
  margin-block-start: calc(var(--wi-spacing-6) * -1);
}

.wi-block-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wi-spacing-2) var(--wi-spacing-3);
  border: 1px dashed var(--wi-color-danger);
  border-radius: var(--wi-radius-medium);
  background: var(--wi-color-danger-container);
  padding: var(--wi-spacing-3) var(--wi-spacing-4);
  color: var(--wi-color-danger);
  font-size: var(--wi-font-size-300);
}

.wi-component-blocks-demo {
  border-top: 1px solid var(--wi-color-border);
}

@media print {
  .wi-block-error {
    display: none;
  }
}

@media (max-width: 768px) {
  .wi-block--hero,
  .wi-block--cta,
  .wi-block--card_grid,
  .wi-block--product_hero,
  .wi-block--stats,
  .wi-block--cabinet_story,
  .wi-block--bento,
  .wi-block--backstage,
  .wi-block--brand_grid {
    width: 100%;
  }

  .wi-showcase-hero,
  .wi-backstage {
    border-radius: var(--wi-radius-large);
    padding: var(--wi-spacing-6);
  }

  .wi-block-hero {
    border-radius: var(--wi-radius-medium);
  }

  .wi-person__photo {
    width: var(--wi-person-photo-size);
    height: var(--wi-person-photo-size);
  }

  /* Volgt de mobiele binnenmarge van het centrale formulierraster. */
  .wi-contact-form__header {
    padding: var(--wi-spacing-5) var(--wi-spacing-5) 0;
  }

  .wi-contact-form__alert {
    margin-inline: var(--wi-spacing-5);
  }

  .wi-block-section-heading--surface,
  .wi-block-card-section--surface {
    --wi-nested-surface-padding: var(--wi-nested-surface-padding-compact);
  }
}
