/**
 * Hausgeflüster – Frontend Public CSS
 *
 * Design system, DIVI isolation, map layout and marker styles.
 * Additional sections for popup, player, panel, mini-player will be
 * added in subsequent steps.
 */

/* =====================================================================
 * Self-hosted Fonts (DSGVO-konform, kein Google-CDN)
 * ================================================================== */

/* Montserrat – latin-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url('../fonts/montserrat-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Montserrat – latin */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url('../fonts/montserrat-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;
}

/* Open Sans – latin-ext */
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400 700;
    font-stretch: 100%;
    font-display: swap;
    src: url('../fonts/opensans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Open Sans – latin */
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400 700;
    font-stretch: 100%;
    font-display: swap;
    src: url('../fonts/opensans-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;
}

/* =====================================================================
 * CSS Custom Properties (Design System)
 * ================================================================== */

:root {
    /* Primary colours (Reana Design, April 2026) */
    --hg-color-dark: #333333;
    --hg-color-red: #ea5153; /* koralle */
    --hg-color-blue: #62abce; /* hellblau */
    --hg-color-dark-blue: #1b4889; /* dunkelblau – map lines, headlines, accents */

    /* Derived colours */
    --hg-color-red-light: #f4847e;
    --hg-color-red-dark: #d4403a;
    --hg-color-blue-light: #8ec4dd;
    --hg-color-blue-dark: #4a8fad;

    /* Neutrals */
    --hg-color-bg: #f9f7f5; /* beige */
    --hg-color-bg-card: #ffffff;
    --hg-color-border: #e8e4df;
    --hg-color-text: #333333;
    --hg-color-text-light: #777777;
    --hg-color-overlay: rgba(51, 51, 51, 0.6);

    /* Shadows */
    --hg-shadow-sm: 0 2px 8px rgba(51, 51, 51, 0.1);
    --hg-shadow-md: 0 4px 16px rgba(51, 51, 51, 0.15);
    --hg-shadow-lg: 0 8px 32px rgba(51, 51, 51, 0.2);

    /* Radii */
    --hg-radius-sm: 8px;
    --hg-radius-md: 12px;
    --hg-radius-lg: 20px;
    --hg-radius-full: 50%;

    /* Transitions */
    --hg-transition-fast: 150ms ease;
    --hg-transition-normal: 300ms ease;
    --hg-transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography (Reana Design, April 2026): Open Sans for everything */
    --hg-font-display:
        'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --hg-font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --hg-font-size-xs: 0.75rem;
    --hg-font-size-sm: 0.875rem;
    --hg-font-size-base: 1rem;
    --hg-font-size-lg: 1.25rem;
    --hg-font-size-xl: 1.5rem;
    --hg-font-size-2xl: 2rem;
    --hg-font-size-3xl: 2.5rem;

    /* Z-Index Layers */
    --hg-z-map: 1;
    --hg-z-markers: 10;
    --hg-z-panel-tab: 50;
    --hg-z-panel: 60;
    --hg-z-mini-player: 70;
    --hg-z-overlay: 80;
    --hg-z-popup: 90;
    --hg-z-popup-nav: 95;

    /* Layout: footer row height (used to size the map container). */
    --hg-footer-height: 36px;
}

@media (max-width: 767px) {
    :root {
        --hg-footer-height: 30px;
    }
}

/* =====================================================================
 * DIVI Isolation & App Container Reset
 * ================================================================== */

.hg-app {
    position: relative;
    width: 100%;
    font-family: var(--hg-font-body);
    color: var(--hg-color-text);
    background: var(--hg-color-bg);
    line-height: 1.6;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hg-app *,
.hg-app *::before,
.hg-app *::after {
    box-sizing: border-box;
}

/* Reset parent-theme button overrides (Open Sans, no borders, no default
 * background). Excludes .hg-marker because map markers are visual circles,
 * not text buttons – they bring their own background/border. */
button:not(.hg-marker) {
    font-family: var(--hg-font-body) !important;
    cursor: pointer;
    border: none;
    padding: 0px;
    margin: 0;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.hg-side-tabs button:not(.hg-marker) {
    padding: 9px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border: none !important;
    box-shadow: none !important;
}

p {
    margin: 0;
    padding: 0 !important;
}

.hg-map-container p {
    margin: 0 0 0.5em;
    padding: 0 !important;
}

h2,
h3,
h4 {
    margin: 0;
    padding: 0;
    line-height: 1.3;
    letter-spacing: normal !important;
    text-transform: none !important;
}

a {
    text-decoration: none;
    color: var(--hg-color-blue);
}

/* Global focus-visible indicator for all interactive elements */
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--hg-color-blue);
    outline-offset: 2px;
}

/* Remove default outline for mouse/touch clicks */
button:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
    outline: none;
}

/* =====================================================================
 * Map Container
 * ================================================================== */

.hg-map-container {
    position: relative;
    width: 100%;
    /* Fill viewport minus the footer row (overrides the inline style from the shortcode). */
    height: calc(100vh - var(--hg-footer-height)) !important;
    overflow: hidden;
    background: var(--hg-color-bg);
    z-index: var(--hg-z-map);
}

/* Map Wrapper (Panzoom target) */
.hg-map-wrapper {
    position: relative;
    width: 100%;
    cursor: grab;
    /* Note: Panzoom sets transform-origin: 50% 50% via inline style */
}

.hg-map-wrapper:active {
    cursor: grabbing;
}

.hg-map-image {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Markers Layer – positioned over the map image */
.hg-markers-layer {
    position: absolute;
    inset: 0;
    z-index: var(--hg-z-markers);
    pointer-events: none;
}

/* =====================================================================
 * Zoom Controls
 * ================================================================== */

.hg-map-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: calc(var(--hg-z-markers) + 5);
}

.hg-map-controls button {
    width: 40px;
    height: 40px;
    border-radius: var(--hg-radius-sm);
    background: var(--hg-color-bg-card);
    color: var(--hg-color-text);
    font-size: var(--hg-font-size-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 2px 8px rgba(51, 51, 51, 0.1),
        0 0 0 1px rgba(51, 51, 51, 0.04);
    border: none;
    transition:
        background var(--hg-transition-fast),
        color var(--hg-transition-fast),
        transform var(--hg-transition-fast);
}

.hg-map-controls button:hover {
    background: var(--hg-color-red);
    color: #fff;
    transform: scale(1.05);
    box-shadow:
        0 3px 12px rgba(238, 82, 75, 0.25),
        0 0 0 0 transparent;
}

.hg-map-controls button:active {
    transform: scale(0.95);
}

/* =====================================================================
 * Sponsor Logo Strip (bottom of the map)
 * ================================================================== */

/* Compact column: small label stacked on top of the horizontal logo row,
 * both inside one card that hugs its content. */
.hg-sponsor-strip {
    position: absolute;
    left: 16px;
    bottom: 16px;
    /* Hug the widest child (= the logo row), clamp to the available
     * space between left edge and the zoom controls on the right. */
    width: max-content;
    max-width: calc(100% - 16px - 76px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px 20px 10px;
    background: #f8f7f5;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(51, 51, 51, 0.08);
    z-index: calc(var(--hg-z-markers) + 4);
    pointer-events: auto;
    overflow: hidden;
}

.hg-sponsor-strip-label {
    flex: 0 0 auto;
    font-size: var(--hg-font-size-xs);
    font-weight: 600;
    color: var(--hg-color-dark-blue);
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.2;
}

.hg-sponsor-strip-list {
    /* Intrinsic width: all originals + clones on one line. Strip's
     * overflow:hidden clips what doesn't fit; the marquee animation
     * translates the list left to reveal everything in turn. */
    width: max-content;
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 0;
}

/* Marquee activated by JS after duplicating the items. Animates from 0 to
 * -50% translation (= one full copy of the originals), then loops. Because
 * the second half is an exact clone, the jump at 100% back to 0% is
 * imperceptible – looks like a seamless endless scroll. */
.hg-sponsor-strip-list--marquee {
    animation: hg-sponsor-marquee var(--hg-sponsor-marquee-duration, 40s) linear
        infinite;
    will-change: transform;
}

@keyframes hg-sponsor-marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Respect reduced-motion – no animation at all */
@media (prefers-reduced-motion: reduce) {
    .hg-sponsor-strip-list--marquee {
        animation: none;
    }
}

.hg-sponsor-strip-item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    height: 40px;
}

.hg-sponsor-strip-item img {
    max-height: 40px;
    max-width: 120px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.hg-sponsor-strip-item a {
    display: flex;
    align-items: center;
    height: 100%;
    transition:
        transform var(--hg-transition-fast),
        opacity var(--hg-transition-fast);
}

@media (hover: hover) {
    .hg-sponsor-strip-item a:hover {
        transform: translateY(-1px);
        opacity: 0.85;
    }
}

@media (max-width: 767px) {
    .hg-sponsor-strip {
        left: 12px;
        bottom: 12px;
        max-width: calc(100% - 12px - 60px);
        gap: 10px;
        padding: 8px 14px;
    }
    .hg-sponsor-strip-label {
        font-size: 0.5em;
    }
    .hg-sponsor-strip-list {
        gap: 14px;
    }
    .hg-sponsor-strip-item,
    .hg-sponsor-strip-item img {
        max-height: 28px;
        height: 28px;
    }
    .hg-sponsor-strip-item img {
        max-width: 90px;
    }
}

/* =====================================================================
 * Floating Logo Card (top-right corner of the map)
 * ================================================================== */

.hg-logo-card {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 120px;
    background: var(--hg-color-bg-card);
    border-radius: var(--hg-radius-md);
    box-shadow: 0 4px 16px rgba(51, 51, 51, 0.12);
    z-index: calc(var(--hg-z-markers) + 5);
    pointer-events: none;
}

.hg-logo-card img {
    display: block;
    width: 100%;
    height: auto;
}

@media (max-width: 767px) {
    .hg-logo-card {
        width: 84px;
        top: 12px;
        right: 12px;
    }
}

/* =====================================================================
 * Markers
 * ================================================================== */

/* Marker layer holds the --hg-marker-scale counter-zoom factor so that
 * markers keep a constant visual size regardless of the current map zoom
 * level. JS updates the variable on every panzoomchange. */
.hg-markers-layer {
    --hg-marker-scale: 1;
}

.hg-marker {
    position: absolute;
    transform: translate(-50%, -50%) scale(var(--hg-marker-scale));
    transform-origin: center center;
    width: 52px;
    height: 52px;
    border-radius: var(--hg-radius-full);
    border: none;
    background: var(--hg-color-blue);
    cursor: pointer;
    pointer-events: auto;
    z-index: var(--hg-z-markers);
    transition: background 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    outline: none;
    padding: 0;
}

/* Dot variant – used when the stop has no Standort-Code */
.hg-marker--dot {
    width: 22px;
    height: 22px;
}

/* Hover state only on real pointers – prevents sticky hover after a tap
 * on touch devices (where :hover is triggered once and never cleared).
 * The circle turns koralle (like the active state) as hover affordance.
 * Elevated z-index lifts the whole marker (including its tooltip, which
 * lives in the marker's stacking context) above neighbouring markers. */
@media (hover: hover) {
    .hg-marker:hover {
        background: var(--hg-color-red);
        transform: translate(-50%, -50%) scale(var(--hg-marker-scale));
        z-index: calc(var(--hg-z-markers) + 10);
    }
}

.hg-marker:focus-visible {
    outline: 2px solid var(--hg-color-red);
    outline-offset: 3px;
    z-index: calc(var(--hg-z-markers) + 10);
}

/* Active state: same shape as hover (circle + floating name pill), but
 * the circle itself switches from hellblau to koralle to signal the
 * current selection. */
.hg-marker--active {
    background: var(--hg-color-red);
    z-index: calc(var(--hg-z-markers) + 5);
}

/* Highlight state – triggered from panel list hover (JS sets the class).
 * Same flat aesthetic: subtle coral ring instead of a scale bump. */
.hg-marker--highlight {
    transform: translate(-50%, -50%) scale(var(--hg-marker-scale));
    background: var(--hg-color-red);
}

/* Standort-Code inside marker (e.g. "K12") */
.hg-marker-code {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.01em;
    pointer-events: none;
}

/* Hover/active tooltip (house name) – coral pill that floats just above
 * the marker. Sized to match the Reana mockup: pill height matches the
 * 52 px marker circle, generous horizontal padding, no arrow. */
.hg-marker-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--hg-color-red);
    color: #fff;
    padding: 24px 24px;
    border-radius: 12px;
    font-size: 17px;
    line-height: 1;
    font-family: var(--hg-font-body);
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    z-index: calc(var(--hg-z-markers) + 10);
    opacity: 0;
    transition:
        opacity 200ms ease,
        transform 200ms ease;
}

