/* ==========================================================================
   Section 8 item 03 — Chapter: การทำ ESG เพื่อลดต้นทุนและเข้าถึงทุน
   (.bp-section-8-03)

   Same 2-stage architecture as 8-02. Layout deltas vs 8-02:
     - Stage A headline is 2-color (red line 1 + white line 2); we expose
       .__headline-red / .__headline-white spans so the colors sit inline.
     - Both story blocks use `--single` (no paired variant here).
     - Stage B visual is bubble-tree.png using a slightly taller float
       (translateY -10px, 6s cycle) so the bubble feel reads as "ลอยเบาๆ".
   ========================================================================== */

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

/* --- Stages wrapper ----------------------------------------------------- */
.bp-section-8-03__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-03.is-stage-b .bp-section-8-03__stages {
    transform: translateX(-100vw);
}
.bp-section-8-03.is-snap .bp-section-8-03__stages {
    transition: none;
}

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

/* ============================================================
   Stage A — mixed-color headline + 2 story blocks + glass CTA
   ============================================================ */
.bp-section-8-03 .bp-section-8-03__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-03__headline {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
    max-width: 860px;
}
.bp-section-8-03__headline-red   { color: #E01C24; }
.bp-section-8-03__headline-white { color: #ffffff; }

/* Desktop: text + logo on a single row. Mobile reverts to vertical stack. */
.bp-section-8-03__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-03__story-text {
    color: #ffffff;
    font-size: 1.05rem;
    line-height: 1.85;
    margin: 0;
}

.bp-section-8-03__story-logos {
    display: flex;
    align-items: center;
    /* Left-aligned so the logo sits flush against the story text on its left
       (no floating-in-the-middle-of-the-column look). Mobile's centered stack
       overrides this below. */
    justify-content: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}
.bp-section-8-03__story-logo {
    height: auto;
    object-fit: contain;
    display: block;
}
.bp-section-8-03__story-logos--single .bp-section-8-03__story-logo {
    width: 220px;
}
/* Hand logo is visually heavy — pushed further down from the generic solo
   size so it stays clearly secondary to McKinsey's block above. */
.bp-section-8-03__story[data-brand="esg-bond"] .bp-section-8-03__story-logo {
    width: 80px;
}

.bp-section-8-03__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-03 .bp-section-8-03__inner--b {
    width: 100%;
    max-width: 1320px;
    padding: 72px 48px;
    color: #171717;
    display: block;
}
.bp-section-8-03__article {
    display: grid;
    grid-template-columns: 42% 1fr;
    gap: 56px;
    align-items: start;
}
.bp-section-8-03__article-left {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.bp-section-8-03__article-title {
    margin: 0;
    color: #E01C24;
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.25;
}
.bp-section-8-03__article-desc {
    margin: 0;
    color: #171717;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.75;
    max-width: 440px;
}

/* Bubble-tree — taller float than 8-02's robotic to evoke a slow "drift up"
   motion. 6s cycle, ease-in-out so it hovers rather than bobs mechanically. */
.bp-section-8-03__visual {
    display: block;
    width: 440px;
    max-width: 90%;
    height: auto;
    margin: 16px auto 8px;
    animation: bp-section-8-03-float 6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes bp-section-8-03-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-10px) scale(1.02); }
}

.bp-section-8-03__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 8-01/8-02) */
.bp-section-8-03__article-right {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
}
.bp-section-8-03 [data-carousel="articles"] { --bp-per-view: 3; }
.bp-section-8-03 [data-carousel="tiktok"]   { --bp-per-view: 4; }
.bp-section-8-03__feed { min-width: 0; }
.bp-section-8-03__feed + .bp-section-8-03__feed {
    padding-top: 32px;
    border-top: 1px solid #C8C8C8;
}
.bp-section-8-03__feed-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.bp-section-8-03__feed-title {
    margin: 0;
    color: #171717;
    font-size: 1.1rem;
    font-weight: 700;
}
.bp-section-8-03__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-03__view-all:hover {
    background: #E01C24;
    color: #ffffff;
    transform: translateY(-1px);
}
.bp-section-8-03__carousel-shell {
    position: relative;
    width: 100%;
}

.bp-section-8-03__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-03__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-03__article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: #171717;
}
.bp-section-8-03__article-card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #e5e5e5;
    overflow: hidden;
    border-radius: 10px;
}
.bp-section-8-03__article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bp-section-8-03__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-03__article-card-cta img {
    width: 13px;
    height: 13px;
    display: block;
}
.bp-section-8-03__article-card-body {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.bp-section-8-03__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-03__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-03 .bp-section-8-03__inner { padding: 56px 32px; gap: 28px; }
    .bp-section-8-03__headline { font-size: 1.65rem; }
    .bp-section-8-03__story-text { font-size: 1rem; line-height: 1.75; }
    .bp-section-8-03__story-logos--single .bp-section-8-03__story-logo { width: 180px; }
    .bp-section-8-03__story[data-brand="esg-bond"] .bp-section-8-03__story-logo { width: 64px; }
    .bp-section-8-03__story-logos { gap: 32px; }

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

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

    /* Collapse the desktop 2-col grid back to a vertical centered stack. */
    .bp-section-8-03__story {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    .bp-section-8-03__story-text { font-size: 0.95rem; line-height: 1.75; }
    /* Mobile: re-center the logo row under the text (desktop flush-left
       doesn't work when the layout collapses to a centered stack). */
    .bp-section-8-03__story-logos { gap: 24px; justify-content: center; }
    .bp-section-8-03__story-logos--single .bp-section-8-03__story-logo { width: 160px; }
    .bp-section-8-03__story[data-brand="esg-bond"] .bp-section-8-03__story-logo { width: 56px; }

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

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

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

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

    .bp-section-8-03 [data-carousel="articles"] { --bp-per-view: 1; }
    .bp-section-8-03 [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-03__stages {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        min-height: 0;
        transform: none !important;
        transition: none;
    }
    .bp-section-8-03__stage {
        width: 100%;
        overflow: hidden;
    }
}
