/*
Theme Name: Wizard Theme
Theme URI: https://example.com
Description: Innovation Wizard オリジナルテーマ
Author: Your Name
Author URI: https://example.com
Version: 1.0.0
Text Domain: wizard-theme
*/

/* ====================================
   基本設定
==================================== */
:root {
    --font-main: 'Noto Sans JP', sans-serif;
    --color-black: #333;
    --color-border: #e0e0e0;
    --color-white: #fff;
    --color-accent: #000;
    --site-width: 1280px;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: #f5f5f5;
    padding-top: 80px;
    /* グローバルナビゲーション非表示のため130px→80pxに変更 */
}

.inner-container {
    max-width: var(--site-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ====================================
   ヘッダー全体
==================================== */
.site-header {
    background-color: var(--color-white);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
}

/* --- 上段エリア --- */
.header-top-wrapper {
    width: 100%;
    padding: 20px 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo img {
    height: auto;
    max-height: 40px;
    /* PC表示時の高さ */
    width: auto;
    display: block;
}

.header-cta {
    background-color: var(--color-accent);
    color: var(--color-white);
    padding: 10px 30px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 2px;
    transition: opacity 0.3s;
}

.header-cta:hover {
    opacity: 0.8;
}

/* --- 下段エリア(ナビゲーション) --- */
.header-bottom {
    background-color: var(--color-white);
}

.global-nav ul {
    display: flex;
    justify-content: space-between;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.global-nav li {
    position: relative;
    flex: 1;
    text-align: center;
}

/* 区切り線 */
.global-nav li::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background-color: #ddd;
}

.global-nav li:last-child::after {
    display: none;
}

.global-nav a {
    display: block;
    padding: 15px 0;
    color: var(--color-black);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: color 0.3s;
}

.global-nav a:hover {
    color: #888;
}

/* カレントメニューの強調 */
.global-nav li.current a {
    font-weight: 700;
    border-bottom: 2px solid #333;
    padding-bottom: 13px;
    /* ボーダー分だけpaddingを減らして高さを保つ */
}

/* ====================================
   スマホ版レスポンシブ (768px以下)
==================================== */
.hamburger {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .header-top-wrapper {
        padding: 15px 0;
    }

    .header-logo img {
        max-height: 30px;
        /* スマホではロゴを少し小さく */
    }

    .header-cta {
        display: none;
    }

    .hamburger {
        display: block;
        cursor: pointer;
        width: 25px;
        height: 20px;
        position: relative;
        z-index: 1100;
    }

    .hamburger span {
        display: block;
        width: 100%;
        height: 1px;
        background-color: #000;
        position: absolute;
        transition: all 0.4s;
    }

    .hamburger span:nth-child(1) {
        top: 0;
    }

    .hamburger span:nth-child(2) {
        top: 9px;
    }

    .hamburger span:nth-child(3) {
        bottom: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* スマホメニュー */
    .header-bottom {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: #fff;
        transition: right 0.4s ease;
        display: flex;
        flex-direction: column;
        justify-content: center;
        z-index: 1000;
    }

    .header-bottom.active {
        right: 0;
    }

    .global-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0;
        width: 80%;
    }

    .global-nav li {
        width: 100%;
        flex: none;
        border-bottom: 1px solid #f0f0f0;
    }

    .global-nav li::after,
    .global-nav li::before {
        display: none;
    }

    .global-nav li:first-child {
        border-top: 1px solid #f0f0f0;
    }

    .global-nav a {
        padding: 20px;
        font-size: 15px;
    }

    .sp-cta-container {
        margin-top: 40px;
        text-align: center;
    }

    .sp-cta-btn {
        background: #000;
        color: #fff !important;
        padding: 12px 50px;
        text-decoration: none;
        font-size: 14px;
        border-radius: 2px;
        display: inline-block;
    }
}

/* ====================================
   ポートフォリオアーカイブページ
==================================== */
.portfolio-archive {
    background-color: #f5f5f5;
    padding: 60px 0;
}

/* ====================================
   ポートフォリオコンテナ(2カラム)
==================================== */
.portfolio-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* ====================================
   左サイドバー(カテゴリー) - 約1/3
==================================== */
.portfolio-sidebar {
    flex: 0 0 280px;
    padding: 0;
    position: sticky;
    top: 100px;
    /* 固定ヘッダーとの位置調整 */
    height: calc(100vh - 120px);
    /* 画面の高さいっぱいまで確保 */
    overflow: hidden;
    /* はみ出し分は非表示 */
    display: flex;
    flex-direction: column;
}

.sidebar-image {
    width: 100%;
    margin: 0 0 20px 0;
    /* マージンを削減 */
    overflow: hidden;
    border-radius: 4px;
    flex-shrink: 0;
    /* 縮小しない */
}

.sidebar-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    /* マージンを削除して幅いっぱいに */
    color: var(--color-black);
    padding: 20px 20px 15px 20px;
    /* 内部余白で調整 */
    border-bottom: 1px solid #eee;
    /* ボーダーを細く */
    background: #fff;
    border-radius: 4px 4px 0 0;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    /* わずかに影をつけて前面感を出す */
}

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    /* コンテナ自体のパディングは削除 */
    background: #fff;
    border-radius: 0 0 4px 4px;

    /* フレックスボックスで残りの高さを埋める */
    flex-grow: 1;
    overflow-y: auto;
    /* 縦スクロールのみ有効化 */
    min-height: 0;
    /* 重要：フレックス内のスクロールに必要 */

    /* スクロールバーの見た目を少し良くする */
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.category-list::-webkit-scrollbar {
    width: 6px;
}

.category-list::-webkit-scrollbar-track {
    background: transparent;
}

.category-list::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 6px;
}

.category-list li {
    border-bottom: 1px solid #f0f0f0;
    margin: 0 20px;
    /* リストアイテム側で左右余白を確保 */
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5px;
    /* タップしやすいように広げる */
    color: var(--color-black);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.3s, background-color 0.3s;
    border-radius: 2px;
}

.category-list a:hover {
    background-color: #f8f8f8;
    color: #000;
}

.category-list li.current a {
    background-color: var(--color-black);
    color: #fff;
    font-weight: 700;
}

.category-list .count {
    font-size: 12px;
    color: #999;
}

.category-list li.current .count {
    color: #ccc;
}

/* ====================================
   右コンテンツエリア(カード) - 約2/3
==================================== */
.portfolio-content {
    flex: 1;
}

.portfolio-title {
    text-align: center;
    font-size: 32px;
    margin: 0 0 40px 0;
    color: var(--color-black);
    font-weight: 700;
}

/* ====================================
   カードリスト
==================================== */
.pf-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.pf-list li {
    background: var(--color-white);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: auto;
    display: flex;
    flex-direction: column;
}

.pf-list li:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.pf-list a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* ====================================
   サムネイル部分
==================================== */
.pf-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 204 / 494;
    overflow: hidden;
    background-color: #f0f0f0;
    flex-shrink: 0;
}