/* Speech-bubble arrow pointing down at the marker */
.hg-marker-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: var(--hg-color-red);
    border-bottom: 0;
}

/* Hover tooltip only on real pointers – avoids a stuck tooltip on touch. */
@media (hover: hover) {
    .hg-marker:hover .hg-marker-tooltip {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.hg-marker:focus-visible .hg-marker-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Active marker keeps the coral tooltip shown persistently (same look
 * as on hover), even when the pointer is elsewhere. */
.hg-marker--active .hg-marker-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Touch devices: hide marker tooltips entirely – the popup already
 * shows the stop title, and a persistent coral pill next to every
 * tapped marker just clutters the screen. `hover: none` catches all
 * touch devices regardless of viewport width (phones, tablets, big
 * phones in landscape), where a 767px media query would miss them. */
@media (hover: none) {
    .hg-marker-tooltip {
        display: none;
    }
}

/* =====================================================================
 * Popup Overlay
 * ================================================================== */

.hg-popup-overlay {
    position: fixed;
    inset: 0;
    background: var(--hg-color-overlay);
    z-index: var(--hg-z-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--hg-transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hg-popup-overlay[hidden] {
    display: none;
}

.hg-popup-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

/* Desktop split-view: overlay only covers right half, no dark backdrop */
@media (min-width: 1024px) {
    .hg-popup-overlay {
        left: 50%;
        right: 0;
        width: 50%;
        background: none;
        align-items: stretch;
        justify-content: stretch;
    }
}

/* =====================================================================
 * Popup Container
 * ================================================================== */

.hg-popup {
    position: relative;
    background: var(--hg-color-bg-card);
    border-radius: var(--hg-radius-lg);
    width: 95vw;
    max-width: 600px;
    max-height: 90vh;
    z-index: var(--hg-z-popup);
    box-shadow:
        0 12px 48px rgba(51, 51, 51, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(51, 51, 51, 0.04);
    transform: scale(0.92) translateY(24px);
    opacity: 0;
    transition:
        transform 450ms cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 300ms ease;
    outline: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.hg-popup--visible {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Mobile: slide-up bottom sheet */
@media (max-width: 767px) {
    .hg-popup {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--hg-radius-lg) var(--hg-radius-lg) 0 0;
        transform: translateY(100%);
        transition:
            transform 400ms cubic-bezier(0.4, 0, 0.2, 1),
            opacity var(--hg-transition-normal);
    }

    .hg-popup--visible {
        transform: translateY(0);
    }
}

/* Desktop split-view: popup fills right half, slides in from right */
@media (min-width: 1024px) {
    .hg-popup {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
        transform: translateX(100%);
        opacity: 1;
        transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hg-popup--visible {
        transform: translateX(0);
    }
}

/* Popup scrollable body */
.hg-popup-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
    border-radius: inherit;
}

/* Custom scrollbar for popup */
.hg-popup-body::-webkit-scrollbar {
    width: 6px;
}

.hg-popup-body::-webkit-scrollbar-track {
    background: transparent;
}

.hg-popup-body::-webkit-scrollbar-thumb {
    background: var(--hg-color-border);
    border-radius: 3px;
}

.hg-popup-body::-webkit-scrollbar-thumb:hover {
    background: var(--hg-color-text-light);
}

/* =====================================================================
 * Popup Close Button
 * ================================================================== */

.hg-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-bg-card);
    color: var(--hg-color-text);
    font-size: var(--hg-font-size-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: calc(var(--hg-z-popup) + 5);
    box-shadow: var(--hg-shadow-sm);
    transition:
        background var(--hg-transition-fast),
        color var(--hg-transition-fast);
}

.hg-popup-close:hover {
    background: var(--hg-color-red);
    color: #fff;
}

.hg-popup-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--hg-color-blue);
}

/* =====================================================================
 * Popup Navigation Arrows
 * ================================================================== */

.hg-popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-red) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--hg-color-red);
    font-size: var(--hg-font-size-lg);
    color: #fff !important;
    cursor: pointer;
    z-index: var(--hg-z-popup-nav);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 0 0 rgba(238, 82, 75, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
        background 150ms ease,
        color 150ms ease,
        box-shadow 200ms ease,
        border-color 150ms ease;
}

/* Popup prev/next navigation currently unused — keep hidden */
.hg-popup-nav {
    display: none !important;
}

.hg-popup-nav:hover {
    background: var(--hg-color-red);
    color: #fff;
    border-color: var(--hg-color-red);
    transform: translateY(-50%) scale(1.08);
    box-shadow:
        0 4px 12px rgba(238, 82, 75, 0.3),
        0 0 0 3px rgba(238, 82, 75, 0.12);
}

.hg-popup-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.hg-popup-prev {
    left: -20px;
}

.hg-popup-next {
    right: -20px;
}

/* Mobile: arrows inside the popup */
@media (max-width: 767px) {
    .hg-popup-nav {
        width: 36px;
        height: 36px;
        font-size: var(--hg-font-size-base);
        top: auto;
        bottom: 16px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    }

    .hg-popup-nav:hover {
        transform: translateY(0) scale(1.08);
    }

    .hg-popup-nav:active {
        transform: translateY(0) scale(0.95);
    }

    .hg-popup-prev {
        left: 12px;
    }

    .hg-popup-next {
        right: 12px;
    }
}

/* Desktop split-view: nav buttons inside popup edges */
@media (min-width: 1024px) {
    .hg-popup-prev {
        left: 12px;
    }

    .hg-popup-next {
        right: 12px;
    }
}

/* =====================================================================
 * Popup Header
 * ================================================================== */

/* Three-column header per Reana design:
 *   [ K-badge ]  [ Title / Subtitle / Address ]  [ Bird logo ]
 * The badge and logo are fixed-size flex items; the middle column
 * grows to fill the remaining width. All header copy is koralle.
 * flex-wrap:wrap lets the optional description paragraph drop to
 * a new line underneath without squeezing the title/logo row. */
.hg-popup-header {
    padding: 24px 24px 16px;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}

.hg-popup-description {
    flex: 1 0 100%;
    width: 100%;
    margin: 4px 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--hg-color-text);
}

.hg-popup-badge {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    font-size: 26px;
    letter-spacing: 0.01em;
    line-height: 1;
}

.hg-popup-badge[hidden] {
    display: none;
}

.hg-popup-header-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Title (main heading – story subject, e.g. "NaniManu und Mani Matter") */
.hg-popup-title {
    font-family: var(--hg-font-body);
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1.2;
    color: var(--hg-color-red);
    margin: 0 0 2px;
    text-shadow: none;
}

/* Subtitle (topic line, e.g. "Leibeigene und Gefängnis") */
.hg-popup-subtitle {
    font-family: var(--hg-font-body);
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.3;
    color: var(--hg-color-red);
    margin: 0 0 1px;
}

.hg-popup-subtitle[hidden] {
    display: none;
}

/* Address (street name, 3rd line) */
.hg-popup-address {
    font-family: var(--hg-font-body);
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.3;
    color: var(--hg-color-red);
    font-style: normal;
    margin: 0;
}

.hg-popup-address[hidden] {
    display: none;
}

/* Bird logo on the right */
.hg-popup-logo {
    flex: 0 0 auto;
    width: 90px;
    height: auto;
    display: block;
    align-self: flex-start;
}

@media (max-width: 767px) {
    .hg-popup-header {
        padding: 18px 18px 12px;
        gap: 12px;
    }
    .hg-popup-badge {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }
    .hg-popup-logo {
        width: 56px;
    }
    .hg-popup-title {
        font-size: 1.15rem;
    }
    .hg-popup-subtitle,
    .hg-popup-address {
        font-size: 0.85rem;
    }
}

/* Staggered content reveal when popup opens */
.hg-popup--visible .hg-popup-header {
    animation: hg-fade-up 400ms ease both;
    animation-delay: 100ms;
}

.hg-popup--visible .hg-popup-image-wrapper {
    animation: hg-fade-up 400ms ease both;
    animation-delay: 200ms;
}

.hg-popup--visible .hg-player {
    animation: hg-fade-up 400ms ease both;
    animation-delay: 300ms;
}

.hg-popup--visible .hg-popup-snippets {
    animation: hg-fade-up 400ms ease both;
    animation-delay: 400ms;
}

