/**
 * GLOBAL HEADER STYLES
 * ====================
 * Shared navigation header used across home, blog, and legal pages.
 */

html {
    scroll-padding-top: 112px;
}

.global-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    padding: 14px 14px 0;
    pointer-events: none;
}

.global-header-wrapper {
    width: min(1200px, calc(100% - 0.5rem));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.global-header-island,
.global-header-theme-slot,
.global-header-mobile-menu {
    border: 1px solid var(--border-medium, rgba(0, 0, 0, 0.15));
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    box-shadow: 0 6px 24px var(--shadow-subtle, rgba(0, 0, 0, 0.1));
}

[data-theme="light"] .global-header-island,
[data-theme="light"] .global-header-theme-slot,
[data-theme="light"] .global-header-mobile-menu {
    background: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .global-header-island,
[data-theme="dark"] .global-header-theme-slot,
[data-theme="dark"] .global-header-mobile-menu {
    background: rgba(12, 12, 12, 0.88);
}

.global-header-island {
    pointer-events: auto;
    flex: 1;
    min-height: 54px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 10px 7px 15px;
}

.global-header-theme-slot {
    pointer-events: auto;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.global-header-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color, #0a0a0a);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    line-height: 1;
}

.global-header-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

[data-theme="light"] .global-header-logo-img {
    filter: invert(1);
}

.global-header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
}

.global-header-link,
.global-header-group-summary,
.global-header-mobile-link,
.global-header-mobile-group-summary {
    color: var(--text-muted, #666);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid transparent;
    box-sizing: border-box;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.global-header-link {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 13px;
    border-radius: 999px;
}

.global-header-group {
    position: relative;
    margin: 0;
}

.global-header-group-summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    margin: 0;
    padding: 0 13px;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
}

.global-header-group summary::-webkit-details-marker,
.global-header-mobile-group summary::-webkit-details-marker {
    display: none;
}

.global-header-group-caret {
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform 0.2s ease;
}

.global-header-group[open] .global-header-group-caret,
.global-header-mobile-group[open] .global-header-group-caret {
    transform: rotate(-135deg) translate(-1px, -1px);
}

.global-header-link:hover,
.global-header-link--active,
.global-header-group-summary:hover,
.global-header-group-summary--active,
.global-header-group[open] .global-header-group-summary {
    color: var(--text-color, #0a0a0a);
    background: var(--overlay-10, rgba(0, 0, 0, 0.08));
}

.global-header-group-panel {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    min-width: 220px;
    padding: 7px;
    border-radius: 14px;
    border: 1px solid var(--border-medium, rgba(0, 0, 0, 0.15));
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    box-shadow: 0 14px 34px var(--shadow-subtle, rgba(0, 0, 0, 0.12));
    display: grid;
    gap: 3px;
    z-index: 3;
}

[data-theme="light"] .global-header-group-panel {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .global-header-group-panel {
    background: rgba(14, 14, 14, 0.95);
}

.global-header-sub-link,
.global-header-mobile-sub-link {
    display: block;
    color: var(--text-muted, #666);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    line-height: 1.25;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.global-header-sub-link {
    padding: 9px 10px;
}

.global-header-sub-link:hover,
.global-header-sub-link--active {
    color: var(--text-color, #0a0a0a);
    background: var(--overlay-10, rgba(0, 0, 0, 0.08));
}

.global-header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.global-header-cta,
.global-header-mobile-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.global-header-cta {
    height: 34px;
    padding: 0 15px;
    font-size: 13px;
    line-height: 1;
    color: var(--bg-color, #fff);
    background: var(--text-color-strong, #111214);
    opacity: 1;
    box-shadow: 0 4px 20px var(--shadow-subtle);
}

.global-header-mobile-cta {
    min-height: 44px;
    font-size: 14px;
    line-height: 1;
    color: var(--bg-color, #fff);
    background: var(--text-color-strong, #111214);
    opacity: 1;
    box-shadow: 0 4px 20px var(--shadow-subtle);
}

.global-header-cta:visited,
.global-header-mobile-cta:visited {
    color: var(--bg-color, #fff);
    background: var(--text-color-strong, #111214);
    text-decoration: none;
    opacity: 1;
}

.global-header-cta:hover,
.global-header-mobile-cta:hover {
    color: var(--text-color-strong, #111214);
    background: var(--bg-color, #fff);
    border-color: var(--text-color-strong, #111214);
    text-decoration: none;
    opacity: 1;
    box-shadow: 0 8px 30px var(--shadow-subtle), 0 0 0 1px var(--border-medium, rgba(0, 0, 0, 0.15));
}

.global-header-cta:focus-visible,
.global-header-mobile-cta:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.global-header-menu-button {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--border-medium, rgba(0, 0, 0, 0.15));
    background: var(--overlay-03, rgba(0, 0, 0, 0.03));
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 0;
}

.global-header-menu-button span {
    width: 16px;
    height: 1.5px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.global-header[data-menu-open="true"] .global-header-menu-button span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
}

.global-header[data-menu-open="true"] .global-header-menu-button span:nth-child(2) {
    opacity: 0;
}

.global-header[data-menu-open="true"] .global-header-menu-button span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
}

.global-header-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    pointer-events: auto;
    z-index: 1;
}

.global-header-mobile-menu {
    pointer-events: auto;
    position: relative;
    z-index: 2;
    width: min(1200px, calc(100% - 0.5rem));
    margin: 11px auto 0;
    border-radius: 22px;
    padding: 16px;
    display: grid;
    gap: 13px;
}

.global-header-mobile-menu[hidden],
.global-header-backdrop[hidden] {
    display: none;
}

.global-header-mobile-nav {
    display: grid;
    gap: 6px;
}

.global-header-mobile-link,
.global-header-mobile-group-summary {
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 10px;
}

.global-header-mobile-link:hover,
.global-header-mobile-link--active,
.global-header-mobile-group-summary:hover,
.global-header-mobile-group-summary--active,
.global-header-mobile-group[open] .global-header-mobile-group-summary {
    color: var(--text-color, #0a0a0a);
    background: var(--overlay-10, rgba(0, 0, 0, 0.08));
}

.global-header-mobile-group-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.global-header-mobile-group {
    margin: 0;
}

.global-header-mobile-group-panel {
    display: grid;
    gap: 3px;
    padding: 4px 0 3px 10px;
}

.global-header-mobile-sub-link {
    padding: 9px 12px;
}

.global-header-mobile-sub-link:hover,
.global-header-mobile-sub-link--active {
    color: var(--text-color, #0a0a0a);
    background: var(--overlay-10, rgba(0, 0, 0, 0.08));
}

body.global-header-menu-open {
    overflow: hidden;
}

.global-header-theme-slot .theme-toggle {
    position: static;
    top: auto;
    right: auto;
    width: 44px;
    height: 44px;
    margin: 0;
    border-color: transparent;
    box-shadow: none;
}

.global-header-theme-slot .theme-toggle:hover {
    transform: none;
}

@media (max-width: 899px) {
    .global-header {
        padding: 10px 10px 0;
    }

    .global-header-wrapper {
        width: min(1200px, calc(100% - 3px));
        gap: 7px;
    }

    .global-header-island {
        padding-left: 12px;
        padding-right: 7px;
        min-height: 50px;
    }

    .global-header-logo {
        gap: 8px;
        font-size: 14px;
    }

    .global-header-nav,
    .global-header-cta {
        display: none;
    }

    .global-header-menu-button {
        display: inline-flex;
    }

    .global-header-theme-slot {
        width: 50px;
        height: 50px;
    }
}

@media (min-width: 900px) {
    .global-header-backdrop,
    .global-header-mobile-menu,
    .global-header-menu-button {
        display: none;
    }
}
