/*
 * Opmaak van wat de plugin zelf rendert: de gemeentepagina's (CPT waterhardheid),
 * de gemeentetegels, de postcodewidget en (via assets/ontharder-check.css) de
 * ontharder-check. Die HTML komt uit PHP, niet uit Kadence-blokken, dus Kadence
 * kan ze niet opmaken: CSS-uitzondering volgens richtlijn §9.
 *
 * Overgenomen uit style.css van het child-theme (dev, secties 3, 5, 7, 11, 14, 17).
 * Kleuren en fonts komen uit het Kadence-palet en de Customizer, zodat een
 * wijziging daar ook hier doorwerkt. Alleen merkkleuren die niet in het palet
 * staan (navy-300/100, pink-500/100/50) zijn letterlijk. Klasseprefix: nmk-.
 */

/* --- Tokens, alleen binnen de eigen componenten ------------------------------------------- */
.nmk-wh,
.nmk-wh-grid,
.nmk-wh-count,
.nmk-wtool,
.nmk-oc {
	--navy-900: var(--global-palette3, #0A1A45);
	--navy-700: var(--global-palette4, #17296A);
	--navy-500: var(--global-palette10, #2A46A6);
	--navy-300: #8098DC;
	--navy-100: #DFE6F8;
	--navy-50:  var(--global-palette7, #F2F5FD);
	--pink-600: var(--global-palette1, #CF3369); /* CTA-roze, beslist 2026-10-23 */
	--pink-500: #FF5C8A;
	--pink-100: #FFE0EC;
	--pink-50:  #FFF2F7;
	--ink:     var(--global-palette3, #0A1A45);
	--slate:   var(--global-palette5, #5A6A8F);
	--line:    var(--global-palette6, #E4E8F2);
	--bg:      var(--global-palette9, #FFFFFF);
	--bg-soft: var(--global-palette8, #F6F8FE);
	/* Waterhardheid: zacht / matig / hard */
	--hard-soft: var(--navy-300);
	--hard-mid:  var(--navy-500);
	--hard-hard: var(--pink-500);
	--font-display: var(--global-heading-font-family, "Bricolage Grotesque", sans-serif);
	--font-body:    var(--global-body-font-family, "Hanken Grotesk", sans-serif);
	--r-sm: 10px;
	--r-md: 16px;
	--r-lg: 24px;
	--r-pill: 999px;
	--shadow-sm: 0 1px 2px rgba(26, 42, 102, .06), 0 2px 8px rgba(26, 42, 102, .07);
	--shadow-md: 0 6px 24px rgba(26, 42, 102, .12);
	--shadow-lg: 0 20px 48px rgba(26, 42, 102, .16);
	--ease: cubic-bezier(.2, .8, .2, 1);
}

/* --- Knoppen in plugin-HTML ---------------------------------------------------------------
   Zelfde uitzicht als de Kadence-knop (palette1, hover palette2, pil, 48 px). Kadence kleurt
   een kale <button> op :hover/:focus/:active met zijn eigen waarde (0,1,1); daarom staan
   kleur en achtergrond hier ook expliciet voor die staten (CLAUDE.md). */
.nmk-btn {
	font-family: var(--font-body);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.25;
	border: 0;
	border-radius: var(--r-pill);
	padding: .85em 1.6em;
	display: inline-flex;
	align-items: center;
	gap: .4em;
	min-height: 48px;
	text-decoration: none;
	cursor: pointer;
	transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s ease;
}
.nmk-btn--primary,
.nmk-btn--primary:visited { background-color: var(--pink-600); color: #fff; }
.nmk-btn--primary:hover,
.nmk-btn--primary:focus,
.nmk-btn--primary:active { background-color: var(--global-palette2, #B8285C); color: #fff; }
.nmk-btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.nmk-btn--primary:active { transform: translateY(0); }
.nmk-btn:focus-visible { outline: 2px solid var(--pink-500); outline-offset: 2px; }

/* --- Kleine bouwstenen -------------------------------------------------------------------- */
.nmk-badge {
	display: inline-block;
	background: var(--navy-100);
	color: var(--navy-700);
	border-radius: var(--r-pill);
	padding: .25em .75em;
	font-size: .8125rem;
	font-weight: 600;
}
.nmk-badge--pink { background: var(--pink-100); color: var(--pink-600); }

/* Answer-first: de citeerbare openingszin (GEO). Zelfde vorm als het answer-blok op de pagina's. */
.nmk-answer {
	background: var(--navy-50);
	border-radius: var(--r-lg);
	padding: clamp(1.25rem, 4vw, 2rem);
	font-size: 1.15rem;
	line-height: 1.6;
	font-weight: 500;
	color: var(--navy-900);
	box-shadow: var(--shadow-sm);
}

.nmk-media {
	position: relative; overflow: hidden; display: block;
	border-radius: var(--r-lg); box-shadow: var(--shadow-md);
	background: var(--navy-50); /* placeholder tijdens laden */
}
.nmk-media img { display: block; width: 100%; height: auto; border-radius: inherit; }
.nmk-media--tint::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	mix-blend-mode: multiply; opacity: .14;
	background: linear-gradient(160deg, var(--navy-500), var(--pink-500));
}

/* Hardheidsbol + uitleg (gemeentepagina en widget) */
.nmk-gauge {
	width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
	color: #fff; font-weight: 800; font-family: var(--font-display); flex-shrink: 0;
	background: var(--hard-hard);
}
.nmk-gauge--soft { background: var(--hard-soft); }
.nmk-gauge--mid  { background: var(--hard-mid); }
.nmk-result__txt strong { display: block; font-family: var(--font-display); font-weight: 700; color: var(--navy-900); }
.nmk-result__txt span { color: var(--slate); font-size: .9rem; }

/* °fH-schaal */
.nmk-scale { display: flex; gap: 6px; margin-top: 14px; font-size: .75rem; color: var(--slate); }
.nmk-scale .s { flex: 1; text-align: center; }
.nmk-scale .bar { height: 8px; border-radius: var(--r-pill); margin-bottom: 6px; }
.nmk-scale .bar--soft { background: var(--hard-soft); }
.nmk-scale .bar--mid  { background: var(--hard-mid); }
.nmk-scale .bar--hard { background: var(--hard-hard); }

/* --- Gemeentepagina (CPT waterhardheid) ---------------------------------------------------- */
/* Geen zijbalk, één leesbare kolom. */
.single-waterhardheid .content-container.site-container { display: block; }
.single-waterhardheid #primary.content-area { width: 100%; max-width: 100%; margin: 0; float: none; }
.single-waterhardheid .entry-content .nmk-wh { max-width: 46rem; margin-inline: auto; }
/* Zelfde sectiepadding als de Kadence-pagina's (docs/NMK_DESIGN_TOKENS.md §4.4); de pagina
   heeft geen rijen, dus anders plakt de H1 tegen de header en de laatste regel tegen de footer. */
.single-waterhardheid .entry-content .nmk-wh { padding-block: 4.4vw; }
@media (max-width: 1024px) { .single-waterhardheid .entry-content .nmk-wh { padding-block: 6vw; } }
@media (max-width: 767px) { .single-waterhardheid .entry-content .nmk-wh { padding-block: 9.5vw; } }

.nmk-wh__title {
	font-family: var(--font-display); font-weight: 800; color: var(--navy-900);
	letter-spacing: -.03em; line-height: 1.08;
	font-size: clamp(1.9rem, 6vw, 2.9rem); margin: 0 0 1.1rem;
}
.nmk-wh h2 {
	font-family: var(--font-display); font-weight: 700; color: var(--navy-900);
	letter-spacing: -.02em; font-size: clamp(1.35rem, 4vw, 1.7rem);
	margin: 2.4rem 0 .7rem;
}
.nmk-wh h3 {
	font-family: var(--font-display); font-weight: 700; color: var(--navy-900);
	font-size: 1.1rem; margin: 1.3rem 0 .35rem;
}
.nmk-wh p { line-height: 1.7; margin: 0 0 1rem; }

/* Resultaatkaart bovenaan */
.nmk-wh__gauge-wrap {
	margin: 1.4rem 0 .4rem; background: var(--bg); border: 1px solid var(--line);
	border-radius: var(--r-lg); padding: clamp(1.1rem, 3vw, 1.5rem);
	box-shadow: var(--shadow-md);
}
.nmk-wh__gauge-row { display: flex; align-items: center; gap: 18px; }
/* Instap naar de ontharder-check in de kaart zelf: het enige conversiemoment boven de fold. */
.nmk-wh__gauge-cta {
	display: flex; align-items: center; gap: clamp(.9rem, 3vw, 1.4rem);
	margin-top: clamp(1rem, 3vw, 1.3rem); padding-top: clamp(1rem, 3vw, 1.3rem);
	border-top: 1px solid var(--line);
}
.nmk-wh .nmk-wh__gauge-cta p {
	margin: 0; flex: 1 1 auto;
	font-size: .95rem; line-height: 1.55; color: var(--slate);
}
.nmk-wh__gauge-cta .nmk-btn { margin: 0; flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 560px) {
	.nmk-wh__gauge-cta { flex-direction: column; align-items: stretch; }
	.nmk-wh__gauge-cta .nmk-btn { width: 100%; justify-content: center; }
}
.nmk-wh__gauge-wrap .nmk-gauge {
	width: 84px; height: 84px; font-size: 1.7rem;
	box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--hard-hard) 55%, transparent);
}
.nmk-wh__gauge-wrap .nmk-gauge--soft { box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--hard-soft) 60%, transparent); }
.nmk-wh__gauge-wrap .nmk-gauge--mid  { box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--hard-mid) 55%, transparent); }
.nmk-wh__gauge-wrap .nmk-result__txt strong { font-size: 1.25rem; }

.nmk-wh .nmk-scale { margin: 0 0 1.6rem; gap: 10px; }
.nmk-wh .nmk-scale .s { padding: 8px 4px 6px; border-radius: var(--r-md); }
.nmk-wh .nmk-scale .s.is-active { background: var(--navy-50); color: var(--navy-900); font-weight: 600; }
.nmk-wh .nmk-scale .bar { height: 10px; }

/* Zachte CTA-kaart naar de ontharder-check */
.nmk-cta-card {
	--cta-pad: clamp(1.3rem, 4vw, 1.9rem);
	margin: 2.2rem 0 1rem;
	background: linear-gradient(135deg, var(--pink-50) 0%, var(--navy-50) 100%);
	border: 1px solid var(--pink-100); border-radius: var(--r-lg);
	padding: var(--cta-pad); box-shadow: var(--shadow-sm);
}
/* Beeld rand-tot-rand onderin de kaart. Drie klassen nodig: Kadence zet
   `.single-content figure:last-child { margin-bottom: 0 }` (0,2,1). */
.nmk-wh .nmk-cta-card .nmk-cta-card__media {
	margin: var(--cta-pad) calc(-1 * var(--cta-pad)) calc(-1 * var(--cta-pad));
	border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px);
	box-shadow: none;
}
.nmk-wh .nmk-cta-card .nmk-cta-card__media img {
	aspect-ratio: 21 / 9; object-fit: cover; height: auto; border-radius: inherit;
}
.nmk-cta-card__title {
	font-family: var(--font-display); font-weight: 700; color: var(--navy-900);
	font-size: 1.2rem; margin: 0 0 .5rem !important;
}
.nmk-cta-card p { margin-bottom: 1rem; }
.nmk-cta-card .nmk-btn { margin: 0; }

.nmk-wh__foot { font-size: .95rem; color: var(--slate); margin-top: 1.6rem; }

/* Gemeentefusie: "misschien zoek je de buurgemeente", roze accentrand. */
.nmk-wh__fusie {
	margin: 1rem 0 0; padding: .85rem 1rem;
	font-size: .92rem; line-height: 1.6; color: var(--navy-700);
	background: var(--pink-50); border-left: 3px solid var(--pink-500);
	border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.nmk-wh__fusie a { color: var(--pink-600); font-weight: 600; }
.nmk-wh__fusie a:hover { color: var(--navy-700); }

/* Spreiding tussen distributiezones (Wallonië, Brussel). */
.nmk-wh__spread {
	margin: 1rem 0 0; padding: .85rem 1rem;
	font-size: .92rem; line-height: 1.6; color: var(--navy-700);
	background: var(--navy-50); border-left: 3px solid var(--navy-300);
	border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* Werkwijze + bron (Brussel: eigen bewerking, dus op elke pagina verantwoord). */
.nmk-wh__methode {
	margin: .6rem 0 0; padding: .9rem 1.05rem;
	font-size: .9rem; line-height: 1.7; color: var(--navy-700);
	background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
	box-shadow: 0 1px 2px rgba(10, 26, 69, .04), 0 6px 16px -10px rgba(10, 26, 69, .18);
}
.nmk-wh__methode strong { color: var(--navy-900); letter-spacing: -.01em; }
.nmk-wh__methode a { color: var(--pink-600); font-weight: 600; text-underline-offset: 2px; }
.nmk-wh__methode a:hover,
.nmk-wh__methode a:focus-visible { color: var(--navy-700); }

/* --- Gemeentetegels ([nmk_wh_provincie], [nmk_wh_index]) ---------------------------------- */
.nmk-wh-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px; margin: 1.2rem 0 2rem;
}
.nmk-wh-tile {
	display: flex; flex-direction: column; gap: 2px;
	min-height: 44px; padding: 12px 14px; border-radius: var(--r-md); text-decoration: none;
	background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
	border-left: 4px solid var(--hard-mid);
	transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.nmk-wh-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--navy-300); }
.nmk-wh-tile:active { transform: translateY(0); }
.nmk-wh-tile:focus-visible { outline: 2px solid var(--pink-500); outline-offset: 2px; }
.nmk-wh-tile--soft { border-left-color: var(--hard-soft); }
.nmk-wh-tile--mid  { border-left-color: var(--hard-mid); }
.nmk-wh-tile--hard { border-left-color: var(--hard-hard); }
.nmk-wh-tile .g { font-family: var(--font-display); font-weight: 700; color: var(--navy-900); line-height: 1.2; }
.nmk-wh-tile .v { font-size: .85rem; color: var(--slate); }
.nmk-wh-count { color: var(--slate); font-weight: 400; font-size: .8em; }

/* --- Postcodewidget ([nmk_wh_widget], hub) ------------------------------------------------- */
.nmk-wtool {
	max-width: 34rem; margin: 1.2rem auto 0; text-align: left; background: var(--bg);
	border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.1rem, 4vw, 1.6rem);
	box-shadow: var(--shadow-md);
}
.nmk-tool__label {
	display: flex; align-items: center; justify-content: space-between; gap: .5rem;
	font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
	color: var(--navy-900); margin: 0 0 .2rem;
}
.nmk-tool__note { font-size: .82rem; color: var(--slate); margin: .9rem 0 0; line-height: 1.5; }
.nmk-wtool__form { display: flex; gap: 10px; margin: .5rem 0 0; }
.nmk-wtool__form input {
	flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: var(--r-pill);
	padding: 13px 18px; font-family: inherit; font-size: 1rem; min-height: 48px;
	background: var(--bg); color: var(--ink);
}
.nmk-wtool__form input:focus-visible { outline: 2px solid var(--navy-500); outline-offset: 1px; border-color: var(--navy-500); }
.nmk-wtool__form .nmk-btn { white-space: nowrap; }
.nmk-wtool__err { color: var(--pink-600); font-size: .9rem; margin: .7rem 0 0; }
.nmk-wtool__res { margin-top: 1.1rem; }
.nmk-wtool__resin {
	display: flex; align-items: center; gap: 16px; background: var(--navy-50);
	border-radius: var(--r-md); padding: 14px; margin-bottom: .9rem;
}
.nmk-wtool__res .nmk-btn { width: 100%; justify-content: center; }
@media (max-width: 460px) {
	.nmk-wtool__form { flex-direction: column; }
	.nmk-wtool__form .nmk-btn { justify-content: center; }
}

/* --- Minder beweging ----------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.nmk-btn,
	.nmk-wh-tile { transition: none; }
	.nmk-btn--primary:hover,
	.nmk-wh-tile:hover { transform: none; }
}
