
/* ============================================================
   1. Design Tokens
   ============================================================ */
:root {
  /* Farben */
  --color-bg: #ffffff;
  --color-text: #14171a;
  --color-text-muted: #5c6670;
  --color-line: #e6e8eb;
  --color-tint: #f5f6f7;
  --color-accent: #0a5c2e;
  --color-brand: #fcc10d;

  /* Typografie */
  --font-base: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --container-width: 1280px;
  --container-width-wide: 1440px;
  --container-width-narrow: 800px;
  --gutter: 1.5rem;
  --header-height: 80px;

  /* Abstände */
  --space-section: clamp(3rem, 6vw, 6rem);
  /* Abstand zwischen Hero und erstem Inhaltsblock. 0 = nahtlos. */
  --space-after-hero: 0rem;

  /* Sonstiges */
  --radius: 8px;
  --transition: 160ms ease;
}

/* ============================================================
   2. Reset / Basis
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  margin: 0;
  /* clip statt hidden: erhält position: sticky des Headers */
  overflow-x: clip;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  font-weight: 700;
  text-wrap: balance;
}

p { margin: 0 0 1em; }

a { color: inherit; text-decoration: none; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ============================================================
   3. Layout: Container & Sections
   ============================================================ */

/* Fixe Breite, zentriert */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: var(--container-width-narrow); }

.container--wide { max-width: var(--container-width-wide); }

/* Volle Fensterbreite, Innenabstand bleibt erhalten */
.container--full { max-width: none; }

/* Ohne Innenabstand: Inhalt reicht bis an die Fensterkanten.
   Meist zusammen mit .container--full verwendet. */
.container--flush { padding-inline: 0; }

/* Inhaltsblock: vertikaler Rhythmus.
   Pro Block übersteuerbar über --section-space-top / --section-space-bottom,
   z. B. <section class="section" style="--section-space-top: 2rem"> */
.section {
  padding-block: var(--section-space-top, var(--space-section))
                 var(--section-space-bottom, var(--space-section));
}

/* Randlos: volle Fensterbreite, kein vertikaler Abstand */
.section--flush {
  padding-block: 0;
}

/* Abstand nur oben bzw. nur unten weglassen */
.section--flush-top { --section-space-top: 0rem; }

.section--flush-bottom { --section-space-bottom: 0rem; }

/* Erster Block direkt unter dem Hero: schließt standardmäßig nahtlos an.
   Global über --space-after-hero einstellbar, einzeln über die Klassen oben
   oder --section-space-top. :where() hält die Spezifität bei 0, damit die
   Modifier-Klassen weiterhin greifen. */
:where(.hero + .section) {
  --section-space-top: var(--space-after-hero);
}

/* Randloser Block mit Hintergrundfläche über die ganze Breite */
.section--tinted {
  background-color: var(--color-tint);
  padding-block: var(--section-space-top, var(--space-section))
                 var(--section-space-bottom, var(--space-section));
}

/* ============================================================
   4. Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* Logo | Navigation (mittig) | Aktionen */
  align-items: center;
  gap: var(--gutter);
  width: 100%;
  max-width: var(--container-width);
  min-height: var(--header-height);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Logo links */