@keyframes hg-fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Description (below address) */
.hg-popup-description {
    font-size: var(--hg-font-size-base);
    color: var(--hg-color-text);
    margin-top: 8px;
    line-height: 1.6;
}

/* =====================================================================
 * Popup Image + Play Overlay
 * ================================================================== */

.hg-popup-main-audio {
    padding: 0 24px;
}

.hg-popup-image-wrapper {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: var(--hg-radius-md);
    overflow: hidden;
    background: #1a1a1a; /* Fallback, falls noch keine Bild-URL gesetzt */
}

/* Hochformat-Lösung: das Hintergrundbild ist dasselbe Motiv in voll
 * ausfüllender Cover-Darstellung, weichgezeichnet. Über scale > 1 wird
 * die sichtbare Blur-Kante aus dem Rahmen geschoben. Es sitzt unter
 * dem Vordergrundbild (z-index 0).
 *
 * Der Wrapper-Selektor davor ist wichtig: das Theme setzt via
 * `.hg-app img { height: auto }` (Spezifität 0,1,1) sonst unsere
 * `height: 100%`-Regel ausser Kraft, und das Bild rendert in seiner
 * natürlichen Grösse (Hochformat > Wrapper-Höhe = Overflow). Mit dem
 * zusätzlichen Klassen-Prefix erreichen wir 0,2,0 und gewinnen. */
.hg-popup-image-wrapper .hg-popup-image-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    filter: blur(28px) saturate(1.15);
    transform: scale(1.15);
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
    /* Eigene Compositor-Layer – vermeidet Re-Paints beim Scrollen. */
    will-change: transform;
}

.hg-popup-image-wrapper .hg-popup-image-backdrop[src=''],
.hg-popup-image-wrapper .hg-popup-image-backdrop:not([src]) {
    display: none;
}

.hg-popup-image-wrapper .hg-popup-image {
    display: block;
    /* `position: absolute` + `inset: 0`, damit das Bild zuverlässig den
     * Wrapper ausfüllt, auch wenn dessen Höhe über `aspect-ratio`
     * berechnet wird (Chrome behandelt diese Höhe sonst teilweise als
     * "indefinite" und das Bild rutscht auf seine natürliche Grösse). */
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
}

/* Subtle vignette overlay on image for depth */
.hg-popup-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(51, 51, 51, 0.15) 0%,
        transparent 40%,
        transparent 80%,
        rgba(51, 51, 51, 0.05) 100%
    );
    pointer-events: none;
    border-radius: inherit;
    z-index: 2;
}

.hg-play-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background var(--hg-transition-fast);
}

.hg-play-overlay:hover {
    background: rgba(0, 0, 0, 0.15);
}

.hg-play-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    box-shadow:
        0 4px 20px rgba(98, 171, 206, 0.45),
        0 0 0 0 rgba(98, 171, 206, 0);
    transition:
        transform var(--hg-transition-fast),
        box-shadow var(--hg-transition-fast);
    animation: hg-play-invite 2.5s ease-in-out infinite;
}

.hg-play-overlay:hover .hg-play-icon {
    transform: scale(1.1);
    animation: none;
    box-shadow:
        0 6px 28px rgba(98, 171, 206, 0.5),
        0 0 0 8px rgba(98, 171, 206, 0.15);
}

@keyframes hg-play-invite {
    0%,
    100% {
        box-shadow:
            0 4px 20px rgba(98, 171, 206, 0.45),
            0 0 0 0 rgba(98, 171, 206, 0.2);
    }
    50% {
        box-shadow:
            0 4px 20px rgba(98, 171, 206, 0.45),
            0 0 0 10px rgba(98, 171, 206, 0);
    }
}

/* =====================================================================
 * Popup Actions (Transkript / Bildergalerie toggles)
 * ================================================================== */

/* Thin blue divider top & bottom, two underlined links on one row.
 * Same language as the welcome accordion (border + ">" prefix). */
.hg-popup-actions {
    margin: 8px 0px 16px;
    padding: 8px 0px 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.hg-popup-actions[hidden] {
    display: none;
}

.hg-popup-action {
    font-family: var(--hg-font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--hg-color-dark-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color var(--hg-transition-fast);
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.hg-popup-action:hover {
    color: var(--hg-color-red);
}

.hg-popup-action[hidden] {
    display: none;
}

.hg-popup-action-arrow {
    display: inline-block;
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

/* =====================================================================
 * Gallery Lightbox
 * ================================================================== */

.hg-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10500;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding: 48px 56px 12px;
    color: #fff;
}

.hg-gallery-lightbox[hidden] {
    display: none;
}

.hg-gallery-stage {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    gap: 12px;
}

.hg-gallery-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
}

.hg-gallery-meta {
    display: flex;
    align-items: baseline;
    gap: 16px;
    width: 100%;
    font-family: var(--hg-font-body);
    font-size: 0.9rem;
    color: #fff;
    padding: 0 4px;
}

.hg-gallery-caption {
    flex: 1 1 auto;
    font-weight: 600;
}

.hg-gallery-copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.hg-gallery-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.hg-gallery-close,
.hg-gallery-prev,
.hg-gallery-next {
    position: absolute;
    background: rgba(0, 0, 0, 0.35);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: var(--hg-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--hg-transition-fast),
        color var(--hg-transition-fast);
    font-family: inherit;
    line-height: 1;
    padding: 0;
}

.hg-gallery-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 24px;
}

.hg-gallery-prev,
.hg-gallery-next {
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    font-size: 32px;
}

.hg-gallery-prev {
    left: 8px;
}
.hg-gallery-next {
    right: 8px;
}

.hg-gallery-close:hover,
.hg-gallery-prev:hover,
.hg-gallery-next:hover {
    background: var(--hg-color-red);
    color: #fff;
}

.hg-gallery-close:focus-visible,
.hg-gallery-prev:focus-visible,
.hg-gallery-next:focus-visible {
    outline: 2px solid var(--hg-color-red);
    outline-offset: 3px;
}

.hg-gallery-thumbs {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0 4px;
    scrollbar-width: thin;
}

.hg-gallery-thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border: 2px solid transparent;
    border-radius: var(--hg-radius-sm);
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    overflow: hidden;
}

.hg-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hg-gallery-thumb.is-active {
    border-color: var(--hg-color-red);
}

.hg-gallery-thumb:focus-visible {
    outline: 2px solid var(--hg-color-red);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .hg-gallery-lightbox {
        padding: 40px 8px 8px;
    }

    .hg-gallery-prev,
    .hg-gallery-next {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .hg-gallery-thumbs {
        padding-bottom: 2px;
    }

    .hg-gallery-thumb {
        width: 44px;
        height: 44px;
    }

    .hg-gallery-meta {
        flex-wrap: wrap;
    }
}

/* =====================================================================
 * Transcript Section
 * ================================================================== */

.hg-transcript-section {
    padding: 0 24px 12px;
}

.hg-transcript-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: var(--hg-color-bg);
    border-radius: var(--hg-radius-sm);
    margin-top: 8px;
    font-size: var(--hg-font-size-base);
    line-height: 1.9;
    border-left: 3px solid var(--hg-color-border);
    font-style: italic;
    color: var(--hg-color-text);
}

/* Custom scrollbar for transcript */
.hg-transcript-content::-webkit-scrollbar {
    width: 5px;
}

.hg-transcript-content::-webkit-scrollbar-track {
    background: transparent;
}

.hg-transcript-content::-webkit-scrollbar-thumb {
    background: var(--hg-color-border);
    border-radius: 3px;
}

/* =====================================================================
 * Info Cards Section (current businesses)
 * ================================================================== */

.hg-info-cards-section {
    padding: 0 24px 24px;
}

h3.hg-info-cards-title {
    color: var(--hg-color-dark);
    margin: 28px 0 20px;
    line-height: 1.3;
}

/* Info card – editorial "what's in this house" chip: white card on the
 * beige popup, round logo chip, hellblau pill buttons for links. */
.hg-info-card {
    padding: 20px;
    background: var(--hg-color-bg-card);
    border-radius: var(--hg-radius-lg);
    box-shadow: var(--hg-shadow-sm);
    margin-bottom: 14px;
    transition:
        transform var(--hg-transition-normal),
        box-shadow var(--hg-transition-normal);
}

.hg-info-card:last-child {
    margin-bottom: 0;
}

/* Desktop hover lift – skipped on touch to avoid sticky tap state. */
@media (hover: hover) {
    .hg-info-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--hg-shadow-md);
    }
}

.hg-info-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.hg-info-card-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-bg);
    padding: 6px;
    flex-shrink: 0;
    box-shadow: var(--hg-shadow-sm);
}

.hg-info-card-name {
    font-family: var(--hg-font-body);
    font-size: var(--hg-font-size-lg);
    font-weight: 700;
    color: var(--hg-color-dark-blue);
    margin: 0;
    line-height: 1.25;
    letter-spacing: 0.005em;
}

.hg-info-card-description {
    font-size: var(--hg-font-size-base);
    color: var(--hg-color-text);
    line-height: 1.55;
    margin: 0 0 14px;
}

/* Hide bottom margin when description is the last element */
.hg-info-card-description:last-child {
    margin-bottom: 0;
}

.hg-info-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Scope the pill under .hg-app so we override the global .hg-app a
 * link-colour rule (which would otherwise tint the text hellblau and
 * produce an unreadable blue-on-blue pill). */
.hg-app .hg-info-card-link {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    font-size: var(--hg-font-size-sm);
    font-weight: 700;
    color: var(--hg-color-dark-blue);
    background: var(--hg-color-blue);
    border-radius: 999px;
    text-decoration: none;
    transition:
        color var(--hg-transition-fast),
        background var(--hg-transition-fast),
        transform var(--hg-transition-fast),
        box-shadow var(--hg-transition-fast);
}

.hg-app .hg-info-card-link:hover {
    color: #fff;
    background: var(--hg-color-blue-dark);
}

@media (hover: hover) {
    .hg-app .hg-info-card-link:hover {
        transform: translateY(-1px);
        box-shadow: var(--hg-shadow-sm);
    }
}

/* =====================================================================
 * Snippet Grid
 * ================================================================== */

.hg-popup-snippets {
    padding: 0 24px 24px;
}

h3.hg-popup-snippets-title {
    font-family: var(--hg-font-body);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--hg-color-red);
    margin: 0 0 1em;
    padding: 0;
    border: none;
    line-height: 1.2;
}

