/* css/style.css */

:root {
    /* Color Palette */
    --color-primary: #1F6F73;
    /* Tiefes Petrol */
    --color-primary-dark: #165255;
    /* Darker Petrol for hover */
    --color-primary-light: #5FB3A9;
    /* Helles Türkis */
    --color-secondary: #8BC6A2;
    /* Sanftes Grün */
    --color-accent-yellow: #F2C94C;
    /* Warmes Gelb */
    --color-accent-orange: #F2994A;
    /* Sanftes Orange */
    --color-dark: #222222;
    --color-gray: #f4f4f4;
    --color-light-gray: #e0e0e0;
    --color-white: #ffffff;
    --color-black: #000000;

    /* Typography */
    --font-main: 'Inter', sans-serif;

    /* Layout */
    --max-width: 1200px;
    --header-height: 80px;
}

/* Accessibility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

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

html {
    scroll-behavior: smooth;
}

html:not(.no-snap) {
    scroll-snap-type: y mandatory;
}

body {
    font-family: var(--font-main);
    color: var(--color-dark);
    line-height: 1.6;
    background-color: var(--color-white);
}

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

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

ul {
    list-style: none;
}

/* Typography Classes */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--color-black);
}

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

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

/* Layout Utilities */
.content-wrapper {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.responsive-text-box {
    max-width: 1100px;
    width: 100%;
}

.section {
    padding: var(--header-height) 2rem 0 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 0 1.5rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
}

.subpage-body .section {
    min-height: auto;
    display: block;
    scroll-snap-align: none;
    padding: 4rem 0;
}

.fullscreen-section {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Fade-in animation on scroll */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Background Colors */
.bg-primary {
    background-color: var(--color-primary);
}

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

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

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

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 102, 153, 0.3);
}

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

.btn-green:hover {
    background-color: #74a387;
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(139, 198, 162, 0.3);
}

.btn-yellow {
    background-color: var(--color-accent-yellow);
    color: var(--color-black);
}

.btn-yellow:hover {
    background-color: #deba45;
    /* Slightly darker yellow */
    color: var(--color-black);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(242, 201, 76, 0.3);
}

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

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

/* Header & Navigation */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--color-white);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.subpage-header {
    justify-content: flex-start !important;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

/* Horizontal Nav Menu */
.nav-menu {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    flex-direction: column;
    gap: 6px;
}

.hamburger-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.nav-logo {
    height: 48px;
    width: auto;
    display: block;
}

.logo-link {
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-dark);
    position: relative;
    padding-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light), var(--color-secondary));
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
}

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


/* Specific Sections */

/* Hero Section */
.hero-section {
    min-height: 100vh;
    padding-top: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background-color: #f9f9f9;
    padding: 2rem 0;
}

.hero-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    background-color: var(--color-white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 2rem;
    overflow: hidden;
}

.hero-text-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-image-box {
    width: 100%;
    max-width: 290px;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 0.4rem;
    color: var(--color-primary-dark);
}

.hero-subtitle {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.1;
    margin-bottom: 0.2rem;
}

/* Hero Tiles */
.hero-tiles-grid {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
}

.hero-tile {
    flex: 1;
    padding: 2rem;
    border-radius: 8px;
    text-align: left;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.hero-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.hero-tile h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-tile ul {
    margin: 0;
    padding-left: 1.2rem;
    list-style: disc;
}

.hero-tile li {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.hero-tile--petrol {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.hero-tile--petrol:hover {
    color: var(--color-white);
}

.hero-tile--petrol h3 {
    color: var(--color-white);
}

.hero-tile--yellow {
    background-color: var(--color-accent-yellow);
    color: var(--color-black);
}

.hero-tile--yellow:hover {
    color: var(--color-black);
}

.hero-tile--yellow h3 {
    color: var(--color-black);
}

@media (max-width: 768px) {
    .hero-tiles-grid {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-subtitle {
        font-size: 1.8rem;
    }

    .hero-grid {
        padding: 2.5rem 1.5rem;
    }
}

.hero-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light), var(--color-secondary));
    margin: 1rem auto 0;
}

/* Leistung Section */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
    align-items: flex-start;
}

.service-card-wrapper {
    flex: 1 1 280px;
    display: flex;
    flex-direction: column;
}

.service-card {
    background-color: var(--color-gray);
    padding: 2.5rem 2rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 4px solid transparent;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-bottom: 4px solid var(--color-primary);
    background-color: var(--color-white);
}

.icon-placeholder {
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

/* Person Section */
/* Wrapped Content for L-shape wrap */
.wrapped-content {
    display: flow-root;
    /* Modern clearfix */
    width: 100%;
    line-height: 1.8;
    /* Increased for better legibility in wrap */
}

.clear-wrap {
    clear: both;
}

.wrapped-content p {
    text-align: left;
    /* Changed from justify for better flow without auto-hyphenation */
    margin-bottom: 1.5rem;
}

.wrapped-content .image-content {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 0;
    width: 58%;
    max-width: 630px;
    display: block;
    /* Shape-outside to let text flow closer to the person's silhouette */
    shape-outside: inset(0 0 0 0 round 4px);
    shape-margin: 0.5rem;
}

#person .section-title,
#leistungen-unternehmen .section-title,
#privatpersonen .section-title {
    text-align: left;
}

