/*
 * tech.css
 * 技術・工程ページ専用スタイル
 */

.tech-page {
    padding-bottom: 0;
}

/* ---------- Process ---------- */
.tech-process {
    position: relative;
    padding-top: 120px;
    padding-bottom: 32px;
    overflow: hidden;
}

/* Figma: tech-process-intro/tech-process-picture are both 1200px. The section
   itself stays full-width (no max-width) so the bg connector below can be a
   plain 100%-wide box instead of a 100vw hack, which overflows past the
   scrollbar and causes horizontal scroll. */
.tech-process__inner {
    position: relative;
    z-index: 1;
    max-width: calc(var(--container-width-lg) + var(--container-padding) * 2);
    margin-inline: auto;
    padding-inline: var(--container-padding);
    display: flex;
    flex-direction: column;
    gap: 64px;
}

/* Figma: "bg" (node 337:1820) - a full-bleed lightblue band behind the
   bottom of this section, bridging into tech-flow's lightblue background. */
.tech-process__bg-connector {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px;
    background: var(--color-lightblue);
    z-index: 0;
}

.tech-process-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 48px;
}

/* Figma: バッジは固定320px高(h-[320px])。中身は少ないので justify-content:center
   で縦センター。テキスト側は行の高さ(=バッジの320px)に対して親のalign-items:center
   で中央揃えになる。 */
.tech-process-intro__badge {
    flex: 1 1 300px;
    max-width: 340px;
    min-height: 320px;
    background: var(--color-blue);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
}

.tech-process-intro__label {
    font-weight: 700;
    font-size: 20px;
    opacity: 0.5;
    letter-spacing: 0.05em;
}

.tech-process-intro__heading {
    font-size: clamp(1.75rem, 1rem + 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.5;
}

.tech-process-intro__heading span {
    color: var(--color-lightblue);
}

.tech-process-intro__text {
    flex: 3 1 400px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.tech-process-intro__catch {
    font-size: clamp(1.125rem, 0.85rem + 1vw, 1.5rem);
    font-weight: 700;
}

.tech-process-intro__catch span {
    color: var(--color-blue);
}

.tech-process-intro__text p:not(.tech-process-intro__catch) {
    font-size: 18px;
    line-height: 1.75;
    font-weight: 500;
}

.tech-process-picture {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    box-shadow: 0 5px 15px rgba(26, 26, 26, 0.2);
    overflow: hidden;
}

.tech-process-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tech-process-picture__badge {
    position: absolute;
    top: 16px;
    right: 0;
    width: 200px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-blue);
    color: var(--color-white);
    font-weight: 700;
    font-size: 20px;
}

/* ---------- Flow ---------- */
.tech-flow {
    background: var(--color-lightblue);
    padding: 88px 0 120px;
}

/* Figma: このセクションの.section-titleはlightblue背景用にwhiteバリアント
   (company.css の .company-history .section-title と同じパターン)。 */
.tech-flow .section-title {
    border-color: var(--color-white);
    color: var(--color-white);
    max-width: 800px;
    margin: 0 auto;
}

.tech-flow .section-title__label,
.tech-flow .section-title__ja {
    color: var(--color-white);
}

.tech-flow-list {
    max-width: 800px;
    margin: 64px auto 0;
    display: flex;
    flex-direction: column;
    gap: 40px;
    list-style: none;
    padding: 0;
}

/* Each item is a flex row that wraps as a whole, rather than flipping to a
   column layout at one fixed breakpoint: the image (basis 240px) and body
   (basis 400px, higher grow factor) share the row while there's room for
   both, and the body wraps to its own line first once space gets tight,
   leaving the image to grow and fill the row on its own line. */
.tech-flow-item {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}



.tech-flow-item__image {
    max-width: 240px;
    aspect-ratio: 2 / 1;
    overflow: hidden;
}

.tech-flow-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tech-flow-item__body {
    position: relative;
    flex: 3 1 400px;
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    background: var(--color-white);
    padding: var(--spacing-xl) var(--spacing-lg);
}

.tech-flow-item:not(:last-child) .tech-flow-item__body::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    width: 64px;
    height: 12px;
    background: url("../images/tech-flow-arrow.svg") center / contain no-repeat;
}


.tech-flow-item__step {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: var(--spacing-lg);
    border-right: 4px solid var(--color-lightblue);
    color: var(--color-lightblue);
}

.tech-flow-item__step span {
    font-family: var(--font-number);
    font-size: 14px;
    letter-spacing: 0.05em;
}

.tech-flow-item__step strong {
    font-family: var(--font-number);
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.tech-flow-item__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.tech-flow-item__title {
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
}

.tech-flow-item__desc {
    font-size: 15px;
}

/* ---------- Technology ---------- */
/* セクション自体は.containerを使わずフル幅のままにして、グラデーション背景が
   画面端まで届くようにする(.tech-processと同じ「フル幅セクション + インナー」
   パターン)。コンテンツ幅はインナー側のmax-widthで持たせる。 */
.tech-technology {
    padding-top: 120px;
    padding-bottom: 80px;
    /* Figma: 下方向にvar(--color-gray)へ抜けるグラデーション背景
       (front-page.css の .product-feature と同じパターン)。 */
    background: linear-gradient(to bottom, var(--color-white), var(--color-gray));
}

/* base.css の .container と同じ計算式(コンテンツ幅+padding-inline*2)。 */
.tech-technology__inner {
    max-width: calc(var(--container-width) + var(--container-padding) * 2);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.technology-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px 26px;
    margin-top: 64px;
}

.technology-item {
    position: relative;
    aspect-ratio: 316 / 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
    background-size: cover;
    background-position: center;
    text-align: center;
    color: var(--color-white);
    box-shadow: 0 4px 6px rgba(26, 26, 26, 0.25);
}

.technology-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(8, 48, 140, 0.5);
    z-index: 0;
}

