﻿/* ==========================================================================
   History Page Header (overrides shared .page-header background)
   ========================================================================== */
#company-information .page-header {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/company/history-page-hero.webp') !important;
    background-size: cover !important;
    background-position: center 30% !important;
}

/* ==========================================================================
   Company History Overview (Video Replica)
   ========================================================================== */
#company-information #mk-history-zdive {
    background: #f3f4f6 !important;
}

#company-information #zdive-canvas,
#company-information #zdive-panels-layer {
    background: transparent !important;
}

#company-information .zdive-panel {
    backface-visibility: hidden !important;
    -webkit-font-smoothing: antialiased !important;
    text-rendering: geometricPrecision !important;
}

/* 2023年の現代表写真は人物が画像の左寄りに写っているため、
   履歴カード内だけ人物の顔が中央に来るように調整する。 */
#company-information .zdive-panel[data-year="2023"] img,
#company-information #history-overview .history-item[data-year="2023"] .overview-photo img {
    transform: translateY(-10px) scale(1.2) !important;
    transform-origin: left center !important;
    object-position: 50% 80% !important;
}

/* Keep the SP card media inside its rounded surface. The desktop 2023
   portrait crop intentionally uses a scale transform; on a narrow viewport
   that transform must not expand beyond the card edge. */
@media (max-width: 768px) {
    #company-information #mk-history-zdive .zdive-panel {
        overflow: hidden !important;
    }

    #company-information #mk-history-zdive .zdive-panel:not([data-year="2023"]) img {
        transform: none !important;
        transform-origin: center center !important;
        object-position: 50% 80% !important;
    }

    #company-information #mk-history-zdive .zdive-panel[data-year="2023"] img {
        transform: scale(1.08) !important;
        transform-origin: center 80% !important;
        object-position: 50% 80% !important;
    }
}

#company-information #history-overview .history-item[data-year="2023"]:hover .overview-photo img,
#company-information #history-overview .history-item[data-year="2023"].active .overview-photo img {
    transform: translateY(-12px) scale(1.25) !important;
}

#company-information #history-overview.history-overview-section {
    --ov-axis-left: 200px;
    --ov-pad-x: 40px;

    position: relative !important;
    margin-top: -100vh !important;
    min-height: 100vh !important;
    padding: 0 0 150px !important;
    background: #f3f4f6 !important;
    overflow: clip !important;
    opacity: 0 !important;
    transform: scale(0.88) !important;
    transform-origin: top center !important;
    filter: blur(6px) !important;
    transition: opacity 1.2s ease, transform 1.4s cubic-bezier(0.15, 0.7, 0.2, 1), filter 1.1s ease !important;
}

#company-information #history-overview.history-overview-section.section-in {
    opacity: 1 !important;
    transform: none !important;
    filter: blur(0) !important;
}

body.skip-zdive #company-information #history-overview.history-overview-section {
    margin-top: 0 !important;
}

#overview-shapes-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    display: block !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: 0 !important;
    margin-bottom: 0 !important;
    transition: opacity 0.25s ease !important;
}

#overview-shapes-canvas.is-visible {
    opacity: 1 !important;
}

#company-information #history-overview .history-overview-timeline {
    position: relative !important;
    z-index: 1 !important;
    max-width: 1040px !important;
    margin: 0 auto !important;
    padding: 0 var(--ov-pad-x) 0 !important;
    box-sizing: border-box !important;
}

#company-information #history-overview .history-overview-timeline::before,
#company-information #history-overview .history-overview-timeline::after {
    display: none !important;
}

#company-information #history-overview .history-timeline {
    position: relative !important;
}

#company-information #history-overview .timeline-header-block {
    position: relative !important;
    padding: 72px 0 44px !important;
    margin-bottom: 8px !important;
    text-align: center !important;
}

#company-information #history-overview .timeline-title-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
}

