/* ===============================================================
   Top Page
   - Hero (KV)
   - Solution
   - Reasons
   - Products
   - Purpose
   - News
   - Locations
   - Flow
================================================================ */

/* ====== Hero (KV) ====== */
.hero {
    position: relative;
    width: 100%;
    aspect-ratio: 240/107; /* アスペクト比：PCでフル幅ヒーロー、SPで少し縦長。必要に応じて数値調整 */
    overflow: clip;
    isolation: isolate; /* ::before オーバーレイを下に閉じ込める */
}

/* 画像レイヤ */
.hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像トリミングしてもセンターで綺麗に */
}

/* 画面上のテキストブロック */
.hero__content {
    position: absolute;
    top: 120px;
    left: 4.611112vw;
    z-index: 1;
    display: grid;
    align-content: center; /* 垂直センター。PDFに合わせて上寄せにするなら padding-top を使う */
    max-width: min(1100px, 92vw);
    margin-inline: auto;
    color: var(--color-text-white);
}

/* タイトルとリード：既存トークンに合わせやすい素地だけ */
.hero__title {
    margin: 0 0 0.5em;
    font-size: var(--font-size-title-hero);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.04em;
    color: var(--color-text-white);
    text-shadow: 0px 0px 10px rgb(6 63 180 / 80%);
}

.hero__lead {
    width: min(560px, 38.8889vw);
    margin: 0;
    font-size: var(--font-size-text-lg, 1.8rem);
    line-height: 1.7;
    color: var(--color-text-white);
    text-shadow: 0px 0px 10px rgb(6 63 180 / 80%);
}

/* コントラスト確保のためのグラデーションオーバーレイ（装飾） */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0; /* 画像の上・テキストの下 */
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.35) 0%,
        rgba(0,0,0,0.25) 40%,
        rgba(0,0,0,0.15) 100%
    );
    pointer-events: none;
}

/* ====== Modifiers ====== */
.hero--home {}

/* ====== Responsive ====== */
@media (max-width: 1024px) {
    .hero {
        position: relative;
        width: 100%;
        aspect-ratio: 21 / 10; /* アスペクト比：PCでフル幅ヒーロー、SPで少し縦長。必要に応じて数値調整 */
        overflow: clip;
        isolation: isolate; /* ::before オーバーレイを下に閉じ込める */
    }
}

@media (max-width: 768px) {
    .hero {
        aspect-ratio: 375 / 445; /* 16:9 など実際の比率を指定 */
    }
    .hero__content {
        position: absolute;
        top: initial;
        bottom: 24px;
        left: 24px;
    }
    .hero__title {
        margin: 0 0 0.2em;
        font-size: var(--font-size-title-xl, 3rem);
    }
    .hero__lead {
        width: 100%;
        font-size: var(--font-size-text-md, 1.6rem);
    }
}

/* 動きが苦手なユーザー配慮（念のため） */
@media (prefers-reduced-motion: reduce) {
    .hero__image {
        transition: none;
    }
    .hero::before {
        transition: none;
    }
}


/* ===============================================================
    solution
=============================================================== */
.solution {
    width: 100%;
    margin: 0 auto;
    padding: 50px 40px;
    box-sizing: border-box;
    background-color: var(--color-bg-section-blue);
}

.solution__title {
    position: relative;
}
.solution__title::before {
    content: "";
    position: absolute;
    top: 0.2em;
    right: calc(50% + 9.2em);
    width: 70px;
    height: 92px;
    /* background: url(../image/top/note-illust.png) no-repeat bottom / contain; */
}
.solution__title::after {
    content: "";
    position: absolute;
    top: 0.2em;
    left: calc(50% + 9em);
    width: 118px;
    height: 170px;
    background: url(../image/top/solution-illust.png) no-repeat bottom / contain;
}
.solution__content {
    width: 100%;
    margin: 0 auto;
}

/* 4つ並びカード */
.solution__list {
    position: relative;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.77778vw;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    z-index: 9;
}

.solution__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: var(--color-bg-card-sky);
    border-radius: 12px;
    padding: 4rem 1.6rem;
}

.solution__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 150px;
    margin: 0 0 1.5rem;
    border-radius: 50%;
    background-color: #fff;
}

