/*
 * The homepage look for every other page: the building blocks behind the patterns in
 * /patterns (page-*, section-*), plus teaser lists, forms and blog posts.
 * Homepage-only styling stays in theme.css.
 */

/* Page shell (templates/page.html): sections stack edge to edge. */
.joy-page-main > .alignfull,
.joy-page-main .wp-block-post-content > .alignfull { margin-block: 0; }
.joy-page-main .wp-block-post-content > :last-child:not(.alignfull) { margin-bottom: clamp(3rem, 6vw, 5rem); }

/* Text in pages and posts. :where() keeps it easy to override in components. */
:where(.joy-page-main, .joy-post) :where(p, li) { font-size: 1.0625rem; line-height: 1.7; }
:where(.joy-page-main, .joy-post) :where(h2) { font-size: clamp(1.75rem, 2.6vw, 2.35rem); line-height: 1.14; }
:where(.joy-page-main, .joy-post) :where(h3) { font-size: clamp(1.25rem, 1.6vw, 1.45rem); line-height: 1.25; }
/* Rhythm inside text sections (beats WordPress' default 1rem gap between blocks). */
.joy-prose > :is(h2, h3) { margin-block-start: clamp(2rem, 4vw, 2.75rem); }
.joy-prose > :is(h2, h3) + :is(p, ul, ol) { margin-block-start: 0.65rem; }
.joy-prose > :is(h2, h3) + :is(.joy-steps, .joy-card-grid, .wp-block-buttons, .wp-block-columns) { margin-block-start: 1.5rem; }
:is(.joy-prose, .joy-prose .wp-block-column) > .joy-eyebrow + :is(h2, h3) { margin-block-start: 0.6rem; }
.joy-prose > :first-child { margin-block-start: 0; }
:where(.joy-page-main, .joy-post) :where(strong) { font-weight: 650; }
:where(.joy-page-main, .joy-post) :where(ul, ol):not(.joy-checklist) { padding-left: 1.25rem; }
:where(.joy-page-main, .joy-post) li::marker { color: var(--wp--preset--color--accent); }
:where(.joy-page-main, .joy-post) :where(p, li) a:not(.wp-element-button) {
  text-decoration-line: underline;
  text-decoration-color: rgba(204, 75, 28, 0.45);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}
:where(.joy-page-main, .joy-post) :where(p, li) a:not(.wp-element-button):hover {
  color: var(--wp--preset--color--accent-dark);
  text-decoration-color: currentColor;
}

/* Eyebrow label, as on the homepage. */
.joy-eyebrow {
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.5;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--wp--preset--color--accent-dark);
}

/* Page header ("Paginakop"): warm gradient band with eyebrow, title and intro. */
.joy-page-hero {
  padding-block: clamp(2.75rem, 6vw, 4.75rem) clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(180deg, var(--wp--preset--color--canvas) 0%, #f8eadf 72%, var(--wp--preset--color--peach) 100%);
}
.joy-page-hero__copy > * { margin-block: 0; }
.joy-page-hero__inner .joy-page-hero__copy { max-width: 40rem; }
.joy-page-hero h1 {
  margin-top: 0.7rem;
  font-size: clamp(2.35rem, 4.4vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}
.joy-page-hero__copy > h1:first-child { margin-top: 0; }
.joy-page-hero__intro {
  margin-top: 1.15rem !important;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1.35vw, 1.2rem) !important;
  line-height: 1.6;
  color: var(--wp--preset--color--muted);
}
.joy-page-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.joy-page-hero__inner > * { margin: 0; min-width: 0; }
.joy-page-hero__image img { display: block; width: 100%; height: auto; }

/* Sections. Two plain sections in a row share one gap instead of two. */
.joy-section { padding-block: clamp(3rem, 6vw, 5rem); }
.joy-section:not([class*="joy-section--"]) + .joy-section:not([class*="joy-section--"]) { padding-top: 0; }
.joy-section--tint { background: linear-gradient(180deg, var(--wp--preset--color--peach) 0, var(--wp--preset--color--canvas) 14rem); }
.joy-section--surface { background: var(--wp--preset--color--surface); }
.joy-section__head { margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.joy-section__head > * { margin-block: 0; }
.joy-section__head > * + * { margin-top: 0.6rem; }
.joy-section__head > p:not(.joy-eyebrow) {
  margin-top: 0.85rem;
  max-width: 38rem;
  color: var(--wp--preset--color--muted);
}

/* Cards with an icon, as on the homepage. */
.joy-support-card {
  box-sizing: border-box;
  height: 100%;
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: var(--wp--preset--color--peach);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.045), 0 8px 24px -20px rgba(0, 0, 0, 0.18);
}
.joy-support-card h3 { margin: 0; font-size: clamp(1.25rem, 1.6vw, 1.45rem); line-height: 1.2; }
.joy-support-card h3 + p {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--wp--preset--color--muted);
}

