/* ==========================================================================
   Section 8 item 02 — Chapter: การสร้างวัฒนธรรมองค์กรที่ใส่ใจต้นทุน
   (.bp-section-8-02)

   Mirrors section-8-01's 2-stage architecture (200vw flex container, .is-stage-b
   slides translateX(-100vw), .is-snap kills the transition). What's different:

   - Stage A "stories" are vertical center-aligned blocks (paragraph above,
     centered logo[s] below) — NOT the 2-col text+visual layout of 01.
       * .bp-section-8-02__story-logos--single  → one centered logo (BCG)
       * .bp-section-8-02__story-logos--pair    → two logos side by side (Toyota+Ford)
   - Stage B uses build-robotic.png with a subtle float animation (NOT a rotating
     gear) and has no decorative gear-left — there's only the light bg.
   ========================================================================== */

/* --- Section override --------------------------------------------------- */
.bp-section-8-02 {
    display: block;
    padding: 0;
    overflow: hidden;
    min-height: 100vh;
}

/* --- Stages wrapper ----------------------------------------------------- */
.bp-section-8-02__stages {
    display: flex;
    align-items: flex-start;
    width: 200vw;
    min-height: 100vh;
    transform: translateX(0);
    transition: transform 0.7s cubic-bezier(0.77, 0, 0.175, 1);
    will-change: transform;
}
.bp-section-8-02.is-stage-b .bp-section-8-02__stages {
    transform: translateX(-100vw);
}
.bp-section-8-02.is-snap .bp-section-8-02__stages {
    transition: none;
}

/* --- Individual stage --------------------------------------------------- */
.bp-section-8-02__stage {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bp-section-8-02__stage-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}
.bp-section-8-02__stage-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================================
   Stage A (dark intro) — headline + 2 vertical story blocks + glass CTA
   ============================================================ */
.bp-section-8-02 .bp-section-8-02__inner {
    width: 100%;
    max-width: 1320px;
    padding: 72px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    position: relative;
    z-index: 1;
}

.bp-section-8-02__headline {
    margin: 0;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
    max-width: 860px;
}

/* Desktop: text-left + logo-right on a single row. Mobile reverts to a
   vertical centered stack (overridden in the @media block below). */
.bp-section-8-02__story {
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}
.bp-section-8-02__story-text {
    color: #ffffff;
    font-size: 1.05rem;
    line-height: 1.85;
    margin: 0;
}

/* Logo row — single (BCG) or pair (Toyota+Ford). Both center-aligned. */
.bp-section-8-02__story-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 56px;
    flex-wrap: wrap;
}
.bp-section-8-02__story-logo {
    height: auto;
    object-fit: contain;
    display: block;
}
.bp-section-8-02__story-logos--single .bp-section-8-02__story-logo {
    width: 220px;
}
.bp-section-8-02__story-logos--pair .bp-section-8-02__story-logo {
    width: 150px;
}

.bp-section-8-02__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 220px;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 14px 40px;
}

/* ============================================================
   Stage B (light article)
   ============================================================ */
.bp-section-8-02 .bp-section-8-02__inner--b {
    width: 100%;
    max-width: 1320px;
    padding: 72px 48px;
    color: #171717;
    display: block;
}
.bp-section-8-02__article {
    display: grid;
    grid-template-columns: 42% 1fr;
    gap: 56px;
    align-items: start;
}

.bp-section-8-02__article-left {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.bp-section-8-02__article-title {
    margin: 0;
    color: #E01C24;
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.25;
}
.bp-section-8-02__article-desc {
    margin: 0;
    color: #171717;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.75;
    max-width: 440px;
}

/* Robotic visual — subtle float so it feels alive without spinning like a gear. */
.bp-section-8-02__visual {
    display: block;
    width: 440px;
    max-width: 90%;
    height: auto;
    margin: 16px auto 8px;
    animation: bp-section-8-02-float 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes bp-section-8-02-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-8px) scale(1.02); }
}

.bp-section-8-02__article-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* Right column — 2 stacked feeds (same pattern as 01) */
.bp-section-8-02__article-right {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
}
.bp-section-8-02 [data-carousel="articles"] { --bp-per-view: 3; }
.bp-section-8-02 [data-carousel="tiktok"]   { --bp-per-view: 4; }
.bp-section-8-02__feed { min-width: 0; }
.bp-section-8-02__feed + .bp-section-8-02__feed {
    padding-top: 32px;
    border-top: 1px solid #C8C8C8;
}
.bp-section-8-02__feed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.bp-section-8-02__feed-title {
    margin: 0;
    color: #171717;
    font-size: 1.1rem;
    font-weight: 700;
}
.bp-section-8-02__view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #171717;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}
.bp-section-8-02__view-all:hover {
    background: #E01C24;
    color: #ffffff;
    transform: translateY(-1px);
}
.bp-section-8-02__carousel-shell {
    position: relative;
    width: 100%;
}