.hg-snippets-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 480px) {
    .hg-snippets-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Snippet Card */
.hg-snippet-card {
    background: var(--hg-color-bg-card);
    border-radius: var(--hg-radius-md);
    padding: 0;
    border: none;
    box-shadow: 0 1px 6px rgba(51, 51, 51, 0.06);
    transition:
        box-shadow 250ms ease,
        transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.hg-snippet-card:hover {
    box-shadow:
        0 6px 20px rgba(51, 51, 51, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04);
    transform: translateY(-3px);
}

/* Snippet Image Wrapper – contains image + play overlay + duration badge */
.hg-snippet-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--hg-color-bg);
    cursor: pointer;
}

.hg-snippet-image-wrapper--no-image {
    background: linear-gradient(135deg, var(--hg-color-bg) 0%, #e8e4df 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Vordergrund + Backdrop – selbes Pattern wie beim Hero-Bild des
 * Popups: contain für vollständige Darstellung von Hochformat-Fotos,
 * blurred Cover-Kopie füllt die Ränder. Wrapper-Prefix hebt die
 * Spezifität auf 0,2,0, damit die Theme-Regel `.hg-app img { height:
 * auto }` (0,1,1) unsere height/width-100 % nicht mehr überschreibt. */
.hg-snippet-image-wrapper .hg-snippet-image {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    transition: transform 0.4s ease;
}

.hg-snippet-image-wrapper .hg-snippet-image-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    filter: blur(22px) saturate(1.15);
    /* scale > 1 schiebt die Blur-Kante aus dem 16:10-Rahmen. */
    transform: scale(1.15);
    opacity: 0.9;
    pointer-events: none;
    will-change: transform;
    display: block;
}

.hg-snippet-image-wrapper .hg-snippet-image-backdrop[src=''],
.hg-snippet-image-wrapper .hg-snippet-image-backdrop:not([src]) {
    display: none;
}

.hg-snippet-card:hover .hg-snippet-image {
    transform: scale(1.04);
}

/* Play Overlay on image */
.hg-snippet-play-overlay {
    position: absolute;
    inset: 0;
    /* Explizit über .hg-snippet-image (z-index 1) und Backdrop (0). */
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    cursor: pointer;
    transition: background var(--hg-transition-fast);
    padding: 0;
}

.hg-snippet-play-overlay:hover {
    background: rgba(0, 0, 0, 0.15);
}

.hg-snippet-play-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(98, 171, 206, 0.45);
    transition:
        transform var(--hg-transition-fast),
        box-shadow var(--hg-transition-fast);
    padding-left: 0px;
}

.hg-snippet-play-overlay:hover .hg-snippet-play-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(98, 171, 206, 0.55);
}

/* Duration badge – bottom-right corner of image */
.hg-snippet-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    /* Über Image (1) und Play-Overlay (2). */
    z-index: 3;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* Snippet Progress Bar – thin bar between image and info */
.hg-snippet-progress {
    height: 3px;
    background: var(--hg-color-border);
    overflow: hidden;
}

.hg-snippet-progress-filled {
    height: 100%;
    width: 0;
    background: var(--hg-color-red);
    transition: width 100ms linear;
}

/* Snippet Info area (title + transcript toggle) */
.hg-snippet-info {
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.hg-snippet-title {
    font-size: var(--hg-font-size-sm);
    font-weight: 600;
    color: var(--hg-color-dark);
    margin: 0;
    line-height: 1.35;
    flex: 1 1 auto;
}

/* Snippet Transcript */
.hg-snippet-transcript-toggle {
    font-size: var(--hg-font-size-xs);
    color: var(--hg-color-blue);
    flex-shrink: 0;
    white-space: nowrap;
    padding: 2px 0;
    border: none;
    background: none;
    cursor: pointer;
    transition: color var(--hg-transition-fast);
}

.hg-snippet-transcript-toggle:hover {
    color: var(--hg-color-blue-dark);
}

.hg-snippet-transcript {
    font-size: var(--hg-font-size-sm);
    line-height: 1.7;
    color: var(--hg-color-text-light);
    padding: 10px 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid var(--hg-color-border);
}

/* =====================================================================
 * Audio Player (in-popup)
 * ================================================================== */

.hg-player {
    padding: 16px 24px;
}

.hg-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

/* Skip buttons (±15s) */
.hg-player-skip-back,
.hg-player-skip-forward {
    width: 40px;
    height: 40px;
    border-radius: var(--hg-radius-full);
    color: var(--hg-color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color var(--hg-transition-fast),
        background var(--hg-transition-fast);
}

.hg-player-skip-back:hover,
.hg-player-skip-forward:hover {
    color: var(--hg-color-blue);
    background: rgba(98, 171, 206, 0.1);
}

.hg-player-skip-back svg,
.hg-player-skip-forward svg {
    width: 24px;
    height: 24px;
}

/* Play / Pause button */
.hg-player-play-pause {
    width: 56px;
    height: 56px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-blue);
    color: #fff;
    font-size: var(--hg-font-size-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--hg-shadow-sm);
    transition:
        background var(--hg-transition-fast),
        transform var(--hg-transition-fast);
}

.hg-player-play-pause:hover {
    background: var(--hg-color-blue-dark);
    transform: scale(1.05);
}

.hg-player-play-pause:active {
    transform: scale(0.95);
}

.hg-player-icon-play,
.hg-player-icon-pause {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Optical centering: play triangle is visually left-heavy, nudge right */
.hg-player-icon-play {
    padding-left: 3px;
}

.hg-player-icon-play[hidden],
.hg-player-icon-pause[hidden] {
    display: none;
}

/* Progress section */
.hg-player-progress {
    padding: 0 24px;
}

/* Progress bar track – ::before expands touch target */
.hg-player-progress-bar {
    position: relative;
    height: 6px;
    background: var(--hg-color-border);
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
    touch-action: none;
}
.hg-player-progress-bar::before {
    content: '';
    position: absolute;
    top: -14px;
    bottom: -14px;
    left: 0;
    right: 0;
}

/* Filled portion */
.hg-player-progress-filled {
    height: 100%;
    width: 0;
    background: var(--hg-color-red);
    border-radius: 3px;
    transition: width 100ms linear;
    pointer-events: none;
}

/* Draggable handle with subtle glow */
.hg-player-progress-handle {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--hg-color-red);
    border-radius: var(--hg-radius-full);
    border: 2px solid #fff;
    box-shadow:
        0 1px 4px rgba(51, 51, 51, 0.15),
        0 0 8px rgba(238, 82, 75, 0.2);
    cursor: grab;
    transition:
        transform var(--hg-transition-fast),
        box-shadow var(--hg-transition-fast);
    z-index: 2;
    touch-action: none;
}
/* Invisible larger touch target around handle */
.hg-player-progress-handle::before {
    content: '';
    position: absolute;
    top: -14px;
    bottom: -14px;
    left: -14px;
    right: -14px;
}

.hg-player-progress-handle:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow:
        0 1px 4px rgba(51, 51, 51, 0.15),
        0 0 12px rgba(238, 82, 75, 0.3);
}

.hg-player-progress-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.3);
}

/* Time labels */
.hg-player-times {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: var(--hg-font-size-xs);
    color: var(--hg-color-text-light);
    font-variant-numeric: tabular-nums;
}

/* =====================================================================
 * Playing Snippet Card Highlight
 * ================================================================== */

.hg-snippet-card--playing {
    box-shadow:
        0 0 0 2px var(--hg-color-red),
        0 2px 8px rgba(238, 82, 75, 0.15);
}

.hg-snippet-card--playing .hg-snippet-play-overlay {
    background: rgba(238, 82, 75, 0.2);
}

.hg-snippet-card--playing .hg-snippet-progress {
    background: rgba(238, 82, 75, 0.15);
}

/* =====================================================================
 * Side Panel – Tab Handle
 * ================================================================== */

/* Side tabs container (right edge, vertically centered) */
.hg-side-tabs {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--hg-z-panel-tab);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hg-side-tab {
    background: var(--hg-color-red);
    color: #fff;
    border: none;
    border-radius: var(--hg-radius-md) 0 0 var(--hg-radius-md);
    padding: 12px 8px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: var(--hg-font-display);
    font-size: var(--hg-font-size-lg);
    box-shadow: var(--hg-shadow-md);
    transition:
        background var(--hg-transition-fast),
        transform var(--hg-transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.hg-side-tab:hover {
    background: var(--hg-color-red-dark);
}

.hg-side-tab--info {
    background: var(--hg-color-blue);
}

.hg-side-tab--info:hover {
    background: var(--hg-color-blue-dark);
}

.hg-side-tab-icon {
    font-size: var(--hg-font-size-xl);
    line-height: 1;
}

.hg-side-tab-label {
    font-family: var(--hg-font-display);
}

/* Alias for panel tab active state */
.hg-panel-tab.hg-panel-tab--active {
    transform: translateX(4px);
    opacity: 0.7;
}

/* Mobile: keep side tabs on the right edge, slightly compact */
@media (max-width: 767px) {
    .hg-side-tab {
        padding: 10px 6px;
        font-size: var(--hg-font-size-md);
    }

    .hg-side-tab-icon {
        font-size: var(--hg-font-size-lg);
    }
}

/* =====================================================================
 * Side Panel – Container
 * ================================================================== */

.hg-panel {
    position: fixed;
    right: -350px;
    top: 0;
    bottom: 0;
    width: 340px;
    background: var(--hg-color-bg-card);
    z-index: var(--hg-z-panel);
    box-shadow:
        -4px 0 24px rgba(51, 51, 51, 0.1),
        -1px 0 6px rgba(0, 0, 0, 0.04);
    transition: right var(--hg-transition-slow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hg-panel--open {
    right: 0;
}

/* Mobile: bottom sheet */
@media (max-width: 767px) {
    .hg-panel {
        right: auto;
        left: 0;
        top: auto;
        bottom: -100%;
        width: 100%;
        height: 70vh;
        border-radius: var(--hg-radius-lg) var(--hg-radius-lg) 0 0;
        transition: bottom var(--hg-transition-slow);
    }

    .hg-panel--open {
        bottom: 0;
    }
}

/* =====================================================================
 * Side Panel – Header
 * ================================================================== */

.hg-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hg-color-border);
    flex-shrink: 0;
}

.hg-panel-logo {
    max-height: 36px;
    width: auto;
}

.hg-panel-close {
    width: 32px;
    height: 32px;
    border-radius: var(--hg-radius-full);
    font-size: var(--hg-font-size-xl);
    color: var(--hg-color-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color var(--hg-transition-fast),
        background var(--hg-transition-fast);
}

.hg-panel-close:hover {
    color: var(--hg-color-red);
    background: rgba(238, 82, 75, 0.08);
}

/* =====================================================================
 * Side Panel – Tabs
 * ================================================================== */

.hg-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--hg-color-border);
    flex-shrink: 0;
    font-size: 16px;
}

.hg-panel-tab-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: var(--hg-font-size-sm);
    font-weight: 600;
    color: var(--hg-color-text-light);
    text-align: center;
    border-bottom: 2px solid transparent;
    transition:
        color var(--hg-transition-fast),
        border-color var(--hg-transition-fast);
}

