/* ==========================================================================
   MAXXMA BYD Ecosystem Range — Article-Specific Stylesheet
   Brand: Modern Premium Light Theme + 3D Scroller / Parallax
   Accent: Electric Blue (#48819f) + Gold (#C8963E)
   ========================================================================== */

:root {
    --ts-gold: #C8963E;
    --ts-gold-light: #D4A84B;
    --ts-gold-dark: #B5852F;
    --ts-blue: #1E3A5F;
    --ts-blue-light: #2A5080;
    --ts-blue-dark: #162D4A;
    --ts-ev-teal: #0ea5e9;
    --ts-ev-teal-light: #38bdf8;
    --ts-gray: #4B5563;
    --ts-dark: #1a1a2e;
    --ts-white: #FFFFFF;
    --ts-off-white: #F8FAFC;
    --ts-light-gray: #E2E8F0;
    --ts-lighter: #F1F5F9;
    --ts-radius: 12px;
    --ts-radius-sm: 8px;
    --ts-shadow-sm: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
    --ts-shadow-md: 0 4px 20px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
    --ts-shadow-lg: 0 12px 40px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
    --ts-transition: 0.35s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    margin: 0; padding: 0;
    font-family: 'Sarabun','Graphik Thai',-apple-system,BlinkMacSystemFont,sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--ts-off-white);
    color: var(--ts-dark);
    line-height: 1.7;
}

/* ── Anchor Scroll Offset (TOC overlap fix) ─────────────────────────────── */
h2, h3, h2[id], h3[id], section[id], .ts-section__title {
    scroll-margin-top: 120px;
}

/* ═════════════════════════════════════════════════════════════
   HERO
   ═════════════════════════════════════════════════════════════ */
.ts-hero {
    position: relative;
    min-height: 580px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f1c2e 0%, #162D4A 55%, #0a1628 100%);
    overflow: hidden;
    padding: 100px 24px 80px;
}
.ts-hero__bg { position: absolute; inset: 0; z-index: 0; }
.ts-hero__bg::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10,22,40,.65) 0%, rgba(10,22,40,.92) 100%);
}
.ts-hero__img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.ts-hero__overlay {
    position: absolute; inset: 0; z-index: 1;
    background:
        radial-gradient(ellipse at 20% 45%, rgba(14,165,233,.18) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 55%, rgba(200,150,62,.14) 0%, transparent 50%);
}
.ts-hero__content { position: relative; z-index: 2; text-align: center; max-width: 840px; width: 100%; }

.ts-breadcrumb { font-size: .8125rem; color: rgba(255,255,255,.5); margin-bottom: 16px; }
.ts-breadcrumb a { color: rgba(255,255,255,.65); text-decoration: none; transition: color var(--ts-transition); }
.ts-breadcrumb a:hover { color: var(--ts-gold-light); }

.ts-hero__category {
    display: inline-block;
    background: rgba(14,165,233,.18);
    border: 1px solid rgba(14,165,233,.35);
    color: var(--ts-ev-teal-light);
    font-size: .75rem; font-weight: 600;
    padding: 5px 18px;
    border-radius: 9999px;
    margin-bottom: 20px;
    letter-spacing: .05em; text-transform: uppercase;
}
.ts-hero h1 {
    font-size: clamp(1.6rem,4.2vw,2.8rem);
    font-weight: 700; color: var(--ts-white);
    line-height: 1.3; margin: 0 0 20px;
}
.ts-hero__highlight {
    background: linear-gradient(135deg, var(--ts-gold), #e9c34c);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.ts-hero__subtitle {
    font-size: 1rem; color: rgba(255,255,255,.7);
    line-height: 1.8; margin: 0 auto 28px;
    max-width: 700px;
}
.ts-hero__meta {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 20px; font-size: .8125rem; color: rgba(255,255,255,.5);
}
.ts-hero__meta span { display: flex; align-items: center; gap: 6px; }

/* ═════════════════════════════════════════════════════════════
   LAYOUT — TOC sidebar + Article
   ═════════════════════════════════════════════════════════════ */
.ts-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 0;
    gap: 0;
    position: relative;
}

