/* ==========================================================================
   INFINITY FINANCE – Clean flat architecture
   Reset → Variables → Base → Layout → Components → Utilities → Media
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/* Variables                                                                  */
/* -------------------------------------------------------------------------- */
:root {
  --font-family: "Poppins", Helvetica, sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-size-body: 19px;
  --font-size-body-resp: clamp(0.875rem, 1.5vw + 0.75rem, 19px);
  --font-size-small: 16px;
  --font-size-small-resp: clamp(0.8125rem, 1vw + 0.65rem, 16px);
  --font-size-subheading: 24px;
  --font-size-subheading-resp: clamp(1rem, 1.5vw + 0.75rem, 24px);
  --font-size-heading: 30px;
  --font-size-heading-resp: clamp(1.125rem, 2vw + 0.75rem, 30px);
  --font-size-hero-title: clamp(1.5rem, 4vw + 1rem, 50px);
  --font-size-hero-sub: clamp(1rem, 1.5vw + 0.5rem, 22px);
  --line-height-body: 150%;
  --line-height-tight: 1.4;
  --letter-spacing: 0;
  --color-primary: #355518;
  --color-text: #000000;
  --color-text-muted: #2c2929;
  --color-bg: #E6E6E6;
  --color-bg-hero-bar: #355518;
  --color-white: #ffffff;
  --color-white-transparent: transparent;
  --shadow-button: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-nav: 0 2px 5px rgba(0, 0, 0, 0.1);
  --spacing-s: 24px;
  --spacing-m: 48px;
  --spacing-inline: 20px;
  --nav-height: 17vh;
  --nav-height-mobile: 80px;
  --card-image-height: 341px;
  --card-body-height: 300px;
  --touch-min: 44px;
  --footer-col-min: 180px;
}

/* -------------------------------------------------------------------------- */
/* Base                                                                      */
/* -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  max-width: 100%;
  min-height: 100%;
}

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

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

/* -------------------------------------------------------------------------- */
/* Layout – Page wrapper                                                     */
/* -------------------------------------------------------------------------- */
.page-wrapper {
  background-color: #808080;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  position: relative;
}

/* -------------------------------------------------------------------------- */
/* Components – Header / Navigation                                          */
/* -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navigation {
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  height: var(--nav-height);
  min-height: 100px;
  padding: 0 24px;
  background-color: var(--color-white);
  margin: 0;
  box-shadow: var(--shadow-nav);
  position: relative; /* needed for absolute logo centering */
}

.nav-logo-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.navigation .nav-logo {
  width: 280px;
  max-width: 45vw;
  max-height: 120px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.navigation .nav-link {
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body-resp);
  letter-spacing: var(--letter-spacing);
  line-height: var(--line-height-body);
  color: var(--color-text);
  white-space: nowrap;
}

.navigation .nav-link:hover,
.nav-link-active {
  color: var(--color-primary);
}

.nav-cta {
  display: inline-flex;
  height: var(--touch-min);
  min-width: 120px;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  background-color: var(--color-primary);
  border-radius: 8px;
  box-shadow: var(--shadow-button);
  color: var(--color-white);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.nav-cta:hover {
  opacity: 0.95;
}

.nav-actions {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------- */
/* Components – Hero                                                         */
/* -------------------------------------------------------------------------- */
.hero {
  position: absolute;
  width: 100%;
  left: 0;
  top: max(100px, var(--nav-height)); /* tracks nav height, removes gap */
  height: 848px;
  overflow-x: hidden;
}

.hero-overlay {
  position: absolute;
  width: 100%;
  height: 100px;
  top: 625px;
  left: 0;
}

.hero-image {
  position: static;
  width: 100%;
  height: calc(100% - 248px);
  object-fit: cover;
}

.hero-green-bar {
  position: absolute;
  width: 100%;
  height: 110px;
  top: 600px;
  left: 0;
  background-color: var(--color-bg-hero-bar);
  z-index: -1;
}

.hero-title {
  position: absolute;
  max-width: 610px;
  width: 85%;
  top: 135px;
  left: 42px;
  margin: 0;
  font-family: var(--font-family);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-hero-title);
  line-height: 1.2;
  letter-spacing: var(--letter-spacing);
  color: var(--color-white);
}

.hero-subtitle {
  position: absolute;
  max-width: 514px;
  width: 75%;
  top: 300px;
  left: 42px;
  margin: 0;
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-hero-sub);
  line-height: 1.35;
  letter-spacing: var(--letter-spacing);
  color: var(--color-white);
}

