.service {
    min-height: 960px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
}

/* ▼ ここから追加：代替画像クラス */
.service-bg-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    width: auto;
    height: auto;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: -2; /* 動画より下に配置する想定 */
}
/* ▲ ここまで追加 */

.service-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.service-background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.service-js-logo {
    position: absolute;
    top: 110px;
    left: 0;
    z-index: 3;
}

.service-container {
    width: 100%;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 0; /* shapesのz-index: 1より大きい値を設定 */
}

.content-wrapper {
    display: flex;
    gap: 124px;
    justify-content: space-around;
    max-width: 1260px;
    margin: auto;
    position: relative;
    z-index: 2; /* shapesのz-index: 1より大きい値を設定 */
}

.service-content {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 210px;
}

.title-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.service-title {
    color: #787878;
    font-family: "BIZ UDGothic";
    font-size: 36px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    letter-spacing: 9px;
    margin: 0;
}

.service-subtitle {
    color: #787878;
    font-family: "BIZ UDGothic";
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    letter-spacing: 3px;
    margin: 0;
}

.service-concept {
    margin-top: 40px;
    display: flex;
    align-items: flex-start;
    gap: 27px;
}

.grid-line {
    display: flex;
    flex-direction: column;
    width: 3px;
    height: 126px;
}

.blue-line {
    width: 3px;
    height: 63px;
    background: #2CA7DC;
}

.red-line {
    width: 3px;
    height: 63px;
    background: #E60012;
}

.concept-primary {
    color: #2CA7DC;
    font-family: "BIZ UDGothic";
    font-size: 24px;
    font-style: normal;
    font-weight: 700;
    line-height: 42px;
    letter-spacing: 9.6px;
    margin: 0;
}

.concept-secondary {
    color: #E60012;
    font-family: "BIZ UDGothic";
    font-size: 24px;
    font-style: normal;
    font-weight: 700;
    line-height: 42px;
    letter-spacing: 9.6px;
    margin: 0;
}

.service-description {
    color: #787878;
    font-family: "BIZ UDGothic";
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: 36px;
    letter-spacing: 4px;
    margin: 30px 0 0 0;
}

.service-items {
    margin-top: 210px;
    display: flex;
    flex-direction: column;
    gap: 60px;
    margin-bottom: 210px;
}

.service-item {
    display: flex;
    flex-direction: column;
}

.service-heading {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    color: #787878;
    font-family: "BIZ UDGothic";
    font-size: 28px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    letter-spacing: 7px;
}

.square {
    color: #D90214;
    font-family: "BIZ UDGothic";
    font-size: 28px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    letter-spacing: 7px;
}

.service-labels {
    display: grid;
    grid-template-columns: repeat(2, 399px);
    gap: 30px 32px;
    margin-top: 40px;
}

.service-labels.three-items {
    display: grid;
    grid-template-columns: repeat(2, 399px);
    grid-template-rows: auto auto;
    gap: 30px 32px;
}

.service-labels.three-items .service-label:last-child {
    grid-column: 1 / 2;
    grid-row: 2;
}

.service-label {
    display: flex;
    width: 399px;
    height: 80px;
    padding: 18px 30px;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    color: #FFF;
    text-align: center;
    font-family: "BIZ UDGothic";
    font-size: 20px;
    font-style: normal;
    line-height: 27px;
    letter-spacing: 3.5px;
}

/* 2行テキスト用の調整 */
.service-label br + * {
    margin-top: -4px; /* 2行テキストの行間を少し詰める */
}

.service-label.red {
    background: #D8394D;
}

.service-label.blue {
    background: #28A7E1;
}

.concept-secondary br {
    display: none;
}

@media screen and (min-width: 1005px) {
    .concept-secondary br {
        display: block;
    }
}

