/* Smart Energy Management – Stylesheet
   Farben stammen aus dem bisherigen Design (Elementor Global Colors). */

:root {
  --blau-dunkel: #1C244B;
  --blau-text: #324A6D;
  --blau-akzent: #467FF7;
  --orange: #FD9807;
  --hell: #F3F5F8;
  --weiss: #FFFFFF;
  --rahmen: #C8D5DC;
  --breite: 1150px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--blau-text);
  background: var(--weiss);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blau-akzent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  color: var(--blau-dunkel);
  line-height: 1.25;
  margin: 1.6em 0 0.5em;
  font-weight: 600;
}
h1 { font-size: 2.1rem; margin-top: 0.4em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
h2 + h3, h3 + p.untertitel { margin-top: 0; }

p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
hr { border: 0; border-top: 1px solid var(--rahmen); margin: 2.5rem 0; }

table { border-collapse: collapse; width: 100%; margin-bottom: 1.5em; }
th, td { border: 1px solid var(--rahmen); padding: 0.5em 0.75em; text-align: left; vertical-align: top; }
th { background: var(--hell); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.button, button.button {
  display: inline-block;
  background: var(--orange);
  color: var(--weiss);
  font: inherit;
  font-weight: 600;
  padding: 0.65em 1.4em;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.button:hover, button.button:hover { background: #e28600; text-decoration: none; }
.button.sekundaer { background: var(--blau-akzent); }
.button.sekundaer:hover { background: #2f68dd; }

/* ---------- Kopfbereich ---------- */
.kopf {
  background: var(--weiss);
  border-bottom: 1px solid var(--rahmen);
  position: sticky;
  top: 0;
  z-index: 10;
}
.kopf .innen {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.kopf .logo img { height: 56px; width: auto; }
.hauptmenue { margin-left: auto; }
.hauptmenue ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; flex-wrap: wrap; }
.hauptmenue a {
  display: block;
  padding: 0.5em 0.85em;
  color: var(--blau-dunkel);
  font-weight: 500;
  border-radius: 6px;
}
.hauptmenue a:hover { background: var(--hell); text-decoration: none; }
.hauptmenue li.aktiv a { color: var(--orange); }
.kopf .login { padding: 0.5em 1.2em; }
.menue-schalter { display: none; }
.menue-knopf { display: none; }

@media (max-width: 900px) {
  .kopf .innen { gap: 0.75rem; }
  .menue-knopf {
    display: inline-block;
    margin-left: auto;
    order: 2;
    padding: 0.4em 0.8em;
    border: 1px solid var(--rahmen);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: var(--blau-dunkel);
  }
  .kopf .login { order: 3; }
  .hauptmenue { order: 4; flex-basis: 100%; display: none; margin: 0; }
  .menue-schalter:checked ~ .hauptmenue { display: block; }
  .hauptmenue ul { flex-direction: column; padding: 0.5rem 0; }
}

/* ---------- Inhalt ---------- */
main { min-height: 50vh; }

.inhalt {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}
.inhalt > .inhalt { padding: 0; }
.beitrag { max-width: 860px; }
.beitrag .titelbild { border-radius: 10px; margin: 1.5rem 0 2rem; }
.meta { color: #6b7d95; font-size: 0.9rem; margin-bottom: 1.25rem; }

/* Spalten: nebeneinanderliegende Bereiche (z. B. Bild + Text) */
.spalten {
  display: grid;
  gap: 2rem;
  align-items: center;
  margin: 2rem 0;
}
.spalten-2 { grid-template-columns: repeat(2, 1fr); }
.spalten-3 { grid-template-columns: repeat(3, 1fr); }
.spalten-4 { grid-template-columns: repeat(4, 1fr); }
.spalten img { border-radius: 10px; }
.spalten h2:first-child, .spalten h3:first-child { margin-top: 0; }

@media (max-width: 800px) {
  .spalten-2, .spalten-3, .spalten-4 { grid-template-columns: 1fr; }
  .spalten-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Karten (Energiegemeinschaften-Übersicht, Beitragsliste) */
.karten { align-items: stretch; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) { .karten { grid-template-columns: 1fr; } }
.karte {
  background: var(--hell);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.karte h3 { margin-top: 0; }
.karte .untertitel { font-weight: 600; margin-top: -0.4em; }
.karte ul { padding-left: 1.2em; }
.karte li { margin-bottom: 0.5em; }
.karte img { border-radius: 8px; margin: -0.5rem -0.5rem 1rem; width: calc(100% + 1rem); max-width: none; aspect-ratio: 16 / 10; object-fit: cover; }
.karte h3 a { color: var(--blau-dunkel); }
.karte .mehr { font-weight: 600; }
.beitragsliste { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 1.5rem 0 2rem; }
@media (max-width: 900px) { .beitragsliste { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .beitragsliste { grid-template-columns: 1fr; } }

/* ---------- Hero (Startseite) ---------- */
.hero {
  max-width: var(--breite);
  margin: 1.5rem auto 0;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.hero-karte {
  position: relative;
  min-height: 340px;
  border-radius: 12px;
  overflow: hidden;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-size: cover;
  background-position: center;
  background-color: var(--blau-dunkel);
  color: var(--weiss);
}
.hero-karte::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(28, 36, 75, 0.35) 0%, rgba(28, 36, 75, 0) 70%);
}
.hero-karte > * { position: relative; }
.hero-karte h2 { color: var(--weiss); margin: 0 0 0.4em; font-size: 1.5rem; }
.hero-karte p { font-size: 0.95rem; }
.hero-karte .button { align-self: flex-start; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .hero-karte { min-height: 260px; } }

/* ---------- Formulare ---------- */
.formular { max-width: 640px; margin: 1rem 0 2rem; }
.formular label { display: block; font-weight: 500; margin-bottom: 0.3em; color: var(--blau-dunkel); }
.formular input[type="text"], .formular input[type="email"], .formular textarea {
  width: 100%;
  font: inherit;
  padding: 0.6em 0.8em;
  border: 1px solid var(--rahmen);
  border-radius: 6px;
  background: var(--weiss);
}
.formular textarea { resize: vertical; }
.formular .zeile { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.formular .zeile input { flex: 1 1 240px; }
.formular .hp { position: absolute; left: -9999px; }
.hinweis { padding: 1rem 1.25rem; border-radius: 8px; margin: 1rem 0; }
.hinweis.ok { background: #e6f6ec; color: #1d6b3a; }
.hinweis.fehler { background: #fdecec; color: #a12727; }

/* ---------- Fußbereich ---------- */
.fuss {
  background: var(--blau-dunkel);
  color: #d5dbea;
  margin-top: 3rem;
  font-size: 0.95rem;
}
.fuss .innen {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 3rem 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr;
  gap: 2.5rem;
}
.fuss img { max-width: 220px; margin-bottom: 1rem; background: var(--weiss); padding: 0.5rem; border-radius: 6px; }
.fuss h3 { color: var(--weiss); font-size: 1rem; margin: 0 0 0.75em; }
.fuss ul { list-style: none; margin: 0; padding: 0; }
.fuss li { margin-bottom: 0.4em; }
.fuss a { color: var(--weiss); }
.fuss a:hover { color: var(--orange); }
.fuss .copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
}
@media (max-width: 800px) { .fuss .innen { grid-template-columns: 1fr; gap: 1.5rem; } }