/* TOC Desktop */
.ts-toc { position: relative; }
.ts-toc__inner { position: sticky; top: 100px; padding: 24px 20px 24px 0; }
.ts-toc__title {
    display: flex; align-items: center; gap: 8px;
    font-size: .9375rem; font-weight: 700; color: var(--ts-dark);
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--ts-light-gray);
}
.ts-toc__title svg { color: var(--ts-ev-teal); }
.ts-toc__list { list-style: none; padding: 0; margin: 0; }
.ts-toc__list li { margin-bottom: 4px; }
.ts-toc__list a {
    display: block; font-size: .8125rem; color: var(--ts-gray);
    text-decoration: none; padding: 6px 10px;
    border-radius: var(--ts-radius-sm);
    transition: all var(--ts-transition);
    border-left: 2px solid transparent;
}
.ts-toc__list a:hover {
    color: var(--ts-gold-dark);
    background: rgba(200,150,62,.06);
    border-left-color: var(--ts-gold-light);
}
.ts-toc__list a.ts-toc--active {
    color: var(--ts-gold-dark); font-weight: 600;
    background: rgba(200,150,62,.1);
    border-left-color: var(--ts-gold);
}

/* Article Body */
.ts-article { min-width: 0; padding: 0 0 80px; }
.ts-article__container { max-width: 780px; margin: 0 auto; }

/* ═════════════════════════════════════════════════════════════
   SECTION & SCENE (Parallax / Fade-in)
   ═════════════════════════════════════════════════════════════ */
.ts-section { margin-bottom: 80px; padding: 0; }
.ts-scene {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
    will-change: transform, opacity;
}
.ts-scene--visible { opacity: 1; transform: translateY(0); }

.ts-section__header { margin-bottom: 28px; }
.ts-section__num {
    display: inline-block; font-size: .8125rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase;
    color: var(--ts-gold-dark);
    background: rgba(200,150,62,.1);
    padding: 6px 16px; border-radius: 9999px; margin-bottom: 14px;
}
.ts-section__num--ev {
    color: var(--ts-ev-teal);
    background: rgba(14,165,233,.1);
}
.ts-section__title {
    font-size: 1.75rem; font-weight: 700;
    color: var(--ts-dark); line-height: 1.4; margin: 0;
}
.ts-section__body { font-size: 1rem; color: var(--ts-dark); line-height: 1.85; }
.ts-section__body h3 {
    font-size: 1.25rem; font-weight: 600;
    color: var(--ts-blue-dark);
    margin: 32px 0 12px; padding-top: 4px;
}
.ts-section__body h3:first-child { margin-top: 0; }
.ts-section__body p { margin: 0 0 16px; }
.ts-section__body ul, .ts-section__body ol { padding-left: 24px; margin: 0 0 20px; }
.ts-section__body li { margin-bottom: 8px; }
.ts-section__body strong { color: var(--ts-blue-dark); }
.ts-section__body a { color: var(--ts-gold-dark); text-decoration: underline; text-underline-offset: 3px; transition: color var(--ts-transition); }
.ts-section__body a:hover { color: var(--ts-gold); }

/* ── Stat blocks (big numbers) ───────────────────────────────────────── */
.ts-stat-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 16px; margin: 28px 0;
}
.ts-stat-card {
    background: var(--ts-white);
    border: 1px solid var(--ts-light-gray);
    border-radius: var(--ts-radius);
    padding: 24px 16px;
    text-align: center;
    transition: transform var(--ts-transition), box-shadow var(--ts-transition);
}
.ts-stat-card:hover { transform: translateY(-4px); box-shadow: var(--ts-shadow-md); }
.ts-stat-card__num {
    font-size: 2rem; font-weight: 800;
    background: linear-gradient(135deg, var(--ts-ev-teal), var(--ts-gold));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    display: block; margin-bottom: 6px;
}
.ts-stat-card__label { font-size: .8125rem; color: var(--ts-gray); line-height: 1.45; }