#company-information #history-overview .timeline-main-title {
    position: relative !important;
    z-index: 2 !important;
    margin: 0 0 12px !important;
    color: #1c2a5e !important;
    font-size: clamp(2.8rem, 5vw, 4rem) !important;
    line-height: 1 !important;
    letter-spacing: 0.14em !important;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif !important;
    font-weight: 600 !important;
}

#company-information #history-overview .timeline-title-line {
    display: block !important;
    width: 30px !important;
    height: 2px !important;
    background: #3a6bc9 !important;
    margin: 0 0 10px !important;
}

#company-information #history-overview .timeline-subtitle {
    position: relative !important;
    z-index: 2 !important;
    margin: 0 !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.3em !important;
    color: #5880c8 !important;
    font-family: "Helvetica Neue", Arial, sans-serif !important;
    font-weight: 500 !important;
    line-height: 1 !important;
}

#company-information #history-overview .timeline-watermark {
    position: absolute !important;
    left: -2px !important;
    top: -30px !important;
    margin: 0 !important;
    font-size: clamp(5.2rem, 12vw, 8.8rem) !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: 0.01em !important;
    color: #e7e8ea !important;
    font-family: "Helvetica Neue", Arial, sans-serif !important;
    pointer-events: none !important;
    user-select: none !important;
}

#company-information #history-overview .timeline-today-label {
    position: relative !important;
    z-index: 2 !important;
    margin: 0 0 8px !important;
    color: #999ea7 !important;
    font-size: 1.12rem !important;
    line-height: 1 !important;
    letter-spacing: 0.08em !important;
    font-family: "Helvetica Neue", Arial, sans-serif !important;
    font-weight: 700 !important;
}

#company-information #history-overview .timeline-present-label {
    position: relative !important;
    z-index: 2 !important;
    margin: 0 !important;
    color: #2f3540 !important;
    font-size: clamp(2.25rem, 3.6vw, 3.05rem) !important;
    line-height: 1 !important;
    letter-spacing: 0.01em !important;
    font-family: "Times New Roman", "Yu Mincho", "Hiragino Mincho ProN", serif !important;
    font-weight: 500 !important;
}

#company-information #history-overview .timeline-header-block::before {
    display: none !important;
}

#company-information #history-overview .history-timeline::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: var(--ov-axis-left) !important;
    width: 1px !important;
    background: #c3c8d2 !important;
    transform: translateX(-50%) !important;
    z-index: 0 !important;
}

#company-information #history-overview .history-progress-line {
    position: absolute !important;
    left: var(--ov-axis-left) !important;
    top: 35px !important;
    width: 2px !important;
    height: 0;
    background: linear-gradient(180deg, #2d4f96 0%, #173b7b 100%) !important;
    transform: translateX(-50%) !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

#company-information #history-overview .history-item {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 220px minmax(0, 1fr) !important;
    gap: 34px !important;
    align-items: start !important;
    padding: 34px 0 50px !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
}

#company-information #history-overview .history-item.is-visible {
    opacity: 1 !important;
}

#company-information #history-overview .history-item::before {
    content: '' !important;
    position: absolute !important;
    left: var(--ov-axis-left) !important;
    top: 49px !important;
    width: 11px !important;
    height: 11px !important;
    border-radius: 50% !important;
    border: 2px solid #233d79 !important;
    background: #f3f4f6 !important;
    box-shadow: 0 0 0 5px rgba(150, 158, 170, 0.18) !important;
    transform: translate(-50%, -50%) !important;
    z-index: 2 !important;
}

#company-information #history-overview .history-item:last-child {
    padding-bottom: 26px !important;
}

#company-information #history-overview .history-left {
    text-align: right !important;
    padding-top: 2px !important;
    padding-right: 44px !important;
}

#company-information #history-overview .history-year {
    margin: 0 !important;
    font-size: clamp(3rem, 4.8vw, 4rem) !important;
    line-height: 1 !important;
    letter-spacing: -0.02em !important;
    color: var(--year-tone, #b8bcc3) !important;
    font-family: "Times New Roman", "Yu Mincho", "Hiragino Mincho ProN", serif !important;
    font-weight: 600 !important;
    transition: color 0.35s ease !important;
    user-select: none !important;
}