/* Numbered steps; the numbers come from CSS so steps can be added or moved freely. */
.joy-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
  counter-reset: joy-step;
}
.joy-steps > * { margin: 0 !important; }
.joy-step {
  position: relative;
  box-sizing: border-box;
  padding: 1.35rem 1.5rem 1.35rem 4.75rem;
  border-radius: 1.25rem;
  background: var(--wp--preset--color--surface);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.045), 0 8px 24px -20px rgba(0, 0, 0, 0.18);
  counter-increment: joy-step;
}
.joy-step::before {
  content: counter(joy-step);
  position: absolute;
  top: 1.25rem;
  left: 1.35rem;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--surface);
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.15rem;
  line-height: 1;
}
.joy-step > * { margin-block: 0; }
.joy-step h3 { font-size: 1.2rem; line-height: 1.25; }
.joy-step h3 + p { margin-top: 0.35rem; font-size: 0.9375rem; line-height: 1.6; color: var(--wp--preset--color--muted); }

/* Highlighted block ("Uitgelicht blok"). */
.joy-note {
  box-sizing: border-box;
  padding: clamp(1.35rem, 3vw, 1.9rem) clamp(1.35rem, 3vw, 2.1rem);
  border-radius: 1.25rem;
  background: var(--wp--preset--color--surface);
  box-shadow: inset 4px 0 0 var(--wp--preset--color--accent), 0 0 0 1px rgba(0, 0, 0, 0.045), 0 8px 24px -20px rgba(0, 0, 0, 0.18);
}
.joy-note--peach { background: var(--wp--preset--color--peach); box-shadow: none; }
.joy-note > * { margin-block: 0; }
.joy-note > * + * { margin-top: 0.75rem; }
.joy-note h2 { font-size: clamp(1.5rem, 2.2vw, 1.85rem); }
.joy-note h3 { font-size: 1.25rem; }
.joy-note :where(p, li) { font-size: 1rem; }

/* Large quote, like "Ervaring uit de praktijk" on the homepage. */
.wp-block-quote.joy-quote {
  margin-block: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
  border: 0;
  border-block: 1px solid #e7d8ca;
}
.joy-quote p {
  margin: 0;
  font-family: var(--wp--preset--font-family--display);
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  line-height: 1.38;
}
.joy-quote p + p {
  margin-top: 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--wp--preset--color--muted);
}
.joy-quote cite {
  display: block;
  margin-top: 1rem;
  color: var(--wp--preset--color--accent-dark);
  font-size: 0.8125rem;
  font-style: normal;
  font-weight: 650;
}

/* Closing call to action ("Oproep"). */
.joy-cta {
  box-sizing: border-box;
  padding: clamp(2rem, 5vw, 3.25rem) clamp(1.25rem, 4vw, 2.5rem);
  border-radius: 2rem;
  background: var(--wp--preset--color--peach);
  text-align: center;
}
.joy-cta > * { margin-block: 0; }
.joy-cta .joy-brand-heart { width: 4.5rem; margin-inline: auto; }
.joy-cta h2 {
  margin-top: 0.75rem;
  color: var(--wp--preset--color--accent);
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  line-height: 1.2;
}
.joy-cta h2 + p { margin-top: 0.75rem; color: var(--wp--preset--color--muted); }
.joy-cta .wp-block-buttons { margin-top: 1.5rem; justify-content: center; }

