/* Business Blue Theme */
:root {
  --primary-blue: #005b96; /* Main business blue */
  --secondary-blue: #03396c; /* Darker blue for contrast */
  --light-blue: #b3cde0; /* Light blue for backgrounds */
  --text-dark: #333333; /* Dark text for readability */
  --text-light: #ffffff; /* White text for dark backgrounds */
  --main-transparent: rgba(0, 91, 150, 0.8); /* Transparent blue */
  --secondary: #d3d3d3; /* Light gray for menu links */
  --secondary-hover: #ff9900; /* Orange for hover */
}

@font-face {
  font-family: "bootstrap-icons";
  src: url("/fonts/bootstrap-icons.woff2?dd67030...") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: 'copperplate'; /* Match Adobe's font-family name */
  src: url('https://use.typekit.net/.../font-file.woff2'); /* Copy from Adobe's CSS */
  font-display: swap;
}

h1, h2, h3, h4, h5 {
  font-family: "copperplate", serif;
  font-weight: 500;
  font-style: normal;
}

/* Map Bootstrap's text colors to custom theme */
.text-primary {
  color: var(--primary-blue) !important;
}

.text-secondary {
  color: var(--secondary-blue) !important;
}

.text-dark {
  color: var(--text-dark) !important;
}

body {
  font-family: 'Lato', Helvetica, sans-serif;
  color: var(--text-dark);
  margin: 0; /* Prevent default margins */
}

.bg-primary-blue {
  background-color: var(--primary-blue);
  color: var(--text-light);
}

.bg-secondary-blue {
  background-color: var(--secondary-blue);
  color: var(--text-light);
}

.bg-light-blue {
  background-color: var(--light-blue);
}

.btn-primary {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.btn-primary:hover {
  background-color: var(--secondary-blue);
  border-color: var(--secondary-blue);
}

/* Footer Styles */
footer h5 {
  color: #F8F9F1;
}

.footer-link {
  color: #F8F9F1;
  text-decoration: none !important;
  transition: color 0.2s ease-in-out, text-decoration 0.2s ease-in-out;
}

.footer-link:hover {
  color: var(--light-blue);
  text-decoration: underline !important;
}

/* Homepage Background Styles */
.background-image {
  z-index: -999998;
}

.background-image img {
  z-index: -999999;
}

/* Homepage Title Styles */
.emshouse-title {
  font-size: 6rem; /* Double the default h1 size (2.5rem * 2) */
  color: #ffffff; /* White */
  transition: color 0.2s ease-in-out; /* Smooth color transition on hover */
  cursor: pointer; /* Add hand cursor */
  position: absolute; /* Ensure positioning context */
  transform: translate(-50%, -50%); /* Center horizontally and vertically */
  margin-top: -150px; /* Shift further upward on desktop */
}

.emshouse-title:hover {
  color: var(--primary-blue);
}

/* Responsive adjustments for emshouse-title */
@media (max-width: 767px) {
  .emshouse-title {
    font-size: 3rem; /* Smaller on mobile */
    margin-top: -250px; /* Match desktop's upward shift */
  }
}

/* Custom Z-Index Utility */
.z-100 {
  z-index: 100 !important;
}

/* Menu Styles */
.menu-overlay {
  display: none !important; /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1050; /* Above other content */
  background: rgba(0, 0, 0, 0.5); /* Slight backdrop */
}

.menu-overlay.open {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease-in-out;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: center; /* Center the Emshouse text */
  padding: 0; /* Remove padding to ensure full width */
  position: relative; /* Allow absolute positioning of close button */
  background: transparent; /* Transparent on all views */
  border-bottom: 1px solid #ffffff; /* Add 1px white border at the bottom */
}

.emshouse-header {
  font-family: "copperplate", serif;
  font-weight: 500;
  font-style: normal;
  font-size: 2rem;
  color: #ffffff; /* White */
  padding-top: 22px; /* Move Emshouse lower */
  padding-bottom: 10px; /* Ensure consistent height */
}

.close-menu {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.close-menu i {
  pointer-events: none;
}

.menu-items {
  flex-direction: row; /* Default to horizontal on desktop */
}

.menu-item {
  background: var(--main-transparent); /* rgba(0, 91, 150, 0.8) */
  transition: background-color 0.3s ease-in-out, opacity 0.5s;
  opacity: 0.4;
  width: 33.3333%; /* Enforce equal widths on desktop */
}

.menu-overlay.open .menu-item {
  opacity: 1;
}

.menu-item:hover {
  background: rgba(0, 91, 150, 0.2); /* Same color as unhovered but more transparent */
}

.menu-item a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #ffffff; /* White text */
  text-decoration: none;
  font-family: "copperplate", serif;
  font-weight: 500;
  font-style: normal;
  font-size: 54px;
  line-height: 1;
  height: 100%;
  width: 100%;
  transition: color 0.2s;
}

.menu-item a:hover,
.menu-item a:focus {
  color: #ffffff; /* White on hover */
}

.menu-footer {
  background: var(--main-transparent); /* Same transparent blue as menu items */
  z-index: 1; /* Above the overlay background */
}

/* Responsive Menu Styles */
@media (max-width: 767px) {
  .menu-items {
    flex-direction: column; /* Vertical on mobile */
    position: absolute;
    top: 0%; /* Start at the top */
    left: 0;
    height: auto; /* Let the height be determined by children */
  }

  .menu-item {
    height: 5vh; /* Use viewport height to ensure consistency */
    min-height: 0; /* Prevent flexbox from expanding */
    width: 100%; /* Full width on mobile */
    flex: none;
  }

  .menu-item a {
    font-size: 16px; /* Further reduced to fit smaller height */
    line-height: 1; /* Match font-size to prevent extra height */
  }

  .close-menu i {
    font-size: 40px;
  }

  .emshouse-header {
    font-size: 1.5rem; /* Smaller font size on mobile */
    width: 100%; /* Full width to match menu items */
    text-align: center; /* Ensure text is centered */
    background: var(--main-transparent); /* Add background to Emshouse header */
  }

  .menu-footer {
    display: block; /* Show on mobile */
    top: calc(0% + 15vh); /* Start after menu-items (0% + 3 * 5vh) */
    height: calc(100% - 15vh); /* Fill remaining space */
  }

  .open-menu {
  z-index: 10; /* Ensures button is above any potential overlays */
  position: relative; /* Establishes stacking context */
}
}

@media (min-width: 700px) and (max-width: 767px) {
  .close-menu i {
    font-size: 50px;
    margin-top: 5px;
  }
}

@media (max-width: 1335px) {
  .menu-item a {
    font-size: 32px;
  }
}

/* Stats Section */
.stats-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--light-blue) 0%, #d0e0ec 100%); /* Subtle gradient */
}

