/**
 * 株式会社イマジネックス メインスタイルシート
 */

/* ---------------------------------------------------- */
/* 1. 基本設定 / 共通コンポーネント
/* ---------------------------------------------------- */

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

html {
    scroll-behavior: smooth;
}

        /* --- PC: ナビゲーションのホバーアニメーション --- */
        .nav-link-custom {
            position: relative;
            color: #4B5563; /* gray-600 */
            transition: color 0.3s ease;
        }
        .nav-link-custom:hover {
            color: #1B3C73; /* primary */
        }
        /* 下線の装飾 */
        .nav-link-custom::after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: -4px;
            left: 0;
            background-color: #1B3C73;
            transition: width 0.3s ease;
        }
        .nav-link-custom:hover::after {
            width: 100%;
        }

        /* --- 矢印（Chevron） --- */
        .chevron {
            display: inline-block;
            width: 6px;
            height: 6px;
            margin-left: 4px;
            border-right: 2px solid currentColor;
            border-bottom: 2px solid currentColor;
            transform: translateY(-2px) rotate(45deg);
            transition: transform 0.3s ease;
        }
        .chevron.active {
            transform: translateY(1px) rotate(-135deg);
        }

        /* --- PC: ドロップダウン --- */
        @media (min-width: 768px) {
            .dropdown-menu {
                position: absolute;
                top: calc(100% + 10px);
                left: 50%;
                transform: translateX(-50%) translateY(10px);
                min-width: 10rem;
                background-color: white;
                box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
                border-radius: 0.375rem;
                z-index: 100;
                opacity: 0;
                visibility: hidden;
                transition: all 0.3s ease;
                border: 1px solid #f3f4f6;
            }
            .dropdown-menu.active {
                opacity: 1;
                visibility: visible;
                transform: translateX(-50%) translateY(0);
            }
            .dropdown-menu a {
                display: block;
                padding: 0.75rem 1rem;
                font-size: 0.875rem;
                color: #4B5563;
                transition: background 0.2s, color 0.2s;
            }
            .dropdown-menu a:hover {
                background-color: #f9fafb;
                color: #1B3C73;
            }
        }

        /* --- モバイルメニューアニメーション --- */
        .mobile-nav-container {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.4s ease-in-out, opacity 0.3s;
            opacity: 0;
        }
        .mobile-nav-container.active {
            max-height: 100vh;
            opacity: 1;
        }
        .rotate-icon { transition: transform 0.3s ease; display: inline-block; }
        .rotate-icon.active { transform: rotate(45deg); color: #1B3C73; }
        
        .mobile-submenu {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
        }
        .mobile-submenu.active { max-height: 250px; }
        .menu-line { 
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; 
        }
        #mobile-menu-btn.active .line-1 { transform: translateY(8px) rotate(45deg); }
        #mobile-menu-btn.active .line-2 { opacity: 0; }
        #mobile-menu-btn.active .line-3 { transform: translateY(-8px) rotate(-45deg); }

/* ---------------------------------------------------- */
/* 3. ヒーローセクション
/* ---------------------------------------------------- */

.hero-section {
    position: relative;
    overflow: hidden;
    background-color: #1B3C73;
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: slideFade 25s infinite;
}

/* スライド背景画像 */
.hero-slide:nth-child(1) { background-image: url('../images/S__192118790.jpg'); animation-delay: 0s; }
.hero-slide:nth-child(2) { background-image: url('../images/S__192118793.jpg'); animation-delay: 5s; }
.hero-slide:nth-child(3) { background-image: url('../images/S__192118797.jpg'); animation-delay: 10s; }
.hero-slide:nth-child(4) { background-image: url('../images/S__192118795.jpg'); animation-delay: 15s; }
.hero-slide:nth-child(5) { background-image: url('../images/S__192118794.jpg'); animation-delay: 20s; }

@keyframes slideFade {
    0% { opacity: 0; transform: scale(1.0); }
    8% { opacity: 1; }
    20% { opacity: 1; }
    28% { opacity: 0; transform: scale(1.05); }
    100% { opacity: 0; }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(27, 60, 115, 0.75), rgba(4, 30, 107, 0.4));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    animation: heroTextUp 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes heroTextUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-text-br {
    display: block;
}

@media (max-width: 768px) {
    .hero-text-br {
        display: inline;
    }
}

/* ---------------------------------------------------- */
/* 4. コンテンツレイアウト / 製品紹介
/* ---------------------------------------------------- */

.overlap-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .overlap-container {
        display: block;
        height: 600px;
    }
    .overlap-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 70%;
        z-index: 1;
    }
    .overlap-text {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 50%;
        z-index: 2;
    }
}

