/*
 * SJB-thema — kleine aanvullingen op theme.json.
 * Kleuren en lettertypes staan in theme.json; hier staan alleen vormen die
 * theme.json niet kan beschrijven (de groene boog, de AI-labels, de kaarten).
 */

/* ---------- Groene boog (zoals op de cover van de stijlgids) ---------- */
.is-style-groene-boog {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}
.is-style-groene-boog::before {
	content: "";
	position: absolute;
	z-index: -1;
	right: -14%;
	bottom: -38%;
	width: min(62vw, 820px);
	aspect-ratio: 539 / 427;
	background: url("../images/boog.svg") no-repeat center / 100% 100%;
	transform: translateY(var(--sjb-boog-y, 0px)) rotate(-12deg);
	pointer-events: none;
	will-change: transform;
}
@media (max-width: 781px) {
	.is-style-groene-boog::before {
		right: -40%;
		bottom: -12%;
		width: 120vw;
	}
}

/* ---------- Groene lijn links (zoals in het briefhoofd) ---------- */
.is-style-briefhoofd-lijn {
	border-left: 1px solid var(--wp--preset--color--donkergroen);
	padding-left: var(--wp--preset--spacing--20);
}

/* ---------- Kaart ---------- */
.is-style-kaart {
	background: var(--wp--preset--color--grijs-licht);
	border-top: 3px solid var(--wp--preset--color--donkergroen);
	padding: var(--wp--preset--spacing--30);
	height: 100%;
}
.is-style-kaart :where(h2, h3, h4) a {
	text-decoration: none;
}
.is-style-kaart :where(h2, h3, h4) a:hover {
	text-decoration: underline;
}

/* ---------- Organische vorm voor foto's ---------- */
.wp-block-image.is-style-organisch img,
.wp-block-post-featured-image.is-style-organisch img {
	-webkit-mask: url("../images/boog.svg") no-repeat center / 100% 100%;
	mask: url("../images/boog.svg") no-repeat center / 100% 100%;
	aspect-ratio: 539 / 427;
	object-fit: cover;
}

/* ---------- AI-labels (stijlgids: 1 = geen, 2 = ondersteunend, 3 = volledig) ---------- */
.sjb-ailabel {
	display: grid;
	place-items: center;
	flex: none;
	width: 4.5rem;
	height: 4.5rem;
	margin: 0;
	color: #fff;
	font-family: var(--wp--preset--font-family--alegreya);
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1;
	background: url("../images/label-groen.svg") no-repeat center / contain;
}
.sjb-ailabel-1 { background-image: url("../images/label-rood.svg"); }
.sjb-ailabel-2 { background-image: url("../images/label-oranje.svg"); }
.sjb-ailabel-3 { background-image: url("../images/label-groen.svg"); }

/* ---------- Hoofding ---------- */
.sjb-header .wp-block-site-title {
	margin: 0;
}
.sjb-header .sjb-header__adres {
	margin: 0;
	color: var(--wp--preset--color--grijs);
	font-size: var(--wp--preset--font-size--klein);
	line-height: 1.3;
}

/* ---------- Footer ---------- */
.sjb-footer a {
	color: inherit;
	text-decoration: none;
}
.sjb-footer a:hover,
.sjb-footer a:focus-visible {
	text-decoration: underline;
}
.sjb-footer :where(h2, h3, h4) {
	color: inherit;
}

/* ---------- Nieuws ---------- */
.sjb-nieuws .wp-block-post-featured-image img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

/* Linkse uitlijning blijft de norm (stijlgids): geen uitgevulde tekst. */
.has-text-align-justify {
	text-align: left !important;
}

/* ---------- Lijst zonder bolletjes ---------- */
.sjb-lijst-plat {
	list-style: none;
	padding-left: 0;
}
.sjb-lijst-plat li + li {
	margin-top: 0.35rem;
}

/* ---------- Omlijnde knop in het groen ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	color: var(--wp--preset--color--donkergroen);
}
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid currentColor;
	padding: calc(0.8rem - 2px) calc(1.4rem - 2px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover {
	background: var(--wp--preset--color--donkergroen);
	color: var(--wp--preset--color--wit);
	border-color: var(--wp--preset--color--donkergroen);
}

/* ---------- Kort groen streepje onder een titel ---------- */
.wp-block-separator.sjb-kort {
	width: 4rem;
	border: 0;
	border-top: 3px solid var(--wp--preset--color--donkergroen);
	opacity: 1;
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)) !important;
}