#company-information #history-overview .history-center.overview-center {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 340px !important;
    gap: 40px !important;
    align-items: end !important;
}

#company-information #history-overview .history-content.overview-content {
    border-bottom: 1px solid #dee1e6 !important;
    padding-bottom: 20px !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
}

#company-information #history-overview .history-title {
    margin: 0 0 12px 0 !important;
    font-size: clamp(1.34rem, 2.05vw, 1.64rem) !important;
    line-height: 1.48 !important;
    letter-spacing: 0.02em !important;
    color: #39404a !important;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif !important;
    font-weight: 700 !important;
    transition: color 0.35s ease !important;
}

#company-information #history-overview .history-text {
    margin: 0 !important;
    color: #666e78 !important;
    font-size: 1.25rem !important;
    line-height: 1.95 !important;
}

#company-information #history-overview .overview-photo {
    margin: 0 !important;
    width: 100% !important;
    opacity: 0 !important;
    transform: translateY(12px) !important;
    visibility: hidden !important;
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease !important;
}

#company-information #history-overview .overview-photo img {
    display: block !important;
    width: 100% !important;
    height: 226px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12) !important;
}

#company-information #history-overview .overview-photo--empty {
    display: none !important;
}

#company-information #history-overview .history-item.active .history-year,
#company-information #history-overview .history-item:hover .history-year {
    color: var(--year-tone, #1e2f67) !important;
    filter: saturate(1.1) contrast(1.05) !important;
}

#company-information #history-overview .history-item.is-visible .history-content.overview-content {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
}

#company-information #history-overview .history-item.active .history-title,
#company-information #history-overview .history-item:hover .history-title {
    color: #1e2f67 !important;
}

#company-information #history-overview .history-item.active::before,
#company-information #history-overview .history-item:hover::before {
    background: #1e2f67 !important;
    border-color: #1e2f67 !important;
    box-shadow: 0 0 0 5px rgba(150, 158, 170, 0.22) !important;
}

#company-information #history-overview .history-item.active .overview-photo,
#company-information #history-overview .history-item:hover .overview-photo {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

/* First item (1958) — founding year accent */
#company-information #history-overview .history-item:first-of-type .history-left::before {
    content: 'SINCE' !important;
    display: block !important;
    font-size: 0.6rem !important;
    letter-spacing: 0.28em !important;
    color: #4a70be !important;
    font-family: "Helvetica Neue", Arial, sans-serif !important;
    font-weight: 700 !important;
    text-align: right !important;
    padding-right: 44px !important;
    margin-bottom: 4px !important;
    opacity: 0.85 !important;
}

#company-information #history-overview .history-item:first-of-type::before {
    width: 15px !important;
    height: 15px !important;
    background: #f3f4f6 !important;
    border-color: #233d79 !important;
    box-shadow: 0 0 0 5px rgba(150, 158, 170, 0.18) !important;
}

#company-information #history-overview .ov-header,
#company-information #history-overview .ov-item {
    display: none !important;
}

@media (max-width: 960px) {
    #company-information #history-overview.history-overview-section {
        --ov-axis-left: 140px;
        --ov-pad-x: 24px;
        padding-bottom: 120px !important;
    }

    #company-information #history-overview .history-overview-timeline {
        padding-top: 44px !important;
    }

    #company-information #history-overview .timeline-header-block {
        padding: 56px 0 36px !important;
    }

    #company-information #history-overview .timeline-main-title {
        font-size: clamp(2.2rem, 5vw, 2.8rem) !important;
        margin-bottom: 10px !important;
    }

    #company-information #history-overview .timeline-title-line {
        width: 24px !important;
        margin-bottom: 8px !important;
    }

    #company-information #history-overview .timeline-subtitle {
        font-size: 0.62rem !important;
    }

    #company-information #history-overview .timeline-today-label {
        font-size: 1.15rem !important;
    }

    #company-information #history-overview .timeline-present-label {
        font-size: clamp(1.5rem, 3.8vw, 2rem) !important;
    }

    #company-information #history-overview .history-item {
        grid-template-columns: 158px minmax(0, 1fr) !important;
        gap: 22px !important;
        padding: 28px 0 38px !important;
    }

    #company-information #history-overview .history-left {
        padding-right: 36px !important;
    }

    #company-information #history-overview .history-item::before {
        top: 41px !important;
        width: 8px !important;
        height: 8px !important;
    }

    #company-information #history-overview .history-center.overview-center {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px !important;
    }

    #company-information #history-overview .overview-photo {
        max-width: 380px !important;
    }

    #company-information #history-overview .overview-photo img {
        height: 190px !important;
    }
}

