/* ==========================================================================
   LEBENSRAUM IMMOBILIEN - MASTER STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600&display=swap');

:root {
    --primary: #019fbf;
    --dark: #1a1a1a;
    --white: #ffffff;
    --radius: 20px;
    --section-spacing: 100px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Montserrat', sans-serif; color: var(--dark); line-height: 1.8; overflow-x: clip; background-color: var(--white); -webkit-font-smoothing: antialiased; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 40px; }

/* --- HEADER & NAVIGATION --- */
header { position: fixed; width: 100%; top: 0; z-index: 2000; padding: 30px 0; transition: var(--transition); background: transparent; }
header.shrink { background: rgba(255, 255, 255, 0.98); padding: 15px 0; box-shadow: 0 10px 30px rgba(0,0,0,0.03); }

.header-container { max-width: 1400px; margin: 0 auto; padding: 0 40px; display: flex; justify-content: space-between; align-items: center; }

.logo { display: flex; align-items: center; gap: 15px; text-decoration: none !important; }
.logo-icon { height: 35px; width: auto; transition: var(--transition); }
.logo-text { color: var(--white); font-weight: 300; font-size: 1.2rem; letter-spacing: 2px; text-transform: uppercase; transition: var(--transition); }

header.shrink .logo-text { color: var(--primary); font-weight: 600; }
header.shrink .logo-icon { content: url('/assets/img/star-blue.png'); }

.nav-desktop { display: block; }
.nav-links { display: flex; list-style: none; gap: 30px; align-items: center; }
.nav-links li a { text-decoration: none; color: var(--white); font-weight: 400; font-size: 0.85rem; letter-spacing: 1.5px; text-transform: uppercase; transition: var(--transition); }

header.shrink .nav-links li a { color: var(--dark); }
header.shrink .nav-links li a:hover { color: var(--primary); }
.nav-links li a.active { color: var(--primary) !important; font-weight: 600; }

.cta-btn { background: var(--primary); color: var(--white) !important; padding: 12px 25px !important; border-radius: 50px; font-weight: 600; display: inline-block; border: 1px solid var(--primary); text-transform: uppercase; letter-spacing: 1px; transition: var(--transition); text-decoration: none; cursor: pointer; }
.cta-btn:hover { background: transparent; color: var(--primary) !important; }
header.shrink .cta-btn.active { background: transparent; color: var(--primary) !important; }

/* --- OVERLAY MENÜ --- */
.burger { display: none; cursor: pointer; z-index: 3000; }
.burger div { width: 25px; height: 2px; background: var(--white); margin: 6px; transition: var(--transition); }
header.shrink .burger div { background: var(--primary); }

.burger.toggle div:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); background: var(--primary); }
.burger.toggle div:nth-child(2) { opacity: 0; }
.burger.toggle div:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); background: var(--primary); }

.nav-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--white); z-index: 2500; display: flex; flex-direction: column; align-items: center; justify-content: center; visibility: hidden; opacity: 0; transform: translateY(-100%); transition: var(--transition); }
.nav-overlay.open { visibility: visible; opacity: 1; transform: translateY(0); }
.nav-overlay ul { list-style: none; text-align: center; }
.nav-overlay a { font-size: 1.8rem; color: var(--dark); text-decoration: none; text-transform: uppercase; display: block; margin: 20px 0; letter-spacing: 3px; transition: var(--transition);}
.nav-overlay a.active, .nav-overlay a:hover { color: var(--primary); font-weight: 600; }

.overlay-header { position: absolute; top: 30px; left: 40px; display: flex; align-items: center; gap: 15px; }
.overlay-logo { height: 30px; }
.overlay-title { color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; font-size: 1.1rem; }
.close-x { position: absolute; top: 25px; right: 40px; font-size: 3.5rem; cursor: pointer; color: var(--primary); line-height: 1; z-index: 3000; font-weight: 300; }

/* --- HERO BEREICHE --- */
.hero { height: 60vh; min-height: 500px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--white); background-size: cover; background-position: center; background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('/assets/img/hero-bg.jpg'); }
.hero h1 { font-size: 3.5rem; font-weight: 300; letter-spacing: 8px; text-transform: uppercase; margin-bottom: 10px; }
.hero p { letter-spacing: 4px; font-weight: 300; font-size: 1rem; }