.hero-image-mobile {
  display: none;
}

.hero-cta-mobile {
  display: none;
}

.hero-stats {
  /* ── Container: lives inside the green bar (600–710px within hero) ── */
  position: absolute;
  width: 100%;
  top: 616px;
  left: 0;
  box-sizing: border-box;
  padding: 8px 8%;        /* vertical: centres content in green bar; horizontal: mirrors original ~20%/47%/75% spread */
  margin: 0;
  list-style: none;
  /* New flex layout – replaces per-stat position:absolute */
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
}

.hero-stats .stat {
  /* Stat column: value on top, label below */
  position: static;       /* no longer absolutely positioned */
  width: auto;            /* no longer 100px – let content dictate width */
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
}

.hero-stats .stat-value {
  display: block;         /* own line – prevents "40Kunden" run-together */
  color: var(--color-white);
  font-size: 30px;
  line-height: 1.3;
  white-space: nowrap;
}

.hero-stats .stat-label {
  display: block;         /* own line below value */
  color: var(--color-white);
  font-size: 21px;
  line-height: 1.3;
  white-space: nowrap;
}

/* nth-child left values are no longer needed (position:static ignores left) */
.hero-stats .stat:nth-child(1),
.hero-stats .stat:nth-child(2),
.hero-stats .stat:nth-child(3) {
  left: auto;
}

.anchor-offset {
  position: relative;
  top: -50px;
}

/* -------------------------------------------------------------------------- */
/* Components – Cards                                                        */
/* -------------------------------------------------------------------------- */
.cards {
  display: flex;
  justify-content: space-between;
  align-items: stretch; /* equal-height cards; was flex-start */
  gap: 35px;
  width: calc(1165px + 35px);
  margin: 0 auto;
  position: absolute;
  top: 950px;
  left: 50%;
  transform: translateX(-50%);
}

.card {
  width: 600px;
  position: relative;
  background-color: transparent;
  display: flex;          /* enables card-body to stretch to full card height */
  flex-direction: column;
}

.card-extra-mobile {
  display: none;
}

.card-image-wrap {
  width: 100%;
  height: var(--card-image-height);
  background-size: cover;
  background-position: 50% 50%;
}

.card-image {
  width: 100%;
  height: var(--card-image-height);
  object-fit: cover;
}

.card-body {
  width: 100%;
  min-height: 0;
  background-color: var(--color-white);
  padding: var(--spacing-inline);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
}

.card-title {
  margin: 0;
  padding: 0 0 0 12px;
  font-family: var(--font-family);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-heading-resp);
  line-height: 1.35;
  color: var(--color-text-muted);
}

.card-text {
  margin: 0;
  padding: 0 0 0 12px;
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body-resp);
  line-height: var(--line-height-body);
  color: var(--color-text);
  flex: 1 1 auto;
}

/* -------------------------------------------------------------------------- */
/* Components – Impressum block (green footer variant) – removed from index   */
/* -------------------------------------------------------------------------- */
.impressum-block {
  display: none;
}

.impressum-block .impressum-box {
  color: var(--color-white);
  font-family: var(--font-family);
  font-size: 13px;
  line-height: 1.5;
  padding: var(--spacing-inline);
  width: 80%;
}

.impressum-block a {
  color: var(--color-white);
}

/* -------------------------------------------------------------------------- */
/* Components – Feature horizontal (bild-quer)                                */
/* -------------------------------------------------------------------------- */
.feature-horizontal {
  position: absolute;
  width: 1200px;
  height: 470px;
  top: 1650px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  background-color: var(--color-white);
  box-sizing: border-box;
}

.feature-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  order: 1;
  width: 50%;
  min-width: 0;
  padding: var(--spacing-inline);
  box-sizing: border-box;
  flex: 1 1 auto;
}

.feature-title {
  margin: 0;
  padding: 0 0 0 12px;
  font-family: var(--font-family);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-heading-resp);
  line-height: 1.35;
  color: var(--color-text-muted);
}

.feature-desc {
  margin: 0;
  padding: 0 0 0 12px;
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body-resp);
  line-height: var(--line-height-body);
  color: var(--color-text);
  flex: 1 1 auto;
}