.hg-panel-tab-btn:hover {
    color: var(--hg-color-text);
}

.hg-panel-tab-btn.active {
    color: var(--hg-color-red) !important;
    border-bottom-color: var(--hg-color-red);
}

/* =====================================================================
 * Side Panel – Inline Playing State (playlist feedback)
 * ================================================================== */

/* Equalizer bars inside each item (hidden by default) */
.hg-panel-item-eq {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    flex-shrink: 0;
}

.hg-panel-item-eq span {
    display: block;
    width: 3px;
    background: var(--hg-color-red);
    border-radius: 1px;
    animation: hg-eq-bar 1.2s ease-in-out infinite;
}

.hg-panel-item-eq span:nth-child(1) {
    height: 60%;
    animation-delay: 0s;
}

.hg-panel-item-eq span:nth-child(2) {
    height: 100%;
    animation-delay: 0.2s;
}

.hg-panel-item-eq span:nth-child(3) {
    height: 40%;
    animation-delay: 0.4s;
}

@keyframes hg-eq-bar {
    0%,
    100% {
        transform: scaleY(0.3);
    }
    50% {
        transform: scaleY(1);
    }
}

/* Playing item: show equalizer, hide number badge */
.hg-panel-item--playing .hg-panel-item-eq {
    display: flex;
}

.hg-panel-item--playing .hg-panel-item-number {
    display: none;
}

/* Playing item highlight */
.hg-panel-item--playing {
    background: rgba(238, 82, 75, 0.06);
    border-left-color: var(--hg-color-red);
}

.hg-panel-item--playing .hg-panel-item-title {
    color: var(--hg-color-red);
    font-weight: 600;
}

.hg-panel-item--playing .hg-panel-item-play {
    background: var(--hg-color-red);
    color: #fff;
    border-color: var(--hg-color-red) !important;
}

.hg-panel-item--playing .hg-panel-item-play:hover {
    background: var(--hg-color-red-dark);
    border-color: var(--hg-color-red-dark) !important;
}

/* Paused state: freeze equalizer */
.hg-panel-item--paused .hg-panel-item-eq span {
    animation-play-state: paused;
}

.hg-panel-item--paused .hg-panel-item-play {
    background: transparent;
    color: var(--hg-color-red);
}

.hg-panel-item--paused .hg-panel-item-play:hover {
    background: var(--hg-color-red);
    color: #fff;
}

/* =====================================================================
 * Side Panel – Content / List
 * ================================================================== */

.hg-panel-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
}

/* Custom scrollbar for panel */
.hg-panel-content::-webkit-scrollbar {
    width: 5px;
}

.hg-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.hg-panel-content::-webkit-scrollbar-thumb {
    background: var(--hg-color-border);
    border-radius: 3px;
}

.hg-panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--hg-color-text-light);
}

.hg-panel-empty {
    padding: 24px 20px;
    text-align: center;
    color: var(--hg-color-text-light);
    font-style: italic;
    font-size: var(--hg-font-size-sm);
}

/* =====================================================================
 * Side Panel – List Item
 * ================================================================== */

.hg-panel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background var(--hg-transition-fast);
    border-left: 3px solid transparent;
}

.hg-panel-item:hover {
    background: var(--hg-color-bg);
}

.hg-panel-item--active {
    background: var(--hg-color-bg);
    border-left-color: var(--hg-color-red);
}

/* Number badge */
.hg-panel-item-number {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-border);
    color: var(--hg-color-text);
    font-size: var(--hg-font-size-xs);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hg-panel-item--active .hg-panel-item-number {
    background: var(--hg-color-red);
    color: #fff;
}

/* Info block */
.hg-panel-item-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hg-panel-item-title {
    font-size: var(--hg-font-size-sm);
    font-weight: 500;
    color: var(--hg-color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hg-panel-item-subtitle {
    font-size: var(--hg-font-size-xs);
    color: var(--hg-color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Play button */
.hg-panel-item-play {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--hg-radius-full);
    color: var(--hg-color-red);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--hg-color-red) !important;
    padding-left: 2px;
    transition:
        background var(--hg-transition-fast),
        color var(--hg-transition-fast),
        border-color var(--hg-transition-fast);
}

.hg-panel-item-play:hover {
    background: var(--hg-color-red);
    color: #fff;
    border-color: var(--hg-color-red) !important;
}

/* =====================================================================
 * Side Panel – Footer (Offline)
 * ================================================================== */

.hg-panel-footer {
    flex-shrink: 0;
    padding: 12px 20px;
    border-top: 1px solid var(--hg-color-border);
}

.hg-offline-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--hg-radius-sm);
    background: var(--hg-color-blue);
    color: #fff;
    font-size: var(--hg-font-size-sm);
    font-weight: 600;
    text-align: center;
    transition: background var(--hg-transition-fast);
}

.hg-offline-btn:hover {
    background: var(--hg-color-blue-dark);
}

.hg-offline-progress {
    margin-top: 8px;
}

.hg-offline-progress-track {
    height: 4px;
    background: var(--hg-color-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.hg-offline-progress-bar {
    height: 100%;
    width: 0;
    background: var(--hg-color-blue);
    border-radius: 2px;
    transition: width 200ms linear;
}

.hg-offline-progress-text {
    font-size: var(--hg-font-size-xs);
    color: var(--hg-color-text-light);
}

/* =====================================================================
 * Mini Player
 * ================================================================== */

.hg-mini-player {
    position: fixed;
    bottom: 16px;
    right: 16px;
    left: auto;
    max-width: 480px;
    width: calc(100% - 32px);
    background: var(--hg-color-dark);
    color: #ffffff;
    z-index: var(--hg-z-mini-player);
    transform: translateY(calc(100% + 32px));
    transition:
        transform var(--hg-transition-normal),
        max-width var(--hg-transition-normal),
        border-radius var(--hg-transition-fast);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border-radius: var(--hg-radius-md);
}

.hg-mini-player--visible {
    transform: translateY(0);
    animation: hg-mini-bounce-in 500ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes hg-mini-bounce-in {
    from {
        transform: translateY(calc(100% + 32px));
    }
    to {
        transform: translateY(0);
    }
}

/* Minimized state: compact pill */
.hg-mini-player--minimized {
    max-width: 200px;
}

.hg-mini-player--minimized .hg-mini-player-progress-bar,
.hg-mini-player--minimized .hg-mini-player-time,
.hg-mini-player--minimized .hg-mini-player-autoplay,
.hg-mini-player--minimized .hg-mini-player-skip-back,
.hg-mini-player--minimized .hg-mini-player-skip-forward,
.hg-mini-player--minimized .hg-mini-player-next,
.hg-mini-player--minimized .hg-mini-player-info {
    display: none !important;
}

.hg-mini-player--minimized .hg-mini-player-content {
    padding: 6px 10px;
    gap: 4px;
    justify-content: center;
    flex-wrap: nowrap;
}

.hg-mini-player--minimized .hg-mini-player-controls {
    gap: 2px;
    margin-left: 0;
}

/* Rotate chevron when minimized (points up to expand) */
.hg-mini-player--minimized .hg-mini-player-minimize svg {
    transform: rotate(180deg);
}

/* Seekable progress bar at top */
.hg-mini-player-progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    z-index: 2;
    transition: height var(--hg-transition-fast);
}

.hg-mini-player-progress-bar:hover {
    height: 6px;
}

.hg-mini-player-progress-filled {
    height: 100%;
    width: 0;
    background: var(--hg-color-red);
    transition: width 100ms linear;
    pointer-events: none;
}

/* Content layout – two rows */
.hg-mini-player-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 14px 8px 16px;
    gap: 4px 10px;
}

/* Info section – full width top row */
.hg-mini-player-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 100%;
    cursor: pointer;
}

.hg-mini-player-info:hover .hg-mini-player-title {
    color: var(--hg-color-red-light);
}

.hg-mini-player-title {
    font-family: var(--hg-font-display);
    font-size: var(--hg-font-size-lg);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    transition: color var(--hg-transition-fast);
    flex-shrink: 1;
    min-width: 0;
}

.hg-mini-player-subtitle {
    font-size: var(--hg-font-size-xs);
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    flex-shrink: 1;
    min-width: 0;
}

/* Dot separator between title and subtitle */
.hg-mini-player-subtitle:not(:empty)::before {
    content: '\00B7';
    margin-right: 6px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 700;
}

/* Time display */
.hg-mini-player-time {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: var(--hg-font-size-xs);
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    white-space: nowrap;
}

.hg-mini-player-separator {
    margin: 0 1px;
    opacity: 0.4;
}

/* Controls – push to right side of second row */
.hg-mini-player-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Shared button base for mini-player controls */
.hg-mini-player-skip-back,
.hg-mini-player-skip-forward,
.hg-mini-player-next {
    width: 32px;
    height: 32px;
    border-radius: var(--hg-radius-full);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color var(--hg-transition-fast),
        background var(--hg-transition-fast);
    padding: 0;
}

.hg-mini-player-skip-back:hover,
.hg-mini-player-skip-forward:hover,
.hg-mini-player-next:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.hg-mini-player-play-pause {
    width: 40px;
    height: 40px;
    border-radius: var(--hg-radius-full);
    background: var(--hg-color-red);
    color: #ffffff;
    border: none;
    font-size: var(--hg-font-size-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--hg-transition-fast),
        transform var(--hg-transition-fast);
    padding: 0;
    line-height: 1;
}

.hg-mini-player-play-pause:hover {
    background: var(--hg-color-red-dark);
    transform: scale(1.05);
}

