/*
Theme Name: Meine Hausautomatisierung
Theme URI: https://meine-hausautomatisierung.de/
Author: Jan Rakoski
Description: Magazin- und Ratgeber-Theme fuer meine-hausautomatisierung.de.
Version: 1.0.0
Text Domain: hausauto
*/

:root {
  --ha-green: #218334;
  --ha-green-dark: #116123;
  --ha-green-soft: #eaf6ec;
  --ha-ink: #111817;
  --ha-muted: #5c6864;
  --ha-line: #dfe6e1;
  --ha-soft: #f6f8f6;
  --ha-panel: #ffffff;
  --ha-footer: #111c1e;
  --ha-radius: 8px;
  --ha-shadow: 0 18px 45px rgba(20, 33, 35, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ha-ink);
  background: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }

.ha-wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.ha-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--ha-line);
  backdrop-filter: blur(12px);
}
.ha-header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 30px;
  justify-content: space-between;
}
.ha-brand {
  display: inline-grid;
  grid-template-columns: 44px auto;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  min-width: 250px;
}
.ha-logo-mark {
  width: 42px;
  height: 42px;
  border: 3px solid var(--ha-green);
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.ha-logo-mark svg { width: 26px; height: 26px; stroke: var(--ha-green); }
.ha-brand-name {
  display: block;
  font-weight: 850;
  font-size: 18px;
  line-height: 1.03;
  letter-spacing: -.02em;
}
.ha-brand-sub {
  display: block;
  margin-top: 4px;
  color: var(--ha-green);
  font-size: 12px;
  font-weight: 700;
}
.ha-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 750;
}
.ha-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ha-nav a {
  position: relative;
  text-decoration: none;
  padding: 31px 0 28px;
}
.ha-nav a:hover,
.ha-nav .current-menu-item > a,
.ha-nav .current_page_item > a {
  color: var(--ha-green);
}
.ha-nav a:hover::after,
.ha-nav .current-menu-item > a::after,
.ha-nav .current_page_item > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 2px;
  background: var(--ha-green);
}
.ha-nav svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}
.ha-mobile-toggle { display: none; }

