/* Immo Rebellen site header – loads on every page.
   Everything is namespaced (#irh / .irh-*) and sets its own font, colours
   and box model, so the theme/Elementor kit can't bleed into it. */

@font-face {
  font-family: "IR Bebas Neue";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/bebas-neue-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --irh-h: 84px;
  --irh-h-compact: 68px;
  --irh-gold: #e3be4f;
  --irh-gold-hover: #f0cd63;
  --irh-ink: #f5f5f5;
  --irh-canvas: #0d0f13;
  --irh-top: var(--wp-admin--admin-bar--height, 0px);
}

@media (max-width: 1023px) {
  :root {
    --irh-h: 68px;
    --irh-h-compact: 60px;
  }
}

/* in-page anchors (#About-Us …) land below the header, not under it */
html {
  scroll-padding-top: calc(var(--irh-h) + 16px);
}

/* iOS Safari: "overflow-x: hidden" on html/body (set by the theme/page) makes
   fixed elements jump into the page while scrolling. "clip" cuts the sides
   off just the same without that side effect; browsers that don't know clip
   ignore the line and keep the previous value. */
body.irh-on,
html:has(body.irh-on) {
  overflow-x: clip !important;
}

/* the theme's own header is replaced */
body.irh-on .elementor-location-header,
body.irh-on #site-header.site-header {
  display: none !important;
}

#irh,
#irh *,
#irh-panel,
#irh-panel * {
  box-sizing: border-box;
}

#irh {
  position: fixed;
  top: var(--irh-top);
  left: 0;
  right: 0;
  z-index: 9990;
  height: var(--irh-h);
  margin: 0;
  color: var(--irh-ink);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  /* own compositing layer: Safari keeps it glued to the top while scrolling */
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
  transition: height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#irh a {
  color: inherit;
  text-decoration: none;
  box-shadow: none;
}

#irh img {
  display: block;
  max-width: none;
  height: auto;
  border: 0;
}

#irh .irh-ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- layers: legibility scrim (over photos) / glass (scrolled) ---------- */

.irh-scrim,
.irh-glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.irh-scrim {
  bottom: -40px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.22) 60%, rgba(0, 0, 0, 0) 100%);
}

.irh-glass {
  opacity: 0;
  background: rgba(13, 15, 19, 0.74);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
}

/* gold hairline that grows in once the header turns to glass */
.irh-glass::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(227, 190, 79, 0.55), transparent);
  transform: scaleX(0);
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#irh.is-scrolled,
#irh.irh--solid.is-scrolled {
  height: var(--irh-h-compact);
}

#irh.is-scrolled .irh-scrim {
  opacity: 0;
}

#irh.is-scrolled .irh-glass,
#irh.irh--solid .irh-glass {
  opacity: 1;
}

#irh.is-scrolled .irh-glass::after {
  transform: scaleX(1);
}

#irh.irh--solid .irh-scrim {
  opacity: 0;
}

#irh.is-hidden {
  transform: translate3d(0, calc(-100% - var(--irh-top) - 2px), 0);
}

/* reserves the header's height on pages without a photo on top */
.irh-spacer {
  height: var(--irh-h);
  background: var(--irh-canvas);
}

/* ---------- layout ---------- */

.irh-inner {
  position: relative;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.irh-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

#irh .irh-logo-mark {
  height: 36px;
  width: auto;
  transition: height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#irh .irh-logo-word {
  height: 15px;
  width: auto;
}

#irh .irh-logo:hover .irh-logo-mark {
  transform: rotate(-8deg) scale(1.06);
}

#irh.is-scrolled .irh-logo-mark {
  height: 30px;
}

/* ---------- desktop navigation ---------- */

.irh-nav {
  margin: 0 auto;
}

#irh .irh-menu,
#irh .irh-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

#irh .irh-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

#irh .irh-menu > li {
  position: relative;
  margin: 0;
}

