/* Language visibility — policy pages with .en / .zh blocks */
html[lang="en"] p.zh,
html[lang="en"] .lang-zh,
html[lang="en"] .i18n-zh-only { display: none !important; }

html[lang="zh-CN"] p.en,
html[lang="zh-CN"] .lang-en,
html[lang="zh-CN"] .i18n-en-only { display: none !important; }

html[lang="en"] .policy-hero h2 { display: none; }
html[lang="zh-CN"] .policy-hero .policy-note { display: none; }

/* Language switcher in header nav */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(10, 35, 66, 0.08);
    border: 1px solid rgba(10, 35, 66, 0.12);
    flex-shrink: 0;
}

.lang-switcher__btn {
    font-family: var(--font-nav, 'Roboto', sans-serif);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 7px 12px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--primary-dark, #0a2342);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1;
}

.lang-switcher__btn:hover {
    background: rgba(10, 35, 66, 0.08);
}

.lang-switcher__btn.is-active {
    background: var(--primary-dark, #0a2342);
    color: #fff;
    box-shadow: 0 6px 16px rgba(10, 35, 66, 0.22);
}

@media (max-width: 768px) {
    .nav-links .lang-switcher {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
        padding: 6px;
    }

    .nav-links .lang-switcher__btn {
        flex: 1;
        padding: 12px 16px;
        font-size: 0.85rem;
    }
}

/* Mobile hamburger menu — unified across all pages */
@media (max-width: 968px) {
    body.menu-open .nav-links,
    body.menu-open header.site-header .nav-links {
        max-height: min(75vh, 560px) !important;
        opacity: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        z-index: 1002;
    }

    body.menu-open header,
    body.menu-open header.site-header {
        z-index: 1100;
        overflow: visible;
    }
}

@media (max-width: 968px) {
    body.menu-open .nav-links a,
    body.menu-open .nav-links .nav-dropdown-toggle,
    body.menu-open .nav-dropdown-menu a {
        text-align: center !important;
        text-align-last: center !important;
        text-justify: auto !important;
    }

    body.menu-open .nav-links .nav-dropdown-toggle {
        width: 100%;
        padding: 14px 0 !important;
        border-bottom: 1px solid rgba(15, 36, 64, 0.1);
        color: #0f2440 !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
    }

    body.menu-open .nav-dropdown-menu {
        position: static !important;
        min-width: 100%;
        border: none;
        border-radius: 8px;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.45);
        margin-bottom: 8px;
        padding: 0;
    }

    body.menu-open .nav-dropdown-menu a {
        border-bottom: 1px solid rgba(15, 36, 64, 0.08);
        padding: 12px 12px !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        width: 100%;
        display: block;
    }

    body.menu-open .nav-dropdown-menu a:last-child {
        border-bottom: none;
    }
}

/* Site-wide justified text (both EN & 中文) */
body {
    text-align: justify;
    text-justify: inter-word;
}

p,
li,
td,
blockquote,
figcaption,
h1, h2, h3, h4, h5, h6,
.i18n,
.i18n-html,
.text-p,
.info-content,
.article-body,
.article-body p,
.article-body li,
.article-body blockquote,
.features-b__prose,
.features-b__prose p,
.features-b__prose li,
.features-b__mediaTagline,
.talk-show__script,
.talk-show__script p,
.talk-show__article-body,
.talk-show__article-body p,
.talk-show__inline-title,
.talk-show__ep-label,
.card-excerpt,
.card-title,
.social-follow__mission,
.whatsapp-desc,
.whatsapp-copy-grid p,
.whatsapp-benefits li,
.page-header p,
.section p,
.section p.en,
.section p.zh,
.section h3,
.policy-note,
.mc-poster__subline,
.mc-poster__case,
.mc-poster__foot,
.mc-poster__section-title,
.mc-poster__doctor-meta-title,
.mc-poster__box li,
.mc-poster__doctor-meta-list li,
.mc-poster__ending,
.mc-poster__cta small,
.quote-text,
.value-card p,
.cta-section p,
section.hero p,
.universal-section-header h3,
.card-panel .text-p,
.poster-footer p,
.footer-section p,
.highlight,
.trap-box p,
.cta-box p,
.cta-highlight,
.step-list li,
.check-list li,
.gi-box li,
.gl-card p {
    text-align: justify;
    text-justify: inter-word;
}

p,
li,
blockquote,
.i18n-html,
.article-body p,
.features-b__prose p {
    text-align-last: left;
}

.section-title,
.section-title--features,
.page-header h1,
.social-title,
.value-title,
.newspaper-masthead__title,
.newspaper-masthead__sub,
.article-title,
.category-title,
.mc-poster__headline-top,
.mc-poster__headline-main,
.cta-section h2,
.cta-box h3 {
    text-align: justify;
    text-justify: inter-word;
}