.stats-section .container {
  position: relative;
  z-index: 1;
}

.stat-item {
  position: relative; /* Needed for absolute positioning of the circle */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  padding: 2rem 1rem; /* Add padding to ensure the circle fits */
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px; /* Size of the circle */
  height: 150px;
  background: rgba(255, 255, 255, 0.15); /* Subtle white with opacity */
  border-radius: 50%;
  z-index: -1; /* Behind the content */
}

.stat-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.stat-icon {
  font-size: 3rem;
  color: var(--primary-blue);
  margin-bottom: 1rem;
  display: block;
  position: relative;
  z-index: 1; /* Ensure icon is above the circle */
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary-blue);
  margin-bottom: 0.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1; /* Ensure number is above the circle */
}

.stat-label {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  z-index: 1; /* Ensure label is above the circle */
}

/* Add border-top and inset shadow to the contact section */
.contact-section-shadow {
  border-top: 3px solid var(--primary-blue);
  box-shadow: inset 0px -10px 15px -10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 767px) {
  .stat-item {
    margin-bottom: 2rem;
  }

  .stat-item::before {
    width: 120px; /* Smaller circle on mobile */
    height: 120px;
  }

  .stat-icon {
    font-size: 2.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 1rem;
  }
}

/* Shared Gradient Background for Sections */
.gradient-section {
  position: relative;
  background: linear-gradient(135deg, var(--light-blue) 0%, #d0e0ec 100%); /* Matches stats-section */
}

/* Impressum and Datenschutz Shared Styles */
.impressum-section,
.datenschutz-section {
  position: relative;
}

.custom-link {
  color: var(--primary-blue);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.custom-link:hover {
  color: var(--secondary-blue);
  text-decoration: underline;
}

/* Custom Typography Adjustments (Minimal) */
.page-subtitle {
  font-size: 1.5rem;
  font-weight: 500;
}

@media (max-width: 767px) {
  .page-subtitle {
    font-size: 1.3rem;
  }
}

/* Hover effect for devices that support hover */
@media (hover: hover) and (pointer: fine) {
  .card:hover .secondary-image {
    opacity: 1 !important;
  }
  .card:hover .primary-image {
    opacity: 0 !important;
  }
}

.close-menu {
  margin-right: 20px;;
}