#person .section-title::after,
#leistungen-unternehmen .section-title::after,
#privatpersonen .section-title::after {
    margin: 1rem 0 0;
}

#person .section-title::after {
    background: linear-gradient(to right, var(--color-primary), var(--color-accent-yellow));
}

#privatpersonen .section-title::after {
    background: linear-gradient(to right, var(--color-accent-yellow), var(--color-accent-orange));
}

.profile-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    /* Show full image */
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .wrapped-content .image-content {
        float: none;
        width: 100%;
        margin: 0 0 2rem 0;
        max-width: 100%;
        text-align: center;
    }

    .profile-image {
        max-width: 360px;
        margin: 0 auto;
        display: block;
    }
}

/* Kontakt Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 8px;
}

.contact-info h3 {
    color: var(--color-white);
}

.details-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 992px) {
    .contact-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding: 2rem;
    }

    .details-row {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
    }

    .contact-details li {
        justify-content: center;
    }

    .qr-code-wrapper {
        margin-bottom: 2rem;
    }
}

.contact-details {
    margin-top: 0;
}

.contact-details li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-details a {
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.contact-details a:hover {
    border-bottom: 1px solid var(--color-white);
    opacity: 0.8;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* QR Code */
.qr-code-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 1rem;
    flex-shrink: 0;
}

.qr-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    padding: 1rem;
    border: none;
    border-radius: 4px;
    font-family: var(--font-main);
    background-color: rgba(255, 255, 255, 0.9);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid var(--color-white);
    background-color: var(--color-white);
}

/* Footer & Impressum */
.site-footer {
    scroll-snap-align: end;
}

.impressum-content {
    min-height: calc(100vh - var(--header-height) - 80px);
    /* 80px is approx footer height */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
}

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

.footer-links a {
    color: var(--color-light-gray);
}

.footer-links a:hover {
    color: var(--color-white);
}

@media (max-width: 480px) {
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    html:not(.no-snap) {
        scroll-snap-type: none;
    }

    .nav-menu {
        justify-content: flex-end;
    }

    #site-header {
        height: auto;
        padding: 0.5rem 0;
    }

    .desktop-logo {
        display: block;
        margin-bottom: 2rem;
    }

    #mobile-nav-toggle {
        display: flex;
    }

    /* Hamburger Animation to X */
    .mobile-nav-toggle.open .hamburger-bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-nav-toggle.open .hamburger-bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-nav-toggle.open .hamburger-bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--color-white);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        padding: 2rem;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        align-items: center;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-link {
        font-size: 1.2rem;
    }

    .hero-grid {
        padding: 2rem 1.5rem;
    }

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

    .hero-subtitle {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .split-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-container {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
        gap: 3rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 2rem 1rem;
    }

    .details-row {
        flex-direction: column;
        gap: 2rem;
    }

    .details-inner {
        padding: 1.5rem;
    }

    .details-inner p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 1rem;
    }

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

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

/* Per-card inline detail panel */
.card-detail-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, margin-top 0.4s ease;
    opacity: 0;
    margin-top: 0;
}

.card-detail-panel.visible {
    max-height: 600px;
    opacity: 1;
    margin-top: 1rem;
}

.details-inner {
    padding: 2.5rem;
    background-color: var(--color-gray);
    border-radius: 8px;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.details-inner h3 {
    color: var(--color-primary-dark);
    margin-bottom: 1rem;
}

.details-inner p {
    font-size: 1.1rem;
    line-height: 1.8;
}

.close-details {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-dark);
    cursor: pointer;
    line-height: 1;
}

.close-details:hover {
    color: var(--color-primary);
}

.interactive-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-card:hover {
    background-color: var(--color-white);
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.interactive-card.active {
    border-bottom: 4px solid var(--color-primary);
    background-color: var(--color-white);
}

.content-frame-yellow {
    border: 8px solid var(--color-accent-yellow);
    background-color: var(--color-accent-yellow);
    padding: 2rem;
    border-radius: 8px;
    margin: 1rem auto;
    max-width: 1200px;
}

@media (max-width: 768px) {
    .content-frame-yellow {
        padding: 1.5rem;
        border-width: 4px;
        margin: 1rem 0;
    }

    @media (max-width: 380px) {
        .content-frame-yellow {
            padding: 1rem 0.75rem;
            border-width: 3px;
        }
    }

    .responsive-text-box {
        padding: 0 1rem;
    }
}

/* Modal Component */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: var(--color-white);
    width: 90%;
    height: 90%;
    max-width: 1000px;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-light-gray);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--color-dark);
}

.close-modal {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-dark);
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: var(--color-primary);
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.modal-pdf-embed {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
}

.modal-fallback {
    padding: 2rem;
    text-align: center;
}

/* Prevent scrolling when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: var(--color-white);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 1.5rem;
    z-index: 3000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    transform: translateY(150%);
    transition: transform 0.5s ease;
    border-left: 5px solid var(--color-primary);
    max-width: 1000px;
    margin: 0 auto;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-content p {
    font-size: 0.95rem;
    margin: 0;
    color: var(--color-dark);
}

.cookie-content a {
    color: var(--color-primary);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 0;
        gap: 1.5rem;
    }

    .cookie-actions {
        width: 100%;
        justify-content: center;
    }
}