/* ==========================================================================
   PreventPartner – één overzichtsstijl voor Professionals, Nieuws en de module
   "Professionals per expertise/dienst".
   Loaded by:
     html/com_content/category/professionals.php   (after professionals.css + relations.css)
     html/com_content/category/nieuws.php          (before nieuws.css)
     modules/mod_prevent_professionals/tmpl/default.php
   Tokens: style guide (preventpartner-styleguide.md); same values as professionals.css / relations.css.

   Parts
     .pp-ov                 wrapper (container for the column count)
     .pp-ov-head            grey band: h1, intro, filter row with result count
     .pp-ov-grid            card grid: 1 / 2 / 3 columns (--4: 4 columns on wide content columns)
     .pp-ov-card            card: image, eyebrow, title, tags, text, secondary button
   Card order on screen: image – eyebrow – title – tags – text – button.
   In the HTML the title comes first (h2); CSS "order" puts the eyebrow above it.
   ========================================================================== */

:root {
  --pp-navy: #0C215B; --pp-navy-heading: #202E56; --pp-mist: #C1CCD6; --pp-link: #224FAA;
  --pp-text: #22262A; --pp-text-muted: #333333; --pp-coral-text-on-grey: #B43C3E;
  --pp-surface: #F1F1F1; --pp-border: #CCCCCC; --pp-white: #FFFFFF;
  --pp-font: "SUSE", sans-serif; --pp-radius: 4px;
  --pp-space-1: 4px; --pp-space-2: 8px; --pp-space-3: 16px; --pp-space-4: 24px;
  --pp-space-5: 32px; --pp-space-6: 48px; --pp-space-7: 64px;
}

.pp-ov {
  container: pp-ov / inline-size;
  font-family: var(--pp-font);
  line-height: 1.6;
  color: var(--pp-text);
}
.pp-ov p { margin: 0; }
/* Lists without bullets/indent (beats ".container-component ul" in user.css) */
.pp-ov ul[role="list"] { margin: 0; padding-left: 0; list-style: none; }

/* ==========================================================================
   Head: grey band with title, intro and filter
   ========================================================================== */

.pp-ov-head {
  display: flex;
  flex-direction: column;
  gap: var(--pp-space-3);
  margin: 0 0 var(--pp-space-6);
  padding: var(--pp-space-4) var(--pp-space-3);
  background: var(--pp-surface);
  border: 1px solid transparent; /* visible in forced colors */
  border-radius: var(--pp-radius);
}
@container pp-ov (min-width: 640px) {
  .pp-ov-head { padding: var(--pp-space-5); }
}
/* Without a filter (news overview, filter off): no grey band, just the title and intro */
.pp-ov .pp-ov-head--plain { margin-bottom: var(--pp-space-5); padding: 0; background: none; border: 0; }

.pp-ov-head__text { display: flex; flex-direction: column; gap: var(--pp-space-2); max-width: 760px; }
.pp-ov .pp-ov-head__title {
  margin: 0;
  font-size: clamp(1.625rem, 4cqi, 2rem);
  line-height: 1.3;
  font-weight: 600;
  color: var(--pp-navy-heading);
  text-wrap: balance;
}
.pp-ov-head__intro > * { margin: 0 0 var(--pp-space-2); }
.pp-ov-head__intro > :last-child { margin-bottom: 0; }
.pp-ov-head__intro > p:first-child { font-weight: 600; } /* lead line (style guide: bold intro) */
.pp-ov-head__intro a { color: var(--pp-link); }
.pp-ov-head__intro img { max-width: 100%; height: auto; }

