/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #2d7a5e;
  color: white !important;
  padding: 8px;
  z-index: 2000;
  transition: top 0.3s;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 3px solid #2d7a5e;
  outline-offset: 2px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 300; /* Lighter font weight for body text */
  line-height: 1.8; /* Increased for better horizontal scanning */
  color: #2d7a5e; /* Darkened for accessibility (WCAG AA) */
  background-color: #fff;
  -webkit-font-smoothing: antialiased; /* Sharper rendering for light weights */
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Navigation */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 60px; /* Ensure minimum height for proper centering */
}

.logo a {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.5rem;
  font-weight: 300; /* Lighter weight for logo */
  color: #2d7a5e; /* Darkened for accessibility */
  text-decoration: none;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  list-style: none;
  flex: 1; /* Take up available space */
  margin: 0; /* Remove all margins */
  margin-left: 30px; /* Add some space between logo and links */
  padding: 0; /* Remove all padding */
  justify-content: flex-end; /* Align links to the right */
  align-items: center; /* Vertically center the nav items */
}

.nav-links li {
  margin: 0; /* Remove all margins */
  padding: 0; /* Remove all padding */
  margin-left: 30px; /* Only left margin for spacing between items */
}

.nav-links a {
  color: #2d7a5e; /* Darkened for accessibility */
  text-decoration: none;
  font-weight: 300; /* Lighter weight for navigation */
  position: relative;
  padding: 0; /* Remove padding */
  display: inline-block; /* Ensure proper alignment */
}

/* Subtle hover effect with underline animation */
.nav-links a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px; /* Slightly below the text */
  left: 0;
  background-color: #2d7a5e;
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  background: none;
  border: none;
  padding: 15px; /* Increased hit area for mobile */
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

.bar {
  width: 25px;
  height: 2px; /* Thinner bars for hamburger menu */
  background-color: #2d7a5e; /* Darkened for accessibility */
  margin: 3px 0;
  transition: 0.4s;
}

/* Hamburger to X animation */
.bar.change:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.bar.change:nth-child(2) {
  opacity: 0;
}

.bar.change:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 60px;
}

.hero h1 {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 3rem;
  margin-bottom: 10px;
  font-weight: 300; /* Lighter weight for main heading */
  letter-spacing: 1px; /* Added letter spacing for elegance */
  color: #2d7a5e; /* Darkened for accessibility */
}

.subtitle {
  font-size: 1.5rem;
  color: #2d7a5e; /* Darkened for accessibility */
  margin-bottom: 30px;
  font-weight: 300; /* Lighter weight for subtitle */
  font-style: italic;
}

.profile-image-container {
  margin: 30px auto;
}

.profile-image {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto;
  border: 3px solid #f5f5f5; /* Thinner border */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

/* Sections */
.section {
  padding: clamp(60px, 10vh, 100px) 0; /* Fluid padding based on screen size */
  min-height: 50vh;
}

/* Alternating section backgrounds for visual hierarchy */
section:nth-of-type(even) {
  background-color: rgba(45, 122, 94, 0.02); /* 2% opacity of brand green */
}

h2 {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.2rem); /* Fluid font size */
  margin-bottom: 2.5rem; /* Increased space after titles */
  position: relative;
  padding-bottom: 10px;
  font-weight: 300; /* Lighter weight for section headings */
  letter-spacing: 0.5px;
  color: #2d7a5e; /* Darkened for accessibility */
  /* Add word breaking for long German words */
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

h2:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 1px; /* Thinner underline */
  background-color: #2d7a5e;
}

h3 {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.5rem;
  margin: 3.5rem 0 1.25rem; /* Increased top margin to group content clearly */
  font-weight: 300; /* Lighter weight for subheadings */
  color: #2d7a5e; /* Darkened for accessibility */
}

/* Heading hierarchy fix styles */
.h2-style {
  font-size: 2.2rem;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  color: #2d7a5e;
  margin-bottom: 30px;
}

.h3-style {
  font-size: 1.5rem;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  color: #2d7a5e;
  margin: 25px 0 15px;
}

.h4-style {
  font-size: 1.2rem;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  color: #2d7a5e;
  margin: 20px 0 10px;
}

