/* ============================================================
   Navigation.css – Huber Holzbau Sitepackage
   Präfix "ahn-" auf allen Klassen und IDs.
   ============================================================ */

:root {
  --ahn-bg:       #eeeae5;
  --ahn-sub-bg:   #eee;
  --ahn-text:     #222;
  --ahn-accent:   #000000;
  --ahn-divider:  rgba(238,234,229,.13);
  --ahn-hover:    rgba(28,129,74,.15);
  --ahn-header-h: 64px;
  --ahn-ease:     cubic-bezier(.22,1,.36,1);
  --ahn-dur:      .34s;
}

/* ── Header ─────────────────────────────────────────────────── */
.ahn-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--ahn-header-h);
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 0;
  z-index: 900;
}

.ahn-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.ahn-logo img { height: 40px; width: auto; }

.ahn-logo img {
    height: 25vw;
    width: auto;
    position: absolute;
    top: 5px;
    left: 8px;
    display: block;
    padding: 1vw 2vw;
    background-color: #fff;
    box-shadow: 1px 2px 9px #0000008a;
}


  .ahn-logo {
    transition: transform 0.35s ease;
    transform-origin: left top; /* ← von left center ändern */
    align-self: flex-start; /* ← raus aus dem .is-scrolled-Block, immer aktiv */
  }

  .ahn-header.is-scrolled .ahn-logo {
    transform: scale(0.5);
    /* align-self: flex-start; -  Logo aus der Flex-Mitte nach oben schieben */
  }

  .ahn-header.is-scrolled .ahn-logo img {
    box-shadow: none;
}


  .ahn-header {
    align-items: flex-start; /* ← Header richtet alle Kinder oben aus */
    border-top: 4px solid #fff;
  }

  .ahn-logo {
    transition: transform 0.35s ease;
    transform-origin: left top;
  }

  .ahn-header.is-scrolled .ahn-logo {
    transform: scale(0.5);
  }

    .ahn-burger {
    margin-top: 4px; /* ggf. anpassen */
  }



/* ── Hamburger ──────────────────────────────────────────────── */
.ahn-burger {
  background: none; border: none; cursor: pointer;
  padding: 10px; margin-right: -10px;
  display: flex; flex-direction: column; gap: 5px; z-index: 1100;
}
.ahn-burger__bar {
  display: block; width: 24px; height: 2px;
  background: #5B4823; border-radius: 2px;
  transition: transform var(--ahn-dur) var(--ahn-ease), opacity .2s, width var(--ahn-dur) var(--ahn-ease);
  transform-origin: center;
}
.ahn-nav-open .ahn-burger__bar              { background: #fff; }
.ahn-nav-open .ahn-burger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ahn-nav-open .ahn-burger__bar:nth-child(2) { opacity: 0; width: 0; }
.ahn-nav-open .ahn-burger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Overlay ────────────────────────────────────────────────── */
.ahn-nav-bg {
  position: fixed; inset: 0; background: rgba(25,15,5,.52);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  z-index: 950; opacity: 0; pointer-events: none;
  transition: opacity var(--ahn-dur) var(--ahn-ease);
}
.ahn-nav-open .ahn-nav-bg { opacity: 1; pointer-events: auto; }

/* ── Drawer ─────────────────────────────────────────────────── */
.ahn-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(360px,92vw); background: var(--ahn-bg);
  z-index: 1000; display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--ahn-dur) cubic-bezier(.6,0,.8,0);
  will-change: transform;
}
.ahn-nav-open .ahn-drawer { transform: translateX(0); transition-timing-function: var(--ahn-ease); }

.ahn-drawer__head {
  flex-shrink: 0; height: var(--ahn-header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--ahn-divider); background-color: #1c814a;
}
.ahn-drawer__brand { color: var(--ahn-text); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; opacity: .55; }
.ahn-drawer__close {
  background: none; border: none; cursor: pointer; color: #ffffff;
  opacity: .6; padding: 8px; margin-right: -8px; display: flex; align-items: center; transition: opacity .2s;
}
.ahn-drawer__close:hover { opacity: 1; }
.ahn-drawer__close svg { width: 30px; height: 30px; }

