/* ═══════════════════════════════════════════════════════════
   UNIFIED MODULE HEADER STYLES
═══════════════════════════════════════════════════════════ */

/* CSS Variables - Dark theme (default) */
:root {
    --f-display: 'Space Grotesk', system-ui, sans-serif;
    --f-body:    'Inter', system-ui, sans-serif;
    --sp-1: 4px;  --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
    --sp-5: 24px; --sp-6: 32px;  --sp-7: 48px;  --sp-8: 80px;
    --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

html {
    --bg-root:    #1c2027;
    --bg-surface: #20252d;
    --bg-card:    #262d38;
    --bg-card-hi: #2d3547;
    --border:     rgba(255,255,255,0.07);
    --border-hi:  rgba(0,208,230,0.32);
    --text-1:     #edf1f8;
    --text-2:     #7d8fa8;
    --text-3:     #4c5d72;
    --accent-c:   #00d0e8;
    --accent-v:   #9b84f0;
    --accent-w:   #f5a246;
    --accent-g:   #4ed9a0;
    --shadow-card: 0 2px 12px rgba(0,0,0,0.3), 0 8px 32px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 0 1px rgba(0,208,230,0.15), 0 4px 24px rgba(0,208,230,0.08);
    --nav-bg:     rgba(28,32,39,0.88);
}

html[data-theme="light"] {
    --bg-root:    #f2f1ed;
    --bg-surface: #eceae5;
    --bg-card:    #ffffff;
    --bg-card-hi: #f8f7f4;
    --border:     rgba(0,0,0,0.07);
    --border-hi:  rgba(0,160,190,0.35);
    --text-1:     #1a1e26;
    --text-2:     #5a6780;
    --text-3:     #95a0b0;
    --accent-c:   #0099ae;
    --accent-v:   #6e49e0;
    --accent-w:   #c47d1a;
    --accent-g:   #1d9e6c;
    --shadow-card: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.06);
    --shadow-glow: 0 0 0 1px rgba(0,160,190,0.12), 0 4px 16px rgba(0,160,190,0.06);
    --nav-bg:     rgba(242,241,237,0.88);
}

/* Module Header Nav */
.module-header-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 62px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1.5rem, 5vw, 3.5rem);
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.module-header-nav.scrolled {
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.module-header-nav__left {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    flex: 1;
}

.module-header-nav__logo {
    font-family: var(--f-body);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    white-space: nowrap;
}

.module-header-nav__logo span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-c);
    box-shadow: 0 0 6px var(--accent-c);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}

.module-header-nav__module {
    font-family: var(--f-body);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-2);
    transition: color 0.2s ease;
}

.module-header-nav__right {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.module-header-nav__back {
    font-family: var(--f-body);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-2);
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.module-header-nav__back:hover {
    color: var(--text-1);
    text-decoration: underline;
}

.module-header-nav__theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--r-pill);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-1);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color 0.25s, background 0.25s, color 0.25s, box-shadow 0.25s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.module-header-nav__theme-toggle:hover {
    border-color: var(--border-hi);
    background: var(--bg-card-hi);
    box-shadow: 0 0 0 2px rgba(0,208,230,0.15);
}

.module-header-nav__theme-toggle .t-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .module-header-nav {
        padding: 0 clamp(1rem, 5vw, 1.5rem);
    }

    .module-header-nav__left {
        gap: var(--sp-3);
    }

    .module-header-nav__module {
        display: none;
    }

    .module-header-nav__back {
        font-size: 0.75rem;
    }

    .module-header-nav__theme-toggle {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

/* ── BODY OFFSET for fixed header ── */
body {
    padding-top: 62px;
}

/* ── NAV BUTTONS (Info + Hintergrund) ── */
.module-header-nav__btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: var(--r-pill, 999px);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    background: transparent;
    color: var(--text-2, #7d8fa8);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: var(--f-body, 'Inter', sans-serif);
    white-space: nowrap;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    letter-spacing: 0.02em;
}
.module-header-nav__btn:hover {
    border-color: var(--border-hi, rgba(0,208,230,0.32));
    color: var(--text-1, #edf1f8);
    background: var(--bg-card, #262d38);
}

/* ── FOOTER LOGO SWITCHING ── */
.footer-logo-img {
    height: 36px;
    width: auto;
    display: block;
}
html[data-theme="light"] .footer-logo-dark { display: none; }
html:not([data-theme="light"]) .footer-logo-light { display: none; }

/* ── RESPONSIVE: hide btn labels on small screens ── */
@media (max-width: 640px) {
    .module-header-nav__btn span { display: none; }
    .module-header-nav__btn { padding: 0.35rem 0.6rem; }
}

/* ══════════════════════════════════════════════════
   TOOLTIP SYSTEM — cursor-following, .tip + data-tip
══════════════════════════════════════════════════ */
.tip {
    border-bottom: 1px dashed var(--accent-c);
    cursor: help;
    color: inherit;
    transition: color .15s;
}
.tip:hover { color: var(--accent-c); }

#tip-box {
    display: none;
    position: fixed;
    z-index: 9999;
    background: var(--bg-card);
    border: 1px solid var(--border-hi);
    border-radius: var(--r-sm);
    padding: .5rem .8rem;
    font-size: .78rem;
    color: var(--text-1);
    line-height: 1.5;
    max-width: 260px;
    box-shadow: var(--shadow-card);
    pointer-events: none;
}
#tip-box.vis { display: block; }
#tip-box strong {
    color: var(--accent-c);
    display: block;
    margin-bottom: .2rem;
    font-size: .8rem;
}

/* ══════════════════════════════════════════════════
   LIGHTBOX SYSTEM — navigation + zoom (feedback-sp style)
══════════════════════════════════════════════════ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.lightbox.active { display: flex; flex-direction: column; }

.lb-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.45), transparent);
}
.lb-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
}
.lb-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.lb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.20);
    color: #fff;
    height: 36px;
    min-width: 36px;
    padding: 0 10px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background .2s;
    white-space: nowrap;
}
.lb-btn:hover { background: rgba(255,255,255,0.22); }
.lb-btn:disabled { opacity: 0.4; cursor: default; }
.lb-btn:disabled:hover { background: rgba(255,255,255,0.12); }
.lb-btn-close {
    background: rgba(220,38,38,0.30);
    border-color: rgba(220,38,38,0.40);
}
.lb-btn-close:hover { background: rgba(220,38,38,0.55); }

.lb-scroll {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 64px 20px 24px;
}
.lb-img-wrap { display: inline-block; }
.lb-img-wrap img {
    display: block;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.55);
    touch-action: pinch-zoom;
    user-select: none;
    -webkit-user-drag: none;
}