/* Figma: タイトルは上半分の下端に、説明文は下半分の上端に寄せ、
   間を1本の横線で区切る(単純に上下スタックではない)。 */
.technology-item__title-wrap,
.technology-item__desc-wrap {
    position: relative;
    z-index: 1;
    flex: 1 0 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.technology-item__title-wrap {
    align-items: flex-end;
}

.technology-item__desc-wrap {
    align-items: flex-start;
}

.technology-item__title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

.technology-item__line {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 64px;
    height: 2px;
    background: var(--color-lightblue);
}

.technology-item__desc {
    font-size: 15px;
    line-height: 1.75;
}

/* ---------- Factories (shares markup with company-access) ---------- */
.tech-factories {
    position: relative;
    background: var(--color-gray);
}

.tech-factories .container {
    padding-block: 120px;
}

.tech-factories .company-access-list {
    display: flex;
    flex-direction: column;
    gap: 48px;
    margin-top: 64px;
}

/* company.css is not enqueued on this template (each page loads its own CSS
   bundle - see inc/enqueue.php), so the shared .company-access-item pattern
   is duplicated here rather than shared. Keep in sync with company.css. */
.tech-factories .company-access-item {
    display: flex;
    flex-wrap: wrap;
}

.tech-factories .company-access-item__image {
    flex: 1 1 400px;
    max-width: 640px;
    aspect-ratio: 2 / 1;
    border-bottom: 8px solid var(--color-blue);
    overflow: hidden;
}

.tech-factories .company-access-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tech-factories .company-access-item__info {
    flex: 2 1 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--spacing-md);
}

.tech-factories .company-access-item__title {
    font-weight: 700;
    font-size: 20px;
    padding: 8px 24px;
    border-bottom: 1px solid var(--color-blue);
}

.tech-factories .company-access-item__detail {
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tech-factories .company-access-item__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-blue);
    text-decoration: underline;
    font-size: 14px;
}

.tech-factories .company-access-item__link-icon {
    width: 14px;
    height: 14px;
    background: url("../images/icon-external-link-blue.svg") center / contain no-repeat;
}

/* ---------- SP (デザイン指定なし。既存パターン踏襲でよしなに調整) ---------- */
@media (max-width: 600px) {

    .tech-process {
        padding-top: 80px;
    }

    .tech-process__inner {
        padding-inline: 16px;
        gap: 32px;
    }

    .tech-process-intro {
        gap: 24px;
    }

    .tech-process-intro__badge {
        min-height: auto;
        max-width: none;
        padding: 32px 16px;
        text-align: center;
    }


    .tech-process-intro__label {
        font-size: 16px;
    }

    .tech-process-intro__text {
        padding: 0 8px;
        text-align: center;
    }

    .tech-process-intro__text p:not(.tech-process-intro__catch) {
        font-size: 14px;
    }

    .tech-process-picture {
        aspect-ratio: 4 / 3;
    }

    .tech-process-picture__badge {
        font-size: 12px;
        width: fit-content;
        height: auto;
        padding: 4px 16px;
    }

    .tech-flow {
        padding: 64px 0 80px;
    }

    .tech-flow-list {
        margin-top: 48px;
        padding: 0 8px;
    }

    .tech-flow-item {
        gap: 0;
    }

    .tech-flow-item__image {
        max-width: none;
    }

    .tech-flow-item__body {
        padding: 16px;
        gap: 12px;
    }

    .tech-flow-item__step {
        padding-right: 12px;
        border-width: 3px;
    }

    .tech-flow-item__step strong {
        font-size: 28px;
    }

    .tech-flow-item__text {
        gap: 8px;
    }

    .tech-flow-item__title {
        font-size: 16px;
    }

    .tech-flow-item__desc {
        font-size: 14px;
    }

    .tech-technology {
        padding-top: 80px;
        padding-bottom: 0;
    }

    .tech-technology__inner {
        padding-inline: 16px;
    }

    /* スマホでは3枚をただ縦積みにするのではなく、カードの幅と位置を
       左寄せ→中央→右寄せと少しずつ変えて配置し、左上から右下へ
       視線が流れるようなメリハリをつける。文字の組み方自体はPCと同じ
       縦積み(タイトル→線→説明文)を維持する。 */
    .technology-list {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-top: 40px;
    }

    .technology-item {
        aspect-ratio: 4 / 3;
        gap: var(--spacing-sm);
        padding: var(--spacing-md);
        width: 84%;
    }

    .technology-item:nth-child(1) {
        align-self: flex-start;
    }

    .technology-item:nth-child(2) {
        align-self: center;
        width: 92%;
    }

    .technology-item:nth-child(3) {
        align-self: flex-end;
    }

    .technology-item__title {
        font-size: 15px;
    }

    .technology-item__line {
        width: 48px;
    }

    .technology-item__desc {
        font-size: 13px;
    }

    .tech-factories .container {
        padding-block: 80px;
    }

    .tech-factories .company-access-list {
        margin-top: 48px;
    }

    .tech-factories .company-access-item__title {
        font-size: 18px;
        padding: 8px 16px;
    }

    .tech-factories .company-access-item__detail {
        padding: 0 16px;
    }
}