.solution__icon img {
    display: block;
    width: 75%;
    height: auto;
    object-fit: contain;
}

.solution__subtitle {
    margin: 0 0 1.090909em;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--color-text-accent);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.solution__text {
    margin: 0;
    font-size: var(--font-size-text-md);
    line-height: 1.45;
    text-align: left;
    color: var(--color-text-main);
}

/* レスポンシブ */
@media (max-width: 1024px) {
    .solution__list {
        grid-template-columns: repeat(2, 1fr);
    }
    .solution__title::before {
        width: 70px;
        height: 80px;
    }
    .solution__title::after {
        top: 0.2em;
        left: calc(50% + 9em);
        width: 90px;
        height: 120px;
    }
}

@media (max-width: 768px) {
    .solution {
        padding: 60px 24px;
        box-sizing: border-box;
    }
    .solution__list {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .solution__item {
        padding: 24px 16px;
    }
    .solution__subtitle {
        min-height: initial;
        font-size: 1.8rem;
    }
    .solution__title::before {
        top: -0.5em;
        right: calc(50% + 5em);
        width: 40px;
        height: 40px;
    }
    .solution__title::after {
        top: 3em;
        left: calc(50% + 4.2em);
        width: 50px;
        height: 70px;
    }
    .solution__icon {
        width: 100px;
        height: 100px;
    }
}


/* ===============================================================
    Reasons
=============================================================== */
.reasons {
    width: 100%;
    margin: 0 auto;
    padding: 50px 0;
    box-sizing: border-box;
}

.reasons__title {
    position: relative;
    margin: 0 0 60px;
    font-size: var(--font-size-title-xl);
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

.reasons__title::after {
    content: "";
    position: absolute;
    top: 0.1em;
    left: calc(50% + 5em);
    width: 53px;
    height: 53px;
    background: url(../image/top/pencil-illust.png) no-repeat bottom / contain;
}

/* コンテナ */
.reasons__list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4.166667vw;
    list-style: none;
    box-sizing: border-box;
}

/* --- アイテム（PC: 2カラム。デフォルト=テキスト左/画像右） --- */
.reasons__item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
    margin: 0 0 clamp(56px, 8vw, 120px);
}

.reasons__item:last-child {
    margin: 0 0 0;
}

/* 反転（--rev = 画像左/テキスト右） */
.reasons__item--rev .reasons__content { order: 2; }
.reasons__item--rev .reasons__media   { order: 1; }

/* --- テキスト --- */
.reasons__head {
    margin: 0 0 8px;
}

.reasons__crown {
    width: 56px;
    height: 50px;
    background: url("../image/top/crown-icon.png") no-repeat center / contain;
    display: inline-block;
}

.reasons__no {
    font-size: var(--font-size-number-l);
    font-weight: 700;
    line-height: 1;
    color: var(--color-marker);
}

.reasons__subtitle {
    display: block;
    margin: 0 0 1.25em;
    font-size: var(--font-size-sub-title-l);
    font-weight: 700;
    line-height: 1.45;
    color: var(--color-text-main);
    position: relative;
}
.reasons__content {
    max-width: 540px;
}

.reasons__text {
    font-size: var(--font-size-text-md);
    line-height: 1.8;
    color: var(--color-text-main);
}

/* --- 画像 --- */
.reasons__media {
    position: relative;
    width: 100%;
    max-width: 520px;
    border-radius: 10px;
}

.reasons__bg {
    display: block;
    margin: 0 0 0 auto;
    width: 89.23076923%;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
}

/* イラスト：デフォルト（画像右のカードでは右下） */
.reasons__illust {
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 38.461538461%;
    height: auto;
    pointer-events: none;
}

/* 画像左のカード（--rev）では左下に配置 */
.reasons__item--rev .reasons__bg {
    margin: 0 auto 0 0;
}

/* 画像左のカード（--rev）では左下に配置 */
.reasons__item--rev .reasons__illust {
    right: 0;
    left: initial;
}

