/*
Theme Name: Zonrekenaar
Theme URI: https://zonrekenaar.nl
Description: Snel, onafhankelijk thema voor Zonrekenaar: rekentools en uitleg over zonnepanelen, thuisbatterijen en het einde van salderen. Gebouwd op basis van het Figma-ontwerp.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: zonrekenaar
License: GPL-2.0-or-later
*/

@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url("assets/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url("assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens (uit Figma-variabelen) ---------- */
:root {
	--ink: #0f2a3d;
	--sun: #f5b700;
	--sun-soft: #fff4cc;
	--surface: #ffffff;
	--bg: #f7f6f1;
	--border: #e3e1d9;
	--green: #1f8a5b;
	--green-soft: #e3f4ea;
	--muted: #5b6b76;
	--red: #c2412d;
	--font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--gutter: 80px;
	--max: 1280px;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 16px;
	line-height: 26px;
	-webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--surface); padding: 8px 16px; border-radius: 8px; clip: auto; width: auto; height: auto; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* Typografie (Figma-stijlen) */
.t-display { font-size: 56px; line-height: 64px; font-weight: 800; letter-spacing: -1.12px; }
.t-h1 { font-size: 40px; line-height: 48px; font-weight: 800; letter-spacing: -0.8px; }
.t-h2 { font-size: 28px; line-height: 36px; font-weight: 700; }
.t-h3 { font-size: 20px; line-height: 28px; font-weight: 700; }
.t-body-l { font-size: 18px; line-height: 30px; font-weight: 400; }
.t-body { font-size: 16px; line-height: 26px; font-weight: 400; }
.t-label { font-size: 14px; line-height: 20px; font-weight: 600; }
.t-small { font-size: 13px; line-height: 18px; font-weight: 500; }
.c-muted { color: var(--muted); }
.c-green { color: var(--green); }
.c-red { color: var(--red); }

.container { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- Componenten ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 14px 24px; border-radius: 999px; border: 0;
	background: var(--sun); color: var(--ink);
	font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap;
	cursor: pointer; transition: filter .15s, background-color .15s;
}
.btn:hover { filter: brightness(.95); }
.btn--secondary { background: var(--surface); border: 1.5px solid var(--border); }
.btn--secondary:hover { filter: none; border-color: var(--ink); }
.btn--dark { background: var(--ink); color: var(--surface); }
.btn--block { width: 100%; }

.tag {
	display: inline-flex; align-self: flex-start; padding: 4px 10px; border-radius: 999px;
	background: var(--green-soft); color: var(--green);
	font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap;
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); }
.field__box {
	position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
	background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0 14px;
}
.field__box:focus-within { border-color: var(--ink); }
.field__box input, .field__box select {
	flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px 0;
	font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); outline: none;
	-moz-appearance: textfield; appearance: none;
}
.field__box input::-webkit-outer-spin-button, .field__box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field__unit { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); pointer-events: none; }

/* Tool card */
.tool-card { display: flex; flex-direction: column; gap: 12px; padding: 28px; transition: border-color .15s, box-shadow .15s; }
.tool-card:hover { border-color: var(--sun); box-shadow: 0 8px 24px rgba(15, 41, 61, .06); }
.icon-box { width: 48px; height: 48px; border-radius: 12px; background: var(--sun-soft); display: flex; align-items: center; justify-content: center; }
.icon-box img { width: 24px; height: 24px; }
.tool-card__title { font-size: 20px; line-height: 28px; font-weight: 700; }
.tool-card__text { color: var(--muted); }
.tool-card__link { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--green); }

/* Article card */
.article-card { display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s; }
.article-card:hover { border-color: var(--sun); }
.article-card__image { height: 200px; background: linear-gradient(90deg, var(--sun-soft), var(--green-soft)); }
.article-card__image img { width: 100%; height: 100%; object-fit: cover; }
.article-card__body { display: flex; flex-direction: column; gap: 10px; padding: 24px; }
.article-card__title { font-size: 20px; line-height: 28px; font-weight: 700; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
.site-header__inner { height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; line-height: 28px; font-weight: 700; white-space: nowrap; }
.logo img { width: 32px; height: 32px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 32px; }
.nav a { font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; }
.nav a:hover, .nav .current-menu-item > a, .nav .current-menu-ancestor > a { color: var(--green); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--border); }
.site-footer__inner { display: flex; gap: 80px; padding-top: 56px; padding-bottom: 56px; }
.site-footer__about { display: flex; flex-direction: column; gap: 12px; width: 360px; flex-shrink: 0; }
.site-footer__brand { font-size: 20px; line-height: 28px; font-weight: 700; color: var(--surface); }
.site-footer__note { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); }
.footer-col h2 { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--sun); margin-bottom: 10px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a:hover { color: var(--surface); }

