/* カラーシミュレーション専用CSS - 神山テーマ統一版 */

/* サイト全体のブランドカラー */
:root {
    --kamiyama-navy: #101080;
    --kamiyama-orange: #f98b3c;
    --kamiyama-light-blue: #2345a9;
    --kamiyama-gray: #506478;
    --kamiyama-light-gray: #f8f9fa;
    --kamiyama-white: #ffffff;
}

/* 強制的にスタイルを適用するため、特異性を最大化 */
html body.page-template-page-color-simulation,
html body[class*="page-template-page-color-simulation"],
html body.page-template-page-color-simulation *,
html body[class*="page-template-page-color-simulation"] * {
    box-sizing: border-box !important;
}

html body.page-template-page-color-simulation,
html body[class*="page-template-page-color-simulation"] {
    background-color: var(--kamiyama-light-gray) !important;
    color: #333 !important;
    line-height: 1.6 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* デバッグ用バッジを削除（スマホ表示改善のため）*/

/* 共通コンテナ */
html body .cs-container {
    width: 100% !important;
    max-width: 1080px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

/* レスポンシブ改行 */
.cs-br-mobile {
    display: none;
}

/* 文字改行の最適化 */
.cs-text-balance {
    text-wrap: balance;
}

.cs-text-pretty {
    text-wrap: pretty;
}

/* 長いテキストの改行制御 */
.cs-long-text {
    /* word-break: keep-all;
    overflow-wrap: break-word; */
}

/* 見出しの改行制御 */
.cs-heading-wrap {
    /* word-break: keep-all; */
}

/* ===== ヒーローセクション ===== */
html body .cs-hero {
    background: linear-gradient(135deg, var(--kamiyama-navy) 0%, #1a1a9a 100%) !important;
    color: var(--kamiyama-white) !important;
    padding: 80px 0 !important;
    text-align: center !important;
    position: relative !important;
    overflow: hidden !important;
}

html body .cs-hero::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>') !important;
    opacity: 0.3 !important;
}

html body .cs-hero-title {
    font-size: 2.4rem !important;
    font-weight: 700 !important;
    color: var(--kamiyama-white) !important;
    margin-bottom: 1.5rem !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
    position: relative !important;
    z-index: 1 !important;
    /* word-break: keep-all !important;
    text-wrap: balance !important; */
}

html body .cs-hero-text {
    font-size: 1.1rem !important;
    color: rgba(255,255,255,0.9) !important;
    max-width: 1080px !important;
    margin: 0 auto !important;
    position: relative !important;
    z-index: 1 !important;
    text-align: center;
}

/* ===== セクション共通スタイル ===== */
.cs-simulator-section {
    padding: 80px 0;
    background: var(--kamiyama-white);
}

.cs-benefits-section {
    padding: 80px 0;
    background: var(--kamiyama-light-gray);
}

.cs-flow-section {
    padding: 80px 0;
    background: var(--kamiyama-white);
}

.cs-cta-section {
    padding: 100px 0;
    background: var(--kamiyama-navy);
    color: var(--kamiyama-white);
    text-align: center;
}

/* ===== セクションタイトル ===== */
.cs-section-title {
    font-size: 2.1rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--kamiyama-navy);
    position: relative;
    /* word-break: keep-all;
    text-wrap: balance; */
}

.cs-section-title::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    background: #2345a9;
    margin: 1rem auto 0;
    border-radius: 2px;
}

.cs-section-text {
    text-align: center;
    color: var(--kamiyama-gray);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    /* word-break: keep-all;
    text-wrap: pretty; */
}

/* ハイライト */
.cs-highlight {
    color: var(--kamiyama-orange);
    font-weight: 700;
}

/* ===== シミュレーター ===== */
.cs-simulator {
    position: relative;
    max-width: 1080px;
    margin: 0 auto;
    background: var(--kamiyama-white);
    border-radius: 20px;
    padding: 30px;
}

/* Swiper.js スタイル */
.cs-swiper {
    position: relative;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
}

.cs-swiper .swiper-wrapper {
    display: flex;
}

.cs-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.cs-swiper .swiper-slide img {
    width: calc(100% - 60px); /* 左右のボタン幅分（30px×2）を差し引いて画像を縮小 */
    height: auto;
    object-fit: contain;
    border-radius: 13px;
    display: block;
    max-width: calc(100% - 60px);
    margin: 0 auto; /* 中央配置 */
}