/* --- SP: 縦積み（テキスト→画像）、イラストは常に右下 --- */
@media (max-width: 768px) {
    .reasons {
        padding: 60px 0;
    }
    .reasons__title::after {
        content: "";
        width: 28px;
        height: 28px;
    }
    .reasons__item {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    /* 並び順を統一：必ず テキスト → 画像 */
    .reasons__content {
        max-width: initial;
        order: 1 !important;
    }
    .reasons__media {
        max-width: initial;
        order: 2 !important;
    }
    .reasons__subtitle::after {
        width: 180px;
        height: 6px;
        margin-top: 8px;
    }
    .reasons__crown {
        width: 40px;
        height: 35px;
        background: url(../image/top/crown-icon.png) no-repeat center / contain;
        display: inline-block;
    }
    .reasons__bg {
        margin: 0 auto 0 0;
    }
    /* イラストはSPで常に右下に統一 */
    .reasons__illust {
        left: initial;
        right: 0;
        width: 35%;
        height: auto;
        pointer-events: none;
    }
}


/* ===============================================================
    Products
=============================================================== */
.products {
    width: 100%;
    margin: 0 auto;
    padding: 50px 0;
    box-sizing: border-box;
    text-align: center;
    background-color: var(--color-bg-section-blue);
}

.products__title {
    position: relative;
    font-size: var(--font-size-title-xl);
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

.products__title::after {
    content: "";
    position: absolute;
    top: -20px;
    left: calc(50% + 3em);
    width: 65px;
    height: 100px;
    background: url(../image/top/search-illust.png) no-repeat bottom / contain;
}

.products__lead {
    margin: 0 0 2.8125em;
    padding: 0 24px;
    font-size: var(--font-size-text-md);
    line-height: 1.8;
    color: var(--color-text-main);
}

.products__list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.388889vw;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.7777778vw;
    list-style: none;
    box-sizing: border-box;
}

.products__item {
    display: flex;
    justify-content: center;
}

.products__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 10px;
}

.products__image {
    width: 100%;
    max-width: 358px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 1.5em;
}

.products__name {
    margin: 0 0 1.333334em;
    font-size: var(--font-size-sub-title-m);
    font-weight: 700;
    color: var(--color-text-main);
}

/* SP */
@media (max-width: 768px) {
    .products {
        padding: 60px 0;
        box-sizing: border-box;
        text-align: center;
        background-color: var(--color-bg-section-blue);
    }
    .products__title::after {
        top: -1em;
        width: 50px;
        height: 77px;
    }
    .products__list {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 0 24px;
    }
    .products__card {
    }
    .products__image {
        max-width: initial;
        height: auto;
        border-radius: 10px;
        margin-bottom: 1.5em;
    }
}


/* ===============================================================
    Purpose
=============================================================== */
.purpose {
    width: 100%;
    margin: 0 auto;
    padding: 50px 0;
    box-sizing: border-box;
    text-align: center;
}

.purpose__lead {
    margin: 0 0 4.166666666vw;
    padding: 0 6.4vw;
    font-size: var(--font-size-text-md);
    color: var(--color-text-sub);
    line-height: 1.8;
}

/* Grid（5列固定） */
.purpose__list {
    --gap: 32px;       /* 行間の横ギャップ */
    --pad-x: 40px;     /* 左右パディング合計（20px + 20px） */
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--gap);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    list-style: none;
    box-sizing: border-box;
    /* ★ コンテナ化（子からコンテナ幅を参照できるように） */
    container-type: inline-size;
}

/* 折り返しを防ぐための縮小許可 */
.purpose__item {
    display: flex;
    justify-content: center;
    min-width: 0;   /* ★ 重要 */
}

/* カード */
.purpose__card {
    display: grid;
    justify-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
    width: 100%;
    min-width: 0;
}

.purpose__card:hover {
    transform: translateY(-8px);
}

.purpose__icon-wrap {
    position: relative;
    display: grid;
    place-items: center;
}

/* 画像：通常は200px。足りないときだけ自動縮小 */
.purpose__icon {
    display: block;
    width: clamp(
        120px,
        /* コンテナ幅から左右パディング＆4つのギャップを引いて5等分 */
        calc((100cqi - var(--pad-x) - (4 * var(--gap))) / 5),
        200px
    );
    height: auto;
    object-fit: contain;
}

.purpose__name {
    display: inline-block;
    margin: 0;
    font-size: var(--font-size-text-lg, 1.8rem);
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-text-main);
}