.bp-section-8-02__feed-empty {
    width: 100%;
    padding: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px dashed rgba(23, 23, 23, 0.2);
    color: #888;
    font-size: 0.9rem;
    text-align: center;
}

/* Article card */
.bp-section-8-02__article-card {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: #171717;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    min-height: 240px;
    padding: 10px 10px 0;
}
.bp-section-8-02__article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: #171717;
}
.bp-section-8-02__article-card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #e5e5e5;
    overflow: hidden;
    border-radius: 10px;
}
.bp-section-8-02__article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bp-section-8-02__article-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: flex-end;
    margin-top: auto;
    padding: 5px 12px;
    border-radius: 999px;
    background: #171717;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1;
    pointer-events: none;
}
.bp-section-8-02__article-card-cta img {
    width: 13px;
    height: 13px;
    display: block;
}
.bp-section-8-02__article-card-body {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.bp-section-8-02__article-card-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.4;
    color: #171717;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bp-section-8-02__article-card-excerpt {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.55;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Tablet ------------------------------------------------------------- */
@media (max-width: 1024px) {
    .bp-section-8-02 .bp-section-8-02__inner { padding: 56px 32px; gap: 28px; }
    .bp-section-8-02__headline { font-size: 1.65rem; }
    .bp-section-8-02__story-text { font-size: 1rem; line-height: 1.75; }
    .bp-section-8-02__story-logos--single .bp-section-8-02__story-logo { width: 180px; }
    .bp-section-8-02__story-logos--pair   .bp-section-8-02__story-logo { width: 130px; }
    .bp-section-8-02__story-logos { gap: 40px; }

    .bp-section-8-02 .bp-section-8-02__inner--b { padding: 56px 32px; }
    .bp-section-8-02__article { grid-template-columns: 44% 1fr; gap: 36px; }
    .bp-section-8-02__article-title { font-size: 1.85rem; }
    .bp-section-8-02__visual { width: 360px; }
    .bp-section-8-02 [data-carousel="articles"] { --bp-per-view: 2; }
    .bp-section-8-02 [data-carousel="tiktok"]   { --bp-per-view: 3; }
}

/* --- Mobile ------------------------------------------------------------- */
@media (max-width: 768px) {
    .bp-section-8-02 .bp-section-8-02__inner { padding: 48px 20px; gap: 24px; }
    .bp-section-8-02__headline { font-size: 1.2rem; line-height: 1.55; }

    /* Mobile: collapse the desktop 2-col grid back to a vertical stack —
       paragraph centered, logo(s) centered below. */
    .bp-section-8-02__story {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    .bp-section-8-02__story-text { font-size: 0.95rem; line-height: 1.75; }
    .bp-section-8-02__story-logos { gap: 32px; }
    .bp-section-8-02__story-logos--single .bp-section-8-02__story-logo { width: 160px; }
    .bp-section-8-02__story-logos--pair   .bp-section-8-02__story-logo { width: 110px; }

    .bp-section-8-02__cta { min-width: 180px; font-size: 1rem; padding: 12px 32px; }

    .bp-section-8-02 .bp-section-8-02__inner--b { padding: 48px 20px; }

    /* Stage B mobile flow — same pattern as 01: title → desc → carousels → visual → buttons. */
    .bp-section-8-02__article {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        gap: 28px;
        width: 100%;
        align-items: stretch;
    }
    .bp-section-8-02__article-left { display: contents; }
    .bp-section-8-02__article-title { order: 1; font-size: 1.5rem; text-align: center; }
    .bp-section-8-02__article-desc  { order: 2; font-size: 0.95rem; text-align: center; margin: 0 auto; max-width: 440px; }
    .bp-section-8-02__article-right { order: 3; width: 100%; align-self: stretch; }
    .bp-section-8-02__visual {
        order: 4;
        width: 220px;
        max-width: 60%;
        margin: 0 auto;
    }
    .bp-section-8-02__article-buttons {
        order: 5;
        justify-content: center;
        margin-top: 4px;
        width: 100%;
        align-self: stretch;
    }

    .bp-section-8-02__feed-title { font-size: 1.1rem; }
    .bp-section-8-02__article-card { min-height: 220px; }

    .bp-section-8-02 [data-carousel="articles"] { --bp-per-view: 1; }
    .bp-section-8-02 [data-carousel="tiktok"]   { --bp-per-view: 1; }

    /* Mobile vertical stack — replace horizontal slide with stacked stages.
       See section-8-01 for rationale. */
    .bp-section-8-02__stages {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        min-height: 0;
        transform: none !important;
        transition: none;
    }
    .bp-section-8-02__stage {
        width: 100%;
        overflow: hidden;
    }
}