header,
nav,
.nav-links,
.nav-links a,
.nav-dropdown,
.nav-dropdown-toggle,
.nav-dropdown-menu,
.nav-dropdown-menu a,
.lang-switcher,
.lang-switcher__btn,
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-read-more,
.btn-3d-back,
.cta-primary,
.cta-secondary,
.mc-poster__cta,
.mc-poster__top-pill,
.whatsapp-btn,
.whatsapp-btn__title,
.whatsapp-btn__sub,
.article-tag,
.article-meta,
.category-jump,
.category-jump__btn,
.stat-item,
.stat-number,
.stat-label,
.social-follow__badge,
.social-section .social-card a,
footer,
footer p,
.gi-box strong,
.formula-box,
.reversal-badge,
.talk-show__byline,
.talk-show__ep-num {
    text-align: inherit;
}

.nav-links a,
.nav-dropdown-toggle,
.lang-switcher__btn,
button,
.btn,
.cta-primary,
.cta-secondary,
.mc-poster__cta {
    text-align: center;
}

/* Hero banner overlay — left-aligned (avoid justify word-spacing) */
.hero-overlay,
.hero-overlay__headline,
.hero-overlay__body,
.hero-overlay__tagline {
    text-align: left;
    text-align-last: left;
    text-justify: auto;
}

.features-intro,
.features-intro p,
.features-intro .i18n,
.features-intro .i18n-html,
.features-intro__text,
.features-intro__line {
    text-align: center;
    text-align-last: center;
    text-justify: auto;
}

.features-b__header .section-title--features,
.features-b__header .section-title--features .features-title__accent,
.features-b__header .section-title--features .features-title__accent2 {
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
}

.testimonials-section,
.testimonials-section__intro,
.testimonials-section .section-title,
.testimonials-section__subtitle,
.testimonials-section__subtitle.i18n {
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
}

.testimonials-section__subtitle {
    display: block;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.testimony-caption,
.testimony-nameAge,
.testimony-line1,
.testimony-quote {
    text-align: left !important;
    text-align-last: left !important;
    text-justify: auto !important;
}

.category-title,
.category-section .category-title,
.category-section .category-title.i18n {
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
}

.category-title,
.category-section .category-title,
.category-section .category-title.i18n {
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
}

#talk-show .talk-show__header,
#talk-show .talk-show__title,
#talk-show .talk-show__header .i18n,
#talk-show .talk-show__tagline,
#talk-show .talk-show__kicker,
#talk-show .talk-show__count {
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
}

#talk-show .talk-show__ep-label.i18n,
#talk-show .talk-show__ep-hint.i18n,
#talk-show .talk-show__ep-num.i18n {
    text-align: left !important;
    text-align-last: left !important;
    text-justify: auto !important;
}

@media (max-width: 768px) {
    .category-jump__btn,
    .category-jump__btn .i18n {
        text-align: left !important;
        text-align-last: left !important;
        text-justify: auto !important;
    }
}

.blog-hero,
.blog-hero__inner,
.blog-hero__kicker,
.blog-hero__title,
.blog-hero__desc,
.blog-hero .i18n {
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
}

.features-b__expertTitle,
.features-b__expertTitle .features-b__titleGold {
    text-align: left;
    text-align-last: left;
    text-justify: auto;
}

/* Social section — center all content site-wide */
section.social-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

section.social-section .social-follow__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: min(1120px, 92%);
    margin: 0 auto;
}

section.social-section .social-title {
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
    width: 100%;
}

section.social-section .social-follow__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

section.social-section .social-follow__identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

section.social-section .social-follow__name,
section.social-section .social-follow__pronoun {
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    max-width: 100%;
}

section.social-section .social-follow__mission {
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
    margin-left: auto;
    margin-right: auto;
}

section.social-section .i18n,
section.social-section .i18n-html {
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
}

section.social-section .social-follow__badges {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

section.social-section .social-follow__badge {
    flex: 0 1 auto;
    gap: 6px;
    padding: 7px 10px;
    font-size: clamp(0.72rem, 1.45vw, 0.86rem);
    white-space: nowrap;
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
    justify-content: center;
}

section.social-section .social-follow__badge .i18n {
    white-space: nowrap;
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
}

section.social-section .social-grid {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 18px;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
}

section.social-section .social-grid > .social-card {
    flex: 0 1 300px;
    width: min(100%, 300px);
    max-width: 300px;
}

section.social-section .social-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

section.social-section .social-card h3,
section.social-section .social-card p,
section.social-section .social-card .i18n,
section.social-section .social-card a {
    text-align: center !important;
    text-align-last: center !important;
    text-justify: auto !important;
    width: 100%;
}

@media (max-width: 900px) {
    section.social-section .social-grid > .social-card {
        width: min(100%, 340px);
        max-width: 340px;
    }
}

@media (max-width: 768px) {
    section.social-section .social-follow__inner,
    section.social-section .social-follow__hero {
        align-items: center;
    }

    section.social-section .social-follow__badges {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 8px;
        max-width: 100%;
        box-sizing: border-box;
    }

    section.social-section .social-follow__badge {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        white-space: normal;
        justify-content: center;
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    section.social-section .social-follow__badge .i18n {
        white-space: normal;
        text-align: center !important;
        text-align-last: center !important;
    }

    section.social-section .social-grid {
        justify-content: center;
        max-width: 100%;
        box-sizing: border-box;
    }
}