.ha-hero {
  min-height: 520px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(0,0,0,.74) 0%, rgba(0,0,0,.56) 38%, rgba(0,0,0,.1) 70%),
    var(--ha-hero-image) center/cover no-repeat;
}
.ha-hero-grid {
  min-height: 520px;
  display: grid;
  align-content: center;
  max-width: 720px;
  padding: 74px 0 38px;
}
.ha-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: .98;
  letter-spacing: -.045em;
}
.ha-hero p {
  margin: 0;
  max-width: 650px;
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ha-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}
.ha-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 7px;
  padding: 13px 24px;
  border: 1px solid transparent;
  font-weight: 850;
  text-decoration: none;
}
.ha-btn-primary { background: var(--ha-green); color: #fff; }
.ha-btn-primary:hover { background: var(--ha-green-dark); }
.ha-btn-ghost { border-color: rgba(255,255,255,.82); color: #fff; background: rgba(0,0,0,.18); }
.ha-btn-outline { border-color: var(--ha-green); color: var(--ha-green); background: #fff; }

.ha-trustbar {
  margin-top: 46px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.ha-trustitem {
  display: grid;
  grid-template-columns: 34px auto;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}
.ha-trustitem svg { width: 30px; height: 30px; stroke: #4fca62; }
.ha-trustitem strong { display: block; color: #fff; }
.ha-trustitem span { color: rgba(255,255,255,.8); }

.ha-section { padding: 54px 0; }
.ha-section-tight { padding: 32px 0 18px; }
.ha-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.ha-section h2,
.ha-section-tight h2,
.ha-archive-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.18;
  letter-spacing: -.02em;
}
.ha-section-head p {
  margin: 8px 0 0;
  color: var(--ha-muted);
}
.ha-more {
  color: var(--ha-green);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.ha-category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
.ha-knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.ha-category-card,
.ha-knowledge-card,
.ha-product-card,
.ha-post-card,
.ha-panel {
  background: var(--ha-panel);
  border: 1px solid var(--ha-line);
  border-radius: var(--ha-radius);
}
.ha-category-card {
  min-height: 128px;
  padding: 20px 16px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  text-decoration: none;
  font-weight: 850;
}
.ha-knowledge-card {
  min-height: 112px;
  padding: 22px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  text-decoration: none;
  font-weight: 850;
}
.ha-category-card svg {
  width: 44px;
  height: 44px;
  stroke: var(--ha-green);
}
.ha-knowledge-card svg {
  width: 38px;
  height: 38px;
  stroke: var(--ha-green);
}
.ha-category-card:hover,
.ha-knowledge-card:hover,
.ha-product-card:hover,
.ha-post-card:hover {
  border-color: rgba(33, 131, 52, .45);
  box-shadow: var(--ha-shadow);
  transform: translateY(-2px);
}
.ha-product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}
.ha-product-card {
  overflow: hidden;
  transition: .18s ease;
}
.ha-product-image,
.ha-post-thumb {
  min-height: 145px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.95), rgba(255,255,255,.15) 30%, transparent 45%),
    linear-gradient(135deg, #eef5f0, #ffffff);
  display: grid;
  place-items: center;
}
.ha-product-image svg {
  width: 86px;
  height: 86px;
  stroke: var(--ha-green);
}
.ha-product-body,
.ha-post-body {
  padding: 18px;
}
.ha-product-body h3,
.ha-post-body h3 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.22;
}
.ha-checks {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: #2d3936;
  font-size: 14px;
}
.ha-checks li::before {
  content: "✓";
  color: var(--ha-green);
  font-weight: 900;
  margin-right: 8px;
}
.ha-mini-btn {
  display: block;
  width: 100%;
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--ha-green);
  color: #fff;
  text-align: center;
  font-weight: 850;
  text-decoration: none;
  font-size: 14px;
}

.ha-starter {
  background:
    linear-gradient(90deg, rgba(235,247,238,.9), rgba(255,255,255,.86)),
    var(--ha-starter-image) left center/contain no-repeat;
  border: 1px solid var(--ha-line);
  border-radius: var(--ha-radius);
  min-height: 166px;
  display: grid;
  grid-template-columns: 1fr minmax(300px, 470px);
  align-items: center;
  gap: 28px;
  padding: 28px 34px 28px 36%;
}
.ha-starter h2 { margin: 0 0 10px; font-size: 24px; }
.ha-starter p { margin: 0 0 18px; color: var(--ha-muted); }
.ha-starter ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.ha-starter li::before {
  content: "✓";
  color: var(--ha-green);
  font-weight: 900;
  margin-right: 9px;
}

.ha-post-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}
.ha-post-card {
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: .18s ease;
}
.ha-post-thumb {
  min-height: 132px;
  background: linear-gradient(135deg, #e9f3eb, #d7e7da);
}
.ha-post-thumb img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}
.ha-post-cat {
  color: var(--ha-muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.ha-post-meta {
  color: #71807b;
  font-size: 12px;
  margin-top: auto;
}

.ha-affiliate-note {
  border: 1px solid var(--ha-line);
  border-radius: var(--ha-radius);
  padding: 18px 22px;
  color: #33413d;
  background: #fff;
}
.ha-affiliate-note strong { margin-right: 4px; }

.ha-site-footer {
  margin-top: 20px;
  background: radial-gradient(circle at 20% 0%, #1d3435, var(--ha-footer) 42%);
  color: #fff;
  padding: 46px 0 24px;
}
.ha-footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 42px;
}
.ha-site-footer a { color: rgba(255,255,255,.82); text-decoration: none; }
.ha-site-footer a:hover { color: #fff; }
.ha-footer-title { font-weight: 850; margin-bottom: 12px; }
.ha-footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; color: rgba(255,255,255,.78); }
.ha-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.14);
  margin-top: 34px;
  padding-top: 18px;
  text-align: center;
  color: rgba(255,255,255,.62);
  font-size: 13px;
}
.ha-footer-disclosure {
  border-top: 1px solid rgba(255,255,255,.14);
  margin-top: 30px;
  padding-top: 18px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

.ha-archive-hero {
  background: var(--ha-soft);
  border-bottom: 1px solid var(--ha-line);
  padding: 52px 0;
}
.ha-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--ha-muted);
  font-size: 14px;
}
.ha-breadcrumbs a {
  color: var(--ha-green);
  font-weight: 750;
  text-decoration: none;
}
.ha-archive-hero p { max-width: 760px; color: var(--ha-muted); font-size: 18px; }
.ha-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 34px;
  align-items: start;
}
.ha-blog-list {
  display: grid;
  gap: 20px;
}
.ha-blog-item {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  padding: 18px;
  border: 1px solid var(--ha-line);
  border-radius: var(--ha-radius);
  text-decoration: none;
  background: #fff;
}
.ha-blog-item h2 { margin: 0 0 10px; font-size: 24px; }
.ha-blog-item p { margin: 0 0 14px; color: var(--ha-muted); }
.ha-sidebar {
  border: 1px solid var(--ha-line);
  border-radius: var(--ha-radius);
  padding: 22px;
  background: #fff;
  position: sticky;
  top: 104px;
}
.ha-sidebar h2 { font-size: 20px; margin: 0 0 14px; }
.ha-sidebar ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }

.ha-single {
  max-width: 820px;
  margin: 0 auto;
}
.ha-single h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -.035em;
}
.ha-single .entry-content {
  font-size: 18px;
  line-height: 1.75;
}
.ha-single .entry-content h2 { margin-top: 42px; line-height: 1.18; }
.ha-single .entry-content p,
.ha-single .entry-content li,
.ha-single .entry-content h2,
.ha-single .entry-content h3 {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.ha-single .entry-content a { color: var(--ha-green); font-weight: 700; }
.ha-single-featured {
  margin: 30px 0;
  border-radius: var(--ha-radius);
  overflow: hidden;
}
.ha-single-featured img { width: 100%; display: block; }
.ha-related,
.ha-affiliate-inline {
  margin-top: 34px;
  border: 1px solid var(--ha-line);
  border-radius: var(--ha-radius);
  background: #fff;
  padding: 22px;
}
.ha-affiliate-inline {
  background: var(--ha-green-soft);
  color: #24342f;
}
.ha-related h2 {
  margin: 0 0 14px;
  font-size: 22px;
}
.ha-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ha-related-grid a {
  border: 1px solid var(--ha-line);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--ha-green);
  font-weight: 800;
  text-decoration: none;
}
.ha-related-grid a:hover {
  border-color: rgba(33, 131, 52, .45);
  background: var(--ha-green-soft);
}

@media (max-width: 1020px) {
  .ha-nav { gap: 18px; font-size: 14px; }
  .ha-category-grid { grid-template-columns: repeat(3, 1fr); }
  .ha-knowledge-grid { grid-template-columns: repeat(3, 1fr); }
  .ha-product-grid,
  .ha-post-grid { grid-template-columns: repeat(2, 1fr); }
  .ha-trustbar { grid-template-columns: repeat(2, 1fr); }
  .ha-starter { grid-template-columns: 1fr; padding-left: 34px; background-size: 48%; background-position: left bottom; }
  .ha-content-grid { grid-template-columns: 1fr; }
  .ha-sidebar { position: static; }
}

@media (max-width: 760px) {
  .ha-wrap { width: calc(100% - 28px); }
  .ha-header-inner { min-height: auto; padding: 14px 0; align-items: flex-start; flex-direction: column; gap: 14px; }
  .ha-brand { min-width: 0; width: 100%; }
  .ha-brand-name { font-size: 17px; }
  .ha-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 0 0 4px;
    font-size: 14px;
    align-items: start;
  }
  .ha-nav li,
  .ha-nav a {
    min-width: 0;
  }
  .ha-nav a {
    display: inline-block;
    max-width: 100%;
    padding: 4px 0 10px;
    white-space: normal;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .ha-nav > a[aria-label="Suche"] { display: none; }
  .ha-nav a::after { bottom: 2px !important; }
  .ha-hero,
  .ha-hero-grid { min-height: 620px; }
  .ha-hero {
    background:
      linear-gradient(180deg, rgba(0,0,0,.78), rgba(0,0,0,.32)),
      var(--ha-hero-image) center/cover no-repeat;
  }
  .ha-hero-grid { align-content: end; padding-bottom: 34px; }
  .ha-hero-grid,
  .ha-actions,
  .ha-trustbar {
    width: 100%;
    max-width: 100%;
  }
  .ha-hero h1 { font-size: 38px; letter-spacing: -.03em; }
  .ha-hero p {
    width: min(100%, 340px);
    max-width: calc(100vw - 28px);
    font-size: 17px;
    line-height: 1.48;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
  }
  .ha-actions { flex-direction: column; }
  .ha-btn { width: 100%; }
  .ha-trustbar,
  .ha-category-grid,
  .ha-knowledge-grid,
  .ha-product-grid,
  .ha-post-grid,
  .ha-footer-grid { grid-template-columns: 1fr; }
  .ha-section-head { display: block; }
  .ha-starter { padding: 220px 22px 24px; background-size: 112%; background-position: left top; }
  .ha-blog-item { grid-template-columns: 1fr; }
  .ha-wrap.ha-single,
  .ha-single,
  .ha-single .entry-content {
    width: 100%;
    max-width: calc(100vw - 36px);
  }
  .ha-single h1 { font-size: 34px; }
  .ha-single .entry-content { font-size: 17px; }
  .ha-single .entry-content h2 { font-size: 25px; max-width: 320px; }
  .ha-single .entry-content p,
  .ha-single .entry-content ul { max-width: 320px; }
  .ha-related-grid { grid-template-columns: 1fr; }
}