/* Filter row: label + buttons left, result count right (wraps on small screens) */
.pp-ov-head .pp-filter {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--pp-space-2) var(--pp-space-4);
  margin: 0;
  padding-top: var(--pp-space-2);
  font-family: var(--pp-font);
}
.pp-ov-head .pp-filter[hidden] { display: none !important; }
.pp-ov-head .pp-filter__label { margin: 0; font-size: .875rem; font-weight: 600; color: var(--pp-text-muted); }
.pp-ov-head .pp-filter__list {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: var(--pp-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.pp-ov-head .pp-filter__select-wrap { flex: 1 1 16rem; }
/* Dropdown + search field (professionals overview): two fields side by side, count right; stacked on a phone */
.pp-ov-head .pp-filter--dropdown,
.pp-ov-head .pp-filter--search { align-items: flex-end; gap: var(--pp-space-3) var(--pp-space-4); }
.pp-ov-head .pp-filter__field { flex: 1 1 15rem; max-width: 24rem; }
.pp-ov-head .pp-filter__field .pp-filter__select-wrap { flex: none; max-width: none; }
.pp-ov-head .pp-filter__field .pp-filter__input { max-width: none; }
.pp-ov-head .pp-filter--dropdown .pp-filter__count,
.pp-ov-head .pp-filter--search .pp-filter__count { padding-bottom: 10px; }
/* Dropdown variant (filter.php 'select' => true, styled in relations.css): dropdown below 768px */
@media (max-width: 767.98px) {
  .pp-ov-head .pp-filter--select .pp-filter__list { display: none; }
  .pp-ov-head .pp-filter--select .pp-filter__select-wrap { display: block; }
}

.pp-ov-head .pp-chip,
.pp-ov-chip {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 44px; /* WCAG 2.5.8 (and comfortable on touch) */
  padding: 8px 14px;
  font: inherit;
  font-size: .9375rem;
  line-height: 1.3;
  color: var(--pp-navy);
  text-decoration: none;
  background: var(--pp-white);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius);
  cursor: pointer;
}
.pp-ov-head .pp-chip:hover,
.pp-ov-chip:hover { color: var(--pp-navy); border-color: var(--pp-navy); }
.pp-ov-head .pp-chip[aria-pressed="true"],
.pp-ov-chip[aria-current] {
  color: var(--pp-white);
  background: var(--pp-navy);
  border-color: var(--pp-navy);
}
.pp-ov-head .pp-chip:focus-visible,
.pp-ov-chip:focus-visible,
.pp-ov-head .pp-filter__select:focus-visible,
.pp-ov-head .pp-filter__input:focus-visible { outline: 3px solid var(--pp-navy); outline-offset: 2px; }

/* Result count ("12 professionals", "3 van 12 professionals getoond", "156 berichten") */
.pp-ov-count,
.pp-ov-head .pp-filter__count {
  margin: 0 0 0 auto;
  font-size: .875rem;
  color: var(--pp-text-muted);
}

/* ==========================================================================
   Grid: 1 column -> 2 -> 3 (-> 4 with .pp-ov-grid--4)
   ========================================================================== */

.pp-ov-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--pp-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.pp-ov-grid > li { display: flex; min-width: 0; }

@container pp-ov (min-width: 560px) {
  .pp-ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container pp-ov (min-width: 880px) {
  .pp-ov-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--pp-space-5); }
}
@container pp-ov (min-width: 1100px) {
  .pp-ov-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--pp-space-4); }
}
/* Module: rows of 4 (default 4 professionals, max 8 = two rows) from 880px, 2 from 560px, else 1 */
@container pp-ov (min-width: 880px) {
  .pp-ov-grid--module { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--pp-space-4); }
}
/* Browsers without container queries: viewport breakpoints */
@supports not (container-type: inline-size) {
  @media (min-width: 576px) { .pp-ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 992px) { .pp-ov-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--pp-space-5); } }
  @media (min-width: 1200px) { .pp-ov-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--pp-space-4); } }
  @media (min-width: 992px) { .pp-ov-grid--module { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--pp-space-4); } }
}

/* Items hidden by the client-side filter (relations.js) */
.pp-ov-grid > [data-pp-keys][hidden] { display: none !important; }

.pp-ov-empty {
  margin: 0;
  padding: var(--pp-space-5);
  background: var(--pp-surface);
  border-radius: var(--pp-radius);
}
.pp-ov-empty[hidden] { display: none !important; }

/* ==========================================================================
   Card
   ========================================================================== */

.pp-ov-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  background: var(--pp-surface);
  border: 1px solid transparent; /* visible in forced colors */
  border-radius: var(--pp-radius);
}

/* Image: 3:2 (news) or square (people). After the text in the DOM, on top visually. */
.pp-ov-card__media {
  order: -1;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--pp-mist);
}
.pp-ov-card__media--square { aspect-ratio: 1 / 1; }
.pp-ov-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pp-ov-card__media--square img { object-position: 50% 20%; }
.pp-ov-card--person .pp-ov-card__media img { filter: grayscale(100%); } /* same as on the profile page */