/* 1920px以下での段階的な調整 */
@media screen and (max-width: 1919px) {
    .service-js-logo {
        display: none;
    }

    .content-wrapper {
        padding-left: calc(325px * 0.8);
        gap: calc(124px * 0.8);
    }

    .service-label {
        width: calc(399px * 0.9);
    }

    .service-labels {
        grid-template-columns: repeat(2, calc(399px * 0.9));
    }

    .service-labels.three-items {
        grid-template-columns: repeat(2, calc(399px * 0.9));
    }
}

/* 1600px以下での更なる調整 */
@media screen and (max-width: 1600px) {
    .content-wrapper {
        padding-left: 0;
         gap: calc(124px* 2.0);
		
    }

    .service-label {
        width: calc(399px * 0.8);
    }

    .service-labels {
        grid-template-columns: repeat(2, calc(399px * 0.8));
    }

    .service-labels.three-items {
        grid-template-columns: repeat(2, calc(399px * 0.8));
    }
}

/* 1300px以下での更なる調整 */
@media screen and (max-width: 1300px) {
    .content-wrapper {
        padding-left: calc(1000px * 0.15);
        gap: calc(124px * 0.05);
    }

    .service-label {
        width: calc(399px * 0.7);
        font-size: 18px;
    }

    .service-labels {
        grid-template-columns: repeat(2, calc(399px * 0.7));
        gap: 20px 24px;
    }

    .service-labels.three-items {
        grid-template-columns: repeat(2, calc(399px * 0.7));
        gap: 20px 24px;
    }
}

@media screen and (max-width: 1100px) {

    .grid-line {
        display: flex;
        flex-direction: column;
        width: 3px;
        height: 90px;
    }
    .service {
        min-height: 800px;
    }

    .content-wrapper {
        padding-left: calc(325px * 0.1);
        padding-bottom:80px;
        gap: calc(124px * 0.1);
        margin: 0 auto;
    }

    .service-content {
        margin-top: 120px;
        flex: 0 0 290px;
    }

    .service-title {
        font-size: 32px;
        letter-spacing: 8px;
    }

    .service-subtitle {
        font-size: 11px;
    }

    .service-concept {
        gap: 20px;
    }

    .concept-primary, .concept-secondary {
        font-size: 22px;
        line-height: 38px;
        letter-spacing: 8px;
    }

    .service-description {
        font-size: 14px;
        line-height: 32px;
    }

    .service-items {
        margin-top: 120px;
        margin-bottom: 120px;
        gap: 50px;
    }

    .service-heading {
        font-size: 24px;
        letter-spacing: 6px;
    }

    .square {
        font-size: 24px;
    }

    .service-label {
        width: calc(399px * 0.75);
        height: 70px;
        font-size: 16px;
    }

    .service-labels {
        grid-template-columns: repeat(2, calc(399px * 0.75));
        gap: 20px 20px;
    }

    .service-labels.three-items {
        grid-template-columns: repeat(2, calc(399px * 0.75));
        gap: 20px 20px;
    }
}

@media screen and (max-width: 1004px) {

    .service-description {
        white-space: normal;
        padding-right: 140px;
    }
    
    .service-description br {
        display: none;
    }
    
    .concept-text {
        display: flex;
        flex-direction: column;
        gap: 8px;  /* テキスト間の適切な間隔を確保 */
    }
    .service {
        min-height: auto;
    }

    .service-container {
        padding-top: 40px;
    }

    .content-wrapper {
        flex-direction: column;
        gap: 60px;
        padding-left: 84px;
        padding-right: 20px;
        margin-bottom:56px;
    }

    .service-content {
        margin-top: 80px;
        flex: none;
    }

    /* タイトルグループの調整 */
    .service-title {
        font-size: 28px;
        letter-spacing: 7px;
    }

    .service-subtitle {
        font-size: 11px;
        letter-spacing: 2.5px;
    }

    /* コンセプト部分の調整 */
    .service-concept {
        margin-top: 30px;
    }

    .concept-primary,
    .concept-secondary {
        font-size: 20px;
        line-height: 36px;
        letter-spacing: 8px;
    }

    /* サービスアイテム部分の調整 */
    .service-items {
        margin-top: 0;
        margin-bottom: 80px;
        gap: 40px;
    }

    .service-heading {
        font-size: 20px;
        letter-spacing: 5px;
    }

    .square {
        font-size: 20px;
    }

    /* サービスラベルのグリッドレイアウト調整 */
    .service-labels,
    .service-labels.three-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        margin-top: 0px;
        margin-right:20px;
        margin-top:20px;
    }

    .service-label {
        width: 90%;
        height: 56px;
        font-size: 14px;
        padding: 15px 20px;
        letter-spacing: 2.5px;
        border-radius:10px;
    }

    /* JSロゴの非表示 */
    .service-js-logo {
        display: none;
    }
}

