/* ===== H&S Header ===== */
.hs_header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    color: #fff;
    font-family: var(--hs-font-body);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.15) 70%, rgba(0, 0, 0, 0) 100%);
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

/* Beim Scrollen: kompakter + solider dunkler Hintergrund */
.hs_header.is-scrolled {
    background: rgba(48, 58, 70, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}
.hs_header.is-scrolled .hs_header_inner {
    padding-top: 8px;
    padding-bottom: 8px;
}
.hs_header.is-scrolled .hs_header_logo_svg {
    width: clamp(120px, 9vw, 160px);
}
.hs_header.is-scrolled .hs_header_logo {
    padding: 0;
}
.hs_header.is-scrolled .hs_header_cta {
    padding-top: 14px;
    padding-bottom: 14px;
    padding-left: clamp(20px, 2vw, 32px);
    padding-right: clamp(20px, 2vw, 32px);
}
/* Trennlinien unter den Nav-Spalten ausblenden im scrolled state */
.hs_header.is-scrolled .hs_header_nav--left::after,
.hs_header.is-scrolled .hs_header_nav--right::after {
    opacity: 0;
}

/* Parent-Theme hat svg { width: 100%; height: auto } - im Header/Mobile-Menu
   ueberschreiben, AUSSER fuer die Logo-SVGs, die ihre Groesse ueber die
   eigene Klasse steuern. */
.hs_header svg:not(.hs_header_logo_svg),
.hs_mobile_menu svg:not(.hs_mobile_logo_svg) {
    width: auto;
    height: auto;
    max-width: none;
    flex-shrink: 0;
}

.hs_header_inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: clamp(20px, 3vw, 50px);
    padding: clamp(20px, 2vw, 32px) clamp(0px, 2vw, 40px);
    max-width: 1920px;
    margin: 0 auto;
    position: relative;
    transition: padding 0.3s ease;
}
.hs_header_cta { transition: padding 0.3s ease, background 0.2s, color 0.2s; }

/* === Nav links/rechts mit Unterstrich-Linie ===
   ">" — nur die direkte (aeussere) UL, nicht das geschachtelte Submenu-UL.
   Sonst erbt das Submenu position: relative + display: flex und wird damit
   horizontal in der LI-Spalte gerendert. */
.hs_header_nav > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: clamp(30px, 4vw, 60px);
    position: relative;
}
.hs_header_nav--left > ul { justify-content: flex-start; padding-right: clamp(60px, 8vw, 110px); }
.hs_header_nav--right > ul { justify-content: flex-end; padding-left: clamp(60px, 8vw, 110px); }

/* WICHTIG: position: relative auf das nav selbst, damit die ::after-Linie
   relativ zur NAV positioniert wird (und nicht zur .hs_header_inner — sonst
   ueberlappen die linke und rechte Linie und es entsteht eine
   durchgehende Linie ueber den Logo-Bereich hinweg).
   align-self: stretch + UL min-height: Beide Navs erreichen die Hoehe der
   Grid-Row (= Hoehe des Kontakt-Buttons rechts). Dadurch sitzen die
   ::after-Linien beider Navs auf derselben Y-Ebene. */
.hs_header_nav {
    position: relative;
    align-self: stretch;
    display: flex;
    align-items: center;
}
.hs_header_nav > ul { width: 100%; }

/* Unterstrich-Linie auf der Hoehe der Items-Unterkante.
   bottom = (nav_height - cta_height) / 2  →  Y-Position = CTA-Bottom
   (= Unterkante des hoechsten Items in der Grid-Row). --hs-cta-height wird
   von header.js dynamisch gesetzt (Default 68px). */
.hs_header_nav--left::after,
.hs_header_nav--right::after {
    content: '';
    position: absolute;
    bottom: calc((100% - var(--hs-cta-height, 68px)) / 2);
    height: 1px;
    background: rgba(255, 255, 255, 0.20);
    pointer-events: none;
    transition: opacity 0.3s ease, bottom 0.3s ease;
}
.hs_header_nav--left::after {
    left: 0;
    right: clamp(60px, 8vw, 130px);
}
.hs_header_nav--right::after {
    /* Bricht die Trennlinie zusaetzlich vor dem Kontakt-Button (Figma):
       JS misst die CTA-Breite und setzt --hs-cta-offset auf .hs_header.
       Fallback 340px falls JS nicht laeuft (entspricht ~CTA-Breite + Gap). */
    right: var(--hs-cta-offset, 340px);
    left: clamp(60px, 8vw, 130px);
}