.logo {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.logo__text {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Navigation mittig */
.nav { justify-self: center; }

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
}

.nav__link {
  position: relative;
  display: inline-block;
  padding-block: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav__link:hover,
.nav__link.is-active { color: var(--color-text); }

.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }

/* Aktionen rechts (Platzhalter, hält die Navigation mittig) */
.site-header__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Burger-Button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.nav-toggle__bar {
  width: 24px;
  height: 2px;
  margin-inline: auto;
  background-color: var(--color-text);
  transition: transform var(--transition), opacity var(--transition);
}

/* ============================================================
   5. Hero
   ============================================================ */
.hero {
  --hero-height: min(82vh, 780px);
  --slope-angle: 2.5deg;                   /* Neigung der schrägen Kante */
  --shape-base: 90px; /* Höhe der Fläche an der linken Kante */ /* vorher: clamp(150px, 22vh, 200px) */

  /* Höhenunterschied der Schräge über die volle Breite (cqw = Breite der Hero) */
  --slope-rise: calc(100cqw * tan(var(--slope-angle)));

  position: relative;
  container-type: inline-size;
  height: var(--hero-height);
  overflow: hidden;
  background-color: var(--color-tint);   /* sichtbar, solange das Bild lädt */
}

/* Hintergrundbild – volle Breite, formatfüllend */
.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Farbige Fläche im Vordergrund.
   Die linke obere Ecke ist abgeschnitten: Die Kante läuft von links unten
   nach rechts oben. */
.hero__shape {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: flex-end;
  height: calc(var(--shape-base) + var(--slope-rise));
  background-color: var(--color-brand);
  clip-path: polygon(0 var(--slope-rise), 100% 0, 100% 100%, 0 100%);
}

/* Slogan auf der Schräge.
   Der Drehpunkt (0,0) liegt exakt auf dem linken Endpunkt der Kante – dieser
   sitzt --shape-base über der Unterkante der Hero. Die Drehung entspricht dem
   Winkel des clip-path, dadurch liegt der Text genau auf der Kante.
   Die Breite entspricht der Länge der Schräge (Hypotenuse), zusammen mit
   text-align: center ist der Text damit auf der Kante zentriert. */
.hero__slogan {
  position: absolute;
  top: calc(100% - var(--shape-base));
  left: 0;
  width: calc(100% / cos(var(--slope-angle)));
  margin: 0;
  transform: rotate(calc(-1 * var(--slope-angle))) translateY(-50%);
  transform-origin: 0 0;

  font-size: clamp(0.8rem, 3.35cqw, 3.625rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-bg);
}

.hero__shape > .container {
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

/* Optionale Überschrift in der farbigen Fläche (z. B. Seitentitel) */
.hero__title {
  margin: 0;
  font-size: clamp(1.5rem, 3.5cqw, 3rem);
  color: var(--color-text);
}

/* ============================================================
   6. Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding-block: 2.5rem;
}

.site-footer__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ============================================================
   7. Platzhalter (später entfernen)
   ============================================================ */
.placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--color-line);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* ============================================================
   8. Responsive
   ============================================================ */
@media (max-width: 860px) {
  :root { --header-height: 64px; }

  /* Steilere Schräge, damit sie auf schmalen Fenstern sichtbar bleibt */
  /*.hero {
    --hero-height: min(70vh, 560px);
  }*/
	.hero {
  --hero-height: min(60vh, 520px);
  --slope-angle: 3deg;   /* vorher: 7deg */
  --shape-base: 60px;    /* vorher: 120px */
}

.hero__image {
  object-position: 50% 20%;   /* Gesichter oben lassen */
}

  .site-header__inner {
    grid-template-columns: 1fr auto;   /* Logo | Burger */
  }

  .nav-toggle { display: flex; }

  /* Navigation als Overlay-Panel */
  .nav {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    display: none;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-line);
    padding: 1rem var(--gutter) 2rem;
  }

  .nav.is-open { display: block; }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav__link {
    display: block;
    padding-block: 0.875rem;
    font-size: 1.0625rem;
    border-bottom: 1px solid var(--color-line);
  }

  .nav__link::after { display: none; }

  /* Burger → X */
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================================
   9. WordPress: Basis
   ============================================================ */

/* Nur für Screenreader */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* „Zum Inhalt springen“ – bei Tastaturfokus sichtbar */
.skip-link:focus-visible {
  position: fixed !important;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 200;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.75rem 1rem;
  clip-path: none;
  background-color: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgb(0 0 0 / 0.18);
  font-weight: 600;
}

/* Admin-Bar schiebt den Sticky-Header nach unten */
.admin-bar .site-header { top: 32px; }

/* Logo als Bild */
.logo--image .custom-logo-link { display: inline-flex; }
.logo--image img { max-height: 48px; width: auto; }

/* Ausrichtungen des Blockeditors */
.alignleft {
  float: left;
  margin: 0.25em 1.5rem 1rem 0;
}

.alignright {
  float: right;
  margin: 0.25em 0 1rem 1.5rem;
}

.aligncenter {
  margin-inline: auto;
}

.entry-content > .alignwide {
  width: min(var(--container-width-wide), 100vw - 2 * var(--gutter));
  max-width: none;
  margin-inline: calc(50% - min(var(--container-width-wide), 100vw - 2 * var(--gutter)) / 2);
}

.entry-content > .alignfull {
  width: 100vw;
  max-width: none;
  margin-inline: calc(50% - 50vw);
}

/* Bildunterschriften */
.wp-caption { max-width: 100%; }

.wp-caption-text,
figcaption {
  margin-top: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.sticky .post-card__title::before {
  content: "★ ";
}

/* ============================================================
   10. Inhalte (the_content)
   ============================================================ */
.entry-content > * { margin-block: 0 1em; }

.entry-content > :last-child { margin-bottom: 0; }

.entry-content h2 { margin-top: 2em; font-size: clamp(1.375rem, 2.5vw, 1.875rem); }
.entry-content h3 { margin-top: 1.75em; font-size: clamp(1.125rem, 2vw, 1.375rem); }

.entry-content > h2:first-child,
.entry-content > h3:first-child { margin-top: 0; }

/* Listen: Reset aus Abschnitt 2 für Inhalte zurücknehmen */
.entry-content ul,
.entry-content ol,
.comment-content ul,
.comment-content ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.entry-content ul, .comment-content ul { list-style: disc; }
.entry-content ol, .comment-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 0.35em; }

.entry-content a:where(:not(.wp-element-button)) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color var(--transition);
}