@media (max-width: 768px) {
    .purpose {
        padding: 60px 0;
    }
    .purpose__list {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 0 16px;
    }
    .purpose__icon {
        width: initial;
        max-width: 200px;
    }
    .purpose__name {
        font-size: var(--font-size-text-md, 1.6rem);
    }
}


/* ===============================================================
    News Section
=============================================================== */
.news {
    width: 100%;
    padding: 50px 0;
    box-sizing: border-box;
    text-align: center;
    background-color: var(--color-bg-section-blue);
}

.news__inner {
}

.news__title {
    position: relative;
    margin: 0 0 12px;
    font-size: var(--font-size-title-xl);
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1.4;
}

.news__title::before {
    content: "";
    position: absolute;
    top: -16px;
    right: calc(50% + 7em);
    width: 90px;
    height: 85px;
    background: url(../image/top/news-icon.png) no-repeat bottom / contain;
}

.news__lead {
    margin: 0 0 2.8125em;
    padding: 0 24px;
    font-size: var(--font-size-text-md);
    color: var(--color-text-sub);
    line-height: 1.8;
}

.news__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.7777778vw;
    width: 100%;
    max-width: 1200px;
    list-style: none;
    padding: 0 1.388889vw;
    margin: 0 auto 48px;
    box-sizing: border-box;
}

.news__item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.news__item:hover {
    transform: translateY(-6px);
}

.news__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.news__image img {
    width: 100%;
    height: auto;
    display: block;
}

.news__meta {
    display: flex;
    gap: 1.25em;
    justify-content: start;
    align-items: center;
    padding: 1em 1.5em 0.555556em;
    font-size: var(--font-size-text-md);
    font-weight: 400;
}

.news__category {
    display: inline-block;
    padding: 0.44445em 0.6em;
    border-radius: 4px;
    font-size: var(--font-size-text-lg);
    font-weight: 700;
    color: #fff;
}