p {
  margin-bottom: 1.5rem;
  font-weight: 300; /* Ensure paragraphs are light */
  color: #2d7a5e; /* Darkened for accessibility */
  max-width: 72ch; /* The optimal line length for the human eye */
}

/* Creating visual paragraphs from <br> tags without changing HTML */
.section p br {
  display: block;
  content: "";
  margin-top: 1.2rem;
}

ul {
  margin-left: 20px;
  margin-bottom: 20px;
  max-width: 72ch;
}

li {
  margin-bottom: 10px;
  font-weight: 300; /* Lighter weight for list items */
  color: #2d7a5e; /* Darkened for accessibility */
}

/* Strong text styling */
strong {
  color: #2d7a5e; /* Darkened for accessibility */
}

/* Global link styling for legal pages and content */
a {
  color: #2d7a5e; /* Unvisited links - darkened for accessibility */
  text-decoration: underline;
  transition: color 0.3s ease;
}

a:visited {
  color: #215c47; /* Visited links - slightly darker green */
}

a:hover {
  color: #3e9e7c; /* Hover state - lighter, brighter green */
}

a:active {
  color: #1a4a39; /* Active state - darker green */
}

/* Buttons with subtle hover effect */
.btn {
  display: inline-block;
  background-color: #2d7a5e;
  color: white !important; /* Force white text color for buttons */
  padding: 12px 25px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 400; /* Slightly heavier for buttons to ensure readability */
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

/* Override link states for buttons to always use white */
.btn:visited,
.btn:hover,
.btn:active {
  color: white !important;
}

.btn:before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.btn:hover:before {
  left: 100%;
}

/* Contact Form */
.contact-info {
  margin-bottom: 30px;
}

.contact-info a {
  color: #2d7a5e; /* Changed to green */
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 400; /* Slightly heavier for form labels */
  color: #2d7a5e; /* Changed to green */
}

input,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  font-weight: 300; /* Lighter weight for form inputs */
  transition: border-color 0.3s ease;
  color: #2d7a5e; /* Changed to green */
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #2d7a5e;
}

.checkbox {
  display: flex;
  align-items: flex-start;
}

.checkbox input {
  width: auto;
  margin-right: 10px;
  margin-top: 5px;
}

/* Footer */
footer {
  background-color: #f5f5f5;
  padding: 30px 0;
  text-align: center;
}

footer p {
  color: #2d7a5e;
  margin: 0 auto;
}

.footer-links {
  margin-bottom: 15px;
}

.footer-links a {
  color: #2d7a5e; /* Changed to green */
  text-decoration: none;
  margin: 0 10px;
  position: relative;
  font-weight: 300; /* Lighter weight for footer links */
}

.footer-links a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: #2d7a5e;
  transition: width 0.3s ease;
}

.footer-links a:hover::after {
  width: 100%;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  padding: 15px;
  z-index: 1000;
  display: block;
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.cookie-banner.show {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.cookie-content h3 {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin-top: 0;
  font-weight: 300; /* Lighter weight for cookie banner heading */
  color: #2d7a5e; /* Changed to green */
}

.cookie-content p {
  color: #2d7a5e; /* Changed to green */
}

.cookie-buttons {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cookie-buttons button {
  padding: 12px 20px; /* Increased touch target */
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 400; /* Slightly heavier for buttons */
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: all 0.3s ease;
  min-height: 44px;
}

#accept-cookies {
  background-color: #438c71;
  color: white;
  padding: 12px 30px;
  font-size: 1rem;
}

#accept-cookies:hover {
  background-color: #36735d;
}

#accept-all {
  background-color: #2d7a5e;
  color: white;
}

#accept-all:hover {
  background-color: #215c47;
}

#accept-necessary {
  background-color: #f5f5f5;
  color: #2d7a5e; /* Changed to green */
}

#accept-necessary:hover {
  background-color: #e5e5e5;
}

#cookie-settings-btn {
  background-color: transparent;
  color: #2d7a5e;
  text-decoration: underline;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  position: absolute;
  top: 5px;
  right: 5px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  color: #2d7a5e; /* Changed to green */
}