@media screen and (max-width: 545px) {
    .concept-text {
        gap: 0px;
    }
    .concept-secondary br {
        display: block;
    }
    .service {
        min-height: auto;
        overflow-x: hidden;
    }

    .service-container {
        padding-top: 24px;
    }

    .content-wrapper {
        padding: 0 0px 0 46px;
        gap: 40px;
        margin-bottom: 40px;
        width: 100%;
    }

    .service-content {
        margin-top: 40px;
        width: 100%;
        align-items: stretch;
    }

    /* タイトル */
    .service-title {
        font-size: 20px;
        font-weight: 700;
        letter-spacing: 5px;
    }

    .service-subtitle {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 2.5px;
    }

    /* コンセプト */
    .service-concept {
        margin-top: 24px;
        gap: 27px;
    }

    .grid-line {
        height: 96px;
    }

    .blue-line,
    .red-line {
        height: 48px;
    }

    .concept-primary,
    .concept-secondary {
        font-size: 16px;
        line-height: 32px;
        letter-spacing: 6.4px;
    }

    .service-description {
        font-size: 10px;
        line-height: 23px;
        letter-spacing: 2px;
        margin-top: 24px;
        width: calc(100% - 20px);
        max-width: none;
        padding-right: 15px;
    }

    .service-items {
        margin: 0;
        gap: 32px;
    }

    .service-heading {
        font-size: 14px;
        letter-spacing: 3.22px;
    }

    .square {
        font-size: 14px;
        letter-spacing: 3.22px;
        color: #D90214;
    }

    /*
     * ------------------------------------------
     * 横スクロール + 2行表示ベース設定
     * ------------------------------------------
     */
    .service-labels,
    .service-labels.three-items {
        display: grid;
        /* 横方向に伸ばしつつ2行(2段) */
        grid-auto-flow: column;
        grid-template-rows: repeat(2, auto);
        gap: 12px;
        padding: 20px 0;
        margin-right: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
    }

    .service-labels::-webkit-scrollbar,
    .service-labels.three-items::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .service-label {
        width: 280px;
        min-width: 280px;
        height: 58px;
        font-size: 12px;
        letter-spacing: 2px;
        padding: 12px 16px;
        margin: 0;
        border-radius: 8px;
        scroll-snap-align: start;
		line-height: 16px;
    }

    /*
     * odd/even で1行目/2行目を振り分け
     * ただし three-items だけは後述で上書き
     */
    .service-labels .service-label:nth-child(odd) {
        grid-row: 1;
    }
    .service-labels .service-label:nth-child(even) {
        grid-row: 2;
    }

    /*
     * ------------------------------------------
     * 「three-items」用のレイアウト上書き
     * 事業戦略全般に関する課題に対して、ラベルを任意配置
     * ------------------------------------------
     */
    .service-labels.three-items {
        /* 2列 × 2行を確保 (実際には3つのラベル) */
        grid-template-columns: repeat(2, 280px);
        grid-template-rows: repeat(2, auto);
    }

    /* nth-child(1)～(3)に一旦autoを指定してから、再配置 */
    .service-labels.three-items .service-label:nth-child(1),
    .service-labels.three-items .service-label:nth-child(2),
    .service-labels.three-items .service-label:nth-child(3) {
        grid-row: auto;
        grid-column: auto;
    }

    /* 3番目 (製品企画提案) を左上 (row1, col1) */
    .service-labels.three-items .service-label:nth-child(3) {
        grid-row: 2;
        grid-column: 1;
    }

    /* 2番目 (マーケティングリサーチ) を左下 (row2, col1) */
    .service-labels.three-items .service-label:nth-child(2) {
        grid-row: 1;
        grid-column: 2;
    }

    /* 1番目 (マーケティングコンサルティング) を右上 (row1, col2) */
    .service-labels.three-items .service-label:nth-child(1) {
        grid-row: 1;
        grid-column: 1;
    }

    /*
     * タイトルや説明文等の細かい調整
     */
    .title-group {
        gap: 12px;
    }

    .service-description br {
        display: none;
    }

    /* スクロールスナップの有効化 */
    .service-labels,
    .service-labels.three-items {
        scroll-snap-type: x mandatory;
    }
}

