/* ============================================================
   LAYOUT.CSS — header, nav, footer, lang switcher
   ============================================================ */

/* ---- HEADER ---- */
.site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--color-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 16px 32px;
}

/* ---- LOGO ---- */
.site-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-zh {
    font-size: 20px;
    color: var(--color-primary);
    font-family: var(--font-chinese);
    font-weight: 400;
    line-height: 1;
}

.logo-en {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.04em;
    font-family: var(--font-main);
}

.logo-en-sub {
    font-weight: 400;
    opacity: 0.6;
    font-size: 12px;
    letter-spacing: 0.02em;
}

/* ---- NAV ---- */
.site-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.site-nav a {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.active {
    color: #ffffff;
}

.site-nav a.nav-cta {
    background: var(--color-coral);
    color: #fff;
    padding: 7px 18px;
    border-radius: 6px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.site-nav a.nav-cta:hover { opacity: 0.85; }

/* ---- LANG SWITCHER ---- */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.lang-switcher a {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    padding: 4px 6px;
    border-radius: 4px;
    text-decoration: none;
    transition: color 0.2s;
}

.lang-switcher a:hover { color: rgba(255,255,255,0.85); }
.lang-switcher a.active { color: var(--color-primary); }

/* ---- HAMBURGER ---- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

/* ---- HEADER STICKY (pagine non-hero) ---- */
.site-header--sticky {
    position: sticky;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
}

.site-header--sticky .logo-en { color: var(--color-text); }

.site-header--sticky .site-nav a { color: var(--color-text-muted); }

.site-header--sticky .site-nav a:hover,
.site-header--sticky .site-nav a.active { color: var(--color-text); }

.site-header--sticky .site-nav a.nav-cta { color: #fff; }

.site-header--sticky .lang-switcher a { color: var(--color-text-muted); }
.site-header--sticky .lang-switcher a.active { color: var(--color-primary); }

.site-header--sticky .nav-toggle span { background: var(--color-text); }

/* ---- MAIN ---- */
.site-main { min-height: 70vh; }

/* ---- FOOTER ---- */
.site-footer {
    background: var(--color-bg-dark);
    padding: 36px 32px 24px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand .logo-zh { color: var(--color-primary); }
.footer-brand .logo-en { color: rgba(255,255,255,0.5); font-size: 13px; }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    justify-content: center;
}

.footer-nav a {
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-nav a:hover { color: rgba(255,255,255,0.8); }

.footer-copy {
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    white-space: nowrap;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: var(--color-secondary);
        padding: 8px 0;
        border-top: 1px solid rgba(255,255,255,0.08);
    }

    .site-nav.open { display: flex; }

    .site-nav a {
        width: 100%;
        padding: 12px 24px;
        border-radius: 0;
        color: rgba(255,255,255,0.8);
    }

    .site-nav a.nav-cta {
        margin: 8px 24px 4px;
        width: auto;
        text-align: center;
        border-radius: 6px;
    }

    .nav-toggle { display: flex; }

    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 16px;
    }

    .footer-nav { justify-content: center; }
    .footer-copy { white-space: normal; }
}

@media (max-width: 600px) {
    .header-inner { padding: 14px 16px; }
    .site-footer  { padding: 28px 16px 20px; }
}