/* ============================================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================================================ */
:root {
    --primary-color: #601124;
    --secondary-color: #E3D0C9;
    --background-color: #F4F4F4;
    --text-color: #333333;
    --white-color: #ffffff;
    --border-color: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-shadow-color: rgba(0, 0, 0, 0.2);
    --overlay-color: rgba(255, 255, 255, 0.8);
}

/* ============================================================================
   BASE STYLES & RESET
   ============================================================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    padding-top: 92px;
    width: 100%;
    word-wrap: break-word;
}

a,
button {
    font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 3px;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */
h1 {
    margin: 0 0 14px;
    color: var(--primary-color);
    text-align: center;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.1;
}

h2 {
    color: var(--primary-color);
    text-align: center;
    line-height: 1.2;
    margin: 0 0 18px;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
}

p {
    margin-top: 0;
}

/* ============================================================================
   LAYOUT - CONTAINER & SECTIONS
   ============================================================================ */
.container {
    width: 100%;
    margin: auto;
    overflow: hidden;
}

.section-content {
    width: min(90%, 920px);
    margin: 0 auto 28px;
    text-align: center;
}

.section-lead {
    max-width: 760px;
    margin: 0 auto;
    color: #555;
}

section {
    padding-top: 140px;
    margin-top: -140px;
}

hr {
    border: 0;
    height: 1px;
    background: var(--secondary-color);
    margin: 40px 0;
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */
header {
    background: var(--background-color);
    color: var(--primary-color);
    text-align: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 4px var(--shadow-color);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 85%;
    padding: 5px 10px;
    min-height: 82px;
}

#logo {
    height: 74px;
    width: auto;
}

/* Navigation Menu */
.menu {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.menu a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 10px 15px;
    transition: color 0.3s ease;
}

.menu a:hover {
    color: var(--secondary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--primary-color);
    min-width: 44px;
    min-height: 44px;
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 82px;
    left: 0;
    width: 100%;
    height: calc(100dvh - 82px);
    background-color: var(--overlay-color);
    z-index: 999;
}

.menu-overlay.open {
    display: block;
}

/* ============================================================================
   MAIN CONTENT SECTIONS
   ============================================================================ */

/* About Section */
#about {
    text-align: center;
}

#about p {
    max-width: 800px;
    margin: 0 auto 18px;
}

#about .intro {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
}

#about img {
    width: 100%;
    height: clamp(220px, 38vw, 430px);
    object-fit: cover;
    object-position: center;
    margin-bottom: 28px;
    display: block;
}

/* ============================================================================
   RENTAL OFFERS (MIETANGEBOTE) SECTION
   ============================================================================ */
.mietangebote-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.mietangebote-card {
    width: min(90%, 1000px);
    max-width: 1000px;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
    text-align: center;
}

/* ============================================================================
   JOB OFFERS (STELLENANGEBOTE) SECTION
   ============================================================================ */
.stellenangebote-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.stellenangebote-card {
    width: min(90%, 1000px);
    max-width: 1000px;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stellenangebote-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 4px 8px var(--hover-shadow-color);
}

.stellenangebote-card h3 {
    margin-top: 0;
    color: var(--primary-color);
    text-align: center;
}

.stellenangebote-card p {
    color: var(--text-color);
}

/* Apply Button */
.bewerben-button {
    display: block;
    margin: 20px auto 0;
    width: fit-content;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--white-color);
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
}

.bewerben-button:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* ============================================================================
   FAQ SECTION
   ============================================================================ */
.faq-section {
    margin-bottom: 40px;
}

.faq-card {
    width: min(90%, 1000px);
    max-width: 1000px;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
    text-align: left;
    margin: 20px auto;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f4f4f4;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
    user-select: none;
    position: relative;
    z-index: 1;
    text-align: left;
    margin-top: 8px;
}

.faq-question:first-child {
    margin-top: 0;
}

.faq-question:hover {
    background-color: var(--secondary-color);
}

.faq-answer {
    height: 0;
    overflow: hidden;
    transition: height 0.24s ease, opacity 0.18s ease;
    background: var(--white-color);
    padding: 0 20px;
    opacity: 0;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 0;
    will-change: height;
}

.faq-answer.open {
    opacity: 1;
}

.faq-answer p {
    margin: 0;
    padding: 10px 0;
}

.faq-arrow {
    transition: transform 0.2s ease;
}

.faq-arrow.open {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .faq-answer,
    .faq-arrow {
        transition: none;
    }
}

