/* ==========================================================================
   Schuhmann Hausverwaltungen – Eigene Styles
   --------------------------------------------------------------------------
   Layout, Abstände und Farben kommen größtenteils direkt aus TailwindCSS
   (Klassen im HTML). Hier liegen nur Dinge, die sich mit Tailwind-Klassen
   schlecht abbilden lassen: Animationen, wiederverwendbare Komponenten
   (Buttons, Karten) sowie Zustände, die per JavaScript gesetzt werden.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Farb- und Design-Variablen
   Die Werte entsprechen den Tailwind-Farben der Farbpalette, damit eigene
   Komponenten exakt zu den Tailwind-Klassen im HTML passen.
   -------------------------------------------------------------------------- */
:root {
    --color-primary: #7f1d1d;        /* red-900   – Primärfarbe */
    --color-primary-hover: #991b1b;  /* red-800   – Hover der Primärfarbe */
    --color-secondary: #94a3b8;      /* slate-400 – Sekundärfarbe */
    --color-bg: #f9fafb;             /* gray-50   – Hintergrund */
    --color-text: #1f2937;           /* gray-800  – Textfarbe */
    --color-muted: #4b5563;          /* gray-600  – gedämpfter Text */

    --radius: 2rem;                  /* Einheitlicher Radius für Boxen & Bilder */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1); /* Weiches Abbremsen */
}


/* --------------------------------------------------------------------------
   2. Grundlagen
   -------------------------------------------------------------------------- */

/* Moderne System-Schriftart (keine externen Fonts → DSGVO-freundlich) */
body {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

/* Verhindert horizontales Scrollen durch seitlich einfliegende Elemente */
main {
    overflow-x: clip;
}

/* Textmarkierung in der Primärfarbe */
::selection {
    background-color: var(--color-primary);
    color: #fff;
}

/* Sichtbarer Fokus-Rahmen für Tastatur-Bedienung */
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: 3px;
}


/* --------------------------------------------------------------------------
   3. Header / Navigation
   -------------------------------------------------------------------------- */

/* Header ist zu Beginn leicht transparent mit Unschärfe-Effekt */
.site-header {
    background-color: rgba(249, 250, 251, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Sobald gescrollt wurde (Klasse kommt per JS), bekommt er einen Schatten */
.site-header.is-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px -15px rgba(31, 41, 55, 0.25);
}

/* Logos sind JPGs mit weißem Hintergrund – "multiply" blendet das Weiß aus */
.logo-img {
    mix-blend-mode: multiply;
}

/* Desktop-Menüpunkte mit animiertem Unterstrich */
.nav-link {
    position: relative;
    display: inline-block;
    padding: 0.5rem 0.9rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    transition: color 0.2s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    bottom: 0.25rem;
    height: 2px;
    border-radius: 2px;
    background-color: var(--color-primary);
    transform: scaleX(0);              /* Unterstrich zunächst unsichtbar */
    transform-origin: left;
    transition: transform 0.3s var(--ease-out);
}

/* Hover und aktiver Abschnitt (Klasse "is-active" setzt das JS) */
.nav-link:hover,
.nav-link.is-active {
    color: var(--color-primary);
}

.nav-link:hover::after,
.nav-link.is-active::after {
    transform: scaleX(1);
}

/* Mobiles Menü: per max-height ein- und ausklappen */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease-out);
}

.mobile-menu.is-open {
    max-height: 30rem;
}