/* ── Science Grid ─────────────────────────────────────────────────────── */
.ts-science-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin: 24px 0; }
.ts-science-card {
    background: var(--ts-white);
    border: 1px solid var(--ts-light-gray);
    border-radius: var(--ts-radius);
    padding: 24px 20px;
    transition: transform var(--ts-transition), box-shadow var(--ts-transition);
}
.ts-science-card:hover { transform: translateY(-4px); box-shadow: var(--ts-shadow-md); }
.ts-science-card h4 { font-size: 1rem; font-weight: 700; color: var(--ts-blue-dark); margin: 0 0 10px; }
.ts-science-card p { font-size: .875rem; color: var(--ts-gray); line-height: 1.65; margin: 0; }

/* ── Callout Boxes ────────────────────────────────────────────────────── */
.ts-callout {
    background: var(--ts-white);
    border-radius: var(--ts-radius);
    padding: 24px 28px; margin: 24px 0;
    border-left: 5px solid var(--ts-gold);
}
.ts-callout--gold { background: linear-gradient(135deg, rgba(200,150,62,.06) 0%, rgba(200,150,62,.02) 100%); border-left-color: var(--ts-gold); }
.ts-callout--blue { background: linear-gradient(135deg, rgba(30,58,95,.04) 0%, rgba(30,58,95,.01) 100%); border-left-color: var(--ts-blue-light); }
.ts-callout--ev   { background: linear-gradient(135deg, rgba(14,165,233,.05) 0%, rgba(14,165,233,.01) 100%); border-left-color: var(--ts-ev-teal); }
.ts-callout h4 { font-size: 1.0625rem; font-weight: 700; color: var(--ts-dark); margin: 0 0 10px; }
.ts-callout p { margin: 0; color: var(--ts-gray); }

/* ── Warning Note ─────────────────────────────────────────────────────── */
.ts-note--warning {
    background: rgba(192,57,43,.06);
    border: 1px solid rgba(192,57,43,.15);
    border-radius: var(--ts-radius-sm);
    padding: 16px 20px;
    font-size: .9375rem; color: #C0392B;
}

/* ── Product Cards (Solution Section) ────────────────────────────────── */
.ts-product-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; margin: 28px 0; }
.ts-product-card {
    background: var(--ts-white);
    border: 1px solid var(--ts-light-gray);
    border-radius: var(--ts-radius);
    padding: 28px 24px;
    transition: transform var(--ts-transition), box-shadow var(--ts-transition), border-color var(--ts-transition);
    position: relative; overflow: hidden;
}
.ts-product-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--ts-gold), var(--ts-ev-teal));
}
.ts-product-card:hover { transform: translateY(-4px); box-shadow: var(--ts-shadow-lg); border-color: rgba(200,150,62,.25); }
.ts-product-card--full { grid-column: 1 / -1; }
.ts-product-card h3 { font-size: 1.125rem; font-weight: 700; color: var(--ts-dark); margin: 0 0 10px; }
.ts-product-card p { font-size: .9rem; color: var(--ts-gray); line-height: 1.65; margin: 0 0 16px; }
.ts-product-card ul { font-size: .875rem; color: var(--ts-gray); padding-left: 18px; margin: 0 0 16px; }
.ts-product-card li { margin-bottom: 6px; }
.ts-product-card a.ts-product-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .875rem; font-weight: 600;
    color: var(--ts-gold-dark);
    text-decoration: none;
    border: 1px solid rgba(200,150,62,.3);
    padding: 7px 16px; border-radius: 9999px;
    transition: all var(--ts-transition);
}
.ts-product-card a.ts-product-link:hover { background: var(--ts-gold); color: var(--ts-white); border-color: var(--ts-gold); }