/* ── Panel-System ───────────────────────────────────────────── */
.ahn-panels { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.ahn-panel {
  position: absolute; inset: 0; overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  transition: transform var(--ahn-dur) var(--ahn-ease);
  display: flex; flex-direction: column;
}
#ahn-p1             { transform: translateX(0);    background: var(--ahn-bg); }
#ahn-p1.ahn-shifted { transform: translateX(-25%); }
#ahn-p2             { transform: translateX(100%); background: var(--ahn-sub-bg); }
#ahn-p2.ahn-visible { transform: translateX(0); }

.ahn-back-btn {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: 15px 20px; width: 100%;
  background: #eeeae5; border: none; border-bottom: 1px solid var(--ahn-divider);
  cursor: pointer; text-align: left; color: var(--ahn-accent);
  font-family: inherit; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  transition: background .16s;
}
.ahn-back-btn:hover { background: var(--ahn-hover); }
.ahn-back-btn svg   { width: 16px; height: 16px; }

.ahn-sub-title {
  flex-shrink: 0; padding: 20px 20px 14px; color: var(--ahn-text);
  font-size: 1.15rem; font-weight: 700; border-bottom: 1px solid var(--ahn-divider);display:none;
}

/* ── Nav-Listen (Mobile Drawer) ─────────────────────────────── */
.ahn-nav-list { list-style: none; padding: 8px 5vw;}
.ahn-nav-list li > a, .ahn-nav-list li > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    color: var(--ahn-text);
    text-decoration: none;
    font-family: inherit;
    font-size: 1.02rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    line-height: 1.3;
    transition: background .15s, color .15s;
    border-bottom: 1px solid #ccc;
}
.ahn-nav-list li > a:hover,
.ahn-nav-list li > button:hover { background: var(--ahn-hover); color: #a8dcbc; }
.ahn-nav-list li > a span,
.ahn-nav-list li > button span { flex: 1; }
.ahn-nav-list li.ahn-active > a,
.ahn-nav-list li.ahn-active > button { color: #1c814a; }
.ahn-nav-list li.ahn-current > a { color: #1c814a; border-left: 8px solid #1c814a; padding-left: 17px; }
/* Sub-Liste (Panel 2) */
#ahn-sub-list li > a.ahn-active  { color: #1c814a; }
#ahn-sub-list li > a.ahn-current { color: #1c814a; border-left: 8px solid #1c814a; padding-left: 17px; }

.ahn-arrow { flex-shrink: 0; color: var(--ahn-accent); width: 17px; height: 17px; opacity: .85; }

ul#ahn-sub-list {margin-top: 0;}

/* ── Drawer Fuß ─────────────────────────────────────────────── */
.ahn-drawer__foot { flex-shrink: 0; border-top: 1px solid var(--ahn-divider); padding: 18px 20px;display: none; }
.ahn-foot-links { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ahn-foot-links a {
  color: var(--ahn-text); text-decoration: none; opacity: .65;
  font-size: .88rem; display: flex; align-items: center; gap: 8px; transition: opacity .18s;
}
.ahn-foot-links a:hover { opacity: 1; color: #a8dcbc; }
.ahn-foot-links svg, .ahn-drawer__brand svg { width: 14px; height: 14px; flex-shrink: 0; }
.ahn-socials { display: flex; gap: 4vw; }
.ahn-socials a { color: var(--ahn-bg); opacity: .68; transition: opacity .18s; display: flex; }
.ahn-socials a:hover { opacity: 1; }
.ahn-socials svg { width: 5vw; height: 5vw; }

body.ahn-nav-open { overflow: hidden; }

/* Side Widget Control  */
.side-widget-control {
    width: 4vw;
    height: 65vw;
    display: block;
    background-color: transparent;
    border: none;
    top: 44vw;
    position: fixed;
    left: 0vw;
    z-index: 99;
}


/* ═══════════════════════════════════════════════════════════
   DESKTOP NAV  (> 850px)
   CSS-Hover-Dropdowns auf der einmalig gerenderten <nav>
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 850px) {
  /* Nav auf Mobile ausblenden – JS baut Drawer */
  .ahn-nav { display: none; }
}

@media (min-width: 851px) {
  .ahn-burger  { display: none; }
  .ahn-nav-bg  { display: none !important; }
  .ahn-drawer  { display: none !important; }
  .side-widget-control { display: none; }

  .ahn-nav {
    display: flex;
    align-items: center;
    height: 100%;
  }

  .ahn-nav__list {
    display: flex; align-items: center; height: 100%; list-style: none; gap: 0; padding: 0 !important;
  }

  .ahn-nav__item {
    position: relative; height: 4vw; display: flex; align-items: center;
  }

  /* Top-Level-Link */
  .ahn-nav__link {
    display: flex; align-items: center; gap: 4px; height: 100%;
    padding: 0 14px 0 0; color: #3a2e1a; text-decoration: none;
    font-size: .88rem; letter-spacing: .03em; white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color .18s, border-color .18s;
    color: #37634b;
  }

  .ahn-nav__item:hover        > .ahn-nav__link,
  .ahn-nav__item:focus-within > .ahn-nav__link,
  .ahn-nav__item.ahn-active   > .ahn-nav__link {
            color: #3a2e1a;
        border-bottom-color: transparent;
        border-bottom-width: 10px;
        padding-top: 8px;
  }

  .ahn-nav__item.ahn-current > .ahn-nav__link {
    color: #1c814a; border-bottom-color: transparent; font-weight: 400;background-color: #f1f1f15e;
  }

  /* Pfeil */
  .ahn-d-arrow {
    width: .8vw; height: .8vw; color: #9e8a6f;
    transition: transform .22s var(--ahn-ease), color .18s;
    flex-shrink: 0; margin-top: .2vw;
  }
  .ahn-nav__item:hover        .ahn-d-arrow,
  .ahn-nav__item:focus-within .ahn-d-arrow { transform: rotate(180deg); color: var(--ahn-accent); }

  /* ── Dropdown ── */
  .ahn-nav__sub {
    display: block; position: absolute; top: calc(100% - 3px); left: 0;
    transform: translateY(-6px);
    min-width: 220px; background: #fff;
    border-top: 1px solid #e6e6e6;
    box-shadow: 0 8px 28px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.07);
    border-radius: 0 0 4px 4px; list-style: none; padding: 0 0;
    opacity: 0; pointer-events: none;
    transition: opacity .2s var(--ahn-ease), transform .2s var(--ahn-ease);
    z-index: 800;
  }
  .ahn-nav__item:hover        .ahn-nav__sub,
  .ahn-nav__item:focus-within .ahn-nav__sub {
    opacity: 1; pointer-events: auto; transform: translateY(0);
  }

  /* Dropdown-Items */
  .ahn-nav__sub-link {
    display: block; padding: 10px 18px; color: #3a2e1a;
    text-decoration: none; font-size: .87vw; white-space: nowrap;
    border-right: 10px solid transparent; border-top: 1px solid #eee;
    transition: background .14s, color .14s, padding-left .14s; width: 100%;
  }
  .ahn-nav__sub-link:hover,
  .ahn-nav__sub-link:focus {
    background: #eeeae5; color: var(--ahn-accent);
     border-right-color: #1c814a;
  }
  .ahn-nav__sub-item.ahn-active  .ahn-nav__sub-link { color: var(--ahn-accent); }
  .ahn-nav__sub-item.ahn-current .ahn-nav__sub-link {
    color: #1c814a; font-weight: 400;
    border-left-color: var(--ahn-accent); padding-left: 22px;
  }
  .ahn-d-sep { height: 1px; background: #e8e3db; margin: 4px 12px; }

  .ahn-header {     
    /* border-top: 1vw solid #1C814A; */
    width: 75vw;
    left: 25vw; 
    padding: 3vw 0 2vw;}

  .ahn-header {
    align-items: flex-start;
    border-top: unset;
    box-shadow: unset;
}

  .ahn-logo {
    display: none;
  }

  .ahn-header:before {
    content: "";
    position: absolute;
    top: 0;
    left: 20px;
    right: 0;
    height: 1vw;
    background-color: #1C814A;
}

}

@media (min-width: 768px) and (max-width: 850px) {

    .ahn-logo img {
        display: none;
    }

    .ahn-header { 
        box-shadow: none;

    }

    .mainwrap {
  
    margin: 12% 0 0 13%;

}

.contactbar {

    font-size: 1vw;
    line-height: 1.2;
}

}

@media (min-width: 851px) and (max-width: 1199px) {
  .ahn-header {
        width: 100%;
        left: 16vw;
    }

    .ahn-header:before {
        left: 0;

    }

    .ahn-nav__link {
        font-size: .78rem;
    }

    .ahn-nav__sub-link {
        font-size: 1.1vw;
    }
}

@media (min-width: 1200px) {
  .ahn-nav__link { padding: 0 20px 0 20px; font-size: 1vw; }
}