.mobile-link {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-link:hover {
    background-color: var(--color-bg);
    color: var(--color-primary);
}


/* --------------------------------------------------------------------------
   4. Hero-Bereich + Lade-Animationen
   Die Texte "fliegen" beim Laden der Seite nacheinander ein.
   Über animation-delay entsteht eine gestaffelte Reihenfolge.
   -------------------------------------------------------------------------- */

/* Hintergrundbild zoomt langsam heraus (Ken-Burns-Effekt) */
.hero-image {
    animation: hero-zoom 12s ease-out both;
}

/* Badge fällt von oben herein */
.hero-badge {
    animation: fly-in-top 0.8s var(--ease-out) 0.1s both;
}

/* Haupttitel fliegt von links herein */
.hero-title {
    animation: fly-in-left 1s var(--ease-out) 0.3s both;
}

/* Untertitel und Buttons blenden von unten ein */
.hero-subtitle {
    animation: fade-up 0.9s var(--ease-out) 0.7s both;
}

.hero-actions {
    animation: fade-up 0.9s var(--ease-out) 0.95s both;
}

/* Pfeil nach unten "hüpft" dauerhaft */
.scroll-hint {
    animation: bounce-soft 2s ease-in-out 1.5s infinite;
}

/* --- Keyframes --- */

@keyframes fly-in-left {
    from { opacity: 0; transform: translateX(-80px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fly-in-top {
    from { opacity: 0; transform: translateY(-40px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes hero-zoom {
    from { transform: scale(1.15); }
    to   { transform: scale(1); }
}

@keyframes bounce-soft {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 10px); }
}


/* --------------------------------------------------------------------------
   5. Scroll-Animationen (Reveal)
   Elemente mit diesen Klassen sind anfangs unsichtbar. Sobald sie in den
   sichtbaren Bereich kommen, setzt das JS die Klasse "is-visible".
   Über die CSS-Variable --delay (im HTML gesetzt) lassen sich Karten
   zeitversetzt einblenden.
   -------------------------------------------------------------------------- */
.reveal,
.reveal-left,
.reveal-right {
    opacity: 0;
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
    transition-delay: var(--delay, 0ms);
}

.reveal       { transform: translateY(40px); }   /* von unten */
.reveal-left  { transform: translateX(-60px); }  /* von links */
.reveal-right { transform: translateX(60px); }   /* von rechts */

.reveal.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
    opacity: 1;
    transform: none;
}


/* --------------------------------------------------------------------------
   6. Wiederverwendbare Komponenten
   -------------------------------------------------------------------------- */

/* Kleine Überschrift über dem Abschnittstitel */
.section-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-primary);
}

/* Abschnittstitel mit kurzem Akzentstrich darunter */
.section-title {
    margin-top: 0.75rem;
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.section-title::after {
    content: "";
    display: block;
    width: 3.5rem;
    height: 4px;
    margin-top: 1.25rem;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

/* In zentrierten Kopfbereichen den Strich ebenfalls zentrieren */
.text-center .section-title::after {
    margin-left: auto;
    margin-right: auto;
}

/* Primär-Button (rot, gefüllt) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.75rem;
    border-radius: 9999px;
    background-color: var(--color-primary);
    color: #fff;
    font-weight: 600;
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -10px rgba(127, 29, 29, 0.6);
}

/* Pfeil-Icon im Button rutscht beim Hover leicht nach rechts */
.btn-primary i {
    transition: transform 0.25s ease;
}

.btn-primary:hover .fa-arrow-right {
    transform: translateX(4px);
}

/* Ghost-Button (transparent, für dunkle Hintergründe) */
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 9999px;
    color: #fff;
    font-weight: 600;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* Karte (weiße Box mit 2rem-Radius, hebt sich beim Hover an) */
.card {
    padding: 2.5rem;
    border-radius: var(--radius);
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(31, 41, 55, 0.05);
    outline: 1px solid #f3f4f6;
    /* Zusätzlich zur Reveal-Transition auch Schatten animieren */
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out),
                box-shadow 0.3s ease;
}

.card.is-visible:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px -20px rgba(31, 41, 55, 0.25);
    transition-delay: 0ms;  /* Hover ohne Verzögerung */
}

/* Rundes Icon-Feld in Karten */
.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 1.25rem;
    background-color: rgba(127, 29, 29, 0.08);
    color: var(--color-primary);
    font-size: 1.5rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Beim Hover einer Karte färbt sich das Icon-Feld rot */
.card:hover .card-icon,
.contact-card:hover .card-icon {
    background-color: var(--color-primary);
    color: #fff;
}

/* Kontakt-Karten (grauer Hintergrund im weißen Abschnitt) */
.contact-card {
    display: block;
    padding: 2rem;
    border-radius: var(--radius);
    background-color: var(--color-bg);
    outline: 1px solid #f3f4f6;
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out),
                background-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-card.is-visible:hover {
    transform: translateY(-6px);
    background-color: #fff;
    box-shadow: 0 25px 50px -20px rgba(31, 41, 55, 0.25);
    transition-delay: 0ms;
}

/* Kleine runde Icons in der Qualifikations-Liste */
.check-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    background-color: var(--color-primary);
    color: #fff;
}

/* Bild-Karte (Zertifikat / VDIV-Logo) */
.img-card {
    display: block;
    padding: 1rem;
    border-radius: var(--radius);
    background-color: var(--color-bg);
}

/* Container der Google-Maps-Karte */
.map-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    animation: fade-in 0.6s ease both;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* --------------------------------------------------------------------------
   7. Unterseiten (Impressum & Datenschutz)
   -------------------------------------------------------------------------- */

/* Inhaltsbox blendet beim Laden ein. Bewusst keine Scroll-Animation (.reveal),
   da die sehr hohe Box sonst nie zu 15 % sichtbar wäre und unsichtbar bliebe. */
.fade-up-load {
    animation: fade-up 0.9s var(--ease-out) 0.6s both;
}

/* Typografie für die übernommenen Rechtstexte (h2–h4, Absätze, Listen, Links) */
.legal-content {
    color: var(--color-text);
    line-height: 1.75;
    overflow-wrap: break-word;
}

/* Lange Wörter (z. B. "Berufshaftpflichtversicherung") auf dem Handy trennen */
.legal-content h2,
.legal-content h3,
.toc-link {
    hyphens: auto;
}

.legal-content h2 {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #f3f4f6;
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--color-primary);
    scroll-margin-top: 7rem;   /* Abstand unter dem fixierten Header beim Anspringen */
}