/* ===== Swiper ナビゲーションボタン ===== */
.cs-swiper .swiper-button-next,
.cs-swiper .swiper-button-prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--kamiyama-navy);
    color: white;
    border: 3px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.cs-swiper .swiper-button-next:after,
.cs-swiper .swiper-button-prev:after {
    display: none; /* Swiperのデフォルトアイコンを非表示 */
}

.cs-swiper .swiper-button-next:hover,
.cs-swiper .swiper-button-prev:hover {
    background: var(--kamiyama-orange);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-50%) scale(1.05);
}

.cs-swiper .swiper-button-prev {
    left: 10px;
}

.cs-swiper .swiper-button-next {
    right: 10px;
}

.cs-swiper .swiper-button-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== キャプション ===== */
.cs-caption {
    text-align: center;
    padding: 1.5rem;
}

.cs-caption h3 {
    font-size: 1.2rem;
    line-height: 1.5;
    font-weight: 600;
    color: var(--kamiyama-navy);
    margin: 0;
}

/* ===== ベネフィットセクション ===== */
.cs-benefits-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1080px;
    margin: 0 auto;
}

.cs-benefit-item {
    background: var(--kamiyama-white);
    padding: 2rem;
    border-radius: 20px;
    border-left: 6px solid var(--kamiyama-light-blue);
    border-top: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    min-height: auto;
}

.cs-benefit-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    width: 80px;
    border-radius: 20px;
    background: var(--kamiyama-light-blue);
    color: white;
    font-size: 1.8rem;
    margin-bottom: 0;
    flex-shrink: 0;
    position: relative;
}

.cs-benefit-icon::after {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 23px;
    border: 2px solid rgba(100, 179, 239, 0.3);
}

.cs-benefit-content {
    flex: 1;
}

.cs-benefit-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--kamiyama-navy);
    margin-bottom: 0.8rem;
    margin-top: 0;
}

.cs-benefit-text {
    color: var(--kamiyama-gray);
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
}

/* ===== フローセクション ===== */
.cs-flow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    text-align: center;
    max-width: 1080px;
    margin: 0 auto;
}

.cs-flow-item {
    background: var(--kamiyama-white);
    padding: 2.5rem 1.5rem;
    border-radius: 15px;
    position: relative;
    border: 2px solid #f0f0f0;
}

.cs-flow-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: #2345a9;
    border-radius: 0 0 4px 4px;
}

.cs-flow-icon {
    font-size: 3rem;
    color: #2345a9;
    margin-bottom: 1.5rem;
}

.cs-flow-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--kamiyama-navy);
    margin-bottom: 1rem;
}

.cs-flow-text {
    color: var(--kamiyama-gray);
    margin: 0;
    font-size: 1rem;
}

/* ===== CTAセクション ===== */
.cs-cta-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--kamiyama-white);
    margin-bottom: 1.5rem;
}

.cs-cta-text {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 3rem;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.cs-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--kamiyama-orange);
    color: var(--kamiyama-white) !important;
    font-weight: 700;
    padding: 1.2rem 3rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 3px solid rgba(255,255,255,0.3);
}

.cs-cta-button:hover {
    background: #e66b2c;
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.02);
    color: var(--kamiyama-white);
    text-decoration: none;
}

.cs-cta-button i {
    margin-right: 0.8rem;
    font-size: 1.2rem;
}

/* ===== ローディング表示 ===== */
.cs-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--kamiyama-gray);
}

