/* --- CSS Reset & Variables --- */
:root {
    /* Adjust this HEX code to match your exact company red */
    --primary-color: #cc0000; 
    --primary-dark: #990000;
    --bg-white: #ffffff;
    --text-dark: #333333;
    --text-light: #ffffff;
}

/* --- Custom Local Font for Logo --- */
@font-face {
    font-family: 'VitamedicusFont';
    /* Replace 'vitamedicus-logo.ttf' with your exact file name */
    src: url('vitamedicus-logo.ttf') format('truetype');
    font-weight: normal; /* Change to 'bold' or '800' if your specific file is a bold version */
    font-style: normal;
    font-display: swap;
}

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

/* --- Smooth Scrolling & Sticky Header Offset --- */
html {
    scroll-behavior: smooth;
    /* This ensures the sticky header doesn't cover the section titles when scrolling */
    scroll-padding-top: 80px;
}

/* Privacy-Friendly System Fonts (No external server requests) */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header & Navigation --- */
header {
    background-color: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-family: 'VitamedicusFont', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: 0.5px;
}

/* Inline SVG Icon for the Logo */
.logo svg {
    width: 30px;
    height: 30px;
    fill: var(--primary-color);
}

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

nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: color 0.3s ease;
}

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

/* --- Hero Section --- */
.hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('hero-bild.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f4f4f4;

    /* Make the hero take up 85% of the viewport height */
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    padding: 20px;
    text-align: center;
    color: var(--text-light);
}

/* --- Hero Section for Subpages (Jobs, etc.) --- */
.hero-subpage {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('hero-bild.jpg');
    padding: 80px 20px;
    color: var(--text-light);
    min-height: auto; /* Overrides the 85vh from the main page */
    display: block;   /* Resets the flexbox centering from the main page */
}

/* --- Specific Margins for Jobs Page --- */
.grid.jobs-grid-margin {
    margin: 60px auto 80px auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.hero-subpage h1 {
    font-size: 2.5rem;
    color: var(--text-light);
    text-shadow: none;
}

.hero p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto 30px auto;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.hero-subpage p {
    font-size: 1.2rem;
    text-shadow: none;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 14px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background 0.3s, transform 0.2s;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    color: var(--text-light);
}

/* --- Alternating Sections (Main Page) --- */
section {
    padding: 80px 20px;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 50px;
}

.bg-white {
    background-color: var(--bg-white);
    color: var(--text-dark);
}

.bg-white .section-title {
    color: var(--primary-color);
}

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

.bg-red .section-title {
    color: var(--text-light);
}

/* --- Grid & Cards --- */
.grid {
    display: grid;
    /* Reduced minmax from 250px to 220px to allow 4 cards in one row on standard desktops */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto 50px auto;
}

.card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    color: var(--text-dark);
    border-top: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
}

/* Specific card styling for the Red section */
.bg-red .card {
    background: var(--primary-dark);
    color: var(--text-light);
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-top: none;
}

.card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.bg-red .card h3 {
    color: var(--text-light);
}

.card ul {
    list-style-position: inside;
    margin-top: 15px;
    flex: 1;
}

.job-type {
    display: inline-block;
    background-color: #f4f4f4;
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 15px;
    width: fit-content;
}

/* --- Contact Box (Main Page) --- */
.contact-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-top: 5px solid var(--primary-color);
}

.contact-info {
    flex: 1;
    min-width: 250px;
}

.contact-info h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.contact-info p {
    margin-bottom: 10px;
}

.emergency {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-top: 15px;
    display: block;
}

/* --- Content Areas (Datenschutz, Impressum) --- */
main {
    flex: 1;
    padding: 60px 20px;
}

.content-box {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-top: 5px solid var(--primary-color);
}

.content-box h1 {
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
}

.content-box h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

.content-box h3 {
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.content-box p, .content-box ul {
    margin-bottom: 15px;
}

.content-box ul {
    list-style-position: inside;
    padding-left: 10px;
}

.content-box a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.content-box a:hover {
    text-decoration: underline;
}

/* --- Apply Box (Jobs Page) --- */
.apply-box {
    text-align: center;
    background: #f4f4f4;
    padding: 40px;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #eaeaea;
}

.apply-box h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.apply-box p {
    margin-bottom: 20px;
}

/* --- Footer --- */
footer {
    background-color: #222;
    color: #ddd;
    text-align: center;
    padding: 40px 20px;
    margin-top: auto;
}

footer a {
    color: #aaa;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--text-light);
}

/* --- Hamburger Menu & Mobile Responsiveness --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Styling for the PNG Logo */
.logo-img {
    width: auto;
    height: 40px; /* You can adjust this number to make the logo bigger or smaller */
    object-fit: contain;
}

/* --- Accordion Menu (Leistungen) --- */
.accordion {
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.accordion-header {
    background-color: var(--bg-white);
    color: var(--primary-color);
    cursor: pointer;
    padding: 20px;
    width: 100%;
    text-align: left;
    border: none;
    border-bottom: 1px solid #eaeaea;
    outline: none;
    transition: background-color 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header:last-child {
    border-bottom: none;
}

.accordion-header:hover, .accordion-header.active {
    background-color: #fcfcfc;
}

.accordion-icon {
    font-size: 1.5rem;
    font-weight: normal;
    transition: transform 0.3s ease;
}

.accordion-header.active .accordion-icon {
    transform: rotate(45deg); /* Turns the + into an x */
}

.accordion-content {
    background-color: var(--bg-white);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-content-inner {
    padding: 20px;
    color: var(--text-dark);
    border-bottom: 1px solid #eaeaea;
}

.accordion-content-inner ul {
    margin-top: 15px;
    list-style-position: inside;
}

/* --- Consultation Banner (Beratung) --- */
.cta-banner {
    background-color: #f4f4f4;
    text-align: center;
    padding: 60px 20px;
    border-top: 2px solid #eaeaea;
}

.cta-banner h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 2rem;
}

.cta-banner p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 30px auto;
}

@media (max-width: 768px) {
    .nav-inner {
        /* Keep header items on the same row in mobile */
        flex-direction: row;
        position: relative;
    }

    .menu-toggle {
        display: flex;
    }

    /* Hide the navigation list by default on mobile */
    nav {
        display: none;
        position: absolute;
        top: 100%; /* Position directly below the header */
        left: -20px; /* Offset the container padding */
        right: -20px;
        background-color: var(--bg-white);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        border-top: 1px solid #eaeaea;
    }

    /* Show the menu when the active class is added by JavaScript */
    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 10px 0;
    }

    nav ul li {
        text-align: center;
        border-bottom: 1px solid #f4f4f4;
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav ul li a {
        display: block;
        padding: 15px 20px;
    }

    /* Fix the Jobs page and layout for small screens */
    .grid {
        /* On very small screens, let cards shrink down to 100% width safely */
        grid-template-columns: 1fr;
    }

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

    .hero-subpage h1 {
        font-size: 1.8rem;
    }

    /* Add slight padding/margin from the left screen edge */
    .logo {
        margin-left: 10px;
    }

    /* Add slight padding/margin from the right screen edge */
    .menu-toggle {
        display: flex;
        margin-right: 10px;
    }
}