/*
Theme Name: new-ksdk
Author: Koji Haraguchi
Description: シンプルなグレー系コーポレートサイト
Version: 1.0
*/

/* === 基本設定 === */
:root {
    --text-color: #333;
    --bg-color: #fff;
    --gray-light: #f4f4f4;
    --gray-dark: #333;
    --accent: #666;
    --font-base: 'Noto Sans JP', sans-serif;
}

body { margin: 0; padding: 0; font-family: var(--font-base); color: var(--text-color); line-height: 1.8; }
a { text-decoration: none; color: inherit; transition: opacity 0.3s; }
a:hover { opacity: 0.7; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; padding: 0; margin: 0; }
h1, h2, h3 { margin: 0; }

/* === レイアウト共通 === */
.l-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.l-section { padding: 80px 0; }
.u-center { text-align: center; margin-top: 40px; }
.bg-gray { background-color: var(--gray-light); }
.bg-dark { background-color: var(--gray-dark); }
.text-white { color: #fff; }

/* === コンポーネント === */
.c-title { text-align: center; font-size: 2.5rem; margin-bottom: 60px; letter-spacing: 0.1em; font-weight: 700; }
.c-btn { display: inline-block; padding: 15px 40px; border: 1px solid var(--text-color); background: #fff; color: var(--text-color); font-weight: bold; letter-spacing: 0.05em; transition: all 0.3s; }
.c-btn:hover { background: var(--text-color); color: #fff; }
.c-btn--white { background: transparent; border-color: #fff; color: #fff; }
.c-btn--white:hover { background: #fff; color: var(--text-color); }

/* === ヘッダー === */
.l-header { position: fixed; width: 100%; top: 0; left: 0; z-index: 100; background: rgba(255,255,255,0.95); box-shadow: 0 1px 5px rgba(0,0,0,0.05); }
.l-header__inner { display: flex; justify-content: space-between; align-items: center; padding: 15px 40px; }
.l-header__logo { font-size: 1.2rem; font-weight: bold; color: var(--gray-dark); }
.l-header__nav ul { display: flex; gap: 30px; align-items: center; }
.btn-contact { background: var(--gray-dark); color: #fff; padding: 10px 20px; font-size: 0.9rem; }

/* === メインビジュアル (Swiper) === */
.p-hero { width: 100%; height: 100vh; position: relative; overflow: hidden; }
.swiper { width: 100%; height: 100%; }
.swiper-slide { position: relative; }
.swiper-slide::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3); }
.swiper-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.p-hero__copy { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 10; color: #fff; text-align: center; width: 90%; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.p-hero__copy h2 { font-size: 3rem; margin-bottom: 20px; letter-spacing: 0.05em; }
.p-hero__copy p { font-size: 1.2rem; }
.swiper-pagination-bullet { background: #fff; opacity: 0.5; }
.swiper-pagination-bullet-active { background: #fff; opacity: 1; }
.swiper-button-next, .swiper-button-prev { color: #fff; }

/* === Service === */
.p-service__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; }
.p-service__card { text-align: center; padding: 40px 20px; border: 1px solid #eee; transition: box-shadow 0.3s; background: #fff; }
.p-service__card:hover { box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.p-service__card h3 { font-size: 1.2rem; margin-bottom: 5px; }
.p-service__card p { color: var(--accent); font-size: 0.9rem; margin-bottom: 20px; }
.p-service__card .detail { text-align: left; font-size: 0.95rem; line-height: 1.6; }

/* === Works === */
.p-works__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.p-works__item { background: #fff; transition: transform 0.3s; cursor: pointer; }
.p-works__item:hover { transform: translateY(-5px); }
.p-works__item figure { margin: 0; overflow: hidden; }
.p-works__item figure img { width: 100%; aspect-ratio: 3/2; object-fit: cover; transition: transform 0.5s; }
.p-works__item:hover figure img { transform: scale(1.05); }
.p-works__item .text { padding: 20px; }
.p-works__item h3 { font-size: 1.1rem; margin-bottom: 10px; }
.p-works__item p { font-size: 0.8rem; color: var(--accent); }

/* === Voice === */
.p-voice__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 40px; }
.p-voice__item { background: var(--gray-light); padding: 30px; border-radius: 4px; }
.p-voice__item .head { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.p-voice__item .head img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; background: #ddd; }
.p-voice__item h4 { font-size: 1rem; margin: 0; }
.p-voice__item span { font-size: 0.8rem; color: var(--accent); }

/* === Contact === */
.p-contact__desc { text-align: center; margin-bottom: 40px; }
.c-form-wrapper { max-width: 600px; margin: 0 auto; }
.c-form-wrapper input, .c-form-wrapper textarea { width: 100%; padding: 15px; margin-bottom: 20px; border: none; box-sizing: border-box; }
.c-form-wrapper button { width: 100%; cursor: pointer; }

/* === Footer === */
.l-footer { background: #000; color: #666; text-align: center; padding: 20px; font-size: 0.8rem; }

/* === Animations === */
.fade-in { opacity: 0; transition: opacity 1s ease-out; }
.fade-in-up { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.is-visible { opacity: 1; transform: translateY(0); }

/* === Responsive === */
@media (max-width: 768px) {
    .l-header { padding: 0; }
    .l-header__inner { padding: 15px 20px; }
    .l-header__nav { display: none; }
    .l-header__hamburger { display: block; width: 30px; height: 20px; background: #ddd; }
    .c-title { font-size: 1.8rem; }
    .p-hero__copy h2 { font-size: 2rem; }
    .p-voice__grid { grid-template-columns: 1fr; }
}

/* === 詳細ページ (Single) === */
.p-single { padding-top: 120px; /* ヘッダー被り防止 */ }

/* ヘッダー周り */
.p-single__header { margin-bottom: 40px; text-align: center; }
.p-single__meta { display: flex; gap: 20px; justify-content: center; align-items: center; margin-bottom: 15px; color: var(--accent); font-size: 0.9rem; }
.cat-label { background: var(--gray-dark); color: #fff; padding: 4px 12px; font-size: 0.8rem; letter-spacing: 0.05em; }
.p-single__title { font-size: 2rem; font-weight: bold; line-height: 1.4; }

/* アイキャッチ */
.p-single__thumb { margin-bottom: 60px; }
.p-single__thumb img { width: 100%; height: auto; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

/* 本文エリア（WordPressのエディタで書いた内容へのスタイル） */
.p-single__body { max-width: 900px; margin: 0 auto 80px; font-size: 1rem; line-height: 2; }
.p-single__body h2 { font-size: 1.5rem; border-bottom: 2px solid var(--gray-light); padding-bottom: 10px; margin: 40px 0 20px; }
.p-single__body h3 { font-size: 1.2rem; margin: 30px 0 15px; border-left: 4px solid var(--gray-dark); padding-left: 15px; }
.p-single__body p { margin-bottom: 30px; }
.p-single__body img { margin: 30px auto; box-shadow: 0 5px 10px rgba(0,0,0,0.05); }

/* ページネーション */
.p-single__nav { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #eee; padding-top: 40px; margin-bottom: 40px; }
.p-single__nav a { font-weight: bold; font-size: 0.9rem; }
.p-single__nav .nav-home .c-btn { font-size: 0.8rem; padding: 10px 30px; }

/* プロジェクト詳細情報のテーブル（エディタ内で作成するテーブル用） */
.wp-block-table { margin: 40px 0; font-size: 0.9rem; }
.wp-block-table td, .wp-block-table th { border: 1px solid #ddd; padding: 15px; }
.wp-block-table th { background: var(--gray-light); text-align: left; width: 30%; font-weight: bold; }

/* スマホ対応 */
@media (max-width: 768px) {
    .p-single__title { font-size: 1.5rem; }
    .p-single__nav { flex-direction: column; gap: 20px; text-align: center; }
    .nav-prev, .nav-next { width: 100%; }
}

/* === アーカイブページ (Archive) === */
.p-archive { padding-top: 120px; min-height: 80vh; }
.p-archive__header { margin-bottom: 60px; }
.p-archive__header .c-title { margin-bottom: 10px; }

/* グリッドレイアウト */
.p-archive__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px; margin-bottom: 80px; }

/* カードデザイン */
.p-archive__item { transition: transform 0.3s, opacity 0.3s; }
.p-archive__item:hover { transform: translateY(-5px); opacity: 0.9; }
.p-archive__thumb img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border: 1px solid #eee; }

.p-archive__content { padding: 20px 0; }
.p-archive__content .meta { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; font-size: 0.8rem; color: var(--accent); }
.p-archive__content .cat-label { background: var(--gray-dark); color: #fff; padding: 2px 10px; font-size: 0.7rem; }
.p-archive__content .title { font-size: 1.1rem; font-weight: bold; line-height: 1.4; }

/* ページネーション装飾 */
.p-pagination { text-align: center; display: flex; justify-content: center; }
.p-pagination .nav-links { display: flex; gap: 10px; flex-wrap: wrap; }
.p-pagination a, .p-pagination .current {
    display: inline-block; padding: 10px 15px; border: 1px solid #ddd; text-decoration: none; color: var(--text-color); font-size: 0.9rem; transition: 0.3s;
}
.p-pagination a:hover, .p-pagination .current { background: var(--gray-dark); color: #fff; border-color: var(--gray-dark); }

/* === トップへ戻るボタン (Page Top) === */
.c-pagetop {
    position: fixed;
    right: 30px;
    bottom: 50px;
    width: 50px;
    height: 50px;
    background: #333; /* メインカラー */
    border-radius: 50%; /* 丸くする */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;           /* 最初は隠す */
    pointer-events: none; /* 隠れている時はクリック不可に */
    transition: opacity 0.3s, transform 0.3s;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 表示用のクラスがついた時の状態 */
.c-pagetop.is-show {
    opacity: 1;
    pointer-events: auto;
}

.c-pagetop:hover {
    background: #555; /* ホバー時は少し明るく */
    transform: translateY(-5px);
}

/* 白い矢印を作る */
.c-pagetop .arrow {
    width: 10px;
    height: 10px;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    transform: rotate(45deg);
    margin-top: 5px; /* 真ん中に見えるように微調整 */
}

/* スマホでは少し小さく・邪魔にならない位置へ */
@media (max-width: 768px) {
    .c-pagetop {
        width: 40px;
        height: 40px;
        right: 15px;
        bottom: 15px;
    }
    .c-pagetop .arrow {
        width: 8px;
        height: 8px;
    }
}

/* ====================================
   スマホ用ハンバーガーメニュー
   ==================================== */

/* --- 1. ハンバーガーボタンの装飾 --- */
.l-header__hamburger {
    display: none; /* PCでは非表示 */
    position: relative;
    width: 30px;
    height: 24px;
    cursor: pointer;
    z-index: 200; /* メニューより手前に表示 */
}

.l-header__hamburger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #333; /* 線の色 */
    transition: all 0.4s;
    border-radius: 2px;
}

/* 3本線の位置 */
.l-header__hamburger span:nth-of-type(1) { top: 0; }
.l-header__hamburger span:nth-of-type(2) { top: 11px; }
.l-header__hamburger span:nth-of-type(3) { bottom: 0; }

/* --- 2. クリックされて「is-active」がついた時の動き（×印になる） --- */
.l-header__hamburger.is-active span:nth-of-type(1) {
    transform: translateY(11px) rotate(45deg);
}
.l-header__hamburger.is-active span:nth-of-type(2) {
    opacity: 0; /* 真ん中の線は消す */
}
.l-header__hamburger.is-active span:nth-of-type(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* --- 3. スマホ時のメニュー表示エリア --- */
@media (max-width: 768px) {
    /* ハンバーガーボタンを表示 */
    .l-header__hamburger {
        display: block;
    }

    /* ナビゲーションを初期状態で隠す */
    .l-header__nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh; /* 画面いっぱい */
        background: rgba(255, 255, 255, 0.98); /* 背景色（少し透過） */
        z-index: 150;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s, visibility 0.4s;
        
        /* 中身を中央揃えにする設定 */
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    /* 「is-active」がついたら表示する */
    .l-header__nav.is-active {
        opacity: 1;
        visibility: visible;
    }

    /* メニューリストのレイアウト調整 */
    .l-header__nav ul {
        flex-direction: column; /* 縦並び */
        gap: 30px;
        display: block; /* フレックス解除 */
    }

    .l-header__nav li {
        margin-bottom: 30px;
    }

    .l-header__nav a {
        font-size: 1.2rem;
        font-weight: bold;
        display: block;
    }
}

/* ============================================
   Google自動広告のヘッダー割り込み防止
   ============================================ */

/* ヘッダー内(.l-header)に .google-auto-placed が入ってきたら消す */
.l-header .google-auto-placed {
    display: none !important;
}

/* スマホメニュー内(.l-header__nav)に入ってきた場合も消す */
.l-header__nav .google-auto-placed {
    display: none !important;
}

/* ====================================
   会社概要・プロフィール (Company)
   ==================================== */
.p-company {
    padding-top: 120px;
    padding-bottom: 80px;
}

.p-company__subtitle {
    margin-bottom: 60px;
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.p-company__inner {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    /* ↓ 少し影をつけることで、背景に埋もれず「紙」のように浮き立たせます */
    /* 不要なら削除してもOKです */
    /* box-shadow: 0 10px 30px rgba(0,0,0,0.03); */
    /* padding: 40px; */ /* box-shadowを使う場合はコメントアウトを外す */
}

/* --- シンプルなテーブルデザイン --- */
.c-table-clean {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.c-table-clean th,
.c-table-clean td {
    padding: 25px 15px; /* 上下の余白をたっぷり取る */
    border-bottom: 1px solid #e0e0e0; /* 薄いグレーの線 */
    text-align: left;
    vertical-align: top; /* 文字を上揃えにする */
}

/* 最後の線は消す */
.c-table-clean tr:last-child th,
.c-table-clean tr:last-child td {
    border-bottom: none;
}

/* 見出し項目 (左側) */
.c-table-clean th {
    width: 25%; /* 幅を固定 */
    color: #888; /* グレーにして主張を抑える */
    font-weight: normal; /* 太字にしない */
    white-space: nowrap; /* 折り返さない */
}

/* 内容 (右側) */
.c-table-clean td {
    width: 75%;
    color: #333;
    line-height: 1.8;
}

/* サービス内容のリスト */
.p-company__services {
    list-style: none;
    padding: 0;
    margin: 0;
}
.p-company__services li {
    margin-bottom: 5px;
    padding-left: 15px;
    position: relative;
}
.p-company__services li::before {
    /* 小さな点を表示 */
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
}

/* 注釈など */
.u-note {
    font-size: 0.8rem;
    color: #999;
    display: block;
    margin-top: 5px;
}

/* リンクテキスト */
.text-link {
    color: #333;
    text-decoration: underline;
    transition: opacity 0.3s;
}
.text-link:hover {
    opacity: 0.6;
    text-decoration: none;
}

/* --- スマホ対応 (縦積みに変更) --- */
@media (max-width: 768px) {
    .p-company__inner {
        padding: 0;
        box-shadow: none;
    }
    
    .c-table-clean th,
    .c-table-clean td {
        display: block; /* ブロック要素にして縦積みに */
        width: 100%;
        padding: 10px 0; /* 上下の余白を少し詰める */
        border: none; /* 一旦枠線を消す */
    }

    .c-table-clean th {
        padding-top: 20px;
        font-size: 0.8rem;
        color: var(--accent);
    }
    
    .c-table-clean td {
        padding-bottom: 20px;
        border-bottom: 1px solid #eee; /* コンテンツの下にだけ線を引く */
    }
}