.entry-content a:where(:not(.wp-element-button)):hover { color: var(--color-accent); }

.entry-content blockquote {
  margin: 1.5em 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--color-brand);
  color: var(--color-text-muted);
  font-style: italic;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.entry-content :is(th, td) {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
}

.entry-content th { font-weight: 600; }

.entry-content :is(pre, code) { font-size: 0.875rem; }

.entry-content pre {
  padding: 1rem;
  border-radius: var(--radius);
  background-color: var(--color-tint);
  overflow-x: auto;
}

/* Titelzeile ohne Hero */
.page-header { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }

.page-header__title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 3rem);
}

.page-header__text,
.entry-meta {
  margin: 0.5rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.entry-meta__categories::before {
  content: "·";
  margin-inline: 0.5rem;
}

.entry-tags,
.entry-edit {
  margin-top: 2rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.entry-tags a,
.entry-edit a { text-decoration: underline; }

/* ============================================================
   11. Beitragslisten
   ============================================================ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.post-card {
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}

.post-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.post-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-card__body { padding: 1.25rem; }

.post-card__title {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.125rem;
}

.post-card__excerpt {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* Blätternavigation und Beitragsnavigation */
.pagination,
.post-navigation,
.comment-navigation,
.page-links {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-line);
  font-size: 0.9375rem;
}

.pagination .nav-links,
.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pagination .page-numbers,
.page-links > a,
.page-links > span {
  display: grid;
  place-items: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding-inline: 0.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  transition: color var(--transition), border-color var(--transition);
}

.pagination .page-numbers:hover,
.page-links > a:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
}

.pagination .page-numbers.current,
.page-links > span {
  color: var(--color-text);
  border-color: var(--color-text);
  font-weight: 600;
}

.post-navigation .nav-links,
.comment-navigation .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
}

.post-navigation .nav-next { text-align: right; margin-left: auto; }

.post-nav__label {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.post-nav__title {
  font-weight: 600;
  transition: color var(--transition);
}

.post-navigation a:hover .post-nav__title { color: var(--color-accent); }

/* ============================================================
   12. Buttons und Formulare
   ============================================================ */
.button,
.wp-element-button,
.wp-block-button__link,
input[type="submit"] {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: var(--radius);
  background-color: var(--color-accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: opacity var(--transition);
}

.button:hover,
.wp-element-button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover { opacity: 0.88; }

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.search-form__field,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.6875rem 0.875rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background-color: var(--color-bg);
  color: inherit;
  font: inherit;
  font-size: 0.9375rem;
}

.search-form__field { flex: 1 1 16rem; width: auto; }

textarea { min-height: 9rem; resize: vertical; }

/* ============================================================
   13. Kommentare
   ============================================================ */
.comments {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--color-line);
}

.comments__title,
.comment-reply-title {
  font-size: 1.25rem;
}

.comment-list,
.comment-list .children {
  list-style: none;
  padding: 0;
}

.comment-list .children { margin-left: clamp(1rem, 4vw, 2.5rem); }

.comment-list > li { margin-bottom: 1.5rem; }

.comment-body {
  padding: 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.comment-meta .avatar { border-radius: 50%; }

.comment-metadata,
.comment-author .says { color: var(--color-text-muted); }

.comment-form { display: grid; gap: 1rem; margin-top: 1.5rem; }

.comment-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.comment-form .form-submit { margin: 0; }

.comments__closed,
.comment-notes,
.comment-form-cookies-consent label {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 400;
}

/* ============================================================
   14. Footer: Widgets und Navigation
   ============================================================ */
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--color-line);
}

.widget__title {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.widget ul { display: grid; gap: 0.5rem; font-size: 0.9375rem; }

.widget a { color: var(--color-text-muted); transition: color var(--transition); }
.widget a:hover { color: var(--color-text); }

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

.footer-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.footer-nav a { color: var(--color-text-muted); transition: color var(--transition); }
.footer-nav a:hover { color: var(--color-text); }

/* ============================================================
   15. Responsive: Ergänzungen
   ============================================================ */
@media (max-width: 1024px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .post-grid { grid-template-columns: 1fr; }

  .alignleft,
  .alignright { float: none; margin-inline: 0; }
}

@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}