/* Play/pause icon visibility */
.hg-mini-player-icon-play,
.hg-mini-player-icon-pause {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hg-mini-player-icon-play {
    padding-left: 2px;
}

.hg-mini-player-icon-play[hidden],
.hg-mini-player-icon-pause[hidden] {
    display: none !important;
}

.hg-mini-player-minimize {
    width: 28px;
    height: 28px;
    border-radius: var(--hg-radius-full);
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color var(--hg-transition-fast),
        background var(--hg-transition-fast);
    padding: 0;
    line-height: 1;
    margin-left: 4px;
}

.hg-mini-player-minimize:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.hg-mini-player-minimize svg {
    transition: transform var(--hg-transition-fast);
}

.hg-mini-player-close {
    width: 28px;
    height: 28px;
    border-radius: var(--hg-radius-full);
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    border: none;
    font-size: var(--hg-font-size-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color var(--hg-transition-fast),
        background var(--hg-transition-fast);
    padding: 0;
    line-height: 1;
}

.hg-mini-player-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Mini-player auto-play toggle */
.hg-mini-player-autoplay {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
}

.hg-mini-player-autoplay-track {
    position: relative;
    width: 32px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9px;
    transition: background var(--hg-transition-fast);
    display: flex;
    align-items: center;
    padding: 2px;
    outline: none;
    cursor: pointer;
    border: none;
}

.hg-mini-player-autoplay-track:focus-visible {
    box-shadow: 0 0 0 2px var(--hg-color-red-light);
}

.hg-mini-player-autoplay-track[aria-checked='true'] {
    background: var(--hg-color-red);
}

.hg-mini-player-autoplay-knob {
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform var(--hg-transition-fast);
    pointer-events: none;
}

.hg-mini-player-autoplay-track[aria-checked='true']
    .hg-mini-player-autoplay-knob {
    transform: translateX(14px);
}

.hg-mini-player-autoplay-label {
    font-size: var(--hg-font-size-xs);
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}

/* Mobile: full-width bottom bar */
@media (max-width: 767px) {
    .hg-mini-player {
        bottom: 0;
        right: 0;
        left: 0;
        max-width: 100%;
        width: 100%;
        border-radius: 0;
    }

    .hg-mini-player--minimized {
        max-width: 160px;
        left: auto;
        right: 8px;
        bottom: 8px;
        border-radius: var(--hg-radius-md);
    }

    .hg-mini-player-content {
        padding: 6px 10px 8px;
        gap: 8px 8px;
    }

    .hg-mini-player-title {
        font-size: var(--hg-font-size-base);
    }

    .hg-mini-player-time {
        display: none;
    }

    .hg-mini-player-subtitle {
        display: none;
    }

    /* Größere Tap-Targets auf Mobile (>= 44 px laut Apple HIG). Der
     * Autoplay-Toggle wird komplett ausgeblendet, um den Platz dafür
     * frei zu machen – er lässt sich im Popup-Player weiterhin setzen.
     */
    .hg-mini-player-controls {
        gap: 6px;
    }

    .hg-mini-player-skip-back,
    .hg-mini-player-skip-forward,
    .hg-mini-player-next {
        width: 44px;
        height: 44px;
    }

    .hg-mini-player-skip-back svg,
    .hg-mini-player-skip-forward svg,
    .hg-mini-player-next svg {
        width: 28px;
        height: 28px;
    }

    .hg-mini-player-play-pause {
        width: 52px;
        height: 52px;
    }

    .hg-mini-player-play-pause svg {
        width: 30px;
        height: 30px;
    }

    .hg-mini-player-autoplay {
        display: none;
    }
}

/* =====================================================================
 * Auto-Play Toggle (in popup player)
 * ================================================================== */

.hg-player-extras {
    display: flex;
    justify-content: flex-end;
    padding: 2px 16px 6px;
}

.hg-player-autoplay-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.hg-player-autoplay-label {
    white-space: nowrap;
    font-size: 0.6875rem;
    color: var(--hg-color-text-light);
}

/* Toggle track */
.hg-player-autoplay-track {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    background: var(--hg-color-border);
    border-radius: 9px;
    transition: background var(--hg-transition-fast);
    outline: none;
}

.hg-player-autoplay-track:focus-visible {
    box-shadow: 0 0 0 2px var(--hg-color-red-light);
}

/* Toggle knob */
.hg-player-autoplay-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform var(--hg-transition-fast);
}

/* Active state */
.hg-player-autoplay-track[aria-checked='true'] {
    background: var(--hg-color-red);
}

.hg-player-autoplay-track[aria-checked='true'] .hg-player-autoplay-knob {
    transform: translateX(14px);
}

/* =====================================================================
 * Popup Content Transition (stop-to-stop navigation)
 * ================================================================== */

.hg-popup-body {
    transition: opacity 200ms ease;
}

.hg-popup-body--fading {
    opacity: 0;
}

/* =====================================================================
 * Edge Cases: missing content
 * ================================================================== */

/* Hide image wrapper when stop has no image */
.hg-popup-image-wrapper[hidden] {
    display: none;
}

/* Hide play overlay when stop has no audio */
.hg-play-overlay[hidden] {
    display: none;
}

/* Disabled offline button */
.hg-offline-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--hg-color-border);
    color: var(--hg-color-text-light);
}

.hg-offline-btn:disabled:hover {
    background: var(--hg-color-border);
}

/* =====================================================================
 * Reduced Motion
 * ================================================================== */

/* =====================================================================
 * Welcome Overlay
 * ================================================================== */

/* Hide empty paragraphs that wpautop occasionally injects between our
 * markup. The shortcode renderer already strips comments and collapses
 * whitespace, but wpautop runs again on the post content and may still
 * leave the odd <p></p> stub. */
.hg-welcome > p:empty {
    display: none;
}

.hg-welcome-overlay {
    position: fixed;
    inset: 0;
    background: var(--hg-color-overlay);
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--hg-transition-normal);
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.hg-welcome-overlay[hidden] {
    display: none;
}

.hg-welcome-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

.hg-welcome {
    position: relative;
    background: var(--hg-color-bg-card);
    border-radius: var(--hg-radius-lg);
    width: 100%;
    max-width: 640px;
    margin: auto 0;
    padding: 0px 36px 32px 36px;
    box-shadow:
        0 16px 64px rgba(51, 51, 51, 0.15),
        0 6px 20px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(51, 51, 51, 0.04);
    transform: scale(0.92);
    opacity: 0;
    transition:
        transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity var(--hg-transition-normal);
    text-align: center;
    flex-shrink: 0;
}

.hg-welcome-overlay--visible .hg-welcome {
    transform: scale(1);
    opacity: 1;
}

/* Close button (top-right) – always visible per Reana design */
.hg-welcome-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--hg-color-blue);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: color var(--hg-transition-fast);
}

.hg-welcome-close:hover {
    color: var(--hg-color-red);
}

/* Top bird-with-headphones illustration (right-aligned, overlaps padding) */
.hg-welcome-logo-top {
    max-width: calc(100% + 72px) !important;
    display: block;
    width: calc(100% + 72px);
    height: auto;
    margin: 0 -36px 20px; /* negative right margin = edge-bleed */
}

/* "Was flüstern die Wände?" handwritten SVG headline */
.hg-welcome-schrift-wrap {
    display: flex;
    justify-content: center;
    text-align: center;
    margin-bottom: 20px;
}

img.hg-welcome-schrift {
    display: block;
    width: 100%;
    max-width: 350px;
    height: auto;
}

/* Subline – "Ein Hörspaziergang durch …" */
p.hg-welcome-subtitle {
    font-family: var(--hg-font-body);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hg-color-blue);
    margin: 0 0 0.5em;
}

/* Description text – hellblau per Reana spec */
.hg-welcome-text {
    font-family: var(--hg-font-body);
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--hg-color-blue);
    margin: 0 auto 24px;
    max-width: 460px;
}

.hg-welcome-text p {
    margin: 0 0 8px;
}

/* "Schnapp dir dein Smartphone …" + "So funktioniert's" + headphones */
.hg-welcome-howto {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: left;
    margin: 4px auto 18px;
    max-width: 400px;
}

.hg-welcome-howto-text {
    flex: 1 1 auto;
}

p.hg-welcome-howto-intro {
    font-family: var(--hg-font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--hg-color-red);
    margin: 0 0 0.8em;
    line-height: 1.3;
}

h3.hg-welcome-howto-title {
    font-family: var(--hg-font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--hg-color-red);
    margin: 0 0 4px;
}

ol.hg-welcome-howto-steps {
    list-style: none;
    counter-reset: hg-howto;
    margin: 0 0 0.8em;
    padding: 0;
    color: var(--hg-color-red);
    font-size: 0.95rem;
    line-height: 1.5;
}

ol.hg-welcome-howto-steps li {
    counter-increment: hg-howto;
}

ol.hg-welcome-howto-steps li::before {
    content: counter(hg-howto) '. ';
    color: var(--hg-color-red);
    font-weight: 700;
    margin-right: 4px;
}

p.hg-welcome-howto-image {
    flex: 0 0 auto;
    width: 110px;
    height: auto;
}

/* Highlight CTA – "> Kostenlos & jederzeit zugänglich"
 * Sits at the bottom of .hg-welcome-howto-text, so no auto-centering. */
.hg-welcome-cta {
    font-family: var(--hg-font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--hg-color-red);
    margin: 0;
    padding: 0;
}

.hg-welcome-cta-arrow {
    margin-right: 4px;
}

/* Collapsibles */
.hg-welcome-details-group {
    border-top: 1px solid var(--hg-color-blue);
    margin-top: 14px;
    margin-bottom: 1em;
}

.hg-welcome-details {
    text-align: left;
    border-bottom: 1px solid var(--hg-color-blue);
}

.hg-welcome-details summary {
    cursor: pointer;
    font-family: var(--hg-font-body);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--hg-color-blue);
    padding: 12px 4px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hg-welcome-details summary::-webkit-details-marker {
    display: none;
}

.hg-welcome-details-arrow {
    display: inline-block;
    transition: transform var(--hg-transition-fast);
    color: var(--hg-color-blue);
}

.hg-welcome-details[open] .hg-welcome-details-arrow {
    transform: rotate(90deg);
}

/* Collapsible content rendered from the WYSIWYG editor – keep TinyMCE
 * formatting (bold/italic/lists/links/images/headings) visually intact.
 * Light beige background and generous padding signal that the accordion
 * is open. */
.hg-welcome-about,
.hg-welcome-instructions {
    padding: 14px 18px 16px;
    margin: 0 0 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--hg-color-dark);
    background: #f8f7f5;
    border-radius: 8px;
}

.hg-welcome-about p,
.hg-welcome-instructions p {
    margin: 0 0 8px;
    color: inherit;
}

.hg-welcome-about strong,
.hg-welcome-instructions strong,
.hg-welcome-about b,
.hg-welcome-instructions b {
    font-weight: 700;
    color: inherit;
}