.hs_header_nav_item { position: relative; }
.hs_header_nav_item a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-family: var(--hs-font-body);
    font-weight: 300;
    font-size: 16px;
    letter-spacing: 0.03em;
    line-height: 1;
    transition: color 0.2s;
}
.hs_header_nav_item a:hover { color: var(--hs-gold); }

/* Active-State: nur Gold-Einfaerbung, kein Underline-Marker. */
.hs_header_nav_item.is-active > a,
.hs_header_nav_item.is-active > a:hover {
    color: var(--hs-gold);
}
.hs_header_nav_caret {
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hs_header_nav_item--has-children:hover .hs_header_nav_caret,
.hs_header_nav_item--has-children:focus-within .hs_header_nav_caret {
    transform: rotate(180deg);
}

/* === Submenu Dropdown ===
   display: block überschreibt das geerbte display: flex von .hs_header_nav ul */
.hs_header_nav ul.hs_header_submenu {
    display: block;
}
.hs_header_submenu {
    position: absolute;
    /* Visuell 8px Gap zum Link, damit das Dropdown den Hauptlink nicht touchiert */
    top: calc(100% + 8px);
    left: -22px;
    margin: 0;
    padding: 14px 0;
    list-style: none;
    min-width: 220px;
    background: rgba(31, 38, 46, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    border-top: 2px solid var(--hs-gold);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition:
        opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s linear 0.28s;
    z-index: 200;
}
/* Bridge ueberspannt genau den 8px Gap zwischen Link-Bottom und Dropdown-Top —
   nicht ueber den Link selbst, damit Klicks auf den Hauptlink nicht abgefangen
   werden. Bleibt aber pointer-events: auto, damit der Maus-Hover auf der
   Bridge die :hover-Kette zur LI persistiert (Submenu schliesst sonst beim
   Ueberqueren des Gaps). */
.hs_header_submenu::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}
.hs_header_nav_item--has-children:hover > .hs_header_submenu,
.hs_header_nav_item--has-children:focus-within > .hs_header_submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition:
        opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s linear 0s;
}
.hs_header_submenu li { display: block; }
.hs_header_submenu a {
    display: block;
    padding: 11px 28px 11px 26px;
    color: #fff;
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1.4;
    white-space: nowrap;
    position: relative;
    transition: color 0.25s ease, padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.hs_header_submenu a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 1px;
    background: var(--hs-gold);
    transform: translateY(-50%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hs_header_submenu a:hover {
    color: var(--hs-gold);
    padding-left: 38px;
}
.hs_header_submenu a:hover::before { width: 18px; }
/* Stagger-Animation der Items beim Oeffnen */
.hs_header_nav_item--has-children:hover > .hs_header_submenu li,
.hs_header_nav_item--has-children:focus-within > .hs_header_submenu li {
    animation: hs_submenu_in 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.hs_header_nav_item--has-children > .hs_header_submenu li:nth-child(1) { animation-delay: 0.04s; }
.hs_header_nav_item--has-children > .hs_header_submenu li:nth-child(2) { animation-delay: 0.08s; }
.hs_header_nav_item--has-children > .hs_header_submenu li:nth-child(3) { animation-delay: 0.12s; }
.hs_header_nav_item--has-children > .hs_header_submenu li:nth-child(4) { animation-delay: 0.16s; }
.hs_header_nav_item--has-children > .hs_header_submenu li:nth-child(5) { animation-delay: 0.20s; }
@keyframes hs_submenu_in {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* === Logo: komplettes SVG (Haus-Icon + Text "HOLZMANN & SEDLMAYER Immobilien") === */
.hs_header_logo {
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    padding: 0 20px;
    transition: opacity 0.25s ease;
}
.hs_header_logo:hover { opacity: 0.85; }
.hs_header_logo_svg {
    width: clamp(170px, 13vw, 230px);
    height: auto;
    display: block;
    transition: width 0.3s ease;
}

/* === CTA-Button rechts (Gold-Outline mit sliding-fill Hover) === */
/* Selector: .hs_header_nav_item .hs_header_cta — hoehere Spezifitaet als
   .hs_header_nav_item a, damit unsere transition (mit padding!) gewinnt.
   Sonst snapt das Padding beim is-scrolled-Wechsel ohne Animation. */
.hs_header_nav_item .hs_header_cta {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: inline-flex !important;
    align-items: center;
    gap: 18px !important;
    padding: clamp(18px, 1.6vw, 24px) clamp(28px, 3vw, 44px);
    border: 2px solid var(--hs-gold);
    text-transform: uppercase;
    letter-spacing: 0.075em;
    font-size: 16px !important;
    color: #fff !important;
    background: transparent;
    transition:
        padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.35s ease;
}
.hs_header_cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hs-gold);
    transform: translateX(-101%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}
.hs_header_cta:hover::before {
    transform: translateX(0);
}
.hs_header_cta_mark {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 2px;
    flex: 0 0 40px;
    background: transparent;
}
.hs_header_cta_mark::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
    transform-origin: left center;
    transform: scaleX(0.75);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.hs_header_cta:hover .hs_header_cta_mark::before { transform: scaleX(1); }
.hs_header_cta_label {
    line-height: 1;
}

/* === Burger (mobile) === */
.hs_header_burger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    /* Touch-Target mindestens 44x44 (WCAG / Apple HIG) */
    padding: 14px 10px;
    flex-direction: column;
    gap: 5px;
}
.hs_header_burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
}

/* === Zwischen xl und xxl: Nav-Abstaende reduzieren damit Items passen === */
@media (max-width: 1549.98px) {
    .hs_header_nav > ul { gap: clamp(12px, 1.5vw, 24px); }
    .hs_header_nav--left > ul { padding-right: clamp(30px, 3vw, 50px); }
    .hs_header_nav--right > ul { padding-left: clamp(30px, 3vw, 50px); }
    .hs_header_nav--left::after { right: clamp(30px, 3vw, 50px); }
    .hs_header_nav--right::after { left: clamp(30px, 3vw, 50px); }
    .hs_header_nav_item a { font-size: 14px; }
}

/* === Tablet / Mobile: Burger ab 1199px === */
@media (max-width: 1199.98px) {
    .hs_header_nav { display: none; }
    .hs_header_burger { display: flex; }
    .hs_header_inner {
        grid-template-columns: auto 1fr auto;
        padding: 16px 20px;
        gap: 16px;
    }
    .hs_header_logo {
        grid-column: 1;
        justify-self: start;
        padding: 0;
    }
    .hs_header_burger {
        grid-column: 3;
        justify-self: end;
    }
    .hs_header_logo_svg { width: clamp(140px, 30vw, 200px); }
}
@media (max-width: 500px) {
    .hs_header_logo_svg { width: clamp(120px, 36vw, 160px); }
}
@media (max-width: 360px) {
    .hs_header_logo_svg { width: 130px; }
    .hs_header_inner { padding: 12px 14px; gap: 10px; }
}
@media (max-width: 320px) {
    .hs_header_logo_svg { width: 110px; }
    .hs_header_inner { padding: 10px 12px; gap: 8px; }
}

/* === Body-Adjust: Header liegt UEBER dem Hero, kein automatischer Spacer-Padding === */
body { padding-top: 0 !important; }
body.hs_menu_open { overflow: hidden; }

/* ===== Mobile Off-Canvas Menu ===== */
.hs_mobile_menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #2A333D;
    color: #fff;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}
@media (min-width: 600px) {
    .hs_mobile_menu { width: 420px; }
}
.hs_mobile_menu.is-open {
    transform: translateX(0);
    visibility: visible;
}

.hs_mobile_backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.hs_mobile_backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* Top: Logo + Close - mit V-Cut Bottom (Pfeil-Spitze nach unten in der Mitte) */
.hs_mobile_menu_top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 36px;
    background: #2F3A46;
    flex-shrink: 0;
    min-height: 110px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 50% 100%, 0 calc(100% - 14px));
}
.hs_mobile_logo {
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
}
.hs_mobile_logo_svg {
    width: clamp(150px, 50vw, 220px);
    height: auto;
    display: block;
}
.hs_mobile_close {
    background: transparent;
    border: none;
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--hs-gold);
    transition: color 0.2s, transform 0.3s ease;
    flex-shrink: 0;
}
.hs_mobile_close:hover {
    color: var(--hs-gold-dark);
    transform: rotate(90deg);
}
.hs_mobile_close svg path { stroke: currentColor; }

