/* 
 * Jochen Benz Website - Main Stylesheet
 * Simplified design with white and blue color scheme
 */

:root {
  --primary-color: #0056a6; /* Professional medium blue */
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --medium-gray: #e9ecef;
  --dark-gray: #343a40;
  --text-color: #212529;
  --shadow: rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

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

html {
  overflow-y: scroll; /* Ensure html element allows scrolling */
}

body {
  font-family: 'Open Sans', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--white);
  overflow-x: hidden; /* Prevent horizontal scrollbars */
  /* Ensure body can scroll vertically if content overflows */
  overflow-y: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

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

a:hover {
  color: #004080; /* Darker blue on hover */
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  background-color: var(--white);
  box-shadow: 0 2px 10px var(--shadow);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  min-height: 140px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 120px;
  margin-right: 1rem;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--primary-color);
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
  border: 2px solid var(--primary-color);
}

.btn-primary:hover {
  background-color: #004080;
  border-color: #004080;
  color: var(--white);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

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

/* Hero Section */
.hero {
  padding: 12rem 0 4rem;
  background-color: var(--light-gray);
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

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

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Main Content Sections */
section {
  padding: 4rem 0;
}

section:nth-child(even) {
  background-color: var(--light-gray);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--dark-gray);
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.service-card {
  background-color: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px var(--shadow);
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px var(--shadow);
}

.service-content {
  padding: 1.5rem;
}

.service-content h3 {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.service-content h3 i {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

.service-content ul {
  margin-top: 1rem;
  padding-left: 1.5rem;
}

.service-content ul li {
  margin-bottom: 0.5rem;
}

/* About Grid */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  align-items: center;
}

.about-image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 5px 15px var(--shadow);
}

.about-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

/* Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
}

.contact-info h3 {
  margin-bottom: 1.5rem;
}

.info-item {
  display: flex;
  margin-bottom: 1.5rem;
}

.info-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-right: 1rem;
}

.info-content h4 {
  margin-bottom: 0.25rem;
}

.contact-form-container h3 {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

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

.checkbox-group input {
  width: auto;
  margin-right: 0.5rem;
  margin-top: 0.25rem;
}

.checkbox-group label {
  margin-bottom: 0;
  font-weight: 400;
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-about p {
  margin-bottom: 1.5rem;
}

.footer-links h4,
.footer-contact h4 {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 0.5rem;
}

.footer-links ul li a {
  color: var(--white);
  opacity: 0.8;
}

.footer-links ul li a:hover {
  opacity: 1;
}

.footer-contact address {
  font-style: normal;
}

.footer-contact address p {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.footer-contact address p i {
  margin-right: 0.5rem;
}

.footer-contact address p a {
  color: var(--white);
  opacity: 0.8;
}

.footer-contact address p a:hover {
  opacity: 1;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  color: var(--white);
  font-size: 1.25rem;
  opacity: 0.8;
}

.footer-social a:hover {
  opacity: 1;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-legal p {
  margin-bottom: 0;
}

.footer-legal a {
  color: var(--white);
  opacity: 0.8;
}

.footer-legal a:hover {
  opacity: 1;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .hero {
    padding: 9rem 0 3rem; /* Increased top padding */
  }
  
  .hero h1 {
    font-size: 2.25rem;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  nav {
    position: fixed;
    top: 100px; /* Adjusted to match mobile header height */
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 5px 10px var(--shadow);
    padding: 1rem 0;
    transform: translateY(-150%); /* Increased to ensure it's fully hidden initially */
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999; /* Ensure it appears above other content */
  }
  
  nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  nav ul {
    flex-direction: column;
    align-items: center;
  }
  
  nav ul li {
    margin: 0.5rem 0;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-buttons .btn {
    width: 100%;
    max-width: 300px;
    margin-bottom: 1rem;
  }
  
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .about-image {
    margin-bottom: 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-social,
  .footer-legal {
    justify-content: center;
    margin-bottom: 1rem;
  }
}

@media (max-width: 576px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .section-header h2 {
    font-size: 1.75rem;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* Add to existing CSS file */
h1, h2, h3, h4, h5, h6 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.4;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 2.5rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-top: 1.5rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    margin-top: 0;
}

.hero-content h1, .hero-content p {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.service-content h3, .about-content h2 {
    text-align: left;
}

.footer-links h4, .footer-contact h4 {
    text-align: left;
    margin-bottom: 1rem;
}

/* Improve text readability over images */
.hero, .appointment {
    position: relative;
}

.hero-content, .appointment-content {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 2rem;
    border-radius: 8px;
}

/* Add white background to text sections for better readability */
.service-content, .about-content {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Add to existing CSS file */
.hero-content, .appointment-content {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2rem;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1, .hero-content p, .appointment-content h2, .appointment-content p {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    color: white;
}

.text-below-image {
    margin-top: 220px;
    background-color: white;
    padding: 1.5rem;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.service-card {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 2rem;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.service-content {
    padding: 1.5rem;
}

.about-content {
    background-color: white;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.about-image-container {
    position: relative;
    margin-bottom: 2rem;
}

.about-image {
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Improved text readability for all text over images */
.text-over-image {
    position: relative;
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.85);
    padding: 1.5rem;
    border-radius: 5px;
    margin: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Standardized text boxes */
.text-box {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.text-box h2, .text-box h3 {
  text-align: left;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.text-box p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.text-box-dark {
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  margin-bottom: 2rem;
}

.text-box-dark h2, .text-box-dark h3 {
  color: white;
  text-align: left;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.text-box-dark p {
  color: white;
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* Override existing styles for consistency */
.hero-content, .appointment-content {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 2rem;
  border-radius: 8px;
  max-width: 800px;
  margin: 0 auto;
}

.service-content {
  padding: 2rem;
  background-color: white;
  border-radius: 0 0 8px 8px;
}

.about-content {
  padding: 2rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Ensure all headings in text boxes fit properly */
.service-content h3 {
  font-size: 1.4rem;
  line-height: 1.4;
  word-wrap: break-word;
  hyphens: auto;
}


/* Additional Mobile Optimizations - Smartphones and Tablets */

/* General image responsiveness */
img {
  max-width: 100%;
  height: auto;
  display: block; /* Prevents bottom margin issues */
}

@media (max-width: 992px) { /* Tablets and smaller */
  /* Adjust typography for better readability */
  body {
    font-size: 15px; /* Slightly smaller base font for tablets */
    line-height: 1.7;
  }
  h1, .hero h1 {
    font-size: 2rem; /* Adjusted from 2.25rem in existing media query */
  }
  h2, .section-header h2 {
    font-size: 1.75rem; /* Adjusted from 2rem in existing media query */
  }
  h3 {
    font-size: 1.4rem;
  }
  .hero p {
    font-size: 1.1rem;
  }
  .header-container {
    padding: 0.75rem 1.5rem; /* Adjust padding, ensure container padding is also considered */
    min-height: 100px; /* Reduce header min-height */
  }
  .logo img {
    height: 80px; /* Smaller logo */
  }
  nav ul li {
    margin-left: 1rem; /* Reduce nav item margin */
  }
}

@media (max-width: 768px) { /* Smartphones in landscape and portrait, smaller tablets */
  body {
    font-size: 14px; /* Further reduce base font for smaller screens */
    line-height: 1.6;
  }
  h1, .hero h1 {
    font-size: 1.8rem; /* Further adjust heading sizes */
  }
  h2, .section-header h2 {
    font-size: 1.6rem;
  }
  h3 {
    font-size: 1.3rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .container {
    padding: 0 1rem; /* Reduce container padding */
  }
  section {
    padding: 3rem 0; /* Reduce section padding */
  }
  .hero {
    padding: 7rem 0 2rem; /* Increased top padding to clear 100px header */
  }
  .logo img {
    height: 60px; /* Even smaller logo */
  }
  /* Ensure mobile navigation toggle is clearly visible and usable */
  .mobile-menu-toggle {
    font-size: 1.8rem; /* Ensure toggle is large enough */
  }
  nav {
    /* top: 80px; is in existing CSS, check if new logo height requires change. New logo height 60px + padding. */
    /* Assuming header height is around 60px + padding, 80px might still be fine or need slight adjustment if header becomes shorter */
  }
  nav ul li a {
    padding: 0.75rem 1rem; /* Increase tappable area for nav links */
    display: block; /* Make the whole area clickable */
    text-align: center;
  }
  nav ul li a::after {
    display: none; /* Remove underline effect for mobile menu items if it looks cluttered */
  }
  /* Ensure buttons are full-width or appropriately sized */
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
  /* .hero-buttons .btn already has width: 100%; max-width: 300px; in existing CSS for this breakpoint */
  
  .footer-grid {
    /* grid-template-columns: 1fr; is in existing CSS */
    text-align: center;
  }
  .footer-links h4, .footer-contact h4, .footer-about p {
    text-align: center; /* Center footer content */
  }
  .footer-contact address p {
    justify-content: center;
  }
}

@media (max-width: 576px) { /* Smaller smartphones */
  body {
    font-size: 13px;
    line-height: 1.5;
  }
  h1, .hero h1 {
    font-size: 1.6rem; /* Existing is 2rem */
  }
  h2, .section-header h2 {
    font-size: 1.4rem; /* Existing is 1.75rem */
  }
  h3 {
    font-size: 1.2rem;
  }
  .hero {
    padding: 5rem 0 1.5rem;
  }
  .section-header {
    margin-bottom: 2rem;
  }
  .logo img {
    height: 50px;
  }
  /* nav top position might need adjustment if header height changes significantly */
  
  .btn {
    width: 100%; /* Make buttons full width for easier tapping */
    margin-bottom: 0.5rem;
  }
  .hero-buttons .btn {
    max-width: none; /* Allow full width, overriding previous max-width */
  }
  .footer-social, .footer-legal {
    gap: 0.5rem; /* Reduce gap for smaller screens */
  }
  .footer-legal p {
    font-size: 0.8rem;
  }
}



/* ===== REVISED MOBILE OPTIMIZATIONS (Scroll & Layout Fixes) ===== */

@media (max-width: 992px) { /* Apply to tablets and phones */
    header {
        position: static !important; /* Make header static on mobile/tablet */
    }

    .hero { /* Adjust hero padding since header is now static */
        padding-top: 2rem !important; /* Small top padding as content flows after static header */
        padding-bottom: 2rem !important;
    }
}

/* Address fixed heights in images/image containers on mobile */
@media (max-width: 768px) { /* Affects tablets and smartphones */
    .service-card > .service-image,
    .about-grid > .about-image {
        height: auto !important;
        min-height: 180px !important;
        background-position: center center !important;
    }

    .services-grid .service-card .service-image { /* Parent div of book cover images */
        height: auto !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .services-grid .service-card .service-image img {
        height: auto !important;
        width: auto !important;
        max-width: 100% !important;
        max-height: 180px; /* Optional: constrain image height */
    }
}

/* Further adjustments for very small screens if needed */
@media (max-width: 576px) {
    .service-card > .service-image,
    .about-grid > .about-image {
        min-height: 150px !important; /* Slightly smaller min-height for smallest screens */
    }
    .services-grid .service-card .service-image img {
        max-height: 150px; /* Optional: constrain image height */
    }
}
/* ===== END REVISED MOBILE OPTIMIZATIONS ===== */