.pp-ov-card__initials {
  font-size: 3rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--pp-navy);
}
.pp-ov-card__placeholder { width: 56px; height: 56px; color: var(--pp-navy); opacity: .45; }

.pp-ov-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--pp-space-2);
  padding: var(--pp-space-4);
}

/* Visual order (DOM: title first). Anything else (plugin output) sits with the text. */
.pp-ov-card__body > *        { order: 4; }
.pp-ov-card__eyebrow         { order: 1; }
.pp-ov-card__title           { order: 2; }
.pp-ov-card__tags,
.pp-ov-card__status          { order: 3; }
.pp-ov-card__text            { order: 4; }
.pp-ov-card__more            { order: 5; }
.pp-ov-card__edit            { order: 6; }

.pp-ov .pp-ov-card__eyebrow {
  margin: 0;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--pp-coral-text-on-grey);

}

.pp-ov .pp-ov-card__title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--pp-navy-heading);
  overflow-wrap: anywhere;
  hyphens: auto;
}
.pp-ov-card__title a { color: inherit; text-decoration: none; }

/* Tags: max. 3 on a card, then "+n" */
.pp-ov .pp-ov-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pp-space-2);
  margin: 0 0 var(--pp-space-1);
  padding: 0;
  list-style: none;
}
.pp-ov .pp-ov-card__tags > li { display: flex; }
.pp-ov-tag {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 24px; /* WCAG 2.5.8 when it is a link */
  padding: 2px 8px;
  font-size: .8125rem;
  line-height: 20px;
  color: var(--pp-navy);
  text-decoration: none;
  background: var(--pp-white);
  border: 1px solid var(--pp-mist);
  border-radius: var(--pp-radius);
}
/* Tag links (expertise -> hub page) stay clickable above the stretched card link */
a.pp-ov-tag { position: relative; z-index: 2; }
a.pp-ov-tag:hover { color: var(--pp-navy); border-color: var(--pp-navy); text-decoration: underline; }
a.pp-ov-tag:focus-visible { outline: 3px solid var(--pp-navy); outline-offset: 2px; }

.pp-ov .pp-ov-card__text { margin: 0; font-size: .9375rem; line-height: 1.55; }
.pp-ov-card__text strong { font-weight: 600; }

.pp-ov .pp-ov-card__status { margin: 0; font-size: .8125rem; font-weight: 600; color: var(--pp-coral-text-on-grey); }
.pp-ov-card--unpublished { border: 2px dashed var(--pp-coral-text-on-grey); }

/* Secondary button ("Lees meer" / "Bekijk profiel") */
.pp-ov-card__more {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 44px;
  margin-top: auto;
  padding: 10px 16px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--pp-text-muted);
  text-decoration: none;
  background: var(--pp-white);
  border: 1px solid var(--pp-border);
  border-radius: var(--pp-radius);
}
/* margin-top:auto keeps the buttons of a row aligned; the text keeps 16px distance above the button */
.pp-ov .pp-ov-card__text { padding-bottom: var(--pp-space-2); }

/* One link per card covers the whole card (the title link on people, "Lees meer" on news) */
.pp-ov-card__stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pp-ov-card__edit { position: relative; z-index: 3; }

.pp-ov-card:hover .pp-ov-card__title { text-decoration: underline; text-underline-offset: 3px; }
.pp-ov-card:hover .pp-ov-card__more { color: var(--pp-navy); border-color: var(--pp-navy); }

/* Focus: ring around the whole (clickable) card */
.pp-ov-card__stretch:focus { outline: none; }
.pp-ov-card__stretch:focus-visible { outline: none; }
.pp-ov-card:has(.pp-ov-card__stretch:focus-visible) { outline: 3px solid var(--pp-navy); outline-offset: 2px; }
.pp-ov-card:has(.pp-ov-card__stretch:focus-visible) .pp-ov-card__more { color: var(--pp-navy); border-color: var(--pp-navy); }
@supports not selector(:has(*)) {
  .pp-ov-card__stretch:focus-visible { outline: 3px solid var(--pp-navy); outline-offset: 2px; }
}

/* On a grey background (e.g. the module in a grey band): white cards */
.pp-ov--on-grey .pp-ov-card,
.pp-rel--grey .pp-ov-card { background: var(--pp-white); border-color: var(--pp-border); }

