/* ===========================================
   story.css - 創業ストーリーページ専用
   Version: 3.0
   v3.0: エンタープライズBtoB品質へ改善
   - タイムラインの洗練化
   - 色・フォント・間隔の統一
=========================================== */

/* 1. Page Base */
.ewrd-page-story {
    background-color: #fff;
    color: var(--secondary-color, #1A2B48);
    overflow-x: hidden;
}

/* ページヘッダーは common.css .ewrd-sub-hero に統合 */

/* ===================================
   ストーリー画像 — 全幅・隙間なし
=================================== */
.ewrd-story-images {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 0;
    max-width: 1200px;
    margin: 0 auto;
}

.ewrd-story-img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===================================
   3. 縦タイムライン（旧）
=================================== */
.ewrd-timeline {
    padding: 120px 0;
}

.ewrd-tl-track {
    position: relative;
    max-width: 1020px;
    margin: 0 auto;
}

/* 中央の縦ライン */
.ewrd-tl-track::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--border-light, #E8EBF0) 5%,
        var(--border-light, #E8EBF0) 95%,
        transparent 100%
    );
    transform: translateX(-50%);
}

/* 各タイムラインアイテム */
.ewrd-tl-item {
    position: relative;
    width: 50%;
    margin-bottom: 16px;
}

.ewrd-tl-item:last-child {
    margin-bottom: 0;
}

.ewrd-tl-left {
    padding-right: 56px;
}

.ewrd-tl-right {
    margin-left: 50%;
    padding-left: 56px;
}

/* ===================================
   ドット
=================================== */
.ewrd-tl-dot {
    position: absolute;
    top: 20px;
    width: 10px;
    height: 10px;
    background: var(--accent-color, #B8942E);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--accent-color, #B8942E);
    z-index: 2;
}

.ewrd-tl-left .ewrd-tl-dot {
    right: -5px;
}

.ewrd-tl-right .ewrd-tl-dot {
    left: -5px;
}

/* 年マーカー */
.ewrd-tl-year-marker {
    text-align: center;
    font-family: var(--font-english, 'Poppins', sans-serif);
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--secondary-color, #1A2B48);
    letter-spacing: 0.12em;
    padding: 12px 0;
    margin-bottom: 12px;
    position: relative;
}

.ewrd-tl-year-marker:not(:first-child) {
    margin-top: 52px;
}

.ewrd-tl-has-img {
    margin-bottom: 32px;
}

/* ===================================
   カード
=================================== */
.ewrd-tl-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: transparent;
}

.ewrd-tl-card-img {
    flex: 0 0 112px;
    width: 112px;
    height: 112px;
    border-radius: var(--radius-md, 4px);
    overflow: hidden;
}

.ewrd-tl-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ewrd-tl-card-body {
    flex: 1;
    padding: 4px 0;
}

.ewrd-tl-date {
    display: block;
    font-family: var(--font-english, 'Poppins', sans-serif);
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--accent-color, #B8942E);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.ewrd-tl-card-body h3 {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--secondary-color, #1A2B48);
    margin-bottom: 0;
    letter-spacing: 0.02em;
}

/* ===================================
   4. グラフセクション（MOMENTUM）
=================================== */
.ewrd-story-graphs {
    padding: 112px 0;
    background: var(--secondary-color, #1A2B48);
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.ewrd-story-graphs::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAElBMVEUAAAAAAAAAAAAAAAAAAAAAAAAi4wAAAAV0Uk5TABAQEBDQlXkAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAA0SURBVDjLY2AYBaNgOAMmBgYWBij4DwIMUMAEBQxQwAAFTFDABAWMUMCIAsAKUMG/UTDkAQAHLALRSN0r2AAAAABJRU5ErkJggg==");
    background-repeat: repeat;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

.ewrd-story-graphs > * {
    position: relative;
    z-index: 1;
}

.ewrd-graphs-label {
    display: inline-block;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-english, 'Poppins', sans-serif);
    font-weight: 500;
    font-size: 0.6875rem;
    letter-spacing: 0.2em;
    border-bottom: 1px solid var(--accent-color, #B8942E);
    padding-bottom: 6px;
    margin-bottom: 20px;
}

.ewrd-graphs-title {
    font-size: clamp(1.375rem, 2vw, 2rem);
    font-family: var(--font-serif, 'Noto Serif JP', serif);
    font-weight: 700;
    color: #fff;
    margin-bottom: 56px;
    letter-spacing: 0.06em;
}

.ewrd-charts-row {
    display: flex;
    gap: 32px;
}

.ewrd-chart-wrapper {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md, 4px);
    padding: 32px;
    min-height: 360px;
    position: relative;
}

.ewrd-chart-wrapper canvas {
    max-height: 300px;
}

.ewrd-chart-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
    font-family: var(--font-japanese, 'Noto Sans JP', sans-serif);
    letter-spacing: 0.04em;
}

.ewrd-chart-note {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 12px;
    text-align: left;
}

/* ===================================
   レスポンシブ
=================================== */
@media (max-width: 900px) {
    .ewrd-tl-track::before {
        left: 24px;
        transform: none;
    }

    .ewrd-tl-item {
        width: 100%;
        padding-left: 56px;
        padding-right: 0;
    }

    .ewrd-tl-left {
        padding-right: 0;
    }

    .ewrd-tl-right {
        margin-left: 0;
        padding-left: 56px;
    }

    .ewrd-tl-dot {
        left: 19px !important;
        right: auto !important;
    }

    .ewrd-tl-year-marker {
        text-align: left;
        padding-left: 56px;
    }

    .ewrd-tl-year-marker:not(:first-child) {
        margin-top: 40px;
    }

    .ewrd-timeline {
        padding: 80px 0;
    }

    .ewrd-charts-row {
        flex-direction: column;
    }

    .ewrd-chart-wrapper {
        min-height: 280px;
    }

    .ewrd-story-graphs {
        padding: 80px 0;
    }
}

@media (max-width: 600px) {
    .ewrd-tl-track::before {
        left: 16px;
    }

    .ewrd-tl-item {
        padding-left: 44px;
    }

    .ewrd-tl-dot {
        left: 11px !important;
    }

    .ewrd-tl-year-marker {
        padding-left: 44px;
    }

    .ewrd-tl-card-img {
        flex: 0 0 80px;
        width: 80px;
        height: 80px;
    }

    .ewrd-tl-card-body h3 {
        font-size: 0.8125rem;
    }

    .ewrd-tl-item {
        margin-bottom: 20px;
    }
}

/* app.css の .main canvas グローバルルール（フロントページ背景用）を上書き */
#revenueChart,
#co2Chart {
    position: static !important;
    top: auto !important;
    left: auto !important;
    height: 100% !important;
    width: 100% !important;
    background-color: transparent !important;
    z-index: auto !important;
}
