/*
Theme Name: Energie Pro
Theme URI: https://energiespeurder.be
Author: Dieter Maes
Description: Licht, snel en mobielvriendelijk blogthema voor energie-affiliatesites (elektriciteit en gas). Meertalig (NL/FR/DE/ES/IT), merkkleuren per domein, affiliate-shortcodes en automatische inhoudsopgave.
Version: 1.0.2
Requires at least: 6.3
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: energie-pro
*/

:root {
	--primary: #0f2d4a;
	--accent: #f5a300;
	--cta: #16a34a;
	--bg: #f6f8fb;
	--surface: #fff;
	--text: #1f2a37;
	--muted: #5b6878;
	--border: #e3e9f0;
	--radius: 14px;
	--shadow: 0 6px 24px rgba(15, 45, 74, .08);
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.65;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { max-width: 100%; height: auto; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--cta); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--primary); margin: 1.6em 0 .6em; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.75rem); }
h3 { font-size: 1.2rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 780px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
}
.admin-bar .site-header { top: 46px; }
@media (min-width: 783px) { .admin-bar .site-header { top: 32px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.header-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--primary); font-weight: 800; letter-spacing: -.01em; margin-right: auto; }
.brand:hover { color: var(--primary); }
.brand-name { font-size: 1.15rem; }
.logo-mark { flex: 0 0 auto; display: block; }
.custom-logo { max-height: 44px; width: auto; }