.pf-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.pf-list li:hover .pf-thumb img {
    transform: scale(1.05);
}

/* ====================================
   テキスト情報部分
==================================== */
.pf-data {
    padding: 12px 15px 15px 15px;
    /* height: 96px; 固定高さを削除 */
    min-height: 96px;
    height: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.pf-company {
    margin: 0 0 4px 0;
    font-size: 10px;
    color: #999;
    font-weight: 400;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pf-company span {
    display: inline;
}

.pf-name {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-black);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.pf-name span {
    display: inline;
}

.pf-cat {
    margin: 0;
    font-size: 9px;
    color: #666;
    font-weight: 400;
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.pf-cat span {
    display: inline-block;
    padding: 2px 6px;
    background-color: #f5f5f5;
    border-radius: 2px;
    white-space: nowrap;
}

.pf-cat:empty {
    display: none;
}

/* ====================================
   ページネーション
==================================== */
.portfolio-pagination {
    margin-top: 50px;
    text-align: center;
}

.portfolio-pagination .page-numbers {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.portfolio-pagination .page-numbers li {
    margin: 0;
}

.portfolio-pagination .page-numbers a,
.portfolio-pagination .page-numbers span {
    display: inline-block;
    padding: 10px 16px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    color: var(--color-black);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.portfolio-pagination .page-numbers a:hover {
    background-color: #f8f8f8;
    border-color: #ccc;
}

.portfolio-pagination .page-numbers .current {
    background-color: var(--color-black);
    color: #fff;
    border-color: var(--color-black);
}

.portfolio-pagination .page-numbers .dots {
    background: transparent;
    border: none;
    padding: 10px 8px;
}

/* ポートフォリオがない場合 */
.no-portfolio {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #666;
    background: #fff;
    border-radius: 4px;
}

/* ====================================
   レスポンシブ対応
==================================== */
@media (max-width: 900px) {
    .pf-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .portfolio-archive {
        padding: 40px 0;
    }

    .portfolio-container {
        flex-direction: column;
        gap: 30px;
    }

    .portfolio-sidebar {
        display: none;
    }

    .portfolio-title {
        font-size: 26px;
        margin-bottom: 30px;
    }

    .pf-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .pf-list li {
        height: auto;
    }

    .pf-data {
        padding: 12px 15px;
        height: auto;
        min-height: 80px;
    }

    .pf-company {
        font-size: 10px;
    }

    .pf-name {
        font-size: 13px;
    }

    .pf-cat {
        font-size: 9px;
    }

    .portfolio-pagination .page-numbers a,
    .portfolio-pagination .page-numbers span {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .pf-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .sidebar-title {
        font-size: 16px;
    }
}

/* ====================================
   スマホ用カテゴリアコーディオン
==================================== */
.sp-category-accordion {
    display: none;
    margin-bottom: 30px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sp-cat-toggle {
    width: 100%;
    text-align: left;
    background: #fff;
    border: none;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-black);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.sp-cat-toggle:hover {
    background-color: #f9f9f9;
}

.sp-cat-toggle .selected-cat {
    margin-left: 10px;
    font-weight: 400;
    font-size: 13px;
    color: #666;
    flex-grow: 1;
}

.sp-cat-toggle .toggle-icon {
    position: relative;
    width: 12px;
    height: 12px;
    display: block;
}

.sp-cat-toggle .toggle-icon::before,
.sp-cat-toggle .toggle-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: #333;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

/* プラスアイコンに見えるように横棒と縦棒 */
.sp-cat-toggle .toggle-icon::before {
    width: 12px;
    height: 2px;
}

.sp-cat-toggle .toggle-icon::after {
    width: 2px;
    height: 12px;
}

/* 開いた状態（マイナスにする） */
.sp-cat-toggle.active .toggle-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    /* 90度回転して横棒と重なるようにする */
}

/* さらに背景色を変える */
.sp-cat-toggle.active {
    background-color: #f0f0f0;
}



.sp-cat-list {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
}

.sp-cat-list.is-open {
    display: grid;
}

.sp-cat-list li {
    width: auto;
    margin: 0;
    list-style: none;
    display: flex;
}

.sp-cat-list a {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 8px;
    background-color: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    color: var(--color-black);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.sp-cat-list li.current a {
    background-color: #333;
    color: #fff;
    font-weight: 700;
    border-color: #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.sp-cat-list .count {
    margin-left: 6px;
    font-size: 11px;
    background: #f1f1f1;
    padding: 2px 8px;
    border-radius: 99px;
    color: #777;
    white-space: nowrap;
}

.sp-cat-list li.current .count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

@media (max-width: 768px) {
    .sp-category-accordion {
        display: block !important;
    }
}


/* ====================================
   紙飛行機お問い合わせボタン
==================================== */
.paper-plane-btn {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 24px;
    background-color: #1a1a1a;
    color: white !important;
    /* aタグの色指定を上書き */
    border: none;
    border-radius: 100px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s;
    overflow: visible;
    /* 飛行機が枠外に出るため */
    outline: none;
    line-height: 1.5;
}

.paper-plane-btn:hover {
    background-color: #333;
    opacity: 1 !important;
    /* 既存のhover opacityを打ち消し */
}

/* メインのアイコン（静止状態用） */
.paper-plane-btn .icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    transition: opacity 0.2s;
    line-height: 0;
}

.paper-plane-btn .icon-wrapper svg {
    fill: currentColor;
    width: 20px;
    height: 20px;
}

/* ホバー中はメインアイコンを隠す（アニメーションで戻すため） */
.paper-plane-btn.active .icon-wrapper {
    opacity: 0;
    transition: opacity 0s;
}

/* 再装填アニメーション */
.paper-plane-btn .icon-wrapper.reloading {
    animation: reload-from-bottom 0.2s cubic-bezier(0.2, 0, 0.2, 1) forwards;
    opacity: 1;
}

@keyframes reload-from-bottom {
    0% {
        transform: translate(-30px, 30px);
        opacity: 0;
    }

    100% {
        transform: translate(0, 0);
        opacity: 1;
    }
}

/* --- X/Y分離放物線アニメーション --- */

/* 外側の要素: X軸移動（等速 Linear） */
.flying-plane-x {
    position: absolute;
    left: 24px;
    top: 50%;
    margin-top: -10px;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 10;
    /* X軸: 右へ等速で飛ぶ */
    animation: fly-x 1.2s linear forwards;
}

/* 内側の要素: Y軸移動（放物線を描く上下動） */
.plane-inner-y {
    display: block;
    width: 100%;
    height: 100%;
    /* Y軸: 上昇して落下する物理挙動 */
    animation: fly-y-physics 1.2s forwards;
}

.plane-inner-y svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* X軸のリニア移動 */
@keyframes fly-x {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translateX(350px);
        opacity: 0;
    }
}

/* Y軸の重力移動（放物線） */
@keyframes fly-y-physics {
    0% {
        transform: translateY(0) rotate(0deg);
        animation-timing-function: cubic-bezier(0.1, 0.45, 0.1, 1);
    }

    50% {
        transform: translateY(-70px) rotate(-10deg);
        animation-timing-function: cubic-bezier(0.9, 0, 0.9, 0.55);
    }

    100% {
        transform: translateY(60px) rotate(30deg);
    }
}

/* ====================================
   スマホ版レスポンシブ (紙飛行機ボタン)
==================================== */
@media (max-width: 768px) {
    .paper-plane-btn {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 2000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        width: auto;
        padding: 12px 30px;
        /* 少し大きくしてタップしやすく */
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .paper-plane-btn.is-scroll-hidden {
        opacity: 0;
        pointer-events: none;
    }

    /* ヘッダー内のレイアウト調整 */
    .header-top {
        position: static;
        /* fixedの基準にならないように */
    }
}