/* Service section card redesign */
.service {
    min-height: 900px;
    overflow: hidden;
}

.service .content-wrapper {
    width: min(1180px, calc(100% - 80px));
    max-width: 1180px;
    justify-content: space-between;
    align-items: flex-start;
    gap: 74px;
    padding: 0;
}

.service-content {
    flex: 0 0 260px;
    margin-top: 92px;
}

.service .title-group {
    gap: 10px;
}

.service-title {
    display: none;
}

.service-subtitle {
    position: relative;
    color: #e60012;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 2px;
}

.service-subtitle::after {
    content: "";
    display: inline-block;
    width: 22px;
    height: 1px;
    margin-left: 8px;
    vertical-align: middle;
    background: #e60012;
}

.service-concept {
    margin-top: 30px;
    gap: 0;
}

.service-concept .grid-line {
    display: none;
}

.concept-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.concept-primary,
.concept-secondary {
    color: #081b3a;
    font-size: 36px;
    line-height: 1.48;
    letter-spacing: 2px;
}

.concept-secondary {
    color: #081b3a;
}

.concept-secondary::first-line {
    color: #e60012;
}

.service-description {
    max-width: 260px;
    color: #0b1b34;
    font-size: 14px;
    line-height: 2;
    letter-spacing: 1px;
    margin-top: 28px;
}

.service-items {
    flex: 1;
    width: 100%;
    margin-top: 72px;
    margin-bottom: 98px;
    gap: 48px;
}

.service-item {
    position: relative;
}

.service-heading {
    position: relative;
    gap: 10px;
    color: #18243a;
    font-size: 17px;
    line-height: 1.4;
    letter-spacing: 3px;
    padding-right: 12px;
}

.service-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    min-width: 80px;
    background: rgba(139, 153, 174, 0.22);
}

.service-heading .square {
    color: #e60012;
    font-size: 15px;
    letter-spacing: 0;
}

.service-labels,
.service-labels.three-items {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 24px 28px;
    margin-top: 22px;
}

.service-labels.three-items .service-label:last-child {
    grid-column: auto;
    grid-row: auto;
}

.service-label {
    position: relative;
    display: grid;
    grid-template-columns: 74px 1fr 22px;
    column-gap: 18px;
    width: auto;
    min-height: 112px;
    height: auto;
    padding: 18px 24px 18px 18px;
    align-items: center;
    justify-content: stretch;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 40px rgba(18, 42, 76, 0.09);
    color: #0b1b34;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 48px rgba(18, 42, 76, 0.14);
}

.service-label.red,
.service-label.blue {
    background: rgba(255, 255, 255, 0.9);
}

.service-card-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(230, 0, 18, 0.1);
    color: #e60012;
}

.service-label.blue .service-card-icon {
    background: rgba(0, 106, 255, 0.1);
    color: #006aff;
}

