/* ============================================================
   whe.bike Header & Footer Redesign
   - Sticky single-row header with light/dark logo switching
   - Localized member CTAs
   - Structured footer with email signup form
   Loads after whe-bike-media.css and whe-enhancements.css.
   ============================================================ */

/* === Sticky header (not on transparent tag/hero pages) ========== */
body:not(.is-head-transparent) #gh-head {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
}

#gh-head {
    height: 64px;
}

#gh-head .gh-head-inner {
    align-items: center;
    min-height: 64px;
    padding: 0 24px;
    gap: 16px;
}

body:not(.is-head-open) #gh-head .gh-head-inner {
    height: 64px;
}

.is-head-open #gh-head .gh-head-inner {
    height: 100%;
    min-height: 100%;
}

/* === Logo light/dark switching ================================ */
.gh-head-logo {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.gh-head-logo a {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.gh-head-logo img {
    display: block;
    max-height: 40px;
    width: auto;
    height: auto;
    filter: none !important;
    -webkit-filter: none !important;
}

.gh-head-logo img:nth-child(2),
.gh-head-logo .gh-head-logo-dark {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

/* Show dark logo in dark theme or when the header is transparent/accent/dark */
body[data-theme="dark"] .gh-head-logo .gh-head-logo-dark,
body.is-head-transparent .gh-head-logo .gh-head-logo-dark,
body.is-head-brand .gh-head-logo .gh-head-logo-dark,
body.is-head-dark .gh-head-logo .gh-head-logo-dark,
body[data-theme="dark"] .gh-head-logo img:nth-child(2),
body.is-head-transparent .gh-head-logo img:nth-child(2),
body.is-head-brand .gh-head-logo img:nth-child(2),
body.is-head-dark .gh-head-logo img:nth-child(2) {
    opacity: 1 !important;
}

body[data-theme="dark"] .gh-head-logo .gh-head-logo-light,
body.is-head-transparent .gh-head-logo .gh-head-logo-light,
body.is-head-brand .gh-head-logo .gh-head-logo-light,
body.is-head-dark .gh-head-logo .gh-head-logo-light,
body[data-theme="dark"] .gh-head-logo img:first-of-type,
body.is-head-transparent .gh-head-logo img:first-of-type,
body.is-head-brand .gh-head-logo img:first-of-type,
body.is-head-dark .gh-head-logo img:first-of-type {
    opacity: 0 !important;
}

/* === Navigation =============================================== */
.gh-head-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.gh-head-menu .nav {
    display: inline-flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gh-head-menu .nav a {
    font-family: var(--sl-font-sans);
    font-size: 15px;
    font-weight: 500;
    color: var(--sl-text-secondary);
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}

.gh-head-menu .nav a:hover,
.gh-head-menu .nav li.nav-current a {
    color: var(--sl-accent);
    border-bottom-color: var(--sl-accent);
}

/* === Header actions =========================================== */
.gh-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gh-head-members {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 4px;
}

.gh-head-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--sl-text-secondary);
    text-decoration: none;
    padding: 6px 10px;
    transition: color .2s;
}

.gh-head-link:hover {
    color: var(--sl-accent);
}

.gh-head-btn.gh-btn {
    background: var(--sl-accent);
    color: #fff;
    border-radius: 100px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s, transform .2s;
}

.gh-head-btn.gh-btn:hover {
    background: color-mix(in srgb, var(--sl-accent) 85%, black);
    transform: translateY(-1px);
}

.gh-search,
.gh-head-brand-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--sl-text-secondary);
    cursor: pointer;
    border-radius: 50%;
    transition: background .2s, color .2s;
}

.gh-search:hover,
.gh-head-brand-search:hover {
    background: var(--sl-border);
    color: var(--sl-accent);
}

.gh-search svg,
.gh-head-brand-search svg {
    width: 18px;
    height: 18px;
}

.whe-theme-toggle {
    color: var(--sl-text-secondary);
}

.whe-theme-toggle:hover {
    color: var(--sl-accent);
}

/* Burger icon color in dark theme */
[data-theme="dark"] .gh-burger::before,
[data-theme="dark"] .gh-burger::after {
    background-color: var(--sl-text) !important;
}