.hg-welcome-about em,
.hg-welcome-instructions em,
.hg-welcome-about i,
.hg-welcome-instructions i {
    font-style: italic;
    color: inherit;
}

.hg-welcome-about u,
.hg-welcome-instructions u {
    text-decoration: underline;
}

.hg-welcome-about h1,
.hg-welcome-about h2,
.hg-welcome-about h3,
.hg-welcome-about h4,
.hg-welcome-about h5,
.hg-welcome-about h6,
.hg-welcome-instructions h1,
.hg-welcome-instructions h2,
.hg-welcome-instructions h3,
.hg-welcome-instructions h4,
.hg-welcome-instructions h5,
.hg-welcome-instructions h6 {
    font-family: var(--hg-font-body);
    font-weight: 700;
    color: inherit;
    margin: 12px 0 6px;
    line-height: 1.3;
}

.hg-welcome-about ul,
.hg-welcome-about ol,
.hg-welcome-instructions ul,
.hg-welcome-instructions ol {
    margin: 6px 0 8px;
    padding-left: 22px;
    color: inherit;
}

.hg-welcome-about ul,
.hg-welcome-instructions ul {
    list-style: disc;
}

.hg-welcome-about ol,
.hg-welcome-instructions ol {
    list-style: decimal;
}

.hg-welcome-about li,
.hg-welcome-instructions li {
    margin: 2px 0;
    color: inherit;
}

.hg-welcome-about a,
.hg-welcome-instructions a {
    color: var(--hg-color-red);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hg-welcome-about a:hover,
.hg-welcome-instructions a:hover {
    color: var(--hg-color-red-dark);
}

.hg-welcome-about img,
.hg-welcome-instructions img {
    max-width: 100%;
    height: auto;
    border-radius: var(--hg-radius-sm);
    margin: 8px 0;
}

/* Dismiss link – subtle grey by default, darkens on hover */
button.hg-welcome-dismiss {
    display: inline-block;
    background: none;
    border: none;
    font-family: var(--hg-font-body);
    font-size: 0.9em;
    font-style: normal;
    font-weight: 400;
    color: #999 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 16px 8px 12px;
    margin-bottom: 1em !important;
    transition: color var(--hg-transition-fast);
}

button.hg-welcome-dismiss:hover {
    color: var(--hg-color-dark) !important;
}

/* Credits footer (very small, multi-line) */
.hg-welcome-credits {
    font-family: var(--hg-font-body);
    font-size: 0.7rem;
    line-height: 1.5;
    color: #999;
    margin-top: 8px;
    text-align: center;
}

.hg-welcome-credits a {
    color: inherit;
    text-decoration: underline;
    transition: color var(--hg-transition-fast);
}

/* Sponsor name links darken on hover (same as dismiss) */
.hg-welcome-credits a:hover,
.hg-welcome-credits a:focus {
    color: var(--hg-color-dark);
}

/* Mobile: tighter padding + stack the headphones illustration above */
@media (max-width: 767px) {
    .hg-welcome-overlay {
        padding: 16px 8px;
    }

    .hg-welcome {
        max-width: 100%;
        padding: 0 16px 24px;
    }

    .hg-welcome-logo-top {
        max-width: calc(100% + 32px) !important;
        display: block;
        width: calc(100% + 32px);
        height: auto;
        margin: 0 -16px 20px; /* negative right margin = edge-bleed */
    }

    .hg-welcome-schrift {
        max-width: 280px;
    }

    .hg-welcome-howto {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .hg-welcome-howto-image {
        order: -1;
        width: 90px;
    }

    .hg-welcome-cta {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hg-play-icon {
        animation: none !important;
    }

    /* Disable staggered popup reveal */
    .hg-popup--visible .hg-popup-header,
    .hg-popup--visible .hg-popup-image-wrapper,
    .hg-popup--visible .hg-player,
    .hg-popup--visible .hg-popup-snippets {
        animation: none !important;
    }

    /* Disable mini-player bounce */
    .hg-mini-player--visible {
        animation: none !important;
    }

    .hg-marker,
    .hg-marker-tooltip,
    .hg-map-controls button,
    .hg-popup,
    .hg-popup-overlay,
    .hg-popup-nav,
    .hg-popup-close,
    .hg-play-overlay,
    .hg-play-icon,
    .hg-snippet-card,
    .hg-snippet-image,
    .hg-snippet-play-overlay,
    .hg-snippet-play-icon,
    .hg-snippet-progress-filled,
    .hg-player-play-pause,
    .hg-player-skip-back,
    .hg-player-skip-forward,
    .hg-player-progress-handle,
    .hg-player-progress-filled,
    .hg-panel,
    .hg-side-tab,
    .hg-panel-item,
    .hg-panel-item-play,
    .hg-panel-tab-btn,
    .hg-panel-close,
    .hg-transcript-toggle,
    .hg-snippet-transcript-toggle,
    .hg-offline-btn,
    .hg-offline-progress-bar,
    .hg-mini-player,
    .hg-mini-player-play-pause,
    .hg-mini-player-skip-back,
    .hg-mini-player-skip-forward,
    .hg-mini-player-next,
    .hg-mini-player-close,
    .hg-mini-player-progress-bar,
    .hg-mini-player-info,
    .hg-player-autoplay-track,
    .hg-player-autoplay-knob,
    .hg-mini-player-autoplay-track,
    .hg-mini-player-autoplay-knob,
    .hg-mini-player-minimize,
    .hg-mini-player-minimize svg,
    .hg-popup-body,
    .hg-welcome-overlay,
    .hg-welcome,
    .hg-welcome-sponsor-link {
        transition-duration: 0ms !important;
    }

    .hg-panel-item-eq span {
        animation: none !important;
    }
}

.hg-panel-item-play-icon svg {
    margin-top: 10px;
}

/* =====================================================================
 * Audio Copyright Info Icon + Tooltip
 * Used for the main audio (top-right of popup image) and for each
 * snippet card (top-right of snippet image). Tooltip toggles open on
 * click/tap or hover (desktop) and closes on outside click / Escape.
 * ================================================================== */

.hg-audio-info {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.hg-audio-info-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--hg-color-dark-blue);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.hg-audio-info-btn:hover,
.hg-audio-info-btn:focus-visible {
    background: var(--hg-color-dark-blue);
    color: #fff;
    outline: none;
    transform: scale(1.05);
}

.hg-audio-info-btn svg {
    display: block;
}

.hg-audio-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    max-width: 260px;
    padding: 10px 12px;
    background: var(--hg-color-bg);
    border: 1px solid var(--hg-color-border);
    border-radius: var(--hg-radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    color: var(--hg-color-dark);
    font-family: var(--hg-font-body);
    font-size: var(--hg-font-size-xs);
    line-height: 1.45;
    white-space: pre-line;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

/* Desktop: open on hover/focus of the wrapper OR button */
@media (hover: hover) {
    .hg-audio-info:hover .hg-audio-tooltip,
    .hg-audio-info-btn:focus-visible + .hg-audio-tooltip {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
}

/* Tap-to-toggle (mobile + desktop persistent click): wrapper gets .is-open */
.hg-audio-info.is-open .hg-audio-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Kleinere Buttons in Snippet-Karten (Foto + Copyright). */
.hg-snippet-info-btn,
.hg-snippet-photo-btn {
    width: 24px;
    height: 24px;
}

/* =====================================================================
 * Popup Credits Section (standort-weite Copyrights)
 * Erscheint ganz unten im Popup, Reana-Beige-Block.
 * ================================================================== */

.hg-popup-credits {
    padding: 20px 24px 28px;
    background: var(--hg-color-bg);
    border-top: 1px solid var(--hg-color-border);
}

h3.hg-popup-credits-title {
    font-family: var(--hg-font-display);
    font-size: var(--hg-font-size-lg);
    color: var(--hg-color-dark-blue);
    margin: 0 0 10px;
    line-height: 1.3;
}

.hg-popup-credits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hg-popup-credits-item {
    font-family: var(--hg-font-body);
    font-size: var(--hg-font-size-sm);
    color: var(--hg-color-dark);
    line-height: 1.5;
    padding: 2px 0;
}

/* Verlinkte Credits optisch gleich wie normale – kein Blau, kein
 * Underline. Nur der Cursor zeigt die Interaktivität an. */
.hg-popup-credits-item a {
    color: inherit;
    text-decoration: none;
}

/* Externes-Link-Icon nach verlinkten Credits (SVG-Mask, erbt die
 * Textfarbe über currentColor). */
.hg-popup-credits-item a::after {
    content: '';
    display: inline-block;
    width: 0.7em;
    height: 0.7em;
    margin-left: 0.3em;
    vertical-align: -0.05em;
    background: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M14 2.5a.5.5 0 00-.5-.5h-4a.5.5 0 000 1h2.79L7.15 8.15a.5.5 0 00.7.7L13 3.71V6.5a.5.5 0 001 0v-4zM4 4c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V9.5a.5.5 0 00-1 0V12c0 .55-.45 1-1 1H4c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h2.5a.5.5 0 000-1H4z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M14 2.5a.5.5 0 00-.5-.5h-4a.5.5 0 000 1h2.79L7.15 8.15a.5.5 0 00.7.7L13 3.71V6.5a.5.5 0 001 0v-4zM4 4c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V9.5a.5.5 0 00-1 0V12c0 .55-.45 1-1 1H4c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h2.5a.5.5 0 000-1H4z'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* =====================================================================
 * Next-Stop-Suggestion (ganz unten im Popup)
 * ================================================================== */

.hg-popup-next-stop {
    padding: 16px 24px 28px;
    background: var(--hg-color-bg);
}

.hg-next-stop-label {
    display: block;
    font-family: var(--hg-font-body);
    font-size: var(--hg-font-size-sm);
    font-weight: 700;
    color: var(--hg-color-red);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.hg-next-stop-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--hg-color-bg-card);
    border-radius: var(--hg-radius-md);
    box-shadow: 0 1px 6px rgba(51, 51, 51, 0.06);
    transition:
        box-shadow 250ms ease,
        transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    cursor: pointer;
    padding: 12px 14px;
}

.hg-next-stop-card:hover,
.hg-next-stop-card:focus-visible {
    box-shadow:
        0 6px 20px rgba(51, 51, 51, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04);
    transform: translateY(-3px);
    outline: none;
}

.hg-next-stop-body {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hg-next-stop-image-wrapper {
    display: block;
    flex: 0 0 auto;
    width: 96px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--hg-radius-sm, 8px);
    background: var(--hg-color-bg);
}

.hg-next-stop-image-wrapper[hidden] {
    display: none;
}

.hg-next-stop-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.4s ease;
}

.hg-next-stop-card:hover .hg-next-stop-image {
    transform: scale(1.04);
}

.hg-next-stop-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.hg-next-stop-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.hg-next-stop-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--hg-color-blue);
    color: #fff;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    line-height: 1;
    letter-spacing: 0.01em;
    text-align: center;
}

.hg-next-stop-badge[hidden] {
    display: none;
}

.hg-next-stop-title {
    display: block;
    font-family: var(--hg-font-body);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
    color: var(--hg-color-red);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-next-stop-subtitle {
    display: block;
    font-family: var(--hg-font-body);
    font-size: var(--hg-font-size-sm);
    color: var(--hg-color-dark-blue);
    margin: 2px 0 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-next-stop-subtitle[hidden] {
    display: none;
}

.hg-next-stop-desc {
    display: block;
    font-family: var(--hg-font-body);
    font-size: var(--hg-font-size-sm);
    color: var(--hg-color-dark);
    margin: 4px 0 0;
    line-height: 1.35;
}

.hg-next-stop-desc[hidden] {
    display: none;
}

.hg-next-stop-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 28px;
    color: var(--hg-color-red);
    font-weight: 400;
    line-height: 1;
    transition: transform 200ms ease;
}

.hg-next-stop-card:hover .hg-next-stop-arrow {
    transform: translateX(4px);
}

/* Mobile: Bild oben, Text drunter */
@media (max-width: 480px) {
    .hg-next-stop-body {
        flex-wrap: wrap;
    }
    .hg-next-stop-image-wrapper {
        width: 100%;
        aspect-ratio: 16 / 9;
    }
    .hg-next-stop-arrow {
        margin-left: auto;
    }
}

/* =====================================================================
 * Footer (Copyright / Legal)
 * ================================================================== */

.hg-footer {
    width: 100%;
    height: var(--hg-footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    text-align: center;
    font-family: var(--hg-font-body);
    font-size: var(--hg-font-size-sm);
    color: var(--hg-color-dark);
    opacity: 0.75;
    background: transparent;
}

.hg-footer a {
    color: inherit;
    text-decoration: none;
}

.hg-footer a:hover {
    text-decoration: underline;
}

.hg-footer-sep {
    margin: 0 6px;
    opacity: 0.6;
}

@media (max-width: 767px) {
    .hg-footer {
        font-size: 12px;
        padding: 0 8px;
    }

    .hg-footer-sep {
        margin: 0 4px;
    }
}

/* =====================================================================
 * Spende: CTA (shared) + Modal
 *
 * Der CTA-Block sitzt einmal im Welcome-Overlay (unter dem Accordion)
 * und einmal im Standort-Popup (vor dem Next-Stop-Card). Beide Trigger
 * öffnen das gemeinsame #hg-donate-modal, das einmalig am Root des
 * Shortcode-Templates liegt.
 * ================================================================== */

/* CTA block -------------------------------------------------------- */

/* Hinweis zur Spezifität: Kind-Regeln sind durchgehend mit `.hg-donate-cta`
 * bzw. `.hg-donate-modal` präfixiert, damit Theme-Defaults auf `button`,
 * `img`, `h2`, `h3`, `p`, `ul/li`, `dl/dt/dd` nicht gewinnen. */

.hg-donate-cta {
    margin: 20px 24px 16px;
    padding: 16px 20px;
    background: var(--hg-color-bg);
    border-radius: var(--hg-radius-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.hg-donate-cta .hg-donate-cta-lead {
    margin: 0;
    font-family: var(--hg-font-body);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--hg-color-dark-blue);
    line-height: 1.35;
}

.hg-donate-cta .hg-donate-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    background: var(--hg-color-red);
    color: #fff;
    font-family: var(--hg-font-body);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition:
        background var(--hg-transition-fast),
        transform var(--hg-transition-fast),
        box-shadow var(--hg-transition-fast);
    box-shadow: 0 2px 8px rgba(238, 82, 75, 0.25);
}

.hg-donate-cta .hg-donate-cta-btn:hover,
.hg-donate-cta .hg-donate-cta-btn:focus-visible {
    background: var(--hg-color-red-dark, #d94037);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(238, 82, 75, 0.4);
}

/* Welcome-Variante sitzt im engeren Overlay – etwas kompakter.
 * Doppelklasse am selben Element, damit Spezifität ≥0,2,0 bleibt. */
.hg-donate-cta.hg-donate-cta--welcome {
    margin: 16px 0 12px;
}

/* Im Standort-Popup läuft die CTA bewusst in denselben 24-px-Gutter
 * wie die Actions-Leiste darüber. */
.hg-donate-cta.hg-donate-cta--popup {
    margin: 16px 24px 20px;
}

/* Modal ------------------------------------------------------------- */

/* Deckt im Konfliktfall (z. B. im Welcome-Overlay geöffnet) jedes
 * andere Overlay ab. Welcome- und Stop-Popup liegen bei 10000/9999 –
 * Donate legen wir darüber. */
.hg-donate-modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(26, 26, 26, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    animation: hg-fade-in 180ms ease;
}

.hg-donate-modal[hidden] {
    display: none;
}

.hg-donate-modal .hg-donate-modal-panel {
    position: relative;
    max-width: 640px;
    width: 100%;
    background: #fff;
    border-radius: var(--hg-radius-lg, 16px);
    padding: 28px 28px 24px;
    box-shadow: 0 12px 40px rgba(26, 26, 26, 0.25);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.hg-donate-modal .hg-donate-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--hg-color-text-light);
    cursor: pointer;
    border-radius: 50%;
    transition:
        background var(--hg-transition-fast),
        color var(--hg-transition-fast);
}

.hg-donate-modal .hg-donate-modal-close:hover,
.hg-donate-modal .hg-donate-modal-close:focus-visible {
    background: var(--hg-color-bg);
    color: var(--hg-color-dark);
}

.hg-donate-modal .hg-donate-modal-logo-wrap {
    display: flex;
    justify-content: center;
    margin: 4px 0 12px;
}

.hg-donate-modal .hg-donate-modal-logo {
    display: block;
    width: 96px;
    height: auto;
}

.hg-donate-modal .hg-donate-modal-title {
    font-family: var(--hg-font-display);
    font-size: var(--hg-font-size-xl, 1.5rem);
    color: var(--hg-color-red);
    text-align: center;
    margin: 0 0 14px;
    line-height: 1.2;
}

.hg-donate-modal .hg-donate-modal-body {
    color: var(--hg-color-dark);
    font-size: 0.95rem;
    line-height: 1.5;
}

.hg-donate-modal .hg-donate-modal-body p {
    margin: 0 0 12px;
}

.hg-donate-modal .hg-donate-modal-purposes {
    margin: 0 0 14px;
    padding: 0 0 0 18px;
    list-style: disc;
}

.hg-donate-modal .hg-donate-modal-purposes li {
    margin: 0 0 4px;
}

.hg-donate-modal .hg-donate-modal-purposes strong {
    color: var(--hg-color-dark-blue);
}

.hg-donate-modal .hg-donate-modal-thanks {
    font-weight: 600;
    color: var(--hg-color-dark-blue);
}

/* TWINT QR-Code Block */
.hg-donate-modal .hg-donate-twint {
    margin-top: 20px;
    text-align: center;
}

.hg-donate-modal .hg-donate-twint-figure {
    margin: 0 auto;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hg-donate-modal .hg-donate-twint-img {
    width: 200px;
    height: auto;
    display: block;
    border-radius: 8px;
}

.hg-donate-modal .hg-donate-twint-caption {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hg-color-dark-blue);
    text-align: center;
}

.hg-donate-modal .hg-donate-account {
    margin-top: 18px;
    padding: 16px 18px;
    background: var(--hg-color-bg);
    border-radius: var(--hg-radius-md);
    border-top: 3px solid var(--hg-color-red);
}

.hg-donate-modal .hg-donate-account-title {
    font-family: var(--hg-font-body);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hg-color-dark-blue);
    margin: 0 0 10px;
}

/* Äusseres Grid im Spendenkonto: links die Bankdaten (dl), rechts der
 * QR-Rechnungs-Block. Auf Mobile wird unterhalb gestapelt. */
.hg-donate-modal .hg-donate-account-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    column-gap: 18px;
    align-items: start;
}

/* dl als kompaktes zwei-spaltiges Grid auf Desktop, auf Mobile
 * einspaltig. Jede dt/dd-Zeile bleibt visuell zusammen. */
.hg-donate-modal .hg-donate-account-list {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    row-gap: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--hg-color-dark);
}

.hg-donate-modal .hg-donate-account-list dt {
    font-weight: 600;
    color: var(--hg-color-text-light);
    white-space: nowrap;
}

.hg-donate-modal .hg-donate-account-list dd {
    margin: 0;
    color: var(--hg-color-dark);
}

.hg-donate-modal .hg-donate-account-iban {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--hg-color-dark-blue);
    /* IBAN nicht mitten im Konto-Block umbrechen – ist schwer zu lesen
     * und zu scannen. Unterhalb des Breakpoints stapelt der
     * Account-Grid sowieso, dann hat das dd volle Breite. */
    white-space: nowrap;
}

