@font-face {
  font-family: 'Avenir';
  src: url('fonts/AvenirNextCyr-Light.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Avenir Heavy';
  src: url('fonts/AvenirNextCyr-Heavy.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

/* ==================== CSS Variables ==================== */
:root {
  /* Colors */
  --color-primary-green: #8CC63F;
  --color-dark-green: #71a331;
  --color-light-green: #a7d95d;
  --color-white: #ffffff;
  --color-black: #1a1a1a;
  --color-gray: #666666;
  --color-light-gray: #f5f5f5;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;

  /* Typography */
  --font-family-base: "Avenir", "Arial", sans-serif;
  --font-family-heading: "Avenir Heavy", "Arial", sans-serif;
  --font-size-base: 18px;
  --font-size-sm: 14px;
  --font-size-md: 18px;
  --font-size-lg: 24px;
  --font-size-xl: 32px;
  --font-size-xxl: 48px;

  --line-height-base: 1.6;
  --line-height-heading: 1.2;

  /* Layout */
  --max-width: 1200px;
  --border-radius: 8px;
  --transition-speed: 0.3s;
}

/* ==================== Global Styles ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  line-height: var(--line-height-heading);
}

h3 {
  font-weight: 800;
  font-size: 1.5rem;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  color: var(--color-white);
}

h4 {
  font-weight: 800; /* Extra bold for subheadings */
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
  font-size: 1.25rem;
}

body {
  font-family: var(--font-family-base);
  line-height: var(--line-height-base);
  color: var(--color-black);
  background-color: var(--color-white);
  background-image: url("assets/bg-texture.png");
  background-repeat: repeat;
  background-size: auto;
  background-position: center;
  padding-top: 240px; /* Compensate for fixed header (increased from 100px) */
  font-size: 1.125rem; /* Bigger body text (approx 18px) */
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--color-primary-green);
}

.contact-record {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.contact-icon {
  color: var(--color-white);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-details p {
  line-height: 1.2;
  margin-bottom: 2px;
}

.contact-links {
  margin-top: var(--spacing-md);
}

.contact-links a {
  color: var(--color-white);
  text-decoration: underline;
  font-weight: 600;
}

.contact-links a:hover {
  text-decoration: none;
  opacity: 0.8;
}

ul {
  list-style-position: inside;
}

/* Bürozeiten Custom Styles */
.hours-grid {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.hours-box {
  background-color: var(--color-white);
  color: var(--color-primary-green);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 4px solid #333; /* Dark border to match header buttons */
  flex: 1;
  min-width: 250px;
  filter: url(#brush-edge-3);
  text-align: center;
}

.hours-day {
  font-family: var(--font-family-heading);
  font-weight: 800;
  font-size: 1.125rem;
  margin-bottom: var(--spacing-xs);
}

.hours-time {
  font-weight: 600;
  font-size: 1.25rem;
}

.contact-info-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  font-weight: 600;
}

.contact-info-row a {
  color: var(--color-white);
  text-decoration: underline;
}

.info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  flex-shrink: 0;
}

/* ==================== Header ==================== */
.header {
  background-color: var(--color-white);
  padding: var(--spacing-sm) 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: padding 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header.shrunk {
  padding: 5px 0;
}

.header-container {
  max-width: 1200px; /* Explicitly 1200px to match green blocks */
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Top row with logo and hamburger */
.header-top {
  width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-logo {
  text-align: center;
}

.header-logo img {
  max-height: 120px;
  width: auto;
  border: none;
  transition: max-height 0.3s ease;
}

.header.shrunk .header-logo img {
  max-height: 72px; /* 40% smaller */
}

/* Call Button */
.call-button {
  position: absolute;
  right: calc(var(--spacing-md) + 50px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  background: transparent; /* Text sits on top */
  color: var(--color-white);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-family: var(--font-family-heading);
  font-weight: bold;
  font-size: var(--font-size-sm);
  text-decoration: none;
  z-index: 1001;
  /* Filter moved to ::before */
}

.call-button::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--color-primary-green);
  border: 3px solid #333;
  z-index: -1;
  filter: url(#brush-edge-2);
  transition: background-color var(--transition-speed), transform var(--transition-speed), box-shadow var(--transition-speed);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.call-button:hover::before {
  background-color: var(--color-dark-green);
  transform: scale(1.05); /* Scale the background/border only */
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.call-button:hover {
  /* No transform on parent to keep text sharp and avoid mobile layout jumps */
  color: var(--color-white);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2); /* Enhance readability */
}

.call-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media (max-width: 600px) {
  .call-button .call-number {
    display: none;
  }
  .call-button {
    padding: 10px;
    border-radius: 50%;
  }
}

/* Hamburger Menu */
.hamburger {
  position: absolute;
  right: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 1001;
}

.hamburger-line {
  display: block;
  width: 28px;
  height: 3px;
  background-color: #666;
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-origin: center;
  filter: url(#brush-edge);
}

/* Smooth hamburger to X animation */
.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background-color: var(--color-primary-green);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background-color: var(--color-primary-green);
}

/* Hover effect */
.hamburger:hover .hamburger-line {
  background-color: var(--color-primary-green);
}

.hamburger.active:hover .hamburger-line {
  background-color: var(--color-dark-green);
}

/* Navigation Pills Menu */
.nav-menu {
  width: 100%;
  padding-top: 0;
  z-index: 1000;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              padding-top 0.3s ease;
}

.nav-menu.active {
  max-height: 200px;
  opacity: 1;
  padding-top: var(--spacing-md);
}

/* Playful staggered animation for nav pills */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-20px);
  }
  50% {
    transform: scale(1.05) translateY(0);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.nav-menu.active .nav-pills li {
  animation: bounceIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  opacity: 0;
}

.nav-menu.active .nav-pills li:nth-child(1) { animation-delay: 0s; }
.nav-menu.active .nav-pills li:nth-child(2) { animation-delay: 0.05s; }
.nav-menu.active .nav-pills li:nth-child(3) { animation-delay: 0.1s; }
.nav-menu.active .nav-pills li:nth-child(4) { animation-delay: 0.15s; }
.nav-menu.active .nav-pills li:nth-child(5) { animation-delay: 0.2s; }
.nav-menu.active .nav-pills li:nth-child(6) { animation-delay: 0.25s; }

.nav-pills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.nav-pill {
  display: block;
  background: transparent;
  color: var(--color-white);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  transition: transform 0.2s;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  font-family: var(--font-family-heading);
  /* Border and Background moved to ::before */
}

.nav-pill::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--color-primary-green);
  border: 3px solid #333;
  border-radius: 0;
  z-index: -1;
  filter: url(#brush-edge);
  transition: background-color var(--transition-speed);
}

.initial-letter {
  font-weight: 900 !important;
  font-family: 'Inter', sans-serif; /* Ensuring it uses a font that supports 900 */
  display: inline-block;
}

/* .nav-pill:hover style removed to prevent text scaling */
.nav-pill:hover {
  color: var(--color-white);
  /* transform: scale(1.02); Removed to keep text sharp */
}

.nav-pill:hover::before {
  background-color: var(--color-dark-green);
  transform: scale(1.05); /* Scale background only */
}

/* ==================== Hero Section ==================== */
.hero {
  width: 100%;
  margin-bottom: var(--spacing-xl);
  padding: 0 var(--spacing-md);
}

.hero-container {
  position: relative;
  /* max-width: 95%; changed to 1200px */
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
  /* Remove direct filter and bg */
  background: transparent; 
  box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
  z-index: 1;
  border-radius: 5px;
  overflow: visible; /* Changed to visible to show the brush border */
}

/* Apply brush border via pseudo-element to match green blocks */
.hero-container::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: #888;
  z-index: -1;
  filter: url(#brush-edge);
  border-radius: 5px;
}

.hero-image-wrapper {
  overflow: hidden;
  border-radius: 5px;
  position: relative;
  z-index: 2;
}

.hero-container img {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  transition: transform 0.8s ease-out; /* Smooth zoom transition */
}

.hero-container:hover img {
  transform: scale(1.08); /* Zoom effect on hover */
}

.hero-text {
  position: absolute;
  bottom: 10%;
  left: 0;
  right: 0;
  width: 90%;
  margin: 0 auto;
  z-index: 3; /* Ensure it's above the hero image */
  opacity: 0;
  animation: heroSlideUp 0.8s ease-out 150ms forwards;
}

@keyframes heroSlideUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-text svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero-text svg text {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 24px;
  font-weight: bold;
  fill: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* ==================== Content Blocks ==================== */
.content-block {
  margin-bottom: var(--spacing-lg);
}

.green-block {
  background-color: var(--color-primary-green);
  padding: var(--spacing-xl) var(--spacing-lg);
  padding-top: var(--spacing-md);
  padding-left: var(--spacing-md);
  margin: var(--spacing-xl) auto;
  max-width: 1200px;
  width: 95%; /* Ensure side margins on all screens */
  position: relative;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
  overflow: visible;
  border-radius: 5px;
}

/* Plain grey border as pseudo-element so filter doesn't affect text */
.green-block::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: #888;
  z-index: -1;
  border-radius: 5px;
}

/* Varied brush-edge filters for each green block border */
.green-block:nth-of-type(1)::before {
  filter: url(#brush-edge);
}

.green-block:nth-of-type(2)::before {
  filter: url(#brush-edge-2);
}

.green-block:nth-of-type(3)::before {
  filter: url(#brush-edge-3);
}

.green-block:nth-of-type(4)::before {
  filter: url(#brush-edge-4);
}

.green-block:nth-of-type(5)::before {
  filter: url(#brush-edge-5);
}

.green-block:nth-of-type(6)::before {
  filter: url(#brush-edge-6);
}

.green-block:nth-of-type(7)::before {
  filter: url(#brush-edge);
}

.green-block:nth-of-type(8)::before {
  filter: url(#brush-edge-2);
}

.green-block:nth-of-type(9)::before {
  filter: url(#brush-edge-3);
}

.block-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Header row: image + title side by side */
.block-header {
  display: flex;
  align-items: flex-end; /* Align title to bottom */
  position: relative;
  z-index: 1;
  margin-bottom: 2rem; /* Add spacing below photo/title row */
}

.block-image {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  /* Position image flush in top-left corner, overlapping grey border */
  margin-top: 0; 
  margin-left: -15px; /* Base for desktop */
}

.block-image img {
  width: 525px; /* Reverted to original desktop size */
  max-width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

.block-title {
  margin-left: -50px;
  padding-bottom: 20px; /* Bottom padding for title */
  z-index: 2;
  flex-grow: 1;
}

.block-title h2 {
  font-size: 3rem; /* 2x Bigger than previous 2.5rem */
  margin-bottom: 0;
  line-height: 1.1;
  color: var(--color-white);
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.block-content {
  color: var(--color-white);
  padding: var(--spacing-md) var(--spacing-lg);
  padding-top: var(--spacing-sm);
}

.block-content h2 {
  display: none; /* Hide old h2 inside content if any remain */
}

.block-content p,
.block-content ul {
  margin-bottom: var(--spacing-sm);
}

.block-content ul {
  padding-left: var(--spacing-md);
}

.block-content li {
  margin-bottom: var(--spacing-xs);
}

.block-icons {
  display: flex;
  gap: var(--spacing-lg); /* Increased gap for larger icons */
  align-items: center;
  justify-content: flex-end;
  padding: 0 var(--spacing-md) var(--spacing-md);
}

.block-icons img {
  width: 128px !important;
  height: 128px !important;
  object-fit: contain;
  flex-shrink: 0 !important;
  max-width: none !important;
  /* transition: transform 0.1s ease-out; Removed for smooth JS parallax */
}

.team-intro {
  font-size: var(--font-size-md);
  margin-bottom: var(--spacing-md);
  font-weight: 600;
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.team-member {
  display: flex;
  gap: var(--spacing-md);
  align-items: center; /* Center text vertically with photo */
}

.team-member img {
  width: 250px; /* Bigger size (approx double previous 120px) */
  height: auto; /* Maintain original aspect ratio */
  flex-shrink: 0;
  border-radius: 0;
  border: 5px solid var(--color-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  object-fit: cover;
}

.team-member-info {
  flex: 1;
  color: var(--color-white);
}

.team-member-info h3 {
  font-size: 2.5rem; /* 2x bigger */
  margin-bottom: var(--spacing-xs);
  font-weight: bold;
}

.team-member-info p {
  font-size: var(--font-size-base);
  margin-bottom: var(--spacing-xs);
  line-height: 1.4;
}

.team-footer {
  font-size: var(--font-size-md);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
}

.team-member-info h3 {
  font-family: var(--font-family-heading);
  font-size: 2.5rem; /* 2x bigger */
  margin-bottom: var(--spacing-xs);
}

.team-names-header {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-md);
  color: var(--color-white);
  text-align: center;
}

.team-names {
  font-family: var(--font-family-heading);
  font-size: 2.5rem; /* 2x bigger */
  font-weight: 600;
  line-height: 1.5;
}

/* Team Names List Animation */
.team-names-list {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-white);
  text-align: center;
  margin-top: var(--spacing-md);
}

.team-names span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.team-names-list.visible span {
  opacity: 1;
  transform: translateY(0);
}

.team-names-list.visible span:nth-child(1) { transition-delay: 0.1s; }
.team-names-list.visible span:nth-child(2) { transition-delay: 0.15s; }
.team-names-list.visible span:nth-child(3) { transition-delay: 0.2s; }
.team-names-list.visible span:nth-child(4) { transition-delay: 0.25s; }
.team-names-list.visible span:nth-child(5) { transition-delay: 0.3s; }
.team-names-list.visible span:nth-child(6) { transition-delay: 0.35s; }
.team-names-list.visible span:nth-child(7) { transition-delay: 0.4s; }
.team-names-list.visible span:nth-child(8) { transition-delay: 0.45s; }
.team-names-list.visible span:nth-child(9) { transition-delay: 0.5s; }
.team-names-list.visible span:nth-child(10) { transition-delay: 0.55s; }
.team-names-list.visible span:nth-child(11) { transition-delay: 0.6s; }
.team-names-list.visible span:nth-child(12) { transition-delay: 0.65s; }
.team-names-list.visible span:nth-child(13) { transition-delay: 0.7s; }
.team-names-list.visible span:nth-child(14) { transition-delay: 0.75s; }

/* ==================== Footer ==================== */
.footer {
  background-color: var(--color-primary-green);
  color: var(--color-white);
  padding: var(--spacing-lg) var(--spacing-md);
  text-align: center;
  margin-top: var(--spacing-xl);
}

.footer-nav ul {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  list-style: none;
  margin-bottom: var(--spacing-md);
}

.footer-nav a {
  color: var(--color-white);
  font-weight: bold;
}

.footer p {
  font-size: var(--font-size-sm);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
  .block-image img {
    width: 420px; /* Intermediate size for tablet landscape */
  }
}

@media (max-width: 768px) {
  /* Header Layout: Logo Left, Phone + Hamburger Right */
  .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 0; /* Add reasonable padding */
  }

  /* Reset absolute positioning for elements in flex container */
  .header-logo {
    order: 1;
    margin-right: auto; /* Push everything else to right? Or let space-between handle it */
    flex-shrink: 0;
  }
  
  .call-button {
    order: 2;
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin-left: auto; /* Push to the right */
    margin-right: 15px; /* Space between phone and burger */
    z-index: 1002;
    /* Ensure text is visible if requested */
    width: auto;
  }
  
  .call-button span {
    display: inline-block; /* Ensure span is visible */
  }

  /* Reduce Hero top distance on mobile */
  .hero {
    margin-top: 0 !important; /* Reset to 0 since header is relative now */
    margin-bottom: var(--spacing-lg);
    padding-top: 0;
  }
  
  /* Increase Hero Text Size */
  .hero-text svg {
    transform: scale(1.1) !important; /* Slightly smaller scale to avoid overflow */
    transform-origin: center;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .hero-container {
      margin-top: 60px !important; 
      margin-left: 0 !important;
      margin-right: 0 !important;
      padding: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      left: 0 !important;
  }

  .hamburger {
    order: 3;
    display: flex;
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    flex-direction: column;
    gap: 6px; /* Increased gap from 5px to 6px */
    z-index: 1002;
  }
  
  /* Fix broken cross animation */
  .hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg); /* Adjusted for gap + height */
  }
  
  .hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
  }
  
  .hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg); /* Adjusted for gap + height */
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-primary-green);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }

  .nav.active {
    display: flex;
    max-height: 95vh; /* Maximize height for mobile */
    overflow-y: auto; /* Enable scrolling */
    padding-bottom: 100px; /* Large bottom padding to prevent cut-off */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }

  .nav ul {
    flex-direction: column;
    gap: 0;
  }

  .nav li {
    border-bottom: 1px solid var(--color-light-green);
  }

  .nav a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
  }

  /* Make menu items more compact on mobile */
  .nav-pills li {
    margin-bottom: 8px; /* Reduce gap between items */
  }

  .nav-pill {
    padding: 10px 15px; /* Smaller padding */
    font-size: 14px; /* Slightly smaller font */
    min-height: auto; /* Allow height to shrink */
  }

  .block-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  
  .block-header {
    flex-direction: column;
    align-items: center;
  }

  .block-image {
    grid-column: 1;
    grid-row: 1;
    margin-left: 0; /* Remove negative margin */
    margin-bottom: var(--spacing-md);
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .block-image img {
    width: 80%; /* Fluid width for smaller screens */
    max-width: 400px;
  }
  
  .block-title {
    margin-left: 0; /* Reset negative margin */
    margin-top: var(--spacing-sm);
    text-align: center;
    padding-bottom: 0;
    width: 100%;
  }

  .block-content {
    grid-column: 1;
    grid-row: 2;
  }

  .block-icons {
    grid-column: 1;
    grid-row: 3;
  }

  .team-member {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .team-member img {
    width: 100px; /* Reverted to small size for tablet */
    height: auto;
  }

  .footer-nav ul {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}

@media (max-width: 768px) {
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  :root {
    --font-size-base: 14px;
    --font-size-xl: 24px;
    --font-size-xxl: 32px;
  }

  .header-container {
    padding: 0 var(--spacing-sm);
  }

  /* 3. Green Block Padding: Reduce inner left/right padding */
  .green-block {
    padding: var(--spacing-md) 10px !important;
    border-width: 6px;
    margin: calc(var(--spacing-xl) + 10px) 0 !important; /* Remove side margins if they cause overflow, or use padding */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Ensure all block images are responsive and don't force width */
  .block-image img, 
  .green-block img,
  .hero-container img {
    max-width: 100% !important;
    height: auto !important;
    width: 100% !important; /* Force width to fit container */
    display: block;
    margin: 0 !important;
  }

  /* Prevent negative edge overflow from grey borders on narrow screens */
  .green-block::before, .hero-container::before {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
  }

  /* Remove map overlap on mobile */
  .overlap-wrapper {
    margin-bottom: 0px !important; 
    position: relative;
    z-index: 10;
  }
  
  #kontakt {
     margin-bottom: 20px; /* Space before map */
  }

  /* 1. Mobile Icons: Reduce size and align right */
  .block-icons {
    justify-content: flex-end; /* Align right as requested */
    gap: var(--spacing-sm);
  }
  
  .block-icons img {
    width: 80px !important; /* Increased to 80px as requested */
    height: 80px !important;
    max-width: 80px !important; /* Force max width */
    object-fit: contain;
  }

  /* 4. Hero H1: Bigger on smallest screens */
  .hero-container h1, .block-title h2 { /* Targeting main headings */
    font-size: 2.2rem !important; /* Increase readability */
  }

  /* 5. Header Height: Ensure it's not fixed on mobile to prevent overlap */
  .header {
    padding: var(--spacing-sm) 0;
    position: relative !important; /* Force relative so it pushes content down */
    height: auto !important;
  }

  /* Fix body padding on mobile since header is relative */
  body {
    padding-top: 0 !important;
  }
  
  .header-container {
    padding: 0 var(--spacing-sm);
  }
  
  /* Force Kontakt to be first in the mobile menu */
  .nav-pills {
    display: flex;
    flex-direction: column;
    padding-bottom: 50px; /* Space for scrolling */
  }
  
  .nav-item-kontakt {
    order: -9999 !important; /* Force first position */
  }
  
  .nav-pills li:first-child {
    /* No longer relying on first-child selector */
  }
  .nav-menu.active {
    max-height: 100vh !important; /* Override global 200px limit */
    height: auto !important;
    overflow-y: scroll !important;
    padding-bottom: 100px;
    background-color: var(--color-white); /* Ensure background is solid */
  }
  
  .nav-pills li:first-child {
      order: unset; 
  }
  
  .call-button span {
     display: none !important; /* Hide number completely on mobile */
  }

  .call-button::after {
    content: "Anrufen";
    display: inline-block;
    font-size: 16px;
    font-weight: bold;
    margin-left: 5px;
    color: var(--color-white);
  }

  /* 6. Kontakt Page: Maximize horizontal space */
  .contact-form {
    padding: var(--spacing-md) 10px; /* Reduce padding inside form */
    margin-right: -5px; /* Negative margin to pull to edge? No, just utilize width */
    width: 100%;
    box-sizing: border-box;
  }
  
  .form-group input, .form-group textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  /* TEAM SECTION REFACTOR: Left Photo (Big), Right Text (Vertical Flex) */
  .team-member {
    flex-direction: row; /* Side by side */
    align-items: flex-start;
    text-align: left;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }
  
  .team-member {
    flex-direction: column !important; /* Stack vertically on small screens */
    align-items: center !important;
    text-align: center !important;
    gap: 15px !important;
  }

  .team-member img {
    width: 200px !important; /* Smaller photo for stacking */
    min-width: 0 !important;
    height: auto !important;
    max-width: 80% !important;
  }
  
  .team-member:last-child {
    border-bottom: none;
  }
  
  .team-member img {
    /* Specific dimensions: 160px W x 250px H (-400px height requested, so 300-50=250px) */
    width: 160px !important; 
    min-width: 160px !important; /* Force width within flexbox */
    height: 250px !important;
    flex-shrink: 0 !important; /* Prevent shrinking */
    object-fit: cover;
    border: 3px solid var(--color-white);
  }
  
  .team-member-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .team-member-info h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    line-height: 1.2;
  }
  
  .team-member-info p {
    font-size: 0.9rem;
    line-height: 1.3;
  }

  /* Adjust block image centering from previous step */
  .block-image {
    margin-bottom: var(--spacing-sm);
  }
}
.single-column {
  grid-template-columns: 1fr !important;
}

.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.contact-info-item {
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
}
/* Contact Info Grid Items - Hand-Drawn Tile Style */
.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.contact-info-item {
  background-color: var(--color-white); /* White background */
  padding: var(--spacing-md);
  position: relative;
  /* Brush border style */
  border: 4px solid #888;
  filter: url(#brush-edge);
  margin-bottom: var(--spacing-md); /* Gap for stacking */
  color: var(--color-primary-green); /* Green text */
}

.contact-info-item h3 {
  color: var(--color-primary-green);
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-lg);
  border-bottom: 2px solid var(--color-primary-green);
}

.contact-info-item p {
  margin-bottom: 0.5rem;
}

.contact-info-item p:last-child {
  margin-bottom: 0;
}

.contact-form {
  margin-top: var(--spacing-md);
  max-width: 700px;
  background-color: var(--color-white); /* White background */
  padding: var(--spacing-lg);
  border: 4px solid #888;
  filter: url(#brush-edge);
  color: #333; /* Dark text instead of green for better readability */
}

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: bold;
  color: var(--color-dark-green); /* Darker green for readability */
}

.required {
  color: #ff6b6b;
}

.form-group input[type="email"],
.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  border: 2px solid #ccc; /* Higher contrast border */
  border-radius: 0; /* Sharp edges */
  background: #ffffff; /* White background for max contrast */
  color: #333; /* Dark text */
  transition: all var(--transition-speed);
}

.form-group input[type="email"]:focus,
.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-dark-green);
  background: var(--color-white);
  box-shadow: 0 0 0 3px rgba(123, 192, 67, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.input-error {
  border-color: #ff6b6b !important;
  background: #fff5f5 !important;
}

.error-message {
  display: block;
  color: #ff6b6b;
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
  font-weight: 500;
}

.checkbox-group {
  margin-bottom: var(--spacing-md);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-dark-green);
}

.checkbox-label span {
  flex: 1;
  line-height: 1.5;
}

.checkbox-label a {
  color: var(--color-dark-green); /* Dark green instead of white */
  text-decoration: underline;
  transition: opacity var(--transition-speed);
}

.checkbox-label a:hover {
  opacity: 0.8;
}

.submit-btn {
  background: var(--color-dark-green);
  color: var(--color-white);
  padding: 14px 32px;
  font-size: var(--font-size-md);
  font-weight: bold;
  cursor: pointer;
  transition: all var(--transition-speed);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* Hand-drawn style */
  border-radius: 0;
  border: 4px solid #888;
  filter: url(#brush-edge);
}

.submit-btn:hover {
  background: var(--color-primary-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-message {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  font-weight: 500;
  text-align: center;
  display: none;
}

.form-message.success {
  background: rgba(123, 192, 67, 0.2);
  border: 2px solid var(--color-primary-green);
  color: var(--color-white);
  display: block;
}

.form-message.error {
  background: rgba(255, 107, 107, 0.2);
  border: 2px solid #ff6b6b;
  color: #ff6b6b;
  display: block;
}

/* Map Section - Full Width, No Margins */
.map-section {
  width: 100%;
  height: 650px; /* Increased to 650px as requested */
  padding: 0;
  margin: 0;
  line-height: 0; /* Remove potential bottom space */
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.map-section iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Form responsive adjustments */
@media (max-width: 480px) {
  .contact-form {
    max-width: 100%;
  }

  .submit-btn {
    width: 100%;
  }
}

/* Remove footer margin if map is visible */
.map-section + .footer {
  margin-top: 0;
}

/* Overlap last card over map */
/* Wrapper for the last block to overlap the map */
.overlap-wrapper {
  margin-bottom: -130px; /* Force overlap */
  z-index: 10;
  position: relative;
}

/* Specific adjustment to ensure the overlap is visible and not just a gap reduction */
.map-section {
  margin-top: 0; 
  position: relative;
  z-index: 1;
}

/* ==================== Footer ==================== */
.footer {
  background-color: var(--color-primary-green);
  padding: var(--spacing-xl) 0 var(--spacing-md);
  color: var(--color-white);
  text-align: center;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-lg) 0;
  flex-wrap: wrap;
}

.footer-nav li {
  margin: 0;
}

/* Footer Specific Nav Pills */
/* Footer Specific Nav Pills */
.footer .nav-pill {
  background: transparent !important; /* Remove background on parent */
  color: var(--color-black) !important; /* Text color */
  border: none !important; /* Remove border on parent */
  border-radius: 4px;
  padding: 10px 20px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  transition: transform 0.2s ease;
  filter: none !important; /* Remove filter on parent to avoid double effect */
}

.footer .nav-pill::before {
  background-color: var(--color-white) !important;
  border: 2px solid var(--color-black) !important; /* Thinner single border */
  border-radius: 4px;
}

.footer .nav-pill:hover {
  transform: scale(1.05);
  /* background handled in ::before */
}

.footer .nav-pill:hover::before {
  background-color: #e0e0e0 !important; /* Slight shade on hover */
}

.footer-bottom {
  text-align: center;
  font-size: 0.875rem;
  width: 100%;
}

.footer-bottom p {
  margin: 5px 0;
}

.footer-credit {
  margin-top: 15px;
  font-size: 0.8rem;
}

.footer-credit a {
  color: var(--color-white);
  text-decoration: underline;
  font-weight: bold;
}

.footer-credit a:hover {
  opacity: 0.8;
}