/* カテゴリーごとに色分け */
.news__category--system { background: #89B4E8; }      /* システム解説 */
.news__category--product { background: #6BC7B5; }     /* 製品紹介 */
.news__category--feature { background: #E6BF83; }     /* 機能紹介 */
.news__category--solutions { background: #8999E8; }   /* 連携ソリューション */
.news__category--cases { background: #DB83E6; }       /* 導入事例 */

.news__date {
    font-size: var(--font-size-text-lg);
    font-weight: 400;
}

.news__headline {
    padding: 0 1.5em 2.5em;
    font-size: var(--font-size-sub-title-s);
    font-weight: 700;
    line-height: 1.5;
    color: var(--color-text-main);
    text-align: left;
}

.news__more {
    text-align: center;
}

@media (max-width: 768px) {
    .news {
        padding: 60px 0;
    }
    .news__title::before {
        top: 0.5em;
        right: calc(50% + 4em);
        width: 50px;
        height: 46px;
        background: url(../image/top/news-icon.png) no-repeat bottom / contain;
    }
    .news__list {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 0 24px;
    }
}


/* ===============================================================
    Locations Section
=============================================================== */
.locations {
    width: 100%;
    margin: 0 auto;
    padding: 50px 0;
    box-sizing: border-box;
    text-align: center;
}

.locations__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4.166667vw;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: min(5.861111vw, 70px);
    box-sizing: border-box;
}

.locations__title {
    position: relative;
    margin: 0 0 24px;
    font-size: var(--font-size-title-xl);
    font-weight: 700;
    color: var(--color-text-main);
    text-align: center;
}

.locations__title::before {
    content: "";
    position: absolute;
    top: -4px;
    left: calc(50% + 4.4em);
    width: 46px;
    height: 70px;
    background: url(../image/top/tool-illust.png) no-repeat bottom / contain;
}

.locations__content {
    max-width: 540px;
    text-align: left;
}

.locations__lead {
    margin-bottom: 2.2222223em;
    color: var(--color-text-sub);
    font-size: var(--font-size-text-lg);
    line-height: 1.8;
}

.locations__list {
    list-style: none;
    display: grid;
    gap: 1.2em;
}

.locations__item {
}

.locations__link {
    display: inline-grid;
    grid-auto-flow: column;
    align-items: center;
    gap: 20px;
    font-weight: 800;
    text-decoration: none;
    font-size: var(--font-size-sub-title-s);
    color: var(--color-text-link);
    line-height: 1.4;
    position: relative;
    isolation: isolate;
}

.locations__pin {
    inline-size: 20px;
    block-size: 30px;
    display: grid;
    place-items: center;
}

.locations__pin-img {
    width: 20px;
    height: 30px;
    display: block;
}

.locations__art {
    display: grid;
    place-items: center;
}

.locations__art img {
    max-width: 464px;
    height: auto;
    display: block;
}

@media (max-width: 768px) {
    .locations {
        padding: 60px 0;
    }
    .locations__inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .locations__title {
        text-align: center;
    }
    .locations__title::before {
        top: -4px;
        left: calc(50% + 4.4em);
        width: 30px;
        height: 47px;
    }
    .locations__lead {
        text-align: left;
    }
    .locations__content {
        max-width: initial;
        text-align: left;
    }
    .locations__list {
        justify-items: center;
    }
    .locations__art img {
        width: min(520px, 90%);
        margin-inline: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .locations__link::after {
        transition: none;
    }
}


/* ===============================================================
    Flow Section
=============================================================== */
.flow {
    width: 100%;
    padding: 50px 0;
    box-sizing: border-box;
    background-color: var(--color-bg-section-blue);
}

.flow__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.flow__title {
    position: relative;
    margin: 0 0 24px;
    font-size: var(--font-size-title-xl);
    font-weight: 700;
    color: var(--color-text-main);
    text-align: center;
}

.flow__list {
    max-width: 1000px;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: grid;
    gap: 48px;
}

.flow__item {
    position: relative;
}

/* ↓ 区切りの矢印（中央に小さな白い矢印） */
.flow__item + .flow__item::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -32px;
    transform: translateX(-50%);
    width: 60px;
    height: 16px;
    background: url("../image/top/arrow-down.png") no-repeat center / contain;
}

/* カード本体 */
.flow__card {
    display: grid;
    grid-template-columns: 189px 1fr; /* 左：番号＋アイコン / 右：本文 */
    align-items: center;
    gap: 40px;
    text-align: left;
    background: var(--color-text-white);
    border-radius: 10px;
    padding: 35px 60px;
}

/* 左ブロック（番号リボン＋アイコン） */
.flow__lead {
    position: relative;
    display: grid;
    grid-template-columns: 50px 1fr;
    align-items: start;
    gap: 22px;
}

/* 背景リボン（淡いブルーの帯） */
.flow__lead::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #e9f1ff 0%, #e9f1ff 80%, transparent 80%);
    border-radius: 10px;
    z-index: -1;
}

/* 番号 */
.flow__num {
    font-size: var(--font-size-number-m);
    font-weight: 700;
    color: var(--color-marker); /* 濃い目のブルー */
    line-height: 1;
    letter-spacing: 0.04em;
    text-align: center;
}

/* アイコン */
.flow__icon img {
    width: 122px;
    height: auto;
    display: block;
}

/* 右ブロック（本文） */
.flow__body {
    padding: 10px 0 10px 40px;
    border-left: 1px solid #e5e7eb; /* 縦の薄い区切り線 */
}

.flow__heading {
    margin: 0 0 0.8em;
    font-size: var(--font-size-sub-title-m);
    font-weight: 800;
    color: var(--color-text-main);
}

.flow__text {
    margin: 0;
    font-size: var(--font-size-text-md);
    color: var(--color-text-sub);
    line-height: 1.8;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .flow {
        padding: 60px 0;
    }
    .flow__card {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px;
    }
    .flow__lead {
        display: block;
    }
    .flow__lead::after {
        background: #e9f1ff;
    }
    .flow__list {
        gap: 24px;
    }
    .flow__body {
        padding: 0;
        border-left: none;
    }
    .flow__icon {
        display: block;
        margin: 0 auto;
        text-align: center;
    }
    .flow__icon img {
        width: 35%;
        height: auto;
        margin: 0 auto;
    }
    .flow__heading {
        text-align: center;
    }
    .flow__item + .flow__item::before {
        top: -16px;
        width: 30px;
        height: 8px;
    }
}