/* Nav-Liste */
.hs_mobile_nav {
    padding: 16px 24px 8px;
    flex: 1 1 auto;
}
.hs_mobile_nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.hs_mobile_item {
    border-bottom: 1px solid rgba(217, 217, 217, 0.18);
}
.hs_mobile_item:first-child { border-top: 1px solid rgba(217, 217, 217, 0.18); }

.hs_mobile_link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #fff;
    font-family: var(--hs-font-display);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-align: left;
    transition: color 0.3s ease;
}
.hs_mobile_link:hover { color: var(--hs-gold); }
/* Active-State: aktiver Menue-Eintrag gold, bei Mobile reicht die Color-Aenderung */
.hs_mobile_item.is-active > .hs_mobile_link,
.hs_mobile_item.is-active > a.hs_mobile_link { color: var(--hs-gold); }
.hs_mobile_caret {
    color: #fff;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
}
.hs_mobile_item--has-children.is-open .hs_mobile_link { color: var(--hs-gold); }
.hs_mobile_item--has-children.is-open .hs_mobile_caret {
    transform: rotate(180deg);
    color: var(--hs-gold);
}
/* Andere Items dimmen wenn ein submenu offen ist */
.hs_mobile_nav.has-open .hs_mobile_item:not(.is-open) > .hs_mobile_link {
    color: rgba(255, 255, 255, 0.5);
}

