:root {
  --color-bg: #fafaf7;
  --color-surface: #ffffff;
  --color-text: #1a1f1c;
  --color-muted: #5b6660;
  --color-border: #e3e6e1;
  --color-primary: #2d6a4f;
  --color-primary-dark: #1b4332;
  --color-accent: #f4a261;
  --radius: 8px;
  --max-width: 960px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.site-header .logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-primary-dark);
}

.site-header .logo:hover {
  text-decoration: none;
}

.site-header nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-header nav a {
  color: var(--color-text);
  font-weight: 500;
}

.site-header nav a.active {
  color: var(--color-primary);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  padding: 2.5rem 0 4rem;
}

.hero {
  padding: 3.5rem 0 2.5rem;
  background: linear-gradient(180deg, #eef5f0 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-border);
}

.hero h1 {
  font-size: 2.5rem;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--color-primary-dark);
}

.lead {
  font-size: 1.15rem;
  color: var(--color-muted);
}

.hero .lead {
  font-size: 1.2rem;
  max-width: 640px;
  margin: 0;
}

.hint {
  color: var(--color-muted);
}

h1, h2, h3 {
  color: var(--color-primary-dark);
  line-height: 1.25;
}

h1 { font-size: 2.25rem; margin-top: 0; }
h2 { font-size: 1.6rem; margin-top: 2.5rem; }
h3 { font-size: 1.2rem; margin-top: 1.75rem; }

p, ul, ol {
  margin: 0 0 1.1rem;
}

ul, ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.card {
  display: block;
  color: inherit;
}

a.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  border-color: var(--color-primary);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background: #f1f5f2;
  font-weight: 600;
  color: var(--color-primary-dark);
}

tr:last-child td {
  border-bottom: none;
}

.callout {
  background: #fff8ec;
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  margin: 1.5rem 0;
}

.callout strong {
  color: var(--color-primary-dark);
}

.tag {
  display: inline-block;
  background: #e8f0ea;
  color: var(--color-primary-dark);
  font-size: 0.8rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-right: 0.35rem;
}

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Uitklapbare voor/nadelen blokken (zonnepanelen.html) */
details.topology {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin: 0.4rem 0;
  background: var(--color-surface);
}

details.topology > summary {
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  user-select: none;
}

details.topology > summary::-webkit-details-marker {
  display: none;
}

details.topology > summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  margin-right: 0.4rem;
  color: var(--color-muted);
  transition: transform 0.15s ease;
}

details.topology[open] > summary::before {
  transform: rotate(90deg);
}

details.topology[open] > summary {
  border-bottom: 1px solid var(--color-border);
}

details.topology > ul {
  margin: 0;
  padding: 0.55rem 1rem 0.85rem 2.4rem;
}

details.topology > ul li {
  margin-bottom: 0.35rem;
}

details.topology > .details-prose {
  padding: 0.55rem 1rem 0.55rem 2.4rem;
}

details.topology > .details-prose p {
  margin: 0 0 0.7rem;
}

details.topology > .details-prose p:last-child {
  margin-bottom: 0;
}

/* Flow-diagrammen (laden / ontladen) */
.flow-diagrams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.flow {
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
}

.flow figcaption {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
  text-align: center;
}

.flow figcaption strong {
  color: var(--color-primary-dark);
}

.flow svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Alleenstaande flow-diagrammen krijgen niet de volledige breedte; */
/* zo blijft de schaling consistent met gepairde diagrammen. */
.flow-diagrams .flow:only-child {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

@media (prefers-reduced-motion: reduce) {
  .flow svg animateMotion {
    display: none;
  }
  .flow svg circle {
    display: none;
  }
}

/* Keuzetool */
.tool {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}

.tool fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.tool legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-primary-dark);
}

.tool label {
  display: block;
  margin: 0.4rem 0;
  cursor: pointer;
}

.tool input[type="number"],
.tool select {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  width: 100%;
  max-width: 220px;
}

.tool input[type="range"] {
  width: 100%;
  max-width: 320px;
}

.tool .slider-readout {
  margin: 0.4rem 0 0.6rem;
  font-size: 0.95rem;
}

.tool button {
  background: var(--color-primary);
  color: white;
  border: none;
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.tool button:hover {
  background: var(--color-primary-dark);
}

.tool-result {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #eef5f0;
  border-radius: var(--radius);
  display: none;
}

.tool-result.visible {
  display: block;
}

.tool-result h3 {
  margin-top: 0;
}

/* Begrippenlijst */
dl.glossary {
  margin: 1.5rem 0 2rem;
  padding: 0;
}

dl.glossary > div {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

dl.glossary > div:last-child {
  border-bottom: none;
}

dl.glossary dt {
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}

dl.glossary dt .tag {
  font-weight: 600;
}

dl.glossary dd {
  margin: 0;
  color: var(--color-text);
}

dl.glossary dd p {
  margin: 0 0 0.6rem;
}

dl.glossary dd p:last-child {
  margin-bottom: 0;
}

.glossary-figure {
  margin: 0.8rem 0 0.2rem;
  max-width: 380px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.7rem 0.9rem 0.6rem;
}

.glossary-figure svg {
  width: 100%;
  height: auto;
  display: block;
}

.glossary-figure figcaption {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
  text-align: center;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.9rem; }
  .hero .lead { font-size: 1.05rem; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
}