/* List with check marks. */
.joy-checklist { padding-left: 0; list-style: none; }
.joy-checklist li { position: relative; padding-left: 1.85rem; }
.joy-checklist li + li { margin-top: 0.5rem; }
.joy-checklist li::before {
  content: "";
  position: absolute;
  top: 0.32em;
  left: 0;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--wp--preset--color--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Card that holds a form or other embedded content. */
.joy-form-card {
  box-sizing: border-box;
  padding: clamp(1.35rem, 4vw, 2.5rem);
  border-radius: 1.5rem;
  background: var(--wp--preset--color--surface);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.045), 0 16px 38px -26px rgba(18, 54, 80, 0.28);
}
.joy-form-card > * { margin-block: 0; }
.joy-form-card > * + * { margin-top: 1rem; }

/* Teaser lists (Nieuws, Ons netwerk): every card in a row is equally tall, and every image
   sits in the same 4:3 frame, uncropped, so the picture no longer sets the card height. */
.joy-teasers .wp-block-post-template {
  gap: clamp(1rem, 2vw, 1.5rem);
  /* At most three columns, also when there are only one or two posts. */
  grid-template-columns: repeat(auto-fill, minmax(max(16rem, calc((100% - 3rem) / 3)), 1fr)) !important;
}
.joy-teasers .wp-block-post-template > li { display: flex; margin: 0; }
.joy-teasers .wp-block-post-template > li > .wp-block-group {
  box-sizing: border-box;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem !important;
}
.joy-teasers .wp-block-post-template > li > .wp-block-group > * { margin-block: 0; }
.joy-teasers .wp-block-post-featured-image {
  aspect-ratio: 4 / 3;
  margin: 0 0 1.1rem !important;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0.75rem;
  border-radius: var(--joy-radius-md);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.joy-teasers .wp-block-post-featured-image :is(a, img) { display: block; width: 100%; height: 100% !important; }
.joy-teasers .wp-block-post-featured-image img { object-fit: contain; border-radius: 0; }
.joy-teasers .wp-block-post-date { margin-bottom: 0.35rem !important; font-size: 0.8125rem; color: var(--wp--preset--color--muted); }
.joy-teasers .wp-block-post-title {
  margin-bottom: 0.5rem !important;
  font-size: clamp(1.2rem, 1.5vw, 1.35rem) !important;
  line-height: 1.2;
}
.joy-teasers .wp-block-post-title a { text-decoration: none; }
.joy-teasers .wp-block-post-title a:hover { color: var(--wp--preset--color--accent-dark); }
.joy-teasers .wp-block-post-excerpt { display: flex; flex: 1 0 auto; flex-direction: column; }
.joy-teasers .wp-block-post-excerpt__excerpt { margin: 0; font-size: 0.9375rem; line-height: 1.6; color: var(--wp--preset--color--muted); }
.joy-teasers :is(.wp-block-post-excerpt__more-text, .wp-block-read-more) { margin-top: auto !important; padding-top: 1rem; }
.joy-teasers :is(.wp-block-post-excerpt__more-text a, a.wp-block-read-more) {
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--wp--preset--color--accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
}

/* FormLayer forms (Aanmelden, Contact) in the site's fonts, fields and buttons. */
body .formlayer-form { font-family: var(--wp--preset--font-family--body); color: var(--wp--preset--color--ink); }
body .formlayer-form label,
body .formlayer-form .formlayer-label {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--wp--preset--color--ink);
}
body .formlayer-form .formlayer-sub-label {
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  color: var(--wp--preset--color--muted);
}
body .formlayer-form .required-indicator { color: var(--wp--preset--color--accent); }
body .formlayer-form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select, textarea) {
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1rem;
  color: var(--wp--preset--color--ink);
  background-color: #fff;
  border: 1px solid #e3d3c5;
  border-radius: 0.875rem;
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
body .formlayer-form :is(input, select, textarea)::placeholder { color: #8a979f; }
body .formlayer-form :is(input, select, textarea):focus {
  border-color: var(--wp--preset--color--accent);
  box-shadow: 0 0 0 3px rgba(204, 75, 28, 0.16);
  outline: none;
}
/* FormLayer sets the button colour inline with !important; a background image paints over it. */
body .formlayer-form .formlayer-submit-btn {
  min-height: 48px;
  padding: 0.82rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background-image: linear-gradient(var(--wp--preset--color--accent), var(--wp--preset--color--accent));
  color: var(--wp--preset--color--surface);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  box-shadow: var(--joy-shadow);
  transition: box-shadow 170ms cubic-bezier(0.2, 0, 0, 1), transform 170ms cubic-bezier(0.2, 0, 0, 1);
}
body .formlayer-form .formlayer-submit-btn:hover {
  background-image: linear-gradient(var(--wp--preset--color--accent-dark), var(--wp--preset--color--accent-dark));
  box-shadow: var(--joy-shadow-hover);
  transform: translateY(-1px);
}

/* Blog posts (single template). */
.joy-post-hero { padding-bottom: clamp(2rem, 4vw, 3rem); }
.joy-post-hero .wp-block-post-terms { font-size: 0.7rem; font-weight: 750; letter-spacing: 0.13em; text-transform: uppercase; }
.joy-post-hero .wp-block-post-terms a { color: var(--wp--preset--color--accent-dark); text-decoration: none; }
.joy-post-hero .wp-block-post-title { margin-top: 0.7rem; font-size: clamp(2.2rem, 4vw, 3.25rem); line-height: 1.08; letter-spacing: -0.03em; }
.joy-post-meta { margin-top: 1rem; gap: 0.35rem 1rem; font-size: 0.875rem; color: var(--wp--preset--color--muted); }
/* Keep the image's own shape (WordPress adds object-fit: cover inline), centred and capped. */
.joy-post-image img { display: block; width: auto; max-width: 100%; height: auto; max-height: 26rem; margin-inline: auto; border-radius: var(--joy-radius-lg); }
.joy-post .wp-block-post-content { padding-block: clamp(2rem, 4vw, 3rem); }
.joy-post-nav { padding-bottom: clamp(3rem, 6vw, 5rem); }
.joy-post-nav .wp-block-post-navigation-link { font-size: 0.9375rem; }
.joy-post-nav .wp-block-post-navigation-link a { font-weight: 650; text-decoration: none; }
.joy-post-nav .wp-block-post-navigation-link a:hover { color: var(--wp--preset--color--accent-dark); }

@media (max-width: 781px) {
  .joy-page-hero__inner { grid-template-columns: minmax(0, 1fr); }
  .joy-page-hero__image { max-width: 26rem; }
  .joy-step { padding-left: 4.25rem; }
  .joy-step::before { left: 1.1rem; }
}

/* Single event page: the warm gradient of the page header behind the event. */
.joy-section--hero-tint { background: linear-gradient(180deg, var(--wp--preset--color--canvas) 0%, #f8eadf 22rem, var(--wp--preset--color--canvas) 40rem); }
.joy-post-nav { border-top: 1px solid #e7d8ca; padding-top: 1.5rem; }

/* Lead paragraph, small print and a label inside the call to action. */
.joy-lead { font-size: clamp(1.15rem, 1.6vw, 1.3rem) !important; line-height: 1.6; }
.joy-smallprint { margin-top: 2rem !important; font-size: 0.875rem !important; color: var(--wp--preset--color--muted); }
.joy-cta > .joy-eyebrow { margin-top: 0.75rem; }
.joy-cta > .joy-eyebrow + h2 { margin-top: 0.5rem; }
