/* ========================================
   事業内容ページ統合CSS
   ======================================== */

/* ページ全体のoverflow制御 */
html, body {
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
}

/* モバイルでmainの白背景を透明に（パララクス背景表示のため） */
@media (max-width: 767px) {
    main {
        background: transparent;
    }
}

/*
 * .nowrap-line / .intro-description-nowrap / .intro-description のスタイルは common.css で定義済み
 */

/* ================================================
   固定背景画像
   ================================================ */

/* Fixed Background - レスポンシブ対応 */
.fixed-bg-layer.business-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image: url('../img/mix_img.jpg');
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #002147;
  overflow: hidden;
  max-width: 100vw;
}

/* デスクトップのみfixed attachment + contain */
@media (min-width: 1024px) {
  .fixed-bg-layer.business-bg {
    background-attachment: fixed;
    background-size: contain;
  }
}

/* モバイル用背景画像 */
@media (max-width: 767px) {
  .fixed-bg-layer.business-bg {
    background-image: url('../img/mix_img_sp.jpg');
  }
}

.overlay-white {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(243, 255, 246, 0.45);
  background-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
}

/* モバイル用オーバーレイ強化 */
@media (max-width: 767px) {
  .overlay-white {
    background: rgba(243, 255, 246, 0.65);
  }
}

.bg-grid-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image: linear-gradient(to right, rgba(0, 168, 255, 0.05) 1px, transparent 1px), 
                    linear-gradient(to bottom, rgba(0, 168, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 2;
}



/*
 * .services-section / .services-container のスタイルは common.css で定義済み
 */

/* サービスリスト（縦積み） - 余白なし */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* タブレット以上 */
@media (min-width: 768px) {
    .services-list {
        gap: 0;
    }
}

/* デスクトップ */
@media (min-width: 1024px) {
    .services-list {
        gap: 0;
    }
}

/* ================================================
   サービスアイテムラッパー - 画面端まで背景を表示
   ================================================ */

.service-item-wrapper {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 5rem 0;
    isolation: isolate;
}

/* 背景画像レイヤー */
.service-item-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

/* 各サービスアイテムの背景画像 */
.service-item-wrapper:nth-child(1)::before {
    background-image: url('../img/business-service-1.jpg');
}

.service-item-wrapper:nth-child(2)::before {
    background-image: url('../img/business-service-2.jpg');
}

.service-item-wrapper:nth-child(3)::before {
    background-image: url('../img/business-service-3.jpg');
}

.service-item-wrapper:nth-child(4)::before {
    background-image: url('../img/business-service-4.jpg');
}

/* オーバーレイレイヤー - 奇数: 極薄の青 */
.service-item-wrapper:nth-child(odd)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 33, 71, 0.75);
    z-index: -1;
}

/* オーバーレイレイヤー - 偶数: 白 */
.service-item-wrapper:nth-child(even)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.88);
    z-index: -1;
}

/* タブレット以上 */
@media (min-width: 768px) {
    .service-item-wrapper {
        padding: 7rem 0;
    }
}

/* デスクトップ */
@media (min-width: 1024px) {
    .service-item-wrapper {
        padding: 10rem 0;
    }
}

/* ================================================
   サービスアイテム - 中央揃えコンテンツ
   ================================================ */

.service-item {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
}

/* タブレット以上 */
@media (min-width: 768px) {
    .service-item {
        padding: 0 1.5rem;
        flex-direction: row;
        align-items: flex-start;
        gap: 3rem;
    }
}

/* デスクトップ */
@media (min-width: 1024px) {
    .service-item {
        gap: 4rem;
    }
}

/* ================================================
   画像エリア - 2層スライドイン（元のカードサイズ）
   ================================================ */

.service-image-area {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    height: 150px;
    overflow: hidden;
    margin-bottom: 3rem;
}

/* タブレット以上 */
@media (min-width: 768px) {
    .service-image-area {
        width: 28%;
        height: 180px;
        margin-bottom: 0;
    }
}

/* デスクトップ */
@media (min-width: 1024px) {
    .service-image-area {
        width: 30%;
        height: 200px;
    }
}