/* QR-Rechnungs-Block (rechte Spalte). `figure` hat per Theme-Default
 * ggf. margins – darum hier explizit resetten. */
.hg-donate-modal .hg-donate-account-qr {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.hg-donate-modal .hg-donate-account-qr-img {
    width: 140px;
    height: 140px;
    display: block;
    background: #fff;
    border-radius: 4px;
}

.hg-donate-modal .hg-donate-account-qr-caption {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--hg-color-dark-blue);
    line-height: 1.3;
    text-align: center;
}

/* Account-Grid (Bankdaten + QR) früher stapeln als den Rest, damit
 * die IBAN-Zeile (nowrap) nicht aus der linken Spalte rausläuft. */
@media (max-width: 600px) {
    .hg-donate-modal .hg-donate-account-grid {
        grid-template-columns: 1fr;
        row-gap: 16px;
    }
}

@media (max-width: 480px) {
    .hg-donate-modal .hg-donate-modal-panel {
        padding: 20px 18px 18px;
    }
    .hg-donate-modal .hg-donate-account-list {
        grid-template-columns: 1fr;
        row-gap: 8px;
    }
    .hg-donate-modal .hg-donate-account-list dt {
        margin-bottom: 2px;
    }
}

@keyframes hg-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hg-donate-modal,
    .hg-donate-cta .hg-donate-cta-btn {
        animation: none !important;
        transition: none !important;
    }
}