/* ---------- Home ---------- */
.hero { padding-top: 88px; padding-bottom: 96px; }
.hero__inner { display: flex; align-items: center; gap: 64px; }
.hero__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero__intro { color: var(--muted); }
.hero__buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0; padding: 0; color: var(--green); font-size: 13px; line-height: 18px; font-weight: 500; }

.calc { width: 520px; flex-shrink: 0; padding: 32px; border-radius: 20px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 16px 40px rgba(15, 41, 61, .10); }
.calc__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.result { background: var(--sun-soft); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.result__value { font-size: 40px; line-height: 48px; font-weight: 800; letter-spacing: -0.8px; }
.result__detail { color: var(--ink); }
.result__detail strong { font-weight: 700; }

.facts { background: var(--ink); }
.facts__inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-top: 40px; padding-bottom: 40px; }
.fact__value { font-size: 28px; line-height: 36px; font-weight: 700; color: var(--sun); }
.fact__text { color: var(--border); margin-top: 4px; }

.section { padding-top: 80px; padding-bottom: 80px; }
.section--white { background: var(--surface); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.section__head p { margin-top: 8px; }
.section__more { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--green); white-space: nowrap; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start; }

.newsletter { background: var(--sun); border-radius: 24px; padding: 48px 56px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.newsletter__text { max-width: 520px; display: flex; flex-direction: column; gap: 8px; }
.newsletter__form { display: flex; gap: 8px; }
.newsletter__form input[type=email] { width: 300px; height: 48px; border: 0; border-radius: 999px; padding: 0 20px; background: var(--surface); font-size: 16px; }
.newsletter__form input::placeholder { color: var(--muted); }
.newsletter__msg { margin-top: 8px; font-size: 13px; font-weight: 500; }

/* ---------- Artikel ---------- */
.breadcrumbs { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .sep { margin: 0 6px; }
.article-layout { display: flex; align-items: flex-start; gap: 64px; padding-top: 56px; padding-bottom: 96px; }
.article { width: 800px; max-width: 100%; flex-shrink: 0; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.article-meta img { width: 36px; height: 36px; border-radius: 50%; }
.summary { background: var(--sun-soft); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.summary ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.summary li { padding-left: 18px; position: relative; }
.summary li::before { content: "•"; position: absolute; left: 2px; }

.sidebar { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 104px; }
.admin-bar .sidebar { top: 136px; }
.toc { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.toc a { color: var(--muted); }
.toc a:hover, .toc a.is-active { color: var(--green); }
.ad-slot { background: var(--border); border-radius: 12px; min-height: 250px; display: flex; align-items: center; justify-content: center; padding: 24px; color: var(--muted); font-size: 13px; font-weight: 500; }
.ad-slot:not(:empty):has(> *:not(.ad-slot__label)) { background: none; padding: 0; }

/* Inhoud van de editor */
.entry { display: flex; flex-direction: column; gap: 24px; font-size: 18px; line-height: 30px; }
.entry > * { margin: 0; }
.entry h2 { font-size: 28px; line-height: 36px; font-weight: 700; scroll-margin-top: 104px; }
.entry h3 { font-size: 20px; line-height: 28px; font-weight: 700; scroll-margin-top: 104px; }
.entry a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.entry a.btn { color: var(--ink); text-decoration: none; }
.entry ul, .entry ol { padding-left: 24px; }
.entry li + li { margin-top: 6px; }
.entry img { border-radius: 12px; }
.entry figcaption, .entry .wp-element-caption { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); margin-top: 8px; }
.entry blockquote { margin: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--sun); }

/* Tabel (rekenvoorbeeld) */
.entry .wp-block-table { margin: 0; }
.entry table, .zr-table {
	width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
	border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: 16px; line-height: 26px;
}
.entry table th, .entry table td, .zr-table th, .zr-table td { padding: 14px 20px; text-align: left; border: 0; border-top: 1px solid var(--border); }
.entry table thead th, .zr-table thead th { background: var(--ink); color: var(--surface); font-size: 14px; line-height: 20px; font-weight: 600; border-top: 0; }
.entry table tfoot td, .zr-table tfoot td { background: var(--green-soft); font-size: 14px; line-height: 20px; font-weight: 600; }
.entry .wp-block-table thead, .entry .wp-block-table tfoot { border: 0; }
.entry .wp-block-table .wp-element-caption { text-align: left; }

/* CTA- en offerteblokken (shortcodes) */
.tool-cta { background: var(--ink); border-radius: 16px; padding: 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.tool-cta__title { font-size: 20px; line-height: 28px; font-weight: 700; color: var(--surface); }
.tool-cta__text { font-size: 16px; line-height: 26px; color: var(--border); margin-top: 4px; }
.offer { padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.offer__title { font-size: 20px; line-height: 28px; font-weight: 700; }
.offer__text { font-size: 16px; line-height: 26px; color: var(--muted); }
.offer__note { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); }

/* ---------- Tool-pagina's ---------- */
.page-layout { padding-top: 56px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 32px; }
.page-head { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.page-head .t-body-l { max-width: 820px; }
.filters { padding: 24px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.filters .field { width: 260px; }
.zr-compare { display: flex; flex-direction: column; gap: 32px; }
.compare { overflow: hidden; font-size: 16px; line-height: 26px; }
.compare__row { display: grid; grid-template-columns: 320px 240px 260px 200px 1fr; align-items: center; padding: 20px 28px; border-top: 1px solid var(--border); background: var(--surface); }
.compare__row--head { background: var(--ink); color: var(--surface); padding-top: 14px; padding-bottom: 14px; border-top: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.compare__row--best { background: var(--green-soft); }
.compare__name { font-size: 14px; line-height: 20px; font-weight: 600; }
.compare__net { font-size: 14px; line-height: 20px; font-weight: 600; }
.compare__action { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.compare__action .tag { align-self: center; background: transparent; }
.compare__label { display: none; }
.tool-box { padding: 32px; display: flex; flex-direction: column; gap: 20px; max-width: 900px; border-radius: 20px; }
.tool-box__fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.page-content > :not(.zr-compare):not(.tool-box):not(.tool-grid):not(.calc):not(.wp-block-table) { max-width: 800px; }

/* Archief */
.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.pagination .page-numbers { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.pagination .current { background: var(--sun); border-color: var(--sun); }

/* Gutenberg uitlijning */
.alignwide { max-width: 100%; }
.has-text-align-center { text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
	:root { --gutter: 48px; }
	.hero__inner { gap: 40px; }
	.calc { width: 460px; }
	.article-layout { gap: 40px; }
	.article { width: auto; flex: 1 1 0; }
	.sidebar { flex: 0 0 320px; }
	.compare__row { grid-template-columns: 2fr 1.4fr 1.5fr 1.2fr 2fr; }
	.site-footer__inner { gap: 48px; }
	.site-footer__about { width: 300px; }
}
@media (max-width: 1080px) {
	.nav-toggle { display: block; }
	.nav { display: none; position: absolute; left: 0; right: 0; top: 80px; background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px var(--gutter) 24px; }
	.nav.is-open { display: block; }
	.nav ul { flex-direction: column; gap: 16px; }
	.nav a { font-size: 16px; }
	.site-header__inner { position: relative; }
	.site-header .btn { margin-left: auto; }
	.hero__inner { flex-direction: column; align-items: stretch; }
	.calc { width: 100%; }
	.tool-grid, .article-grid, .archive-grid { grid-template-columns: 1fr 1fr; }
	.article-layout { flex-direction: column; align-items: stretch; }
	.sidebar { position: static; flex: none; }
	.newsletter { flex-direction: column; align-items: flex-start; }
	.site-footer__inner { flex-wrap: wrap; }
	.site-footer__about { width: 100%; }
}
@media (max-width: 760px) {
	:root { --gutter: 16px; }
	.t-display { font-size: 38px; line-height: 44px; letter-spacing: -0.6px; }
	.t-h1 { font-size: 30px; line-height: 38px; }
	.entry h2, .t-h2 { font-size: 24px; line-height: 32px; }
	.hero { padding-top: 40px; padding-bottom: 56px; }
	.calc { padding: 20px; }
	.calc__fields { grid-template-columns: 1fr; }
	.result__value { font-size: 32px; line-height: 40px; }
	.facts__inner { grid-template-columns: 1fr; gap: 16px; }
	.section { padding-top: 56px; padding-bottom: 56px; }
	.section__head { flex-direction: column; align-items: flex-start; }
	.tool-grid, .article-grid, .archive-grid { grid-template-columns: 1fr; }
	.newsletter { padding: 32px 24px; }
	.newsletter__form { flex-direction: column; width: 100%; }
	.newsletter__form input[type=email] { width: 100%; }
	.site-header .btn { display: none; }
	.tool-cta { flex-direction: column; align-items: flex-start; }
	.entry { font-size: 17px; line-height: 28px; }
	.entry .wp-block-table { overflow-x: auto; }
	.filters .field { width: 100%; }
	.compare__row--head { display: none; }
	.compare__row { grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 20px; }
	.compare__name { grid-column: 1 / -1; font-size: 16px; }
	.compare__label { display: block; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); }
	.compare__action { grid-column: 1 / -1; justify-content: space-between; }
	.compare__action .tag { padding-left: 0; }
	.site-footer__inner { gap: 32px; }
	.footer-col { flex: 1 1 140px; }
	.tool-box { padding: 20px; }
}