.cs-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid var(--kamiyama-light-blue);
    border-radius: 50%;
    animation: cs-spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes cs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cs-loading p {
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

/* ===== レスポンシブデザイン ===== */
@media screen and (max-width: 960px) {
    .cs-br-mobile {
        display: block;
    }
    
    html body .cs-container {
        padding: 0 15px !important;
    }
    
    html body .cs-hero-title {
        font-size: 1.9rem !important;
    }
    
    .cs-section-title {
        font-size: 1.6rem;
        margin-bottom: 2rem;
        line-height: 1.3;
    }
    
    .cs-simulator {
        padding: 20px;
        margin: 0 15px;
    }
    
    .cs-swiper .swiper-button-next,
    .cs-swiper .swiper-button-prev {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .cs-swiper .swiper-button-prev {
        left: 5px;
    }
    
    .cs-swiper .swiper-button-next {
        right: 5px;
    }
    
    .cs-swiper .swiper-slide img {
        width: calc(100% - 50px); /* タブレット：左右のボタン幅分（25px×2）を差し引く */
        max-width: calc(100% - 50px);
    }
    
    .cs-benefits-grid {
        gap: 1.2rem;
    }
    
    .cs-flow-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cs-cta-title {
        font-size: 1.7rem;
    }
    
    .cs-cta-text {
        font-size: 1rem;
    }
    
    .cs-cta-button {
        font-size: 1rem;
        padding: 1rem 2.5rem;
    }
    
    .cs-section-text {
        font-size: 1rem;
    }
    
    .cs-benefit-title {
        font-size: 1.1rem;
    }
    
    .cs-benefit-text {
        font-size: 0.95rem;
    }
    
    .cs-flow-title {
        font-size: 1rem;
    }
    
    .cs-flow-text {
        font-size: 0.95rem;
    }
    
    .cs-flow-icon {
        font-size: 2.5rem;
    }
}

@media screen and (max-width: 600px) {
    html body .cs-container {
        padding: 0 15px !important;
    }
    
    html body .cs-hero {
        padding: 50px 0 !important;
    }
    
    html body .cs-hero-title {
        font-size: 1.9rem !important;
        line-height: 1.3 !important;
    }
    
    html body .cs-hero-text {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
    
    .cs-simulator-section,
    .cs-benefits-section,
    .cs-flow-section {
        padding: 50px 0;
    }
    
    .cs-cta-section {
        padding: 70px 0;
    }
    
    .cs-simulator {
        padding: 10px;
        margin: 0 5px;
        border-radius: 15px;
    }
    
    .cs-swiper {
        border-radius: 10px;
    }
    
    .cs-swiper .swiper-button-next,
    .cs-swiper .swiper-button-prev {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .cs-swiper .swiper-button-prev {
        left: 0px;
    }
    
    .cs-swiper .swiper-button-next {
        right: 0px;
    }
    
    .cs-swiper .swiper-slide img {
        width: calc(100% - 40px); /* スマホ：左右のボタン幅分（20px×2）を差し引く */
        max-width: calc(100% - 40px);
    }
    
         .cs-benefit-item {
         flex-direction: column;
         gap: 1.2rem;
         padding: 1.5rem;
         text-align: center;
         border-left: none;
     }
     
     .cs-flow-item {
         padding: 1.5rem;
     }
     
     .cs-benefit-icon {
         width: 70px;
         height: 70px;
         font-size: 1.6rem;
         margin: 0 auto;
     }
     
     .cs-benefit-icon::after {
         border-radius: 20px;
     }
    
    .cs-flow-icon {
        font-size: 3rem;
    }
    
    .cs-cta-title {
        font-size: 1.6rem;
        line-height: 1.4;
    }
    
    .cs-cta-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .cs-cta-button {
        font-size: 1rem;
        padding: 0.9rem 2rem;
    }
    
    .cs-section-title {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }
    
    .cs-section-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .cs-benefit-title {
        font-size: 1rem;
    }
    
    .cs-benefit-text {
        font-size: 0.9rem;
    }
    
    .cs-flow-title {
        font-size: 1rem;
    }
    
    .cs-flow-text {
        font-size: 0.9rem;
    }

    .cs-caption {
        padding: 1rem 0;
    }
    
    .cs-caption h3 {
        font-size: 1rem;
    }

    .cs-flow-item:before {
        display: none;
    }
}

/* より小さなスマートフォン用（480px以下） */
@media screen and (max-width: 480px) {
    html body .cs-hero-title {
        font-size: 1.6rem !important;
        margin-bottom: 1.2rem !important;
    }
    
    html body .cs-hero-text {
        font-size: 0.95rem !important;
    }
    
    .cs-section-title {
        text-align: center;
        font-size: 1.3rem;
        margin-bottom: 1.2rem;
    }
    
    .cs-section-text {
        text-align: left;
        font-size: 0.9rem;
    }
    
    .cs-cta-title {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }
    
    .cs-cta-text {
         font-size: 0.95rem;
    }
    
    .cs-cta-button {
        font-size: 0.95rem;
        padding: 0.8rem 1.8rem;
    }
    
    .cs-simulator {
        padding: 10px;
    }
    
    .cs-swiper .swiper-button-next,
    .cs-swiper .swiper-button-prev {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .cs-swiper .swiper-button-prev {
        left: 4px;
    }

    .cs-swiper .swiper-button-next {
        right: 4px;
    }
    
    .cs-swiper .swiper-slide img {
        width: calc(100% - 35px); /* 小さいスマホ：左右のボタン幅分を差し引く */
        max-width: calc(100% - 35px);
    }
}