.feature-image-wrap {
  position: relative;
  width: 50%;
  height: 470px;
  background-size: cover;
  background-position: center;
  order: 2;
}

.feature-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* -------------------------------------------------------------------------- */
/* Components – Footer (auto layout grid)                                    */
/* -------------------------------------------------------------------------- */
.site-footer {
  position: absolute;
  width: 100%;
  left: 0;
  top: 2250px;
  background-color: var(--color-primary);
  z-index: 0;
  padding: 48px 24px 24px;
  box-sizing: border-box;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--footer-col-min), 1fr));
  gap: var(--spacing-m);
  max-width: 1200px;
  margin: 0 auto 24px;
  justify-items: start;
  align-items: start;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.footer-heading {
  margin: 0;
  font-family: var(--font-family);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-small);
  line-height: 24px;
  color: var(--color-white);
}

.site-footer p {
  margin: 0;
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  font-size: 15px;
  line-height: 22.5px;
  color: var(--color-white);
}

.site-footer a {
  color: var(--color-white);
}

.footer-contact {
  margin-left: 0;
  margin-right: 0;
}

.footer-register {
  margin-right: 0;
}

.footer-copy {
  font-size: var(--font-size-small-resp);
  line-height: 1.4;
  margin: 0;
  text-align: center;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.footer-address-line {
  margin-top: 0.25em;
}

.footer-legal-links {
  margin-top: 0.5em;
}

.footer-legal-links a {
  text-decoration: underline;
}

/* -------------------------------------------------------------------------- */
/* Components – Inner pages (Impressum, Datenschutz)                          */
/* -------------------------------------------------------------------------- */
.page-inner {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-white); /* white bg for Impressum / Datenschutz */
}

.page-inner .inner-main {
  flex: 1 1 auto;
  padding: var(--spacing-m) var(--spacing-inline);
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.legal-content {
  padding: var(--spacing-inline) 0;
}

.legal-content h1 {
  font-size: var(--font-size-heading-resp);
  margin: 0 0 1rem;
  color: var(--color-text);
}

.legal-content h2 {
  font-size: var(--font-size-subheading-resp);
  margin: 1.5rem 0 0.5rem;
  color: var(--color-text);
}

.legal-content p {
  margin: 0 0 0.75rem;
  font-size: var(--font-size-body-resp);
  line-height: var(--line-height-body);
  color: var(--color-text);
}

.legal-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.legal-meta {
  margin-top: 2rem !important;
  font-size: var(--font-size-small-resp) !important;
}

.site-footer-inner {
  position: relative;
  top: auto;
  left: auto;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.2);
}

/* -------------------------------------------------------------------------- */
/* Buttons (mobile CTA)                                                       */
/* -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 12px 24px;
  border: none;
  border-radius: 3px;
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  text-decoration: none;
  color: var(--color-white);
  background-color: var(--color-primary);
  transition: background-color 0.3s ease;
}

.btn-primary:hover {
  background-color: #2d4614;
}

/* ========================================================================== */
/* Media Queries                                                              */
/* ========================================================================== */

/* Desktop narrow / large tablet */
@media (max-width: 1200px) {
  .navigation {
    width: 100%;
    min-height: 100px;
    height: auto;
    padding: 16px 24px;
  }

  .navigation .nav-logo {
    width: 220px;
    max-width: 35vw;
    max-height: none;
    height: auto;
  }

  .nav-links {
    gap: 16px;
  }

  .navigation .nav-link {
    font-size: var(--font-size-small-resp);
  }

  .site-footer {
    top: 2200px;
  }

  .cards {
    width: 95%;
    top: 950px;
  }

  .feature-horizontal {
    width: 95%;
    top: 1650px;
  }

  .card-title,
  .feature-title {
    font-size: var(--font-size-heading-resp);
    font-weight: 600;
  }

  .card-text,
  .feature-desc {
    font-size: var(--font-size-body-resp);
    font-weight: 400;
  }

  .hero-title {
    width: 85%;
    max-width: 450px;
    font-size: var(--font-size-hero-title);
    line-height: 1.25;
  }

  .hero-subtitle {
    width: 75%;
    max-width: 400px;
    top: 250px;
    font-size: var(--font-size-hero-sub);
  }
}

/* Small desktop / tablet */
@media (max-width: 1024px) {
  .nav-links {
    gap: 12px;
  }

  .nav-actions {
    padding-right: 0;
  }
}