/* fx_box スライドインエフェクト */
.fx_box {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 画像：初期状態は画面左端外に隠れている */
.fx_box img {
    position: relative;
    width: 70%;
    height: 100%;
    object-fit: cover;
    left: calc(-100% - 100vw);
    z-index: 10;
    will-change: left;
}

/* 疑似要素（カーテン）：初期状態 */
.fx_box::after {
    content: "";
    display: block;
    width: 70%;
    height: 100%;
    position: absolute;
    top: 50%;
    left: calc(-50% - 50vw);
    transform: translate(-50%, -50%);
    background-color: #002147;
    z-index: 1;
    will-change: left;
    transition: left 1s ease-in-out;
}

/* トリガー時：カーテンが中央へ（第1段階）*/
.fx_box.trigger::after {
    left: 50%;
}

/* トリガー時：画像がスライドイン（第2段階・0.5秒遅延）- 中央より左側に */
.fx_box.trigger img {
    left: -15%;
    transition: all 1.25s 0.5s ease-in-out;
}

/* タブレット以上 */
@media (min-width: 768px) {
    .fx_box.trigger img {
        left: -10%;
    }
}

/* デスクトップ */
@media (min-width: 1024px) {
    .fx_box.trigger img {
        left: -8%;
    }
}

/* 右からスライドインバージョン */
.fx_box.fx_rev img {
    left: auto;
    right: calc(-100% - 100vw);
}

.fx_box.fx_rev::after {
    left: auto;
    right: calc(-50% - 50vw);
    transform: translate(50%, -50%);
}

.fx_box.fx_rev.trigger::after {
    right: 50%;
}

/* トリガー時：画像がスライドイン（第2段階・0.5秒遅延）- 中央より右側に */
.fx_box.fx_rev.trigger img {
    right: -15%;
    transition: all 1.25s 0.5s ease-in-out;
}

/* タブレット以上 */
@media (min-width: 768px) {
    .fx_box.fx_rev.trigger img {
        right: -10%;
    }
}

/* デスクトップ */
@media (min-width: 1024px) {
    .fx_box.fx_rev.trigger img {
        right: -8%;
    }
}

/* ================================================
   テキストボックス - 画像に重ねて配置（はみ出すデザイン）
   ================================================ */

.service-title-box {
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    margin-top: -2rem;
}

/* タブレット以上 - 画像に重ねてはみ出す */
@media (min-width: 768px) {
    .service-title-box {
        padding: 2rem;
        position: absolute;
        bottom: -2rem;
        max-width: 400px;
        z-index: 20;
        margin-top: 0;
    }
    
    /* 左からスライドイン（left）は画像の右下に配置 */
    .service-title-box.left {
        right: 1rem;
        transform: translateY(30px);
    }
    
    /* 右からスライドイン（right）は画像の左下に配置 */
    .service-title-box.right {
        left: 1rem;
        transform: translateY(30px);
    }
    
    .service-title-box.fade-in-active {
        transform: translateY(0);
    }
}

/* デスクトップ */
@media (min-width: 1024px) {
    .service-title-box {
        padding: 2.5rem;
        bottom: -2.5rem;
        max-width: 450px;
    }
    
    .service-title-box.left {
        right: 2rem;
    }
    
    .service-title-box.right {
        left: 2rem;
    }
}

/* フェードインアニメーション発動 */
.service-title-box.fade-in-active {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1s;
}

.service-number {
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    font-weight: 300;
    color: #002147;
    line-height: 1;
    margin-bottom: 0.5rem;
}

/* タブレット以上 */
@media (min-width: 768px) {
    .service-number {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }
}

/* デスクトップ */
@media (min-width: 1024px) {
    .service-number {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
}

.service-title {
    font-family: 'Hannari', serif;
    font-size: 1.3rem;
    font-weight: bold;
    color: #002147;
    line-height: 1.4;
    margin: 0 0 1rem 0;
}

/* タブレット以上 */
@media (min-width: 768px) {
    .service-title {
        font-size: 1.5rem;
    }
}

/* デスクトップ */
@media (min-width: 1024px) {
    .service-title {
        font-size: 1.6rem;
    }
}

.service-description {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 1.5rem;
}

/* タブレット以上 */
@media (min-width: 768px) {
    .service-description {
        font-size: 1rem;
    }
}

/* 詳しく見るボタン */
.service-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #002147;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.service-detail-btn:hover {
    background-color: #003366;
    transform: translateX(4px);
}

.service-detail-btn i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.service-detail-btn:hover i {
    transform: translateX(4px);
}

/* ================================================
   事業一覧セクション
   ================================================ */

.business-list-section {
    position: relative;
    width: 100%;
    min-height: 600px;
    padding: 4rem 0;
    overflow: hidden;
    max-width: 100vw;
}

.business-list-bg-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.business-list-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.business-list-bg-image.active {
    opacity: 1;
}

.business-list-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 33, 71, 0.2);
    z-index: 2;
}

.business-list-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    z-index: 3;
}

.business-list-content {
    /* 共通スタイルを使用 */
}

/* ヘッダー部分(history-headerと同じスタイル) */
.business-list-header {
    text-align: center;
    margin-bottom: 4rem;
}

.business-list-header .subtitle {
    font-family: serif;
    color: #60A5FA;
    letter-spacing: 0.2em;
    font-size: 0.875rem;
    display: block;
}