#irh .irh-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(245, 245, 245, 0.8);
  transition: color 0.2s ease, background 0.2s ease;
}

#irh .irh-link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--irh-gold);
  transform: scaleX(0);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#irh .irh-link:hover,
#irh .irh-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

#irh .irh-link:hover::after,
#irh .is-current > .irh-link::after {
  transform: scaleX(1);
}

#irh .is-current > .irh-link {
  color: #fff;
}

#irh .irh-caret {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}

/* dropdowns (ready for upcoming pages: Eigentümer, Projekte, Blog …) */
#irh .irh-sub {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  min-width: 240px;
  width: max-content;
  max-width: 320px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(17, 19, 24, 0.92);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.2s;
}

#irh .irh-sub::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

#irh .has-sub:hover > .irh-sub,
#irh .has-sub:focus-within > .irh-sub {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

#irh .has-sub:hover > .irh-link .irh-caret,
#irh .has-sub:focus-within > .irh-link .irh-caret {
  transform: rotate(180deg);
}

#irh .irh-sub a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(245, 245, 245, 0.85);
  transition: background 0.2s ease, color 0.2s ease;
}

#irh .irh-sub a:hover,
#irh .irh-sub .is-current > a {
  background: rgba(227, 190, 79, 0.1);
  color: var(--irh-gold);
}

/* ---------- actions ---------- */

.irh-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

#irh .irh-phone,
#irh .irh-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--irh-ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#irh .irh-phone {
  padding: 0 18px 0 14px;
}

#irh .irh-phone .irh-ico,
#irh .irh-call .irh-ico {
  color: var(--irh-gold);
}

#irh .irh-phone:hover,
#irh .irh-call:hover {
  border-color: var(--irh-gold);
  background: rgba(227, 190, 79, 0.1);
}

#irh .irh-cta,
#irh-panel .irh-cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--irh-gold);
  color: var(--irh-canvas);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 8px 24px -10px rgba(227, 190, 79, 0.7);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* light sweep across the button on hover */
#irh .irh-cta::before,
#irh-panel .irh-cta::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

#irh .irh-cta:hover,
#irh-panel .irh-cta:hover {
  background: var(--irh-gold-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -10px rgba(227, 190, 79, 0.85);
}

#irh .irh-cta:hover::before,
#irh-panel .irh-cta:hover::before {
  left: 120%;
}

#irh .irh-cta-arrow,
#irh-panel .irh-cta-arrow {
  transition: transform 0.25s ease;
}

#irh .irh-cta:hover .irh-cta-arrow,
#irh-panel .irh-cta:hover .irh-cta-arrow {
  transform: translateX(3px);
}

#irh .irh-call {
  display: none;
  width: 44px;
  padding: 0;
}

#irh .irh-burger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  color: var(--irh-ink);
  box-shadow: none;
}

#irh .irh-burger span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.35s ease;
}

#irh .irh-burger span:first-child {
  top: 17px;
}

#irh .irh-burger span:last-child {
  top: 25px;
  right: 18px;
}

#irh .irh-burger[aria-expanded="true"] span:first-child {
  top: 21px;
  transform: rotate(45deg);
}

#irh .irh-burger[aria-expanded="true"] span:last-child {
  top: 21px;
  right: 13px;
  transform: rotate(-45deg);
}

#irh .irh-burger:focus-visible,
#irh a:focus-visible,
#irh-panel a:focus-visible {
  outline: 2px solid var(--irh-gold);
  outline-offset: 3px;
}

/* tighter desktop: drop the written number before anything wraps */
@media (max-width: 1240px) {
  #irh .irh-phone-label {
    display: none;
  }

  #irh .irh-phone {
    width: 44px;
    padding: 0;
  }

  /* five menu items + actions on small laptops */
  #irh .irh-menu {
    gap: 0;
  }

  #irh .irh-link {
    padding: 10px 11px;
    font-size: 14px;
  }
}

@media (max-width: 1140px) and (min-width: 1024px) {
  #irh .irh-link {
    padding: 10px 9px;
  }
}