/* === Footer =================================================== */
.gh-foot {
    padding: 64px 0 24px;
    background-color: var(--sl-bg);
    color: var(--sl-text);
    border-top: 1px solid var(--sl-border);
}

.gh-foot a {
    color: var(--sl-text-secondary);
    text-decoration: none;
    transition: color .2s;
}

.gh-foot a:hover {
    color: var(--sl-accent);
    opacity: 1;
}

.gh-foot-inner {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.gh-foot-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 40px;
    align-items: start;
}

.gh-foot-grid > section {
    min-width: 0;
}

.gh-foot-logo {
    position: relative;
    display: inline-block;
    margin: 0 0 16px;
    font-size: 0;
    line-height: 0;
}

.gh-foot-logo a {
    display: inline-block;
    position: relative;
}

.gh-foot-logo img {
    display: block;
    max-height: 40px;
    width: auto;
    height: auto;
}

.gh-foot-logo .gh-foot-logo-dark {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

[data-theme="dark"] .gh-foot-logo .gh-foot-logo-light {
    opacity: 0;
}

[data-theme="dark"] .gh-foot-logo .gh-foot-logo-dark {
    opacity: 1;
}

.gh-foot-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--sl-text-secondary);
    margin: 0;
}

.gh-foot-links h4,
.gh-foot-newsletter h4,
.gh-foot-brand h2#foot-brand-title {
    font-family: var(--sl-font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--sl-text);
    margin: 0 0 20px;
}

.gh-foot-menu .nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gh-foot-menu .nav a {
    font-size: 15px;
    font-weight: 500;
    color: var(--sl-text-secondary);
}

.gh-foot-menu .nav a:hover {
    color: var(--sl-accent);
}

.gh-foot-newsletter .gh-foot-description {
    margin-bottom: 16px;
}

.gh-foot-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.gh-foot-form-fields {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gh-foot-form.loading .gh-foot-form-fields {
    opacity: .7;
    pointer-events: none;
}

.gh-foot-email {
    flex: 1 1 220px;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--sl-border);
    border-radius: 8px;
    background: var(--sl-card);
    color: var(--sl-text);
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.gh-foot-email:focus {
    border-color: var(--sl-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sl-accent) 15%, transparent);
}

.gh-foot-email::placeholder {
    color: var(--sl-text-tertiary);
}

.gh-foot-btn.gh-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    background: var(--sl-accent);
    color: #fff;
    transition: background .2s, transform .2s;
}

.gh-foot-btn.gh-btn:hover {
    background: color-mix(in srgb, var(--sl-accent) 85%, black);
    transform: translateY(-1px);
}

.gh-foot-form-message {
    display: none;
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.gh-foot-form-message.message-success {
    color: var(--sl-text);
    background: color-mix(in srgb, #22c55e 12%, transparent);
    border: 1px solid color-mix(in srgb, #22c55e 35%, transparent);
}

.gh-foot-form-message.message-error {
    color: var(--sl-text);
    background: color-mix(in srgb, #ef4444 10%, transparent);
    border: 1px solid color-mix(in srgb, #ef4444 35%, transparent);
}

.gh-foot-form.success .message-success,
.gh-foot-form.error .message-error {
    display: block;
}

.gh-foot-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--sl-border);
    font-size: 14px;
    color: var(--sl-text-tertiary);
    flex-wrap: wrap;
}

.gh-foot-legal a {
    color: var(--sl-text-tertiary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.gh-foot-legal a:hover {
    color: var(--sl-accent);
}

.gh-foot-social {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gh-foot-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--sl-text-secondary);
    transition: color .2s, transform .2s;
}

.gh-foot-social a:hover {
    color: var(--sl-accent);
    transform: translateY(-2px);
}

.gh-foot-social svg {
    width: 20px;
    height: 20px;
}

/* === Mobile footer / header tweaks ============================ */
@media (max-width: 767px) {
    #gh-head .gh-head-inner {
        padding: 0 16px;
    }

    .gh-head-menu .nav a {
        font-size: 18px;
    }

    .gh-foot-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .gh-foot-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

@media (max-width: 1023px) and (min-width: 768px) {
    .gh-foot-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .gh-foot-newsletter {
        grid-column: 1 / -1;
    }
}