/* ---------- Tabellen (lessentabellen) in huisstijl ---------- */
.wp-block-table {
	margin-block: var(--wp--preset--spacing--30);
	overflow-x: auto;
}
.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--normaal);
	font-variant-numeric: tabular-nums;
}
.wp-block-table thead,
.wp-block-table tfoot {
	border: 0;
}
.wp-block-table table th,
.wp-block-table table td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--grijs-lijn);
	padding: 0.55rem 0.75rem;
	text-align: left;
	vertical-align: top;
}
.wp-block-table th:first-child,
.wp-block-table td:first-child {
	width: 46%;
}
.wp-block-table th:not(:first-child),
.wp-block-table td:not(:first-child) {
	text-align: center;
}
.wp-block-table table thead th {
	background: var(--wp--preset--color--donkergroen);
	color: var(--wp--preset--color--wit);
	font-weight: 700;
	border-bottom: 0;
}
.wp-block-table table tbody tr:nth-child(even) td {
	background: var(--wp--preset--color--grijs-licht);
}
.wp-block-table table tfoot td {
	font-weight: 700;
	border-top: 2px solid var(--wp--preset--color--donkergroen);
	border-bottom: 0;
}
.wp-block-table figcaption {
	margin-top: 0.5rem;
	text-align: left;
}
.wp-block-table.sjb-tabel-tekst th:not(:first-child),
.wp-block-table.sjb-tabel-tekst td:not(:first-child) {
	text-align: left;
}
.wp-block-table.sjb-tabel-tekst th:first-child,
.wp-block-table.sjb-tabel-tekst td:first-child {
	width: 30%;
}

/* =====================================================================
   Effecten (versie 1.4.0). Wie "minder beweging" instelt, krijgt ze niet.
   ===================================================================== */

/* ---------- Hoofding blijft bovenaan en wordt compacter bij scrollen ---------- */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--wp--preset--color--wit);
}
.admin-bar header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}
@media (max-width: 600px) {
	.admin-bar header.wp-block-template-part {
		top: 0;
	}
}
.sjb-header {
	transition: padding 0.25s ease, box-shadow 0.25s ease;
}
.sjb-header .wp-block-image img {
	transition: width 0.25s ease;
}
.sjb-header .sjb-header__adres {
	max-height: 3em;
	overflow: hidden;
	transition: max-height 0.25s ease, opacity 0.2s ease;
}
.sjb-gescrold .sjb-header {
	padding-top: 0.4rem !important;
	padding-bottom: 0.4rem !important;
	box-shadow: 0 2px 14px rgba(0, 40, 20, 0.08);
}
.sjb-gescrold .sjb-header .wp-block-image img {
	width: 36px !important;
}
.sjb-gescrold .sjb-header .sjb-header__adres {
	max-height: 0;
	opacity: 0;
}
/* Ankers (bv. in de lessentabellen) niet onder de hoofding laten verdwijnen */
:where(h1, h2, h3, h4)[id] {
	scroll-margin-top: 110px;
}

/* ---------- Inschuiven bij het scrollen ---------- */
.sjb-anim .sjb-inschuiven {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}
.sjb-anim .sjb-inschuiven.is-zichtbaar {
	opacity: 1;
	transform: none;
}

/* ---------- Kaarten reageren op de muis ---------- */
.is-style-kaart {
	transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.6s ease;
}
.is-style-kaart:hover,
.is-style-kaart:focus-within,
.sjb-anim .sjb-inschuiven.is-style-kaart.is-zichtbaar:hover,
.sjb-anim .sjb-inschuiven.is-style-kaart.is-zichtbaar:focus-within {
	transform: translateY(-4px);
	box-shadow: inset 0 3px 0 var(--wp--preset--color--donkergroen), 0 12px 28px rgba(0, 60, 30, 0.12);
}

/* ---------- Nieuwsfoto's zoomen licht in ---------- */
.sjb-nieuws .wp-block-post-featured-image {
	overflow: hidden;
}
.sjb-nieuws .wp-block-post-featured-image img {
	transition: transform 0.5s ease;
}
.sjb-nieuws .wp-block-post-template > li:hover .wp-block-post-featured-image img,
.sjb-nieuws .wp-block-post-template > li:focus-within .wp-block-post-featured-image img {
	transform: scale(1.04);
}