.header-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { background: none; border: 0; padding: 10px; color: var(--primary); cursor: pointer; border-radius: 10px; line-height: 0; }
.icon-btn:hover { background: var(--bg); }
.burger { display: inline-flex; flex-direction: column; gap: 5px; width: 22px; }
.burger span { height: 2.5px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-open .burger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-open .burger span:nth-child(2) { opacity: 0; }
.nav-open .burger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.search-panel { border-top: 1px solid var(--border); padding: 12px 0; background: var(--surface); }
.search-form { display: flex; gap: 8px; }
.search-field { flex: 1; min-width: 0; font: inherit; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: #fff; }
.search-field:focus { border-color: var(--primary); outline: none; }
.search-submit { font: inherit; font-weight: 700; padding: 12px 18px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; cursor: pointer; }

/* Navigatie – mobiel: schuifpaneel */
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav a { text-decoration: none; color: var(--text); font-weight: 650; }
@media (max-width: 899px) {
	.main-nav {
		position: fixed; top: 0; right: 0; bottom: 0; z-index: 200;
		width: min(320px, 86vw); background: var(--surface);
		padding: 72px 20px 24px; overflow-y: auto;
		transform: translateX(100%); transition: transform .25s ease;
		box-shadow: -10px 0 30px rgba(0,0,0,.12);
	}
	.nav-open .main-nav { transform: none; }
	.nav-open { overflow: hidden; }
	.nav-open #menu-toggle { position: relative; z-index: 210; }
	.main-nav li { position: relative; border-bottom: 1px solid var(--border); }
	.main-nav a { display: block; padding: 14px 40px 14px 4px; font-size: 1.05rem; }
	.main-nav .sub-menu { display: none; padding-left: 12px; }
	.main-nav .sub-open > .sub-menu { display: block; }
	.main-nav .sub-menu li { border: 0; }
	.main-nav .sub-menu a { font-weight: 500; padding: 10px 4px; }
	.sub-toggle { position: absolute; right: 0; top: 6px; width: 40px; height: 40px; border: 0; background: none; font-size: 1rem; color: var(--muted); cursor: pointer; }
	.sub-open > .sub-toggle { transform: rotate(180deg); }
	.nav-overlay { position: fixed; inset: 0; background: rgba(10, 20, 35, .45); z-index: 99; }
}
/* Navigatie – desktop */
@media (min-width: 900px) {
	.header-inner { height: 76px; }
	#menu-toggle, .nav-overlay, .sub-toggle { display: none !important; }
	.main-nav { order: 0; }
	.brand { margin-right: 24px; }
	.main-nav { margin-right: auto; }
	.main-nav > ul { display: flex; gap: 2px; }
	.main-nav > ul > li { position: relative; }
	.main-nav > ul > li > a { display: block; padding: 26px 14px; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 3px solid transparent; }
	.main-nav > ul > li > a:hover, .main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a { color: var(--primary); border-bottom-color: var(--accent); }
	.main-nav .sub-menu {
		position: absolute; top: 100%; left: 0; min-width: 230px; padding: 8px;
		background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
		opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s;
	}
	.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
	.main-nav .sub-menu a { display: block; padding: 9px 12px; border-radius: 8px; font-weight: 550; font-size: .95rem; }
	.main-nav .sub-menu a:hover { background: var(--bg); }
}

/* ---------- Hero ---------- */
.hero {
	background:
		radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
		linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000));
	color: #fff; padding: 44px 0 52px; margin-bottom: 36px;
}
.hero h1 { color: #fff; margin: 0 0 .4em; max-width: 720px; }
.hero p { margin: 0 0 22px; max-width: 640px; font-size: 1.08rem; opacity: .92; }
.hero-search { max-width: 560px; }
.hero .search-field { border-color: transparent; }
.hero .search-submit { background: var(--accent); color: #111; }
@media (min-width: 900px) { .hero { padding: 72px 0 80px; } }

/* ---------- Kaartjes ---------- */
.section-title { margin: 0 0 18px; font-size: 1.35rem; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 6px; height: 1.1em; border-radius: 3px; background: var(--accent); }
.archive-header { padding: 32px 0 8px; }
.archive-header h1 { margin: 0 0 .3em; }
.archive-desc { color: var(--muted); max-width: 720px; }

.card-grid { display: grid; gap: 20px; grid-template-columns: 1fr; margin-bottom: 40px; }
@media (min-width: 620px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .card-grid { grid-template-columns: repeat(3, 1fr); gap: 26px; } }

.card {
	display: flex; flex-direction: column;
	background: var(--surface); border-radius: var(--radius); overflow: hidden;
	box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(15,45,74,.13); }
.card-media { display: block; aspect-ratio: 16 / 9; background: color-mix(in srgb, var(--primary) 8%, #fff); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; }
.card-placeholder .logo-mark { width: 64px; height: 64px; opacity: .9; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 1.15rem; margin: 10px 0 8px; }
.card-title a { color: var(--primary); text-decoration: none; }
.card-title a:hover { color: var(--cta); }
.card-excerpt { color: var(--muted); font-size: .95rem; margin: 0 0 12px; }
.card-meta { margin-top: auto; font-size: .82rem; color: var(--muted); }

.badge {
	align-self: flex-start; display: inline-block;
	background: color-mix(in srgb, var(--accent) 22%, #fff); color: var(--primary);
	font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
	padding: 4px 10px; border-radius: 999px; text-decoration: none;
}
.badge:hover { background: var(--accent); color: #111; }

/* Paginering */
.pagination { margin: 0 0 56px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers { min-width: 44px; padding: 10px 14px; text-align: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; font-weight: 650; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Artikel ---------- */
.single-article { background: var(--surface); padding-bottom: 40px; margin-bottom: 40px; }
.article-header { padding-top: 26px; }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); }
.article-title { margin: 12px 0 10px; }
.article-meta { color: var(--muted); font-size: .9rem; margin: 0 0 20px; }
.article-hero { margin: 0 auto 26px; }
.article-hero img { width: 100%; border-radius: var(--radius); display: block; aspect-ratio: 2.1 / 1; object-fit: cover; }

.entry-content > * { max-width: 100%; }
.entry-content img { border-radius: 10px; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin: .3em 0; }
.entry-content blockquote { margin: 1.5em 0; padding: 14px 20px; border-left: 4px solid var(--accent); background: var(--bg); border-radius: 0 10px 10px 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content .wp-block-table, .entry-content .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.entry-content th, .entry-content td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.entry-content thead th, .entry-content tr:first-child th { background: var(--primary); color: #fff; }
.entry-content tbody tr:nth-child(even) { background: var(--bg); }
.entry-content .wp-block-button__link { background: var(--cta); border-radius: 10px; font-weight: 700; }
.entry-content h2 { scroll-margin-top: 96px; }

/* Inhoudsopgave */
.ep-toc { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 18px; margin: 22px 0; }
.ep-toc summary { font-weight: 800; color: var(--primary); cursor: pointer; }
.ep-toc ol { margin: 10px 0 4px; padding-left: 1.2em; }
.ep-toc a { text-decoration: none; }
.ep-toc a:hover { text-decoration: underline; }

/* ---------- Affiliate-blokken ---------- */
.ep-disclosure { font-size: .82rem; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 8px 12px; margin: 0 0 20px; }
.ep-btn-wrap { margin: 1.4em 0; }
.ep-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	background: var(--cta); color: #fff !important; font-weight: 800; text-decoration: none;
	padding: 14px 22px; border-radius: 12px; min-height: 48px;
	box-shadow: 0 4px 14px color-mix(in srgb, var(--cta) 35%, transparent);
	transition: transform .15s, filter .15s;
}
.ep-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.ep-btn--alt { background: var(--primary); box-shadow: none; }

.ep-provider { position: relative; border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 1.6em 0; background: #fff; }
.ep-provider__badge { position: absolute; top: -12px; left: 16px; background: var(--accent); color: #111; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 4px 10px; border-radius: 999px; }
.ep-provider__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ep-provider__logo { max-height: 48px; width: auto; border-radius: 0 !important; }
.ep-provider__name { font-size: 1.2rem; color: var(--primary); }
.ep-provider__score { margin-left: auto; font-weight: 800; font-size: 1.3rem; color: var(--cta); }
.ep-provider__score small { font-size: .75rem; color: var(--muted); }
.ep-provider__body p { margin: .6em 0; }
.ep-provider .ep-btn { width: 100%; margin-top: 10px; }
@media (min-width: 620px) { .ep-provider .ep-btn { width: auto; } }

.ep-proscons { display: grid; gap: 14px; margin: 1.6em 0; }
@media (min-width: 620px) { .ep-proscons { grid-template-columns: 1fr 1fr; } }
.ep-proscons h4 { margin: 0 0 8px; }
.ep-proscons > div { border-radius: 12px; padding: 14px 18px; }
.ep-proscons ul { list-style: none; padding: 0; margin: 0; }
.ep-proscons li { padding-left: 26px; position: relative; }
.ep-pros { background: #ecfdf3; } .ep-pros h4 { color: #15803d; }
.ep-cons { background: #fef2f2; } .ep-cons h4 { color: #b91c1c; }
.ep-pros li::before { content: "✓"; position: absolute; left: 0; color: #16a34a; font-weight: 800; }
.ep-cons li::before { content: "✕"; position: absolute; left: 0; color: #dc2626; font-weight: 800; }

.ep-tip { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, #fff); padding: 12px 18px; border-radius: 0 12px 12px 0; margin: 1.5em 0; }
.ep-tip p { margin: .4em 0; }

/* Gerelateerd */
.related { margin-bottom: 20px; }

/* Leeg / 404 */
.empty { padding: 48px 16px; text-align: center; }
.empty .search-form { max-width: 520px; margin: 18px auto; }

/* Widgets */
.widget { margin-bottom: 24px; }
.widget-title { margin: 0 0 10px; font-size: 1rem; }

/* Reacties */
.comments { padding: 20px 0 40px; }
.comment-list { padding-left: 1em; }
.comment-form input:not([type=submit]):not([type=checkbox]), .comment-form textarea { width: 100%; font: inherit; padding: 10px; border: 1.5px solid var(--border); border-radius: 10px; }
.comment-form .submit { font: inherit; font-weight: 700; background: var(--primary); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px; cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary); color: rgba(255,255,255,.82); padding: 44px 0 20px; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer h3 { color: #fff; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.brand--footer { color: #fff; margin: 0 0 10px; }
.brand--footer:hover { color: #fff; }
.brand--footer .logo-mark rect { fill: rgba(255,255,255,.12); }
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-nav a { text-decoration: none; opacity: .9; }
.footer-nav a:hover { opacity: 1; text-decoration: underline; color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 32px; padding-top: 18px; font-size: .82rem; }
.footer-bottom p { margin: 0 0 6px; }
.footer-disclosure { opacity: .7; }

/* Gutenberg uitlijningen */
.alignwide { max-width: 1000px; }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }
.wp-block-image figcaption, .wp-caption-text { font-size: .85rem; color: var(--muted); text-align: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
