/* =========================================
   0. LOKALE SCHRIFTARTEN (Fira Sans)
   ========================================= */
@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 300;
  src: url('fonts/fira-sans-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/fira-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 500;
  src: url('fonts/fira-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 600;
  src: url('fonts/fira-sans-600.woff2') format('woff2');
}

/* =========================================
   1. GRUNDEINSTELLUNGEN & VARIABLEN
   ========================================= */
:root {
    --wm-red: #E30613;          /* Werner & Mertz Rot (Akzente) */
    --wm-blue: #003366;         /* Hauptfarbe Dunkelblau */
    --text-main: #333333;       /* Fließtext */
    --text-light: #666666;      /* Nebentext */
    
    /* Layout Maße */
    --wrapper-width: 1280px;
    --side-padding: 110px;      /* Standard Abstand links/rechts */
}

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

body {
    font-family: 'Fira Sans', "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    
    /* Genereller Hintergrund: Weiss */
    background-color: #ffffff; 
    
    /* Scrollbar immer anzeigen, verhindert Springen des Layouts */
    overflow-y: scroll; 
    
    /* Sticky Footer Vorbereitung */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Formularelemente sollen die Schrift erben */
input, button, select, textarea {
    font-family: inherit;
}

/* Links allgemein */
a { color: var(--wm-blue); text-decoration: none; transition: all 0.2s; }
a:hover { color: var(--wm-red); text-decoration: underline; }


/* =========================================
   2. PAGE WRAPPER (Das "Blatt Papier")
   ========================================= */
.page-wrapper {
    /* Fixe Breite, zentriert */
    max-width: var(--wrapper-width);
    width: 100%;
    margin: 0 auto;
    
    /* Hintergrund Weiss */
    background-color: #ffffff;
    
    /* Der Schatten links und rechts für den Boxed-Look */
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
    
    /* Damit der Footer unten bleibt */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}


/* =========================================
   3. HEADER & LOGO
   ========================================= */
.navbar {
    width: 100%;
    /* 110px Abstand links/rechts */
    padding: 30px var(--side-padding); 
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    
    /* Kein absolute mehr, Header ist Teil des Flusses */
    position: relative; 
    z-index: 1000;
}

/* Logo Bereich */
.brand {
    width: 262px; /* Fixe Breite */
    display: flex;
    align-items: center;
}

.brand img {
    width: 100%;
    height: auto;
    display: block;
}


/* =========================================
   4. SPRACHUMSCHALTER (DROPDOWN)
   ========================================= */
.lang-dropdown {
    position: relative;
    z-index: 2000;
}

.lang-btn {
    /* Eckig, Blau, Weißer Text */
    background-color: var(--wm-blue); 
    color: white;
    padding: 12px 20px;
    border: none;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0; /* Eckiges Design */
    transition: background 0.3s;
}

.lang-btn:hover {
    background-color: #002244; /* Etwas dunkler beim Hover */
}

/* Das Menü */
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 200px;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border: 1px solid #eee;
    z-index: 2001;
}

.dropdown-content a {
    color: #333;
    padding: 12px 20px;
    display: block;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    font-size: 0.95rem;
}

.dropdown-content a:hover {
    background: #f9f9f9;
    color: var(--wm-blue);
    padding-left: 25px; /* Kleiner Animationseffekt */
}

.lang-dropdown:hover .dropdown-content { display: block; }


/* =========================================
   5. CONTENT BEREICH
   ========================================= */
.main-content {
    flex: 1; /* Füllt den Platz zwischen Header und Footer */
    padding: 60px var(--side-padding); /* 110px Abstand */
    width: 100%;
}

/* Typografie Hauptüberschrift (Home) */
h1 {
    font-family: 'Fira Sans', sans-serif;
    font-weight: 300; /* Light */
    font-size: 2.2rem;
    color: var(--wm-blue);
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* =========================================
   6. FORMULARE & SUCHE
   ========================================= */
.search-group {
    display: flex;
    gap: 0;
    margin-bottom: 50px;
    width: 100%;
    max-width: 100%; 
}

/* Globale Input Styles (Text & Passwort) */
input[type="text"],
input[type="password"],
.login-input {
    width: 100%;
    padding: 18px 25px !important; /* Erzwingt den großen Innenabstand */
    font-size: 1.1rem;
    color: #333;
    background: #fff;
    border: 2px solid var(--wm-blue) !important;
    outline: none;
    border-radius: 0; 
    box-sizing: border-box !important; /* Verhindert, dass Padding die Box sprengt */
    height: 62px !important; /* Zwingt BEIDE Felder auf exakt die gleiche Höhe */
}

/* Ausnahme für das Suchfeld auf der Startseite: 
   Dort muss der rechte Rahmen weg, damit der Button bündig anschließt */
.search-group input[type="text"] {
    flex-grow: 1;
    width: auto;
    border-right: none !important;
}

button.primary-btn {
    padding: 0 40px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    background-color: var(--wm-blue);
    color: white;
    border: 2px solid var(--wm-blue);
    cursor: pointer;
    border-radius: 0; 
    transition: background 0.3s;
}

button.primary-btn:hover {
    background-color: #002244; 
    border-color: #002244;
}

/* =========================================
   7. SUCHERGEBNISSE
   ========================================= */
.result-item {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 20px 0; /* Vertikaler Abstand */
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    width: 100%;     
    max-width: 100%; 
    
    transition: background 0.2s;
}

.result-item:hover {
    background-color: #fcfcfc;
}

/* Der Sprach-Hinweis (Badge) */
.lang-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #666;
    background-color: #eef; /* Ganz helles Blau/Grau */
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 10px;
    vertical-align: middle;
    border: 1px solid #dde;
}

.btn-link {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 25px;
    
    /* Outline Button Style */
    border: 2px solid var(--wm-blue);
    color: var(--wm-blue);
    text-decoration: none;
    border-radius: 0; /* Eckig */
    white-space: nowrap; /* Kein Umbruch im Button */
    transition: all 0.2s;
}

.btn-link:hover {
    background-color: var(--wm-blue);
    color: white;
    text-decoration: none;
}

/* =========================================
   8. TEXT-SEITEN (MD Styles)
   ========================================= */
.text-content {
    text-align: left;
    line-height: 1.8;
    color: #444;
}

/* Überschriften kleiner & Blau */
.text-content h1 {
    font-weight: 500;
    font-size: 1.6rem;      /* Verkleinert */
    
    color: var(--wm-blue);
    border-bottom: 2px solid var(--wm-blue);
    
    padding-bottom: 10px;
    display: inline-block;
    margin-bottom: 25px;
    text-transform: none; 
}

.text-content h2 {
    color: var(--wm-blue);
    font-size: 1.25rem;     /* Verkleinert */
    
    margin-top: 30px;
    margin-bottom: 10px;
    font-weight: 500;
}

.text-content h3 {
    color: var(--wm-blue);
    font-size: 1.1rem;      /* Verkleinert */
    
    margin-top: 20px;
    margin-bottom: 8px;
    font-weight: 600;
}

.text-content ul, .text-content ol {
    margin-left: 20px;
    margin-bottom: 25px;
    padding-left: 10px;
}

.text-content li {
    margin-bottom: 5px;
}

/* Spalten-Layout für Impressum */
.imprint-grid {
    display: flex;
    flex-wrap: wrap; 
    gap: 80px;
    margin-top: 30px;
}

.imprint-col {
    flex: 1;
    min-width: 300px;
}


/* =========================================
   9. FOOTER (Blau)
   ========================================= */
footer {
    background-color: var(--wm-blue);
    color: white;
    
    /* 110px Padding wie oben */
    padding: 40px var(--side-padding); 
    
    margin-top: auto;
    font-weight: 300;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer nav a {
    color: white;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 30px;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

footer nav a:hover {
    opacity: 1;
    text-decoration: none;
}


/* =========================================
   10. RESPONSIVE (Anpassung der 110px & Mobile)
   ========================================= */

/* Ab 1200px Breite: Padding auf 40px reduzieren */
@media (max-width: 1200px) {
    :root { --side-padding: 40px; }
    .imprint-grid { gap: 40px; }
}

/* Tablet / Handy */
@media (max-width: 768px) {
    :root { --side-padding: 20px; }
    
    /* Zwingt Logo und Button auf dem Handy sauber nebeneinander in EINE Zeile */
    .navbar { 
        flex-direction: row !important; 
        justify-content: space-between !important; 
        align-items: center; 
        gap: 10px; 
        padding-top: 15px; 
        padding-bottom: 15px;
        flex-wrap: nowrap; /* Kein Umbruch! */
    }
    
    /* Logo auf dem Handy minimal verkleinern, damit Platz für den Button bleibt */
    .brand { width: auto; max-width: 160px; } 
    
    /* Sprachmenü sicher im Bildbereich halten und mit dem Finger scrollbar machen */
    .lang-dropdown .dropdown-content {
        right: 0 !important;     /* Öffnet sich nach links innen */
        left: auto !important; 
        max-height: 60vh;        /* Nimmt max 60% der Bildschirmhöhe ein */
        overflow-y: auto;        /* Scrollbalken aktivieren */
    }
    
    /* Suche untereinander anordnen */
    .search-group { flex-direction: column; }
    
    /* WICHTIG: Rahmen beim mobilen Suchfeld wiederherstellen, da der Button nun darunter sitzt */
    .search-group input[type="text"] { 
        border-right: 2px solid var(--wm-blue) !important; 
    }
    button.primary-btn { width: 100%; padding: 15px; }
    
    /* Footer Stack */
    footer { flex-direction: column; text-align: center; gap: 25px; }
    footer nav a { display: block; margin: 10px 0; margin-right: 0; }
    
    /* Impressum Stack */
    .imprint-grid { flex-direction: column; gap: 30px; }
}