/* Tablet */
@media (max-width: 768px) {
  .navigation {
    min-height: 80px;
  }

  .navigation .nav-logo {
    width: 180px;
    max-width: 40vw;
  }

  .hero-title {
    width: 90%;
    max-width: 380px;
    font-size: var(--font-size-hero-title);
    line-height: 1.25;
  }

  .hero-subtitle {
    width: 85%;
    max-width: 380px;
    font-size: var(--font-size-hero-sub);
  }

  .cards {
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
  }

  .card {
    width: 100%;
    max-width: 500px;
  }

  .feature-horizontal {
    flex-direction: column;
    height: auto;
    min-height: 400px;
  }

  .feature-text,
  .feature-image-wrap {
    width: 100%;
    order: unset;
  }

  .feature-image-wrap {
    height: 300px;
  }

  .feature-title {
    white-space: normal;
  }

  .footer-grid {
    justify-items: center;
    text-align: center;
  }

  .footer-col {
    align-items: center;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  body {
    background-color: #f5f5f5;
  }

  .page-wrapper {
    background-color: #f5f5f5; /* prevent dark gray (#808080) showing through on mobile */
  }

  .navigation {
    height: var(--nav-height-mobile);
    min-height: var(--nav-height-mobile);
    justify-content: center;
    padding: 12px 16px;
  }

  .nav-links,
  .nav-actions {
    display: none;
  }

  .navigation .nav-logo {
    width: 200px;
    max-width: 70vw;
  }

  .hero {
    height: 600px;
    top: var(--nav-height-mobile); /* align hero flush below nav; was 141px (desktop default) → left 61px gap */
  }

  .hero-image {
    display: none;
  }

  .hero-green-bar {
    display: none;
  }

  .hero-overlay {
    display: none;
  }

  .hero-stats {
    display: none;
  }

  .hero-image-mobile {
    display: block;
    height: 200px;
    width: 90%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 235px; /* was 125px: moved below subtitle (title ~115px + subtitle ~66px + gaps) */
    object-fit: cover;
  }

  .hero-title {
    width: 90%;
    max-width: 300px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--color-text);
    font-size: var(--font-size-hero-title);
    line-height: 1.2;
    top: 15px; /* was -50px: title started above hero, overlapped with nav */
  }

  .hero-subtitle {
    width: 90%;
    max-width: 300px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--color-text);
    font-size: var(--font-size-hero-sub);
    line-height: 1.35;
    top: 135px; /* was 20px: subtitle overlapped title; now placed below ~3-line title */
  }

  .hero-cta-mobile {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 450px; /* was 340px: now placed below image (235px top + 200px height + 15px gap) */
    padding: 0 16px;
  }

  .hero-cta-mobile .btn {
    flex: 1;
    max-width: 45%;
    min-height: var(--touch-min);
  }

  .card-extra-mobile {
    display: block;
  }

  .cards {
    flex-direction: column;
    align-items: center;
    width: 92%;
    max-width: 92%;
    margin: 800px auto 0;
    top: -200px;
    position: relative;
    left: auto;           /* neutralise base: left: 50% */
    transform: none;      /* neutralise base: translateX(-50%) */
    gap: 24px;
  }

  .card {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .card-image-wrap {
    height: auto;
    width: 100%;
  }

  .card-image {
    height: auto;
    min-height: 200px;
  }

  .card-body {
    padding: 20px 16px;
    align-items: center;
    text-align: center;
  }

  .card-title,
  .card-text {
    padding-left: 0;
    padding-right: 0;
    font-size: var(--font-size-body-resp);
  }

  .card-title {
    font-weight: 600;
  }

  .card-text {
    font-size: var(--font-size-small-resp);
    font-weight: 400;
  }

  .feature-horizontal {
    display: none;
  }

  .site-footer {
    position: relative;
    top: auto;
    padding: 32px 16px 24px;
    margin-top: 48px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 24px;
  }

  .footer-col {
    align-items: center;
  }

  .footer-copy {
    text-align: center;
  }
}

/* Hide mobile-only elements on desktop */
@media (min-width: 1201px) {
  .card-extra-mobile,
  .hero-image-mobile,
  .hero-cta-mobile {
    display: none;
  }
}

@media (min-width: 481px) {
  .card-extra-mobile,
  .hero-cta-mobile,
  .hero-image-mobile {
    display: none;
  }
}