.business-list-section .business-list-header h2 {
    font-family: 'Hannari', 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', 'Hiragino Mincho Pro', 'MS PMincho', serif !important;
    font-size: 2.25rem;
    font-weight: bold;
    margin-top: 0.5rem;
    color: #ffffff;
    background: none;
    padding: 0;
    margin-bottom: 0;
    position: static;
    text-align: center;
    box-shadow: none;
    line-height: 1.2;
}

.business-list-section .business-list-header h2:after,
.business-list-section .business-list-header h2:before {
    display: none;
    content: none;
}

.business-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.business-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.business-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.business-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #002147 0%, #003d82 100%);
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.business-card:hover .business-card-icon {
    transform: scale(1.1) rotate(5deg);
}

.business-card-title {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    color: #002147;
    margin-bottom: 0.75rem;
    font-weight: 700;
    /* main h3 の非対称パディングを上書き */
    padding: 0 !important;
    background: none !important;
    text-align: center;
}

.business-card-title::after {
    display: none !important;
}

.business-card-description {
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    color: #555555;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.business-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #ffffff;
    background: linear-gradient(135deg, #002147 0%, #003d82 100%);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 33, 71, 0.2);
}

.business-card-link:hover {
    background: linear-gradient(135deg, #003d82 0%, #002147 100%);
    box-shadow: 0 6px 20px rgba(0, 33, 71, 0.3);
    transform: translateY(-2px);
    gap: 0.75rem;
}

.business-card-link i {
    transition: transform 0.3s ease;
}

.business-card-link:hover i {
    transform: translateX(4px);
}

/* タブレット以上 */
@media (min-width: 768px) {
    .business-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .business-list-subtitle {
        margin-bottom: 4rem;
    }
}

/* デスクトップ */
@media (min-width: 1024px) {
    .business-cards-grid {
        gap: 3rem;
    }

    .business-card {
        padding: 2.5rem 2rem;
    }
}

/* モバイル用背景画像調整 */
@media (max-width: 767px) {
    .business-list-section {
        overflow-x: hidden;
    }

    .business-list-bg-image {
        background-size: cover;
        background-position: center center;
    }

    /* モバイル用縦長画像に切り替え */
    .business-list-bg-image.bg-01 {
        background-image: url('../img/business-itiran-01_sp.jpg') !important;
    }

    .business-list-bg-image.bg-02 {
        background-image: url('../img/business-itiran-02_sp.jpg') !important;
    }

    .business-list-bg-image.bg-03 {
        background-image: url('../img/business-itiran-03_sp.jpg') !important;
    }

    .business-list-bg-image.bg-05 {
        background-image: url('../img/business-itiran-05_sp.jpg') !important;
    }

    /* モバイル用カード背景透明度 */
    .business-card {
        background: rgba(255, 255, 255, 0.83);
    }
}

/* タブレット以上 */
@media (min-width: 768px) {
    .business-list-section {
        min-height: 700px;
        padding: 5rem 0;
    }
}

/* デスクトップ */
@media (min-width: 1024px) {
    .business-list-section {
        min-height: 800px;
        padding: 6rem 0;
    }

    .business-list-bg-image {
        background-attachment: fixed;
    }
}

/* ================================================
   CTAセクション
   ================================================ */

.cta-section {
    padding: 6rem 0;
    background-color: #002147;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-grid-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0.2;
    background-image: linear-gradient(to right, rgba(0, 168, 255, 0.05) 1px, transparent 1px), 
                      linear-gradient(to bottom, rgba(0, 168, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

.cta-container {
    width: 100%;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 10;
}

.cta-title {
    font-size: 1.875rem;
    font-family: 'Hannari', serif;
    font-weight: bold;
    color: white;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .cta-title {
        font-size: 2.25rem;
    }
}

.cta-description {
    color: #e6f0ff;
    margin-bottom: 2.5rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.8;
}

.cta-button-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    max-width: 42rem;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .cta-button-container {
        flex-direction: row;
    }
}

.cta-button {
    flex: 1 1 0%;
    padding: 1.5rem 2.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-decoration: none;
}

.cta-button-primary {
    background-color: #0056b3;
    color: white;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-button-primary:hover {
    background-color: white;
    color: #0056b3;
}

.cta-button-primary .cta-button-icon-chevron {
    opacity: 0;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-button-primary:hover .cta-button-icon-chevron {
    opacity: 1;
    transform: translateX(0.25rem);
}

.cta-button-secondary {
    background-color: #003366;
    color: white;
    font-family: 'Oswald', sans-serif;
    font-weight: bold;
    font-size: 1.25rem;
    transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-button-secondary:hover {
    background-color: #00a8ff;
}

.cta-button-icon {
    font-size: 1.25rem;
}

.cta-button-icon-sm {
    font-size: 0.875rem;
}

.cta-button-icon-chevron {
    font-size: 0.75rem;
}