@media (max-width: 620px) {
    #company-information .profile-main-heading {
        font-size: clamp(2rem, 8.8vw, 2.35rem);
        line-height: 1.25;
    }

    #company-information #history-overview.history-overview-section {
        --ov-axis-left: 22px;
        --ov-pad-x: 18px;
        padding-bottom: 90px !important;
    }

    #company-information #history-overview .history-overview-timeline {
        padding-top: 30px !important;
    }

    #company-information #history-overview .timeline-header-block {
        padding: 36px 0 24px !important;
    }

    #company-information #history-overview .timeline-main-title {
        font-size: clamp(2rem, 8vw, 2.4rem) !important;
        letter-spacing: 0.12em !important;
        margin-bottom: 8px !important;
    }

    #company-information #history-overview .timeline-title-line {
        width: 20px !important;
        margin-bottom: 6px !important;
    }

    #company-information #history-overview .history-item:first-of-type .history-left::before {
        text-align: left !important;
        padding-right: 0 !important;
    }

    #company-information #history-overview .timeline-watermark {
        left: 0 !important;
        top: -8px !important;
        font-size: clamp(3rem, 14vw, 4.8rem) !important;
    }

    #company-information #history-overview .timeline-today-label {
        font-size: 0.86rem !important;
        margin-bottom: 5px !important;
    }

    #company-information #history-overview .timeline-present-label {
        font-size: 1.55rem !important;
    }

    #company-information #history-overview .timeline-header-block::before {
        left: var(--ov-axis-left) !important;
        top: 26px !important;
        width: 9px !important;
        height: 9px !important;
    }

    #company-information #history-overview .history-timeline::before {
        left: var(--ov-axis-left) !important;
    }

    #company-information #history-overview .history-item {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 22px 0 30px 36px !important;
        box-sizing: border-box !important;
    }

    #company-information #history-overview .history-item::before {
        left: var(--ov-axis-left) !important;
        top: 32px !important;
        width: 9px !important;
        height: 9px !important;
    }

    #company-information #history-overview .history-left {
        display: flex !important;
        justify-content: flex-start !important;
        width: 100% !important;
        min-width: 0 !important;
        text-align: left !important;
        padding-top: 0 !important;
        padding-right: 0 !important;
    }

    #company-information #history-overview .history-year {
        width: auto !important;
        max-width: 100% !important;
        font-size: 2.35rem !important;
    }

    #company-information #history-overview .history-center.overview-center,
    #company-information #history-overview .history-content.overview-content {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    #company-information #history-overview .history-title,
    #company-information #history-overview .history-text {
        overflow-wrap: anywhere;
    }

    #company-information #history-overview .history-text {
        font-size: 1.08rem !important;
    }

    #company-information #history-overview .overview-photo {
        max-width: 100% !important;
    }

    #company-information #history-overview .overview-photo img {
        height: 168px !important;
    }
}

/* ==========================================================================
   会社の歴史 ナラティブセクション (.okg-hn)
   philosophy と history-overview の間に表示
   ========================================================================== */

/* ── セクション全体 ── */
#okg-history-narrative.okg-hn {
    position: relative;
    z-index: 1;
}