.close-btn:hover {
  transform: rotate(90deg);
}

/* Cookie Settings Modal */
.cookie-settings {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1001;
  align-items: center;
  justify-content: center;
}

.settings-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.settings-content h3 {
  color: #2d7a5e; /* Changed to green */
}

.cookie-option {
  margin-bottom: 20px;
}

.cookie-option label {
  font-weight: 400; /* Slightly heavier for option labels */
  display: inline;
  margin-left: 10px;
  color: #2d7a5e; /* Changed to green */
}

.cookie-option p {
  margin-top: 5px;
  margin-left: 30px;
  font-size: 0.9rem;
  color: #2d7a5e; /* Changed to green */
}

.settings-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

#save-settings {
  background-color: #2d7a5e;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 400;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Legal Section and Typography */
.legal-section {
  padding-top: 100px;
}

.legal-section h2 {
  margin-top: 40px;
}

.legal-section h3 {
  margin-top: 30px;
}

/* Index and Glossary for Generated Content */
.index, .glossary, .m-elements {
  list-style: none;
  margin-left: 0;
  margin-bottom: 30px;
}

.index li, .glossary li, .m-elements li {
  margin-bottom: 15px;
  padding-left: 0;
}

.index-link {
  text-decoration: none;
  color: #2d7a5e;
  font-weight: 400;
}

.index-link:hover {
  text-decoration: underline;
}

.glossary li strong, .m-elements li strong {
  display: block;
  margin-bottom: 5px;
}

.seal {
  margin-top: 50px;
  font-size: 0.8rem;
  opacity: 0.8;
}

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

.legal-section h1 {
  /* Add word breaking for h1 on legal pages to prevent overflow */
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 2.2rem;
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 10px;
  font-weight: 300;
  letter-spacing: 0.5px;
  color: #2d7a5e;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.legal-section h1:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 1px;
  background-color: #2d7a5e;
}

/* Added padding-top to legal page h1 titles to prevent navbar overlap */
.legal-page-title {
  padding-top: 80px;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed; /* Changed from absolute to fixed to fill entire viewport */
    top: 60px; /* Position below the navbar */
    left: 0;
    right: 0;
    width: 100vw; /* Full viewport width */
    height: calc(100vh - 60px); /* Fill remaining viewport height below navbar */
    background-color: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center menu items vertically */
    padding: 0; /* Remove padding to allow proper centering */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 999;
  }

  .nav-links.active {
    display: flex;
    margin-left: 0;
  }

  .nav-links li {
    margin: 20px 0; /* Consistent vertical spacing */
    margin-left: 0;
    text-align: center; /* Center text within list items */
    width: 100%; /* Full width for better touch targets */
  }

  .nav-links a {
    font-size: 1.2rem;
    padding: 15px 20px; /* Increased for touch target */
    display: block; /* Make links full width of their container */
    text-align: center; /* Center text */
    min-height: 44px;
  }

  /* Ensure nav container has same horizontal padding as content container */
  .nav-container {
    padding: 0 24px;
  }

  .container {
    padding: 0 24px;
  }

  /* Left-align logo on mobile */
  .logo a {
    text-align: left;
  }

  /* Left-align all section content on mobile */
  .section {
    padding: 30px 0;
    text-align: left;
  }

  .section h2,
  .section h3,
  .section p,
  .section ul,
  .section li {
    text-align: left;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .subtitle {
    font-size: 1.2rem;
  }

  .profile-image {
    width: 200px;
    height: 200px;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 15px;
  }

  h2 {
    font-size: 1.8rem;
  }

  .cookie-buttons {
    flex-direction: column;
  }

  /* Left-align footer content and stack links vertically on mobile */
  footer {
    text-align: left;
  }

  footer p {
    text-align: left;
  }

  /* Stack footer links vertically on mobile with proper spacing */
  .footer-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    text-align: left;
  }

  .footer-links a {
    margin: 0;
    text-align: left;
  }

  /* Hide the pipe separator on mobile */
  .footer-links a::before {
    display: none;
  }
}

/* Small screen optimizations */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .container {
    padding: 0 20px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