.product-card img {
    transition: transform 0.5s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

/* ---------------------------------------------------- */
/* 5. 沿革ページ
/* ---------------------------------------------------- */

.timeline-line-base {
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #e5e7eb;
    z-index: -1;
}

.timeline-line-grow {
    position: absolute;
    left: 12px;
    top: 0;
    width: 4px;
    background-color: #DC2626; /* secondary color */
    height: 0;
    z-index: 0;
    transition: height 0.1s linear;
}

.history-item {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.history-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.history-item.is-visible .history-dot {
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.5);
    transition: transform 0.5s;
    transition-delay: 0.3s;
}

@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

.animate-scroll-line {
    animation: scrollLine 2s infinite ease-in-out;
}

/* ---------------------------------------------------- */
/* 6. 採用ページ
/* ---------------------------------------------------- */

.intro-section {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 64px 24px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.main-message {
    margin: 0;
    color: #4b5563;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 0.05em;
}

.main-message span {
    display: block;
    white-space: nowrap;
}

.sub-message {
    display: block;
    margin-top: 1.5rem;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 400;
}

.requirement-table th {
    width: 30%;
    padding: 1rem;
    text-align: left;
    background-color: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    color: #1B3C73;
}

.requirement-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

@media (max-width: 768px) {
    .intro-section { padding: 48px 20px; }
    .main-message { font-size: 1.1rem; }
}

/* ---------------------------------------------------- */
/* 7. 信条ページ (Creed Page)

         ベーススタイル 
        .paper-texture {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            pointer-events: none;
            opacity: 0.03;
            z-index: 9999;
            background-image: url("https://www.transparenttextures.com/patterns/handmade-paper.png");
        }

        /* 縦書きのアクセントライン 
        .accent-line {
            width: 2px;
            height: 30px;
            background-color: #DC2626;
            margin: 0 auto 1.5rem auto;
        }

        /* セクション内アイテムのセンタリング 
        .creed-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            padding: 1rem;
        }

        /* 最後の写真重なりデザイン用セクション 
        .photo-visual-section {
            position: relative;
            height: 60vh;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 4rem;
            margin-bottom: 8rem;
        }

        .overlap-container {
            position: relative;
            width: 100%;
            max-width: 600px;
            height: 400px;
        }

        /* 背後の大きな写真（メイン） 
        .main-photo {
            position: absolute;
            top: 0;
            left: 0;
            width: 80%;
            height: 100%;
            object-fit: cover;
            border-radius: 2px;
            box-shadow: 0 20px 50px rgba(0,0,0,0.1);
            z-index: 1;
        }

        /* 前面の白枠付き写真（アクセント） 
        .sub-photo-frame {
            position: absolute;
            bottom: -40px;
            right: 0;
            width: 45%;
            aspect-ratio: 1/1;
            background: white;
            padding: 12px; /* 白枠 
            box-shadow: 10px 20px 40px rgba(0,0,0,0.15);
            z-index: 2;
        }
        
        .sub-photo-frame img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
/* ---------------------------------------------------- */


/* ---------------------------------------------------- */
/* 8. ギャラリーセクション
/* ---------------------------------------------------- */

.editorial-container {
    padding: 100px 0;
    overflow: hidden;
    background: #fff;
}

.editorial-wrapper {
    display: flex;
    width: max-content;
    transform: skewX(-6deg);
    will-change: transform;
}

.editorial-card {
    position: relative;
    width: 320px;
    height: 480px;
    flex-shrink: 0;
    overflow: hidden;
    background: #eee;
    border-right: 8px solid #fff;
}

.editorial-card img {
    width: 160%;
    height: 100%;
    object-fit: cover;
    transform: skewX(6deg) scale(1.1);
    transition: transform 0.8s ease-out;
}

.editorial-card:hover img {
    transform: skewX(6deg) scale(1.2);
}

.editorial-info {
    position: absolute;
    bottom: 40px;
    left: 30px;
    z-index: 10;
    color: white;
    transform: skewX(6deg);
}

.editorial-info h3 {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.2;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* 無限ループアニメーション */
.loop-flow {
    animation: scroll-loop 40s linear infinite;
}

@keyframes scroll-loop {
    0% { transform: skewX(-6deg) translateX(0); }
    100% { transform: skewX(-6deg) translateX(-50%); }
}

/* 画像スタックのデザイン */
.image-stack-container {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .stack-item {
        position: absolute;
        background: #fff;
        padding: 10px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        border: 1px solid rgba(0,0,0,0.05);
    }

    .item-back {
        width: 280px;
        height: 280px;
        top: 0;
        left: 10%;
        z-index: 10;
    }

    .item-front {
        width: 300px;
        height: 300px;
        bottom: 0;
        right: 10%;
        z-index: 20;
        border: 2px solid #1B3C73;
    }

    .stack-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* 装飾 */
    .decoration-plus {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        border: 1px solid #1B3C73;
        font-weight: bold;
        color: #1B3C73;
        margin-top: 1rem;
    }

    .title-machinery {
        position: relative;
    }
    .title-machinery::before {
        content: 'MACHINERY';
        position: absolute;
        top: -1.2rem;
        left: 0;
        font-size: 0.75rem;
        font-weight: 900;
        letter-spacing: 0.2em;
        color: #DC2626;
    }

/* --- モバイルデザインの特殊制御 --- */
@media (max-width: 1023px) {
    #machines {
        position: relative;
        padding-top: 4rem;
        padding-bottom: 4rem;
        background-color: #f3f4f6; /* 基調色 */
    }
    /* 画像を背面に回す */
    .mobile-bg-image {
        position: absolute;
        top: 0;
        right: 0;
        width: 70%; /* 右側に配置 */
        height: 100%;
        z-index: 0;
        overflow: hidden;
    }
    .mobile-bg-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    /* 右から左へのホワイトグラデーション */
    .mobile-bg-image::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to left, rgba(243, 244, 246, 0) 0%, rgba(243, 244, 246, 0.8) 50%, rgba(243, 244, 246, 1) 90%);
    }
    .machine-content-wrapper {
        position: relative;
        z-index: 10; /* テキストを前面に */
    }
    /* リストを確実に前面へ出す */
    .machine-list {
        position: relative;
        z-index: 30;
        /* 背景とのコントラストをつけるため少し影を足すことも可能 */
        text-shadow: 0 0 10px rgba(255,255,255,0.8); 
    }

    /* PC用の2枚重なり画像は完全に消す */
    .image-stack-container {
    display: none;
    }
    .machine-content {
        position: relative;
        z-index: 10;
    }
}


/*挨拶セクション*/
.serif-accent {
    font-family: 'Noto Serif JP', serif;
}

/* セクション全体の相対配置 */
#greeting {
    position: relative;
    overflow: hidden;
}