/* Erste Überschrift ohne Trennlinie und oberen Abstand */
.legal-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.legal-content h3 {
    margin-top: 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
}

.legal-content h4 {
    margin-top: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-muted);
}

.legal-content p {
    margin-top: 1rem;
    color: var(--color-muted);
}

.legal-content strong {
    color: var(--color-text);
}

/* Aufzählungen mit roten Punkten */
.legal-content ul {
    margin-top: 1rem;
    padding-left: 1.25rem;
    list-style: disc;
    color: var(--color-muted);
}

.legal-content li {
    margin-top: 0.5rem;
}

.legal-content li::marker {
    color: var(--color-primary);
}

/* Links im Text; lange URLs dürfen umbrechen */
.legal-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
    transition: color 0.2s ease;
}

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

/* Links im Inhaltsverzeichnis (wird per JS aus den h2 erzeugt) */
.toc-link {
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-muted);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.toc-link:hover {
    background-color: var(--color-bg);
    color: var(--color-primary);
}


/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */
.footer-heading {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
}

/* Footer-Links (auch Impressum/Datenschutz ohne href) */
.footer-link {
    cursor: pointer;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--color-secondary);
}


/* --------------------------------------------------------------------------
   9. Scroll-to-Top-Button (unten rechts)
   Standardmäßig unsichtbar; das JS setzt "is-visible", sobald der Nutzer
   ein Stück nach unten gescrollt hat.
   -------------------------------------------------------------------------- */
.scroll-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 9999px;
    background-color: var(--color-primary);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px -8px rgba(127, 29, 29, 0.6);
    cursor: pointer;

    /* Ausgangszustand: ausgeblendet und leicht nach unten versetzt */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s var(--ease-out),
                visibility 0.35s, background-color 0.2s ease;
}

.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-3px);
}


/* --------------------------------------------------------------------------
   10. Barrierefreiheit: reduzierte Bewegung
   Wer im Betriebssystem "Bewegung reduzieren" aktiviert hat, bekommt
   keine Animationen – alle Inhalte sind sofort sichtbar.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
    }
}
