/* ============================================================
   Jalapeño Messer – Modern Header
   Alle Werte werden via Inline-Style aus dem Customizer überschrieben.
   Defaults hier sind nur Fallback.
   ============================================================ */

:root {
    --jmh-dark: #0a0a0a;
    --jmh-bar-bg-scrolled: rgba(10, 10, 10, 0.85);
    --jmh-bar-fg-solid: #ffffff;
    --jmh-bar-fg-transparent: #ffffff;
    --jmh-overlay-bg: #0a0a0a;
    --jmh-overlay-fg: #ffffff;
    --jmh-overlay-muted: #8b8275;
    --jmh-accent: #d72638;
    --jmh-line: rgba(255,255,255,0.12);

    --jmh-logo-h: 72px;
    --jmh-logo-h-scrolled: 52px;

    --jmh-font-menu: clamp(1.5rem, 3.2vw, 2.8rem);
    --jmh-font-menu-mobile: clamp(1.5rem, 3.2vw, 2rem);
    --jmh-font-eyebrow: 0.78rem;
    --jmh-font-toggle: 0.92rem;

    --jmh-bar-h: 88px;
    --jmh-bar-h-scrolled: 64px;
    --jmh-easing: cubic-bezier(0.16, 1, 0.3, 1);
    --jmh-easing-snap: cubic-bezier(0.65, 0, 0.35, 1);
}

body.jmh-locked {
    overflow: hidden;
    height: 100vh;
}

/* Screen-Reader-Only — visuell unsichtbar, für AT lesbar.
   Wird für injizierte <h1>-Fallbacks und SR-only-Texte verwendet. */
.jmh-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================================
   STICKY BAR
   ============================================================ */
.jmh-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9990;
    height: var(--jmh-bar-h);
    padding: 0 clamp(1.25rem, 3vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    transition: height .4s var(--jmh-easing), background-color .4s var(--jmh-easing), border-color .4s var(--jmh-easing), color .4s var(--jmh-easing);
    background: transparent;
    border-bottom: 1px solid transparent;
    pointer-events: none;
    /* Default: Vordergrund-Farbe, wird durch is-style-* überschrieben */
    color: var(--jmh-bar-fg-transparent);
}
.jmh-bar > * { pointer-events: auto; }

/* SOLID-Stil: dauerhaft Hintergrund + entsprechende Vordergrund-Farbe */
.jmh-bar.is-style-solid {
    background: var(--jmh-dark);
    color: var(--jmh-bar-fg-solid);
    border-bottom-color: var(--jmh-line);
}

/* TRANSPARENT-Stil: anfangs transparent, beim Scrollen mit BG */
.jmh-bar.is-style-transparent {
    color: var(--jmh-bar-fg-transparent);
}
.jmh-bar.is-style-transparent.is-scrolled {
    height: var(--jmh-bar-h-scrolled);
    background: var(--jmh-bar-bg-scrolled);
    border-bottom-color: var(--jmh-line);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    /* Bei scrolled wechselt sie zur Solid-Vordergrundfarbe */
    color: var(--jmh-bar-fg-solid);
}

/* SOLID + scrolled: nur Höhe ändern */
.jmh-bar.is-style-solid.is-scrolled {
    height: var(--jmh-bar-h-scrolled);
}

/* Beim geöffneten Overlay: Bar wird durchsichtig (Overlay liegt darunter) */
.jmh-bar[data-state="open"] {
    background: transparent !important;
    border-bottom-color: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    color: var(--jmh-overlay-fg) !important;
}