/* ── Shield Layers ────────────────────────────────────────────────────── */
.ts-shield-layer { margin: 32px 0; padding: 32px 28px; border-radius: var(--ts-radius); border: 1px solid var(--ts-light-gray); }
.ts-shield-layer--exterior { background: linear-gradient(135deg, rgba(30,58,95,.03) 0%, #fff 100%); border-left: 5px solid var(--ts-blue-light); }
.ts-shield-layer--interior { background: linear-gradient(135deg, rgba(200,150,62,.04) 0%, #fff 100%); border-left: 5px solid var(--ts-gold); }
.ts-shield-layer h3 { font-size: 1.2rem; font-weight: 700; color: var(--ts-dark); margin: 0 0 16px; }

/* ── Figures ──────────────────────────────────────────────────────────── */
.ts-figure { margin: 24px 0; text-align: center; }
.ts-figure--full { max-width: 100%; margin: 32px 0; }
.ts-figure__img { width: 100%; height: auto; border-radius: var(--ts-radius-sm); box-shadow: var(--ts-shadow-sm); border: 1px solid var(--ts-light-gray); }
.ts-figure figcaption { font-size: .8125rem; color: var(--ts-gray); margin-top: 10px; font-style: italic; }

/* ── Checklist ────────────────────────────────────────────────────────── */
.ts-checklist { list-style: none; padding: 0; margin: 20px 0; }
.ts-checklist li { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--ts-light-gray); align-items: flex-start; }
.ts-checklist li:last-child { border-bottom: none; }
.ts-checklist__check {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    background: rgba(200,150,62,.12);
    display: flex; align-items: center; justify-content: center;
    font-size: .875rem; font-weight: 700; color: var(--ts-gold-dark);
}
.ts-checklist__text { font-size: .9375rem; color: var(--ts-dark); line-height: 1.6; }

/* ── FAQ ──────────────────────────────────────────────────────────────── */
.ts-faq-item { border: 1px solid var(--ts-light-gray); border-radius: var(--ts-radius-sm); margin-bottom: 12px; background: var(--ts-white); overflow: hidden; transition: box-shadow var(--ts-transition); }
.ts-faq-item:hover { box-shadow: var(--ts-shadow-sm); }
.ts-faq-item summary { padding: 18px 20px; font-size: .9375rem; font-weight: 600; color: var(--ts-dark); cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.ts-faq-item summary::-webkit-details-marker { display: none; }
.ts-faq-item summary::after { content: '+'; font-size: 1.25rem; font-weight: 300; color: var(--ts-gray); transition: transform var(--ts-transition); }
.ts-faq-item[open] summary { border-bottom: 1px solid var(--ts-light-gray); color: var(--ts-gold-dark); }
.ts-faq-item[open] summary::after { content: '−'; color: var(--ts-gold-dark); }
.ts-faq-answer { padding: 16px 20px; font-size: .9375rem; color: var(--ts-gray); line-height: 1.75; }
.ts-faq-answer p { margin: 0; }

/* ── CTA Section ──────────────────────────────────────────────────────── */
.ts-section--cta { background: linear-gradient(135deg,#f8f9fa 0%,#e9ecef 100%); border-radius: var(--ts-radius); padding: 40px 36px; border: 1px solid var(--ts-light-gray); }
.ts-cta-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 28px 0; }
.ts-cta-card { display: flex; flex-direction: column; gap: 4px; background: var(--ts-white); border: 1px solid var(--ts-light-gray); border-radius: var(--ts-radius-sm); padding: 20px 24px; text-decoration: none; color: var(--ts-dark); transition: transform var(--ts-transition), box-shadow var(--ts-transition), border-color var(--ts-transition); }
.ts-cta-card:hover { transform: translateY(-3px); box-shadow: var(--ts-shadow-md); border-color: rgba(200,150,62,.3); }
.ts-cta-card--primary { background: linear-gradient(135deg, var(--ts-gold) 0%, var(--ts-gold-dark) 100%); border: none; color: var(--ts-white); }
.ts-cta-card--primary strong, .ts-cta-card--primary span { color: var(--ts-white); }
.ts-cta-card strong { font-size: 1rem; font-weight: 700; }
.ts-cta-card span { font-size: .8125rem; color: var(--ts-gray); }
.ts-cta-contact { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--ts-light-gray); font-size: .875rem; color: var(--ts-gray); line-height: 1.8; }
.ts-cta-contact a { color: var(--ts-gold-dark); text-decoration: none; font-weight: 500; }
.ts-cta-contact a:hover { text-decoration: underline; }

/* ── Facebook embed wrapper ───────────────────────────────────────────── */
.fb-wrap { width: 100%; padding: 1rem; box-sizing: border-box; }
.fb-wrap iframe { width: 100% !important; min-height: 720px; border: none; border-radius: 12px; background: #fff; display: block; }

/* ── Expert verification bar ─────────────────────────────────────────── */
.ts-expertise { background: linear-gradient(135deg, #e8f0f5 0%, #dce8ef 100%); border-top: 1px solid rgba(30,58,95,.1); border-bottom: 1px solid rgba(30,58,95,.1); padding: 28px 0; grid-column: 1 / -1; }
.ts-expertise__inner { max-width: 780px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 0 24px; }
.ts-expertise__icon { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, rgba(200,150,62,.18), rgba(200,150,62,.06)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ts-gold); }
.ts-expertise__text h3 { font-size: .9375rem; color: var(--ts-dark); margin: 0 0 4px; font-weight: 600; }
.ts-expertise__text h3 strong { color: var(--ts-gold-dark); }
.ts-expertise__text p { font-size: .75rem; color: var(--ts-gray); line-height: 1.5; margin: 0; }

/* ── Related Articles ────────────────────────────────────────────────── */
.ts-related { padding: 48px 0 80px; grid-column: 1 / -1; }
.ts-related__container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.ts-related h2 { font-size: 1.5rem; font-weight: 700; color: var(--ts-dark); margin: 0 0 24px; }
.ts-related__grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.ts-related__card { background: var(--ts-white); border: 1px solid var(--ts-light-gray); border-radius: var(--ts-radius); padding: 24px; text-decoration: none; color: var(--ts-dark); transition: transform var(--ts-transition), box-shadow var(--ts-transition); display: flex; flex-direction: column; gap: 12px; }
.ts-related__card:hover { transform: translateY(-4px); box-shadow: var(--ts-shadow-md); }
.ts-related__card h3 { font-size: 1rem; font-weight: 600; margin: 0; line-height: 1.5; }
.ts-related__card span { font-size: .8125rem; color: var(--ts-gold-dark); font-weight: 500; }

/* Mobile TOC floating button */
.ts-toc-mobile { display: none; position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 100; }
.ts-toc-mobile__btn { background: var(--ts-dark); color: #fff; border: none; padding: 10px 20px; border-radius: 9999px; font-family: 'Sarabun',sans-serif; font-size: .875rem; font-weight: 600; cursor: pointer; box-shadow: var(--ts-shadow-lg); display: flex; align-items: center; gap: 8px; }
.ts-toc-mobile__menu { display: none; position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%); background: var(--ts-dark); border-radius: var(--ts-radius); padding: 12px; min-width: 260px; box-shadow: var(--ts-shadow-lg); }
.ts-toc-mobile__menu.show { display: block; }
.ts-toc-mobile__menu a { display: block; color: rgba(255,255,255,.8); font-size: .8125rem; text-decoration: none; padding: 8px 12px; border-radius: var(--ts-radius-sm); transition: all var(--ts-transition); }
.ts-toc-mobile__menu a:hover { color: var(--ts-gold-light); background: rgba(255,255,255,.06); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .ts-layout { grid-template-columns: 1fr; padding: 32px 16px 0; }
    .ts-toc { display: none; }
    .ts-toc-mobile { display: block; }
    .ts-science-grid, .ts-stat-grid { grid-template-columns: 1fr; }
    .ts-product-grid { grid-template-columns: 1fr; }
    .ts-related__grid { grid-template-columns: 1fr; }
    .ts-hero { min-height: 460px; padding: 80px 16px 60px; }
    .ts-section--cta { padding: 28px 20px; }
    .ts-shield-layer { padding: 24px 20px; }
    .ts-expertise__inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .ts-hero h1 { font-size: 1.5rem; }
    .ts-section__title { font-size: 1.4rem; }
    .ts-article { padding: 0 0 60px; }
}