.service-card-icon svg {
    width: 32px;
    height: 32px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.service-card-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.service-card-title {
    color: #e60012;
    font-family: "BIZ UDGothic";
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 1px;
}

.service-label.blue .service-card-title {
    color: #006aff;
}

.service-card-description {
    color: #0b1b34;
    font-family: "BIZ UDGothic";
    font-size: 12px;
    font-weight: 700;
    line-height: 1.65;
    letter-spacing: 0.5px;
}

.service-card-arrow {
    color: #e60012;
    font-size: 23px;
    font-weight: 700;
    line-height: 1;
}

.service-label.blue .service-card-arrow {
    color: #006aff;
}

@media screen and (max-width: 1300px) {
    .service .content-wrapper {
        width: min(1080px, calc(100% - 56px));
        gap: 42px;
    }

    .service-content {
        flex-basis: 240px;
    }

    .concept-primary,
    .concept-secondary {
        font-size: 31px;
    }

    .service-label {
        grid-template-columns: 60px 1fr 18px;
        min-height: 104px;
        padding: 16px 20px 16px 16px;
    }

    .service-card-icon {
        width: 54px;
        height: 54px;
    }
}

@media screen and (max-width: 1004px) {
    .service .content-wrapper {
        width: min(760px, calc(100% - 40px));
        flex-direction: column;
        gap: 44px;
        padding: 0;
        margin: 0 auto 64px;
    }

    .service-content {
        width: 100%;
        margin-top: 64px;
        flex: none;
    }

    .service-description {
        max-width: 560px;
        padding-right: 0;
    }

    .service-items {
        margin: 0;
        gap: 40px;
    }

    .service-labels,
    .service-labels.three-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        margin: 18px 0 0;
    }

    .service-label {
        width: auto;
        min-height: 116px;
        border-radius: 18px;
    }
}

@media screen and (max-width: 545px) {
    .service .content-wrapper {
        width: calc(100% - 32px);
        gap: 34px;
        margin-bottom: 48px;
    }

    .service-content {
        margin-top: 42px;
        align-items: flex-start;
    }

    .service-title {
        font-size: 16px;
        letter-spacing: 4px;
    }

    .service-subtitle {
        font-size: 11px;
    }

    .concept-primary,
    .concept-secondary {
        font-size: 28px;
        line-height: 1.55;
        letter-spacing: 1px;
    }

    .service-description {
        width: 100%;
        font-size: 13px;
        line-height: 1.9;
        letter-spacing: 0.5px;
        padding-right: 0;
    }

    .service-heading {
        align-items: flex-start;
        font-size: 15px;
        letter-spacing: 1.5px;
    }

    .service-heading::after {
        min-width: 40px;
        margin-top: 10px;
    }

    .service-labels,
    .service-labels.three-items {
        display: grid;
        grid-auto-flow: row;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 14px;
        padding: 0;
        overflow: visible;
        scroll-snap-type: none;
    }

    .service-labels .service-label:nth-child(odd),
    .service-labels .service-label:nth-child(even),
    .service-labels.three-items .service-label:nth-child(1),
    .service-labels.three-items .service-label:nth-child(2),
    .service-labels.three-items .service-label:nth-child(3) {
        grid-row: auto;
        grid-column: auto;
    }

    .service-label {
        grid-template-columns: 50px 1fr 18px;
        width: auto;
        min-width: 0;
        min-height: 96px;
        padding: 14px;
        border-radius: 16px;
    }

    .service-card-icon {
        width: 46px;
        height: 46px;
    }

    .service-card-icon::before {
        width: 20px;
        height: 20px;
        border-width: 2px;
    }

    .service-card-icon::after {
        width: 8px;
        height: 8px;
        border-width: 2px;
    }

    .service-card-title {
        font-size: 15px;
        letter-spacing: 0.5px;
    }

    .service-card-description {
        font-size: 11px;
        line-height: 1.55;
        letter-spacing: 0;
    }
}

.service-card-icon::before,
.service-card-icon::after {
    content: none;
}