/* Logo bei offenem Drawer ausblenden — verhindert dass es das Menü überlagert */
.jmh-bar[data-state="open"] .jmh-logo {
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s var(--jmh-easing);
}
/* Auf Desktop bleibt das Logo sichtbar (Drawer ist Side-Panel, nicht Full-Overlay) */
@media (min-width: 901px) {
    .jmh-bar[data-state="open"] .jmh-logo {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ----- Logo ----- */
.jmh-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    height: 100%;
    padding: 12px 0;
    box-sizing: border-box;
}
/* Höchste Spezifität, um Theme-CSS zu schlagen (Kadence: .site-branding img) */
.jmh-bar a.jmh-logo img,
.jmh-bar a.jmh-logo img.jmh-logo-img,
.jmh-bar a.jmh-logo img.attachment-medium,
.jmh-bar a.jmh-logo img[class*="wp-image-"],
.jmh-bar .jmh-logo img {
    display: block !important;
    height: var(--jmh-logo-h) !important;
    max-height: var(--jmh-logo-h) !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    transition: height .4s var(--jmh-easing), max-height .4s var(--jmh-easing);
}
.jmh-bar.is-scrolled a.jmh-logo img,
.jmh-bar.is-scrolled a.jmh-logo img.jmh-logo-img,
.jmh-bar.is-scrolled .jmh-logo img {
    height: var(--jmh-logo-h-scrolled) !important;
    max-height: var(--jmh-logo-h-scrolled) !important;
}
.jmh-logo-text {
    color: inherit;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

/* ----- Toggle Button ----- */
.jmh-toggle {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    padding: 14px 4px;
    font: inherit;
    font-size: var(--jmh-font-toggle);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
    transition: color .3s var(--jmh-easing);
}
.jmh-toggle:hover { color: var(--jmh-accent); }

/* ===== Theme-Color-Overrides für Toggle & Logo (Kadence Link-Blau überschreiben) ===== */
.jmh-bar a,
.jmh-bar a:link,
.jmh-bar a:visited,
.jmh-bar button,
.jmh-toggle,
.jmh-toggle:link,
.jmh-toggle:visited,
.jmh-toggle:active,
.jmh-toggle:focus {
    color: inherit !important;
    text-decoration: none !important;
    background: transparent !important;
    box-shadow: none !important;
}
.jmh-bar a:hover,
.jmh-toggle:hover,
.jmh-toggle:focus-visible {
    color: var(--jmh-accent) !important;
}

/* Wrapper hat feste Breite, damit kein Springen beim Wort-Wechsel */
.jmh-toggle-label-wrap {
    position: relative;
    display: inline-block;
    min-width: 8em;
    text-align: right;
    height: 1.2em;
    overflow: hidden;
    white-space: nowrap;
}
.jmh-toggle-label {
    position: absolute;
    right: 0;
    top: 0;
    white-space: nowrap;
    transition: opacity .3s var(--jmh-easing), transform .3s var(--jmh-easing);
}
.jmh-toggle-label[data-when="open"] {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}
.jmh-bar[data-state="open"] .jmh-toggle-label[data-when="closed"] {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}
.jmh-bar[data-state="open"] .jmh-toggle-label[data-when="open"] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.jmh-toggle-bars {
    display: inline-block;
    width: 32px;
    height: 14px;
    position: relative;
    flex-shrink: 0;
}
.jmh-toggle-bars span {
    display: block;
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .4s var(--jmh-easing), top .3s var(--jmh-easing) .1s;
}
.jmh-toggle-bars span:nth-child(1) { top: 4px; }
.jmh-toggle-bars span:nth-child(2) { top: 10px; }

.jmh-bar[data-state="open"] .jmh-toggle-bars span {
    transition: top .3s var(--jmh-easing), transform .4s var(--jmh-easing) .1s;
}
.jmh-bar[data-state="open"] .jmh-toggle-bars span:nth-child(1) {
    top: 7px;
    transform: rotate(45deg);
}
.jmh-bar[data-state="open"] .jmh-toggle-bars span:nth-child(2) {
    top: 7px;
    transform: rotate(-45deg);
}

/* ----- Fokus-Ringe (a11y) ----- */
.jmh-toggle:focus-visible,
.jmh-logo:focus-visible {
    outline: 2px solid var(--jmh-accent);
    outline-offset: 6px;
    border-radius: 4px;
}

/* ============================================================
   VOLLBILD-OVERLAY
   ============================================================ */
.jmh-overlay {
    position: fixed;
    inset: 0;
    z-index: 9985;
    background: var(--jmh-overlay-bg);
    color: var(--jmh-overlay-fg);
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s var(--jmh-easing);
}
.jmh-overlay[hidden] { display: none; }
.jmh-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.jmh-overlay-inner {
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(var(--jmh-bar-h) + 2.5rem) clamp(1.25rem, 3vw, 2.5rem) 3rem;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: clamp(2rem, 5vw, 5rem);
    box-sizing: border-box;
}

@media (max-width: 980px) {
    .jmh-overlay-inner {
        grid-template-columns: 1fr;
        padding-top: calc(var(--jmh-bar-h) + 1.5rem);
    }
}

/* ----- Navigation Liste ----- */
.jmh-nav { min-width: 0; }

.jmh-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.jmh-item {
    border-top: 1px solid var(--jmh-line);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .5s var(--jmh-easing), transform .5s var(--jmh-easing);
    transition-delay: calc(var(--i, 0) * 30ms + 80ms);
}
.jmh-item:last-child { border-bottom: 1px solid var(--jmh-line); }

.jmh-overlay.is-open .jmh-item {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Overlay: Theme-Link-Farben überschreiben ===== */
.jmh-overlay a,
.jmh-overlay a:link,
.jmh-overlay a:visited,
.jmh-overlay a:active,
.jmh-overlay a:focus {
    color: inherit !important;
    text-decoration: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.jmh-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    gap: clamp(1rem, 3vw, 2.5rem);
    padding: clamp(0.5rem, 1.1vw, 0.8rem) 0;
    color: var(--jmh-overlay-fg);
    text-decoration: none;
    position: relative;
    transition: color .3s var(--jmh-easing);
}

.jmh-num {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--jmh-overlay-muted);
    font-variant-numeric: tabular-nums;
    transition: color .3s var(--jmh-easing);
    align-self: center;
}

.jmh-text {
    font-size: var(--jmh-font-menu);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    overflow: hidden;
    display: block;
    padding-top: 0.15em;
    padding-bottom: 0.05em;
}
.jmh-text-inner {
    display: inline-block;
    position: relative;
    transition: transform .5s var(--jmh-easing-snap);
}
.jmh-text-inner::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: var(--jmh-accent);
    transform: translateY(100%);
    transition: transform .5s var(--jmh-easing-snap);
}

.jmh-eyebrow {
    font-size: var(--jmh-font-eyebrow);
    color: var(--jmh-overlay-muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 500;
    align-self: center;
    text-align: right;
    transition: color .3s var(--jmh-easing), transform .4s var(--jmh-easing);
}

/* Hover */
@media (hover: hover) {
    .jmh-link:hover .jmh-text-inner {
        transform: translateY(-100%);
    }
    .jmh-link:hover .jmh-num {
        color: var(--jmh-accent);
    }
    .jmh-link:hover .jmh-eyebrow {
        color: var(--jmh-overlay-fg);
        transform: translateX(-6px);
    }
}

/* Focus */
.jmh-link:focus-visible {
    outline: 0;
}
.jmh-link:focus-visible .jmh-text-inner {
    transform: translateY(-100%);
}
.jmh-link:focus-visible .jmh-num {
    color: var(--jmh-accent);
}

/* Active page — Nummer, Titel UND Untertitel alle in Akzent-Farbe */
.jmh-item.is-active .jmh-num,
.jmh-item.is-active .jmh-title,
.jmh-item.is-active .jmh-text,
.jmh-item.is-active .jmh-text-inner,
.jmh-item.is-active .jmh-eyebrow,
.jmh-item.is-active .jmh-link {
    color: var(--jmh-accent) !important;
}
/* Aria-current als Fallback wenn is-active-Klasse fehlt */
.jmh-item .jmh-link[aria-current="page"],
.jmh-item .jmh-link[aria-current="true"] {
    color: var(--jmh-accent) !important;
}
.jmh-item .jmh-link[aria-current="page"] .jmh-num,
.jmh-item .jmh-link[aria-current="page"] .jmh-text,
.jmh-item .jmh-link[aria-current="page"] .jmh-text-inner,
.jmh-item .jmh-link[aria-current="page"] .jmh-eyebrow {
    color: var(--jmh-accent) !important;
}
.jmh-item.is-active .jmh-link::before {
    content: "";
    position: absolute;
    left: -1rem;
    top: 50%;
    width: 6px;
    height: 6px;
    background: var(--jmh-accent);
    border-radius: 50%;
    transform: translateY(-50%);
}

/* Tablet */
@media (max-width: 980px) {
    .jmh-text { font-size: var(--jmh-font-menu-mobile); }
}

/* Mobile: Eyebrow nicht in der Zeile, sondern darunter */
@media (max-width: 720px) {
    .jmh-link {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 0.4rem 0.9rem;
    }
    .jmh-eyebrow {
        grid-column: 2 / 3;
        text-align: left;
        margin-top: -0.3rem;
    }
}

/* ----- Sidebar (Aside) ----- */
.jmh-aside {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 1.5rem;
    opacity: 0;
    transition: opacity .6s var(--jmh-easing) .35s;
}
.jmh-overlay.is-open .jmh-aside {
    opacity: 1;
}

.jmh-aside-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.jmh-aside-eyebrow {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--jmh-overlay-muted);
    font-weight: 600;
}
.jmh-aside-text {
    margin: 0;
    color: var(--jmh-overlay-fg);
    opacity: 0.85;
    font-size: 0.92rem;
    line-height: 1.7;
}
.jmh-aside-text a,
.jmh-aside-text a:link,
.jmh-aside-text a:visited {
    color: inherit !important;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.2) !important;
    transition: color .2s, border-color .2s;
    padding-bottom: 1px;
}
.jmh-aside-text a:hover,
.jmh-aside-text a:focus-visible {
    color: var(--jmh-accent) !important;
    border-bottom-color: var(--jmh-accent) !important;
}