/* "Alle professionals >" under the module */
.pp-ov .pp-ov-more { margin: var(--pp-space-4) 0 0; }
.pp-ov-more a { display: inline-block; min-height: 24px; font-weight: 600; color: var(--pp-navy); }
.pp-ov-more a::after { content: " >"; }

@media (prefers-reduced-motion: no-preference) {
  .pp-ov-card__more, .pp-ov-chip, .pp-ov-head .pp-chip { transition: color .15s, border-color .15s, background-color .15s; }
}

@media (forced-colors: active) {
  .pp-ov-card, .pp-ov-head { border-color: CanvasText; }
  .pp-ov-card__more, .pp-ov-chip, .pp-ov-head .pp-chip { border-color: ButtonText; }
  .pp-ov-chip[aria-current], .pp-ov-head .pp-chip[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .pp-ov-card:has(.pp-ov-card__stretch:focus-visible) { outline-color: Highlight; }
  .pp-ov-card__initials { forced-color-adjust: none; }
}

@media print {
  .pp-ov { container-type: normal; }
  .pp-ov-head { padding: 0; background: none; }
  .pp-ov-head .pp-filter, .pp-ov-filter, .pp-ov-card__more { display: none !important; }
  .pp-ov-grid { display: block; }
  .pp-ov-card { break-inside: avoid; margin-bottom: 16px; border: 1px solid #999; }
}

/* Module mod_prevent_professionals: intro above the cards */
.pp-ov .pp-mod-professionals__intro { max-width: 62ch; margin: 0 0 var(--pp-space-4); }

/* Module mod_articles, layout "pp-news" (latest news on the homepage): title above the cards.
   Cards and grid as above: .pp-ov-card--news in .pp-ov-grid--module (1 / 2 / 4 columns). */
.pp-ov .pp-mod-news__title {
  margin: 0 0 var(--pp-space-4);
  font-size: 1.5rem;
  line-height: 1.33;
  font-weight: 600;
  color: var(--pp-navy-heading);
  text-wrap: balance;
}

/* ==========================================================================
   Homepage news module (mod_articles, layout "pp-news")
   White card with the same border as the professionals row (team.css); image with the date as a label;
   title = the link (covers the card); author only when the articles have different authors. No button, no tags.
   ========================================================================== */
.pp-ov.pp-mod-news .pp-ov-card {
  background: var(--pp-white);
  border: 1px solid var(--pp-border);
}
.pp-ov.pp-mod-news .pp-ov-card__media { position: relative; }

/* Images in black and white (less prominent than the title); full colour on hover/focus, like the professionals row */
.pp-mod-news .pp-ov-card__media img { filter: grayscale(100%); }
.pp-mod-news .pp-ov-card:hover .pp-ov-card__media img,
.pp-mod-news .pp-ov-card:has(.pp-ov-card__stretch:focus-visible) .pp-ov-card__media img { filter: none; }

/* Date label on the image: white with dark blue text, readable on every photo (#202E56 on white 13.5:1) */
.pp-mod-news__date {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  font-size: .8125rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--pp-navy-heading);
  background: var(--pp-white);
  border-radius: var(--pp-radius);
  box-shadow: 0 1px 2px rgb(0 0 0 / .15);
  pointer-events: none;
}

.pp-ov.pp-mod-news .pp-ov-card__body { gap: var(--pp-space-2); padding: var(--pp-space-4) var(--pp-space-4) var(--pp-space-5); }
.pp-ov.pp-mod-news .pp-ov-card__title { hyphens: manual; text-wrap: pretty; } /* no "Vi-deo"; long words still wrap (overflow-wrap) */
.pp-ov.pp-mod-news .pp-mod-news__author { order: 3; margin: 0; font-size: .875rem; color: var(--pp-text-muted); }

/* Hover: underlined title (base card) + slight zoom of the image */
@media (prefers-reduced-motion: no-preference) {
  .pp-mod-news .pp-ov-card__media img { transition: transform .35s ease, filter .35s ease; }
  .pp-mod-news .pp-ov-card:hover .pp-ov-card__media img { transform: scale(1.03); }
}
@media (forced-colors: active) {
  .pp-mod-news__date { border: 1px solid CanvasText; box-shadow: none; }
}