/* EXPOSÉ HEADER FANCY */
.expose-header-fancy { padding: 180px 0 80px 0; text-align: center; position: relative; margin-bottom: 60px; }
.expose-location-badge { background: var(--white); color: var(--primary); padding: 8px 25px; border-radius: 50px; display: inline-block; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; font-size: 0.85rem; margin-bottom: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.expose-title { color: var(--white); text-transform: none; font-weight: 400; font-size: 3.5rem; letter-spacing: 0; margin: 0; text-shadow: 0 4px 20px rgba(0,0,0,0.6); }

/* --- HARD FACTS --- */
.hard-facts-container { max-width: 1100px; margin: -60px auto 0; position: relative; z-index: 10; padding: 0 20px; }
.hard-facts { display: flex; flex-wrap: wrap; background: var(--white); padding: 40px; border-radius: var(--radius); box-shadow: 0 20px 40px rgba(0,0,0,0.06); justify-content: space-around; text-align: center; gap: 30px; }
.fact-item { flex: 1; min-width: 200px; }
.fact-item h2 { color: var(--primary); font-size: 2.8rem; font-weight: 600; }
.fact-item p { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; color: #999; }

/* --- FILTER BAR --- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 20px; background: var(--white); padding: 20px 30px; border-radius: 50px; box-shadow: 0 15px 40px rgba(0,0,0,0.08); margin-top: -100px; position: relative; z-index: 10; justify-content: center; margin-bottom: 80px; }
.filter-bar select, .filter-bar input { padding: 14px 25px; border: 1px solid #eee; border-radius: 30px; font-family: 'Montserrat', sans-serif; font-size: 0.9rem; outline: none; transition: var(--transition); background: #fafafa; }
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--primary); background: #fff; }

/* =========================================================
   GRIDS & CARDS (MAX 4 PRO ZEILE, VOLLER TITEL, BILDER FIX)
   ========================================================= */
section { padding: var(--section-spacing) 0; }
.section-title { text-align: center; font-weight: 300; font-size: 2.2rem; margin-bottom: 60px; letter-spacing: 3px; text-transform: uppercase; }

/* Grid Definition für max 4 in einer Reihe */
.grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 768px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1400px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card { background: var(--white); border-radius: var(--radius); transition: var(--transition); box-shadow: 0 5px 20px rgba(0,0,0,0.03); display: flex; flex-direction: column; height: 100%; }
.card:hover { transform: translateY(-10px); box-shadow: 0 15px 40px rgba(0,0,0,0.08); }

/* BILDER-FIX: Bulletproof Aspect Ratio (3:2) - Scharf und unverzerrt */
.card-image-wrapper { 
    position: relative; 
    width: 100%;
    padding-top: 66.66%; /* Zwingt das Bild in ein perfektes 3:2 Foto-Format */
    overflow: hidden; 
    border-radius: var(--radius) var(--radius) 0 0; 
    background: #f4f4f4;
}

.card img { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; 
    height: 100%; 
    object-fit: cover; /* Verhindert jegliche Verzerrung */
    object-position: center;
    display: block; 
    transition: transform 0.5s ease; 
}
.card:hover img { transform: scale(1.05); }

.immo-badge { position: absolute; top: 20px; left: 20px; background: var(--primary); color: var(--white); padding: 8px 15px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; z-index: 2; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.card-body { padding: 30px 25px; flex-grow: 1; display: flex; flex-direction: column; }

/* TITEL-FIX: Kompletter Titel wird jetzt in voller Länge angezeigt */
.card-body h3 { 
    font-size: 1.15rem; 
    font-weight: 600; 
    color: var(--dark); 
    line-height: 1.5;
    margin-bottom: 20px;
}

/* --- EXPOSÉ DETAILSEITE --- */
.expose-layout { display: flex; gap: 60px; align-items: flex-start; margin-top: 50px; }
.expose-main { flex: 2; }
.expose-sidebar { flex: 1; position: sticky; top: 120px; background: #fff; padding: 40px; border-radius: var(--radius); box-shadow: 0 15px 40px rgba(0,0,0,0.06); }

.expose-gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; margin-bottom: 40px; border-radius: var(--radius); overflow: hidden; }
.expose-gallery img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); cursor: pointer; }
.expose-gallery img:hover { filter: brightness(0.9); }
.gallery-main { height: 500px; }
.gallery-thumbs { display: flex; flex-direction: column; gap: 15px; }
.gallery-thumbs img { height: calc(250px - 7.5px); }

.hard-fact-list { list-style: none; padding: 0; margin: 30px 0; border-top: 1px solid #eee; }
.hard-fact-list li { display: flex; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #eee; font-size: 0.95rem; }
.hard-fact-list li span:first-child { color: #888; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }
.hard-fact-list li span:last-child { font-weight: 600; color: var(--dark); text-align: right;}
.expose-price { font-size: 2.5rem; color: var(--primary); font-weight: 600; margin-bottom: 10px; }

/* --- FOOTER --- */
footer { background-color: #fff; padding: 80px 0 40px 0; border-top: 1px solid #f0f0f0; }
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(32px, 4vw, 64px);
    margin-bottom: 50px;
}
.footer-copyright { border-top: 1px solid #ddd; padding-top: 25px; text-align: center; font-size: 0.85rem; color: #888; }
.footer-bottom { padding-top: 30px; border-top: 1px solid #f5f5f5; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; color: #aaa; font-size: 0.75rem; gap: 20px; }

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .nav-desktop { display: none; }
    .burger { display: block; }
    .expose-layout { flex-direction: column; }
    .expose-sidebar { position: static; width: 100%; }
    .expose-gallery { grid-template-columns: 1fr; }
    .gallery-thumbs { display: none; }
    .gallery-main { height: 300px; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    :root { --section-spacing: 80px; }
    .container, .header-container { padding: 0 20px; }
    .hard-facts-container { margin: -40px auto 0; }
    .hard-facts { flex-direction: column; padding: 30px 20px; gap: 40px; }
    .filter-bar { margin-top: -40px; flex-direction: column; border-radius: 20px; padding: 20px; }
    .filter-bar select, .filter-bar input { width: 100%; border-radius: 10px; }
    .filter-bar .cta-btn { border-radius: 10px; width: 100%; }
    .expose-title { font-size: 2.5rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* =========================================================
   BULLETPROOF BILDER-FIX (Verhindert jegliche Verzerrung)
   ========================================================= */
.card-image-wrapper { 
    position: relative !important; 
    width: 100% !important;
    padding-top: 66.66% !important; /* Zwingt ein perfektes 3:2 Format */
    overflow: hidden !important; 
    border-radius: var(--radius) var(--radius) 0 0 !important; 
    background: #f4f4f4 !important;
    display: block !important;
}

.card-image-wrapper img { 
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important; 
    height: 100% !important; 
    object-fit: cover !important; /* DAS IST DER MAGISCHE BEFEHL GEGEN VERZERRUNG */
    object-position: center !important;
    display: block !important; 
    transition: transform 0.5s ease !important; 
}

.card:hover .card-image-wrapper img { 
    transform: scale(1.05) !important; 
}

/* Touch sliders: keep native iOS/Android swiping and remove snap pauses. */
[data-loop-slider] {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-behavior: auto !important;
    scroll-snap-type: none !important;
    touch-action: auto;
    scrollbar-width: none;
}
[data-loop-slider]::-webkit-scrollbar { display: none; }
[data-loop-slider] > * { min-width: 0; scroll-snap-align: none !important; }

/* Prevent long labels, URLs and generated property values from widening the page. */
html, body { max-width: 100%; overflow-x: clip; }
img, video, iframe, embed, object { max-width: 100%; }

@media (max-width: 900px) {
    .container, .header-container { max-width: 100%; }
    .service-grid, .related-grid { min-width: 0; }
    .service-grid > *, .related-grid > * { flex: 0 0 min(82vw, 340px); }
}

/* Responsive page headings: long dynamic titles must stay within the hero. */
.page-header h1, .page-header p, .hero h1, .hero p, .service-hero h1, .service-hero p,
.service-detail-hero h1, .service-detail-hero p, .valuation-hero h1, .valuation-hero p,
.contact-hero h1, .contact-hero p, .privacy-hero h1, .privacy-hero p,
.legal-hero h1, .legal-hero p, .blog-hero h1, .blog-hero p {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}
@media (max-width: 768px) {
    .page-header { overflow: hidden; }
    .page-header h1, .service-hero h1, .service-detail-hero h1, .valuation-hero h1,
    .contact-hero h1, .privacy-hero h1, .legal-hero h1, .blog-hero h1 {
        font-size: clamp(1.75rem, 8.4vw, 2.45rem) !important;
        line-height: 1.16 !important;
        letter-spacing: clamp(1px, 0.8vw, 3px) !important;
    }
    .page-header p, .service-hero p, .service-detail-hero p, .valuation-hero p,
    .contact-hero p, .privacy-hero p, .legal-hero p, .blog-hero p {
        font-size: clamp(0.75rem, 3.4vw, 1rem) !important;
        line-height: 1.5 !important;
        letter-spacing: clamp(0.8px, 0.65vw, 2px) !important;
    }
}
@media (max-width: 420px) {
    .page-header h1, .service-hero h1, .service-detail-hero h1, .valuation-hero h1,
    .contact-hero h1, .privacy-hero h1, .legal-hero h1, .blog-hero h1 {
        font-size: clamp(1.62rem, 8vw, 2rem) !important;
        letter-spacing: 1px !important;
    }
}
/* Saved properties */
.property-favorite-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    color: #019fbf;
    box-shadow: 0 5px 15px rgba(0,40,60,.16);
    font-family: Arial, sans-serif;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}
.property-favorite-toggle:hover { transform: translateY(-2px) scale(1.04); }
.property-favorite-toggle.is-saved { background: #019fbf; color: #fff; }
.property-favorite-toggle:focus-visible { outline: 3px solid rgba(1,159,191,.3); outline-offset: 3px; }

/* Sustainability and health/lifestyle property scores. */
.property-score-badges {
    position: absolute;
    right: 13px;
    bottom: 13px;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 7px;
    pointer-events: none;
}
.property-score-badge {
    width: 42px;
    height: 42px;
    display: grid;
    place-content: center;
    border: 2px solid rgba(255,255,255,.95);
    border-radius: 50%;
    color: #fff;
    text-align: center;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(0,38,55,.28);
}
.property-score-badge strong { font-size: .9rem; font-weight: 800; }
.property-score-badge small { margin-top: 1px; font-size: .52rem; font-weight: 700; letter-spacing: .05em; }
.property-score-badge.is-green, .property-score-panel-item.is-green .property-score-panel-value { background: #1d9a54; }
.property-score-badge.is-cyan, .property-score-panel-item.is-cyan .property-score-panel-value { background: #019fbf; }
.property-score-badge.is-orange, .property-score-panel-item.is-orange .property-score-panel-value { background: #df921f; }
.property-score-badge.is-red, .property-score-panel-item.is-red .property-score-panel-value { background: #cf4b4b; }
.property-score-badge.is-neutral { background: #71808a; }

.property-scores-panel {
    margin: 28px 0 0;
    padding: 22px;
    border: 1px solid #dcecef;
    border-radius: 16px;
    background: #f8fcfd;
}
.property-scores-panel h3 { margin: 0 0 6px; color: #00283c; font-size: 1.05rem; }
.property-scores-panel > p { margin: 0 0 17px; color: #71808a; font-size: .82rem; line-height: 1.5; }
.property-score-panel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.property-score-more { display: inline-flex; align-items: center; gap: 7px; margin-top: 15px; color: var(--primary, #019fbf); font-size: .77rem; font-weight: 700; text-decoration: none; }
.property-score-more span { font-size: 1rem; line-height: 1; transition: transform .2s ease; }
.property-score-more:hover span { transform: translateX(3px); }
.property-score-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px;
    border: 1px solid #e1edf0;
    border-radius: 12px;
    background: #fff;
}
.property-score-panel-value {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    display: grid;
    place-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}
.property-score-panel-value span { margin-top: 1px; font-size: .52rem; font-weight: 700; }
.property-score-panel-item strong, .property-score-panel-item small { display: block; overflow-wrap: anywhere; }
.property-score-panel-item strong { color: #00283c; font-size: .79rem; line-height: 1.25; }
.property-score-panel-item small { margin-top: 4px; color: #71808a; font-size: .68rem; }
@media (max-width: 520px) {
    .property-score-badges { right: 10px; bottom: 10px; gap: 5px; }
    .property-score-badge { width: 37px; height: 37px; }
    .property-score-badge strong { font-size: .78rem; }
    .property-score-panel-grid { grid-template-columns: 1fr; }
}
/* Privacy choices for optional browser-local features. */
.lri-cookie-banner{position:fixed;z-index:12000;right:24px;bottom:24px;width:min(530px,calc(100vw - 32px));padding:22px;border:1px solid #cfe4e8;border-radius:14px;background:#fff;box-shadow:0 20px 54px rgba(0,40,60,.2);color:#00283c;font-family:Montserrat,sans-serif}.lri-cookie-copy strong{display:block;font-size:1rem}.lri-cookie-copy p{margin:8px 0 7px;color:#526b75;font-size:.82rem;line-height:1.55}.lri-cookie-copy a{color:#008eae;font-size:.74rem;font-weight:700;text-decoration:none}.lri-cookie-options{display:grid;gap:8px;margin:16px 0;padding:13px;border-radius:9px;background:#f5fbfc}.lri-cookie-options label{display:flex;align-items:center;gap:9px;color:#37515b;font-size:.78rem}.lri-cookie-options input{accent-color:#019fbf}.lri-cookie-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:17px}.lri-cookie-actions button{min-height:38px;padding:8px 13px;border:1px solid #c9e0e5;border-radius:8px;background:#fff;color:#006f8d;font:700 .76rem Montserrat,sans-serif;cursor:pointer}.lri-cookie-actions .lri-cookie-accept,.lri-cookie-actions .lri-cookie-save{border-color:#019fbf;background:#019fbf;color:#fff}@media(max-width:600px){.lri-cookie-banner{right:12px;bottom:12px;width:calc(100vw - 24px);box-sizing:border-box;padding:18px}.lri-cookie-actions{display:grid;grid-template-columns:1fr 1fr}.lri-cookie-actions button:last-child{grid-column:1/-1}}
