/* 基本設定 */
:root {
    --primary-color: #333;
    --secondary-color: #8B4513; /* ブラウン系 */
    --background-color: #f9f9f9;
    --white-color: #fff;
    --font-family: 'Helvetica Neue', Arial, 'Hirino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

html, body {
    overflow-x: hidden; /* ★★★ ページ全体の横スクロールを強制的に禁止 ★★★ */
    position: relative;
    width: 100%;
}

body {
    font: 300 100% / 1.5 "Noto Serif JP", serif;
    margin: 0;
    padding-top: 80px; /* 固定ヘッダーの高さ分 */
    color: var(--primary-color);
    background-color: var(--white-color);
}

*, *::before, *::after {
    box-sizing: border-box;
}

h1, h2, h3, p {
    margin: 0;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

section {
    padding: 60px 20px;
}

.section-subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 30px;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}


/* ヘッダー */
.header {
    background-color: var(--white-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
}

.header-logo img {
    height: 40px;
}

.header-nav ul {
    display: flex;
    align-items: center;
}

.header-nav li {
    margin-left: 30px;
}

.cta-button {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    transition: opacity 0.3s;
}

.cta-button:hover {
    opacity: 0.8;
}
.button-container {
    text-align: center;
    margin-top: 35px;
}


/* ハンバーガーメニュー */
.hamburger-menu {
    display: none; /* PCでは非表示 */
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1500;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}


/* ファーストビュー */
.firstview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: calc(100vh - 80px);
    padding: 0;
    background-image: url('../images/firstview.webp');
    background-size: cover;
    background-position: center;
    color: var(--white-color);
}

.firstview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.firstview-content {
    position: relative;
    z-index: 2;
    padding-left: 10%;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}

.firstview-content h1 {
    font-size: 2.8rem;
    line-height: 1.5;
}

.firstview-content p {
    margin: 20px 0;
}

.jcr-badge {
    position: absolute;
    bottom: 20px;
    right: -80px;
    width: 500px;
    z-index: 2;
}

/* CONCEPT */
.concept-body {
    display: flex;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.concept-body img {
    width: 70%;
    mask-image: linear-gradient(to right, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 40%, transparent 100%);
}

.concept-text {
    position: absolute;
    top: 50%;
    right: -125px;
    transform: translateY(-50%);
    width: 55%;
    padding: 20px;
    color: var(--primary-color);
}

.concept-text h3 {
    font-size: 2rem;
    line-height: 1.6;
    margin-bottom: 20px;
}


/* POINT */
.point-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.point-item h3 {
    font-size: 1.5rem;
    margin: 15px 0;
    color: var(--secondary-color);
}

/* Works ポップアップ */
.works-item {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    margin: 5px;
}

.works-item img {
    transition: transform 0.3s;
    display: block;
    width: 100%;
}

.works-item:hover img {
    transform: scale(1.1);
}

.works-item p {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(0,0,0,0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.9rem;
}

.modal-thumb-images {
    border-radius: 5px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}
.modal-thumb-images img{
    border-radius: 5px;
}


/* VIEW */
.view {
    max-width: 900px;
    margin: 0 auto;
}
.view-item {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 50px;
}
.view-item.reverse {
    flex-direction: row-reverse;
}
.view-image {
    flex: 1;
}
.view-text {
    flex: 1;
}
.view-text h3 {
    font-size: 1.4rem;
    line-height: 1.6;
    margin-bottom: 15px;
}


/* モーダル (ポップアップ共通) */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 40px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    margin-top: 200px;
    position: relative;
    border-radius: 10px;
    animation: slideIn 0.3s;
}

.modal-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: #000;
}

.modal-close-btn {
    display: block;
    margin: 20px auto 0;
    padding: 10px 40px;
    background: #555;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


/* お問い合わせフォーム */
.contact {
    background-color: var(--background-color);
}
.submit-button-wrapper {
    display: flex;
    justify-content: center;
}
.submit-button-wrapper a {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 15px 50px;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 5px;
    transition: opacity 0.3s;
    text-decoration: none;
}
.submit-button-wrapper a:hover {
    opacity: 0.8;
}

/* フッター */
.footer {
    background-color: var(--primary-color);
    color: #f0f0f0;
    padding: 40px 20px;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-info p {
    font-size: 0.9rem;
    line-height: 1.7;
}
.footer-logo {
    margin-bottom: 15px;
    width: 150px;
}
.copyright {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #444;
    font-size: 0.8rem;
    color: #aaa;
}


/* 固定LINEアイコン */
.line-fixed {
    position: fixed;
    right: 10px;
    bottom: 20px;
    width: 80px;
    z-index: 999;
}
.privacy-modal-content {
    margin-top: 4800px;
}


/* CONCEPTの文章スタイル */
.concept-text {
    overflow: hidden; /* はみ出した背景をこの要素の範囲で切り取る */
}

.concept-text .concept-description {
    background-color: transparent; /* 本体から背景色を削除 */
    color: #fff;
    padding: 20px;
    border-radius: 1px;
    position: relative; /* 疑似要素を配置するための基準点にする */
    z-index: 1; /* テキストが背景(疑似要素)より手前に来るようにする */
}

.concept-text .concept-description::before {
    content: ''; /* 疑似要素に必須の記述 */
    position: absolute; /* 親要素を基準に配置する */
    top: 0;
    left: 0;
    width: 200%; /* 幅を大きく取り、右側にはみ出させる */
    height: 100%;
    background-color: #524e4e; /* 背景色をこちらで指定 */
    z-index: -1; /* テキストの背面に配置する */
    border-radius: 1px;
}


/* ===================================
   レスポンシブ対応 (全体)
====================================== */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    .header {
        height: 60px;
    }
    .header-nav {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.95);
        transition: right 0.3s ease-in-out;
        flex-direction: column;
        justify-content: center;
    }
    .header-nav.active {
        display: flex;
        right: 0;
    }
    .header-nav ul {
        flex-direction: column;
    }
    .header-nav li {
        margin: 20px 0;
        margin-left: 0;
    }
    .hamburger-menu {
        display: block;
    }
    .hamburger-menu.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger-menu.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    h2 {
        font-size: 1.8rem;
    }
    
    .firstview {
        justify-content: center;
        text-align: center;
        height: 60vh;
    }
    .firstview-content {
        padding: 0 20px;
    }
    .firstview-content h1 {
        font-size: 1.5rem;
    }
    .jcr-badge {
        position: absolute;
        bottom: -16px;
        right: -10px;
        width: 100px;
        z-index: 2;
    }

    .concept-body {
        position: static;
        flex-direction: column;
    }
    .concept-body img {
        width: 100%;
        mask-image: none;
        -webkit-mask-image: none;
    }
    .concept-text {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 20px;
        padding: 0;
    }
    .concept-text h3 {
        font-size: 1.2rem;
    }

    .concept-text .concept-description {
        color: inherit;
        padding: 0;
    }
    .concept-text .concept-description::before {
        display: none;
    }

    .point-grid {
        grid-template-columns: 1fr;
    }

    .view-item, .view-item.reverse {
        flex-direction: column;
    }

    .modal-content {
        width: 90%;
        padding: 20px;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    .footer-line {
        margin-top: 20px;
    }
    .privacy-modal-content {
        margin-top: 7700px;
    }
    .submit-button-wrapper a {
        font-size: 15px;
    }
}


/* ===================================
   Works Section - 最終FIX
====================================== */

/* コンテナの基本設定（はみ出し防止のためoverflow: hiddenを追加） */
.works-slider {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    overflow: hidden; /* ★★★ PC表示ではみ出してしまう場合の最終手段 ★★★ */
}

/* PC表示用のグリッドレイアウト */
.works-grid-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px; /* ★★★ 間隔を20pxから15pxに狭めました ★★★ */
}

/* グリッド内のアイテムがはみ出さないようにする設定 */
.works-grid-layout .swiper-slide {
    min-width: 0;
}

/* PC表示の際、画像を小さくして中央に配置 */
.works-grid-layout .works-item {
    width: 80%; /* ★★★ 画像サイズを80%に小さくしました ★★★ */
    margin: 0 auto;
}

/* --- スマートフォン表示 (768px以下) --- */
/* スマートフォンではoverflow: hiddenを解除してスワイプ可能に */
@media (max-width: 768px) {
    .works-slider {
        overflow: visible;
    }
}

/* Swiperの矢印とページネーションの見た目を調整 */
.swiper-button-prev,
.swiper-button-next {
    color: var(--secondary-color);
}
.swiper-pagination-bullet-active {
    background: var(--secondary-color);
}

/* --- スマホ表示でサイト全体が横スクロールする問題の修正 --- */
@media (max-width: 768px) {
    section#works {
        overflow-x: hidden;
    }
}