/* ── ヘッダー（ダークネイビー背景） ── */
.okg-hn__head {
    background: #0d1524;
    padding: clamp(5rem, 8vw, 8rem) 0 clamp(4rem, 6vw, 6rem);
}

.okg-hn__head-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
}

.okg-hn__eyebrow {
    margin: 0 0 1.2rem;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.38em;
    color: #5880c8;
    text-transform: uppercase;
}

.okg-hn__title {
    margin: 0 0 1.6rem;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 700;
    color: #f0f2f6;
    line-height: 1.2;
    letter-spacing: 0.06em;
}

.okg-hn__lead {
    margin: 0;
    font-size: clamp(0.9rem, 1.4vw, 1.05rem);
    line-height: 2;
    color: #8c9ab5;
    letter-spacing: 0.05em;
}

/* ── ボディ（明るい背景） ── */
.okg-hn__body {
    background: #f3f4f6;
    padding: clamp(4rem, 7vw, 7rem) 0 clamp(5rem, 8vw, 8rem);
}

.okg-hn__body-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── チャプター（各時代） ── */
.okg-hn__chapter {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 0 3rem;
    padding: clamp(2.5rem, 4vw, 3.5rem) 0;
    border-bottom: 1px solid #dde0e6;
    align-items: start;
}

.okg-hn__chapter:last-child {
    border-bottom: none;
}

/* ── 年号 ── */
.okg-hn__chapter-era {
    font-family: "Helvetica Neue", "Times New Roman", serif;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: #a8b4cc;
    letter-spacing: -0.01em;
    line-height: 1;
    padding-top: 0.3rem;
    text-align: right;
    padding-right: 2rem;
    border-right: 2px solid #d0d6e2;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.okg-hn__chapter:hover .okg-hn__chapter-era {
    color: #3a6bc9;
    border-right-color: #3a6bc9;
}

/* ── 50周年チャプター（アクセント強調） ── */
.okg-hn__chapter--featured .okg-hn__chapter-era {
    color: #2d4f96;
    border-right-color: #2d4f96;
}

.okg-hn__chapter--featured .okg-hn__chapter-content {
    border-left: 3px solid #3a6bc9;
    padding-left: 1.4rem;
    margin-left: -1.4rem;
}

/* ── チャプターコンテンツ ── */
.okg-hn__chapter-content {
    padding-left: 0;
}

.okg-hn__chapter-title {
    margin: 0 0 1rem;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
    font-weight: 700;
    color: #1c2a5e;
    line-height: 1.5;
    letter-spacing: 0.03em;
}

.okg-hn__chapter-text {
    margin: 0 0 0.9em;
    font-size: clamp(0.88rem, 1.3vw, 0.98rem);
    line-height: 2;
    color: #545c6e;
    letter-spacing: 0.04em;
}

.okg-hn__chapter-text:last-child {
    margin-bottom: 0;
}

/* ── レスポンシブ ── */
@media (max-width: 768px) {
    .okg-hn__chapter {
        grid-template-columns: 80px 1fr;
        gap: 0 1.5rem;
        padding: 2rem 0;
    }

    .okg-hn__chapter-era {
        font-size: 1.2rem;
        padding-right: 1rem;
    }

    .okg-hn__chapter--featured .okg-hn__chapter-content {
        padding-left: 1rem;
        margin-left: -1rem;
    }
}

@media (max-width: 480px) {
    .okg-hn__chapter {
        grid-template-columns: 1fr;
        gap: 0.6rem 0;
    }

    .okg-hn__chapter-era {
        text-align: left;
        padding-right: 0;
        border-right: none;
        border-bottom: 2px solid #d0d6e2;
        padding-bottom: 0.4rem;
        margin-bottom: 0.4rem;
        font-size: 1.3rem;
    }

    .okg-hn__chapter--featured .okg-hn__chapter-content {
        border-left: none;
        border-top: 3px solid #3a6bc9;
        padding-left: 0;
        padding-top: 0.8rem;
        margin-left: 0;
    }
}