/* Sub-Menus (max-height-Animation, da grid-rows-Trick bei UL mit mehreren LIs nicht greift) */
.hs_mobile_sub {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.hs_mobile_item.is-open .hs_mobile_sub {
    max-height: 400px;
}
.hs_mobile_sub li {
    padding: 6px 0;
}
.hs_mobile_sub li:first-child { padding-top: 4px; }
.hs_mobile_sub li:last-child { padding-bottom: 18px; }
.hs_mobile_sub a {
    color: #fff;
    text-decoration: none;
    font-family: var(--hs-font-body);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}
.hs_mobile_sub a:hover { color: var(--hs-gold); }

/* CTAs */
.hs_mobile_ctas {
    padding: 16px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.hs_mobile_cta {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    height: 65px;
    padding: 0 24px;
    text-decoration: none;
    font-family: var(--hs-font-body);
    font-weight: 300;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    transition: background 0.3s ease, color 0.3s ease;
}
.hs_mobile_cta--primary {
    background: var(--hs-gold);
    color: #fff;
    margin-bottom: -32px; /* ragt in den hellen Foot-Bereich */
    position: relative;
    z-index: 2;
    justify-content: center;
}
.hs_mobile_cta--primary:hover { background: var(--hs-gold-dark); }
.hs_mobile_cta_mark {
    display: inline-block;
    width: 30px;
    height: 2px;
    background: #fff;
    flex-shrink: 0;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.hs_mobile_cta--primary:hover .hs_mobile_cta_mark { width: 40px; }
.hs_mobile_cta--secondary {
    display: flex;
    background: transparent;
    border: 1px solid rgba(29, 29, 29, 0.20);
    color: var(--hs-text);
    justify-content: center;
    width: 100%;
    margin-bottom: 28px;
}
.hs_mobile_cta--secondary:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--hs-text);
}

/* Foot (heller BG mit Outline-Button + Kontakt + Legal)
   V-Cut Top: Pfeil-Spitze ragt nach unten in den hellen Bereich
   (= dunkler Bereich darueber bekommt einen V-Pointer in der Mitte) */
.hs_mobile_foot {
    background: #F7F7F7;
    color: var(--hs-text);
    padding: 70px 24px 28px;
    flex-shrink: 0;
    margin-top: auto;
    clip-path: polygon(0 0, 50% 18px, 100% 0, 100% 100%, 0 100%);
    position: relative;
    z-index: 0;
}
.hs_mobile_contact_row {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 0;
    font-size: 16px;
    line-height: 1.6;
}
.hs_mobile_contact_row strong { font-weight: 700; }
.hs_mobile_contact a {
    color: var(--hs-text);
    text-decoration: none;
}
.hs_mobile_contact a:hover { color: var(--hs-gold); }
.hs_mobile_legal {
    margin-top: 16px;
    color: rgba(29, 29, 27, 0.5);
    font-size: 14.5px;
}
.hs_mobile_legal a { color: inherit; text-decoration: none; }
.hs_mobile_legal a:hover { color: var(--hs-gold); }
.hs_mobile_legal span { margin: 0 10px; }

/* Skip-Link nur fuer Tastatur-Fokus sichtbar (Accessibility), ansonsten visually hidden */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    left: 0;
    width: auto;
    height: auto;
    padding: 8px 16px;
    background: var(--hs-dark);
    color: #fff;
    z-index: 9999;
}