.jmh-aside-meta {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--jmh-line);
}
.jmh-aside-mark,
.jmh-aside-region {
    font-size: 0.72rem;
    color: var(--jmh-overlay-muted);
    letter-spacing: 0.05em;
    display: block;
}
.jmh-aside-region { margin-top: 0.4rem; }

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .jmh-bar,
    .jmh-overlay,
    .jmh-item,
    .jmh-text-inner,
    .jmh-text-inner::after,
    .jmh-aside,
    .jmh-toggle-bars span,
    .jmh-toggle-label,
    .jmh-logo-img,
    .jmh-num,
    .jmh-eyebrow {
        transition: none !important;
    }
    .jmh-item {
        transition-delay: 0ms !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .jmh-aside { opacity: 1 !important; }
    .jmh-link:hover .jmh-text-inner,
    .jmh-link:focus-visible .jmh-text-inner { transform: none !important; }
}

/* ============================================================
   Forced colors
   ============================================================ */
@media (forced-colors: active) {
    .jmh-bar.is-scrolled,
    .jmh-overlay {
        background: Canvas;
        color: CanvasText;
    }
    .jmh-toggle-bars span,
    .jmh-item { border-color: CanvasText; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.jmh-footer {
    background: var(--jmh-overlay-bg);
    color: var(--jmh-overlay-fg);
    padding: clamp(3rem, 7vw, 5.5rem) clamp(1.25rem, 3vw, 2.5rem) 2rem;
    border-top: 1px solid var(--jmh-line);
    position: relative;
    z-index: 5;
}
.jmh-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
}
.jmh-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: clamp(1.5rem, 3vw, 3rem);
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
@media (max-width: 980px) {
    .jmh-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 540px) {
    .jmh-footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Brand */
.jmh-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.jmh-footer-logo {
    display: inline-block;
    text-decoration: none !important;
}
.jmh-footer-logo-img {
    height: 64px;
    width: auto;
    display: block;
    max-width: 100%;
    object-fit: contain;
}
.jmh-footer-tagline {
    margin: 0;
    color: var(--jmh-overlay-fg);
    opacity: 0.6;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Spalten-Titel */
.jmh-footer-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--jmh-overlay-muted);
    font-weight: 600;
    margin: 0 0 1rem;
    padding: 0;
    line-height: 1;
}

/* Adresse */
.jmh-footer-address {
    margin: 0;
    color: var(--jmh-overlay-fg);
    opacity: 0.85;
    font-size: 0.95rem;
    line-height: 1.7;
    font-style: normal;
}

/* Kontakt + Nav Listen */
.jmh-footer-contact,
.jmh-footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}
.jmh-footer-contact li,
.jmh-footer-nav li {
    margin: 0 0 0.5rem;
}
.jmh-footer a,
.jmh-footer a:link,
.jmh-footer a:visited,
.jmh-footer a:active,
.jmh-footer a:focus {
    color: inherit !important;
    text-decoration: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
    transition: color .2s, border-color .2s;
}
.jmh-footer-contact a,
.jmh-footer-nav a {
    color: var(--jmh-overlay-fg) !important;
    opacity: 0.85;
    font-size: 0.95rem;
}
.jmh-footer a:hover,
.jmh-footer a:focus-visible {
    color: var(--jmh-accent) !important;
    border-bottom-color: var(--jmh-accent) !important;
    opacity: 1 !important;
}

/* Bottom-Zeile */
.jmh-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--jmh-line);
    font-size: 0.78rem;
    color: var(--jmh-overlay-muted);
    letter-spacing: 0.04em;
}
@media (max-width: 540px) {
    .jmh-footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Forced colors */
@media (forced-colors: active) {
    .jmh-footer { background: Canvas; color: CanvasText; border-top: 1px solid CanvasText; }
}