/* ---------- tablet & phone ---------- */

@media (max-width: 1023px) {
  .irh-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .irh-nav,
  #irh .irh-phone,
  #irh .irh-actions > .irh-cta {
    display: none;
  }

  #irh .irh-call,
  #irh .irh-burger {
    display: inline-flex;
  }

  .irh-actions {
    margin-left: auto;
    gap: 8px;
  }

  #irh .irh-logo-mark {
    height: 30px;
  }

  #irh .irh-logo-word {
    height: 12px;
  }

  #irh.is-scrolled .irh-logo-mark {
    height: 26px;
  }

  /* menu open: header sits on the panel, no glass needed */
  #irh.is-open .irh-glass,
  #irh.is-open .irh-scrim {
    opacity: 0;
  }
}

@media (max-width: 380px) {
  #irh .irh-logo-word {
    height: 10px;
  }
}

/* ---------- mobile panel ---------- */

#irh-panel {
  position: fixed;
  inset: 0;
  top: var(--irh-top);
  z-index: 9989;
  display: flex;
  flex-direction: column;
  padding: calc(var(--irh-h) + 24px) 24px calc(24px + env(safe-area-inset-bottom));
  color: var(--irh-ink);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
  clip-path: circle(0 at calc(100% - 38px) 34px);
  transition: clip-path 0.6s cubic-bezier(0.7, 0, 0.2, 1), visibility 0s linear 0.6s;
}

#irh-panel[hidden] {
  display: none;
}

#irh-panel.is-open {
  visibility: visible;
  clip-path: circle(150% at calc(100% - 38px) 34px);
  transition: clip-path 0.7s cubic-bezier(0.7, 0, 0.2, 1), visibility 0s;
}

.irh-panel-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(227, 190, 79, 0.16), transparent 60%),
    radial-gradient(90% 50% at 0% 100%, rgba(227, 190, 79, 0.08), transparent 60%),
    var(--irh-canvas);
}

#irh-panel .irh-panel-menu,
#irh-panel .irh-panel-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

#irh-panel .irh-panel-menu > li {
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#irh-panel.is-open .irh-panel-menu > li {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.18s + var(--i, 0) * 0.06s);
}

#irh-panel .irh-panel-link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 0;
  color: var(--irh-ink);
  text-decoration: none;
  font-family: "IR Bebas Neue", "Bebas Neue", "Oswald", sans-serif;
  font-size: clamp(40px, 11vw, 56px);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

#irh-panel .irh-panel-num {
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--irh-gold);
  transform: translateY(-1.4em);
}

#irh-panel .is-current > .irh-panel-link,
#irh-panel .irh-panel-link:hover {
  color: var(--irh-gold);
}

#irh-panel .irh-panel-sub {
  padding: 0 0 14px 30px;
}

#irh-panel .irh-panel-sub a {
  display: block;
  padding: 8px 0;
  color: rgba(245, 245, 245, 0.75);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
}

.irh-panel-foot {
  margin-top: auto;
  padding-top: 32px;
  display: grid;
  gap: 18px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#irh-panel.is-open .irh-panel-foot {
  opacity: 1;
  transform: none;
  transition-delay: 0.42s;
}

#irh-panel .irh-cta--block {
  width: 100%;
  height: 54px;
  font-size: 16px;
}

.irh-panel-contact {
  display: grid;
  gap: 4px;
}

#irh-panel .irh-panel-contact a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: rgba(245, 245, 245, 0.8);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

#irh-panel .irh-ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#irh-panel .irh-panel-contact .irh-ico {
  color: var(--irh-gold);
}

html.irh-locked,
html.irh-locked body {
  overflow: hidden;
}

/* full-screen photo / floor-plan views on property pages */
html.ir-noscroll #irh {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (min-width: 1024px) {
  #irh-panel {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #irh,
  #irh *,
  #irh-panel,
  #irh-panel * {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