/* --- モバイルデザイン (1023px以下) --- */
@media (max-width: 1023px) {
    .greeting-mobile-bg {
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }
    .greeting-mobile-bg img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0.4; /* テキストを読みやすくするため薄く */
    }
    /* グラデーションでテキストエリアの白を確保 */
    .greeting-mobile-bg::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, 
            rgba(255, 255, 255, 1) 0%, 
            rgba(255, 255, 255, 0.9) 50%, 
            rgba(255, 255, 255, 0.2) 100%);
    }
    .greeting-pc-images {
        display: none;
    }
    .greeting-content {
        position: relative;
        z-index: 10;
    }
}

/* --- デスクトップデザイン (1024px以上) --- */
@media (min-width: 1024px) {
    .greeting-mobile-bg {
        display: none;
    }
    .greeting-pc-images {
        position: relative;
        height: 600px;
        width: 100%;
    }
    .img-stack {
        position: absolute;
        box-shadow: 0 30px 60px rgba(0,0,0,0.12);
        border: 8px solid white;
        transition: transform 0.5s ease;
    }
    .img-stack:hover {
        transform: translateY(-10px);
    }
    /* 下側の画像（工場や風景） */
    .img-base {
        width: 85%;
        top: 10%;
        left: 0;
        z-index: 1;
    }
    /* 上側の画像（人物や代表的な製品） */
    .img-top {
        width: 65%;
        bottom: 5%;
        right: 0;
        z-index: 2;
        border-color: #f8fafc;
    }
}

.balanced-text {
    text-wrap: balance;
}