/* ---------- Minder beweging ---------- */
@media (prefers-reduced-motion: reduce) {
	.sjb-header,
	.sjb-header *,
	.is-style-kaart,
	.sjb-nieuws .wp-block-post-featured-image img {
		transition: none !important;
	}
	.is-style-kaart:hover,
	.is-style-kaart:focus-within,
	.sjb-nieuws .wp-block-post-template > li:hover .wp-block-post-featured-image img {
		transform: none !important;
	}
	.is-style-groene-boog::before {
		transform: rotate(-12deg) !important;
	}
}

/* =====================================================================
   Menu en knoppen in organische stijl (versie 1.5.0)
   ===================================================================== */

/* ---------- Menu: organische vlek achter het woord ---------- */
.sjb-header .wp-block-navigation-item__content {
	position: relative;
	z-index: 0;
	padding: 0.5rem 0.7rem;
	text-decoration: none !important;
	transition: color 0.2s ease;
}
.sjb-header .wp-block-navigation-item__content::before {
	content: "";
	position: absolute;
	inset: -2px -4px;
	z-index: -1;
	background: url("../images/vlek.svg") no-repeat center / 100% 100%;
	transform: scale(0.4) rotate(-6deg);
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.2s ease;
}
.sjb-header .wp-block-navigation-item__content:hover,
.sjb-header .wp-block-navigation-item__content:focus-visible,
.sjb-header .current-menu-item > .wp-block-navigation-item__content,
.sjb-header .wp-block-navigation-item__content[aria-current="page"] {
	color: var(--wp--preset--color--donkergroen);
}
.sjb-header .wp-block-navigation-item__content:hover::before,
.sjb-header .wp-block-navigation-item__content:focus-visible::before,
.sjb-header .current-menu-item > .wp-block-navigation-item__content::before,
.sjb-header .wp-block-navigation-item__content[aria-current="page"]::before {
	transform: scale(1) rotate(0deg);
	opacity: 1;
}
/* In het groene gsm-menu: donkergroene vlek, witte tekst */
.sjb-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content::before {
	background-image: url("../images/vlek-donker.svg");
}
.sjb-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
.sjb-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover,
.sjb-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content[aria-current="page"] {
	color: var(--wp--preset--color--wit);
	font-size: var(--wp--preset--font-size--groot);
}

/* ---------- Knoppen: organische vorm met schaduwvlek, zoals de AI-labels ---------- */
body .wp-element-button,
.wp-block-button .wp-block-button__link {
	border-radius: 1.5em 1.05em 1.35em 0.9em / 1.15em 1.45em 0.95em 1.3em;
	box-shadow: 4px 4px 0 rgba(0, 92, 45, 0.3);
	transition: border-radius 0.35s ease, box-shadow 0.25s ease, transform 0.25s ease, background-color 0.2s ease, color 0.2s ease;
}
body .wp-element-button:hover,
body .wp-element-button:focus-visible,
.wp-block-button .wp-block-button__link:hover,
.wp-block-button .wp-block-button__link:focus-visible {
	border-radius: 1.05em 1.5em 0.9em 1.4em / 1.4em 1em 1.35em 1.05em;
	box-shadow: 6px 6px 0 rgba(0, 92, 45, 0.3);
	transform: translate(-1px, -1px);
}
.wp-block-button.is-style-outline > .wp-block-button__link {
	box-shadow: 4px 4px 0 rgba(0, 92, 45, 0.14);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	box-shadow: 6px 6px 0 rgba(0, 92, 45, 0.25);
}
/* Witte knop op de groene band */
.wp-block-button .wp-block-button__link.has-wit-background-color {
	box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.35);
}
.wp-block-button .wp-block-button__link.has-wit-background-color:hover {
	box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.45);
}
/* Zoekknop iets bescheidener */
.wp-block-search .wp-element-button {
	box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
	.sjb-header .wp-block-navigation-item__content::before,
	body .wp-element-button,
	.wp-block-button .wp-block-button__link {
		transition: none !important;
	}
	body .wp-element-button:hover,
	.wp-block-button .wp-block-button__link:hover {
		transform: none;
	}
}