/* ============================================================================
   COOKIE BANNER & MODAL - DSGVO-konform
   ============================================================================ */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    padding: 20px;
    z-index: 1100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner p {
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.cookie-banner a {
    color: white;
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.cookie-banner button,
.cookie-modal button {
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: none;
    text-decoration: none;
    text-align: center;
    min-width: 120px;
}

/* Standard Button (Akzeptieren, Speichern) */
.cookie-modal button[data-action="save"] {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.cookie-modal button[data-action="save"]:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Secondary Button (Einstellungen, Abbrechen) */
.cookie-banner button[data-action="settings"],
.cookie-modal button[data-action="cancel"] {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.cookie-banner button[data-action="settings"]:hover,
.cookie-modal button[data-action="cancel"]:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* Reject Button */
.cookie-banner button[data-action="reject"],
.cookie-banner button[data-action="accept"] {
    background-color: transparent;
    color: var(--white-color);
    border: 1px solid var(--white-color);
}

.cookie-banner button[data-action="reject"]:hover,
.cookie-banner button[data-action="accept"]:hover {
    background-color: var(--white-color);
    color: var(--primary-color);
}

/* Cookie Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal[hidden] {
    display: none !important;
}

.cookie-modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.cookie-modal h3 {
    margin: 0 0 20px 0;
    color: var(--primary-color);
    font-size: 1.5em;
}

.cookie-category {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.cookie-category label {
    display: block;
    cursor: pointer;
}

.checkbox-label {
    font-weight: bold;
    margin-left: 8px;
    color: var(--primary-color);
}

.category-description {
    margin: 8px 0 0 28px;
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.cookie-category input[type="checkbox"] {
    transform: scale(1.2);
}

.cookie-category input[disabled] {
    opacity: 0.7;
}

/* Consent Placeholder */
.consent-placeholder {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    margin: 20px auto;
    max-width: 640px;
}

.consent-placeholder h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.consent-placeholder p {
    color: #666;
    margin: 0 auto 20px;
    line-height: 1.5;
    max-width: 520px;
}

.settings-button {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-decoration: none;
    text-align: center;
    min-width: 120px;
}

.settings-button:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 2.25rem;
    }

    section {
        padding-top: 110px;
        margin-top: -110px;
    }

    #about img {
        height: 280px;
        margin-bottom: 32px;
    }

    .mietangebote-card,
    .stellenangebote-card,
    .faq-card,
    .impressum-card,
    .datenschutz-card {
        width: 92%;
        padding: 16px;
    }

    .faq-question {
        gap: 16px;
        padding: 12px 14px;
    }

    .faq-answer {
        padding: 0 14px;
    }

    .cookie-banner {
        padding: 15px;
    }

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

    .cookie-banner button {
        padding: 12px;
        text-align: center;
    }

    .cookie-modal-content {
        padding: 20px;
        margin: 10px;
    }

    .consent-placeholder {
        padding: 20px 15px;
    }

    footer nav {
        display: grid;
        grid-template-columns: 1fr;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    footer nav a:first-child,
    footer nav a:nth-child(2),
    footer nav a:last-child {
        justify-self: center;
    }

}

/* ============================================================================
   LEGAL PAGES (IMPRESSUM & DATENSCHUTZ)
   ============================================================================ */
.impressum-card,
.datenschutz-card {
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 34px;
    width: min(90%, 1000px);
    max-width: 1000px;
    box-shadow: 0 2px 4px var(--shadow-color);
    text-align: left;
    margin: 40px auto;
    margin-top: 80px;
}

.legal-card h1 {
    text-align: left;
    font-size: clamp(2rem, 4vw, 3rem);
}

.legal-card h2 {
    text-align: left;
    font-size: 1.2rem;
    margin: 30px 0 8px;
}

.legal-card p,
.legal-card li {
    max-width: 780px;
}

.legal-card a {
    color: var(--primary-color);
}

.legal-date {
    margin-top: 34px;
}

/* ============================================================================
   FOOTER
   ============================================================================ */
footer {
    background: var(--primary-color);
    color: var(--white-color);
    text-align: center;
    padding: 40px 0;
    width: 100%;
}

footer nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: min(90%, 1000px);
    margin: 0 auto;
}

footer nav a:first-child {
    justify-self: start;
}

footer nav a:nth-child(2) {
    justify-self: center;
}

footer nav a:last-child {
    justify-self: end;
}

footer nav a {
    color: var(--white-color);
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block;
    padding: 4px 0;
}

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

/* ============================================================================
   MEDIA QUERIES - RESPONSIVE DESIGN
   ============================================================================ */

/* Tablet and Mobile Styles */
@media (max-width: 1000px) {

    /* Mobile Navigation */
    .menu {
        display: flex;
        flex-direction: column;
        gap: 0;
        position: fixed;
        top: 82px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100dvh - 82px);
        background-color: var(--background-color);
        box-shadow: 0 8px 18px var(--shadow-color);
        padding: 8px 0;
        transform: translateY(-120%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.2s ease, opacity 0.2s ease;
        z-index: 1002;
        overflow-y: auto;
    }

    .menu a {
        padding: 14px 24px;
        border-top: 1px solid var(--border-color);
        background-color: var(--background-color);
        text-align: left;
    }

    .menu a:hover {
        color: var(--primary-color);
        background-color: var(--secondary-color);
    }

    .menu-toggle {
        display: block;
        position: absolute;
        top: 50%;
        right: 10px;
        transform: translateY(-50%);
    }

    .menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* Header Layout */
    header .container {
        justify-content: center;
        position: relative;
    }

    /* Content Adjustments */
    #about p {
        max-width: 90%;
    }

    /* Disable Hover Effects on Touch Devices */
    .stellenangebote-card:hover {
        transform: none;
        box-shadow: 0 2px 4px var(--shadow-color);
    }

    .faq-question:hover {
        background-color: #f4f4f4;
    }

    /* Card Layout Adjustments */
}

@media (max-width: 420px) {
    header .container {
        width: 94%;
    }

    #logo {
        height: 52px;
    }

    .cookie-modal {
        padding: 10px;
    }
}
