/* --- Reset & Base Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s;
}

a:hover {
    opacity: 0.7;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

/* --- Color Variables --- */
:root {
    --primary-color: #003366; /* 紺色 */
    --border-color: #ddd;
}

/* --- Layout Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.header {
    border-bottom: 1px solid var(--border-color);
    background: #4a90e2;
    padding: 15px 0;
    position: relative;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-title {
    font-size: 14px;
    color: #fff;
    font-weight: bold;
}

.header-nav ul {
    display: flex;
    gap: 20px;
}

.header-nav a {
    font-size: 14px;
    color: #fff;
    font-weight: bold;
}

/* --- Hamburger Menu --- */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* --- Hero Section (Text Only) --- */
.hero-section {
    background: linear-gradient(135deg, #f5f8fb 0%, #fff 100%);
    padding: 80px 0;
    border-bottom: 3px solid var(--primary-color);
}

/* メインキャッチコピー部分 */
.main-copy {
    text-align: center;
}

.main-copy-sub {
    font-size: 14px;
    display: block;
    margin-bottom: 15px;
    font-weight: normal;
    color: #333;
}

.main-copy-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #333;
}

.contact-btn {
    display: inline-block;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 10px 30px;
    font-size: 14px;
    text-decoration: underline;
}
.contact-btn:hover {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

/* --- Top Area (Image + Intro Text) --- */
.top-area {
    position: relative;
    width: 100%;
    /* 背景画像設定 */
    background-image: url('https://www.kmnext.co.jp/wp-content/uploads/2025/11/MF事業部背景.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    padding: 60px 0;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
}

/* 画像の上に黒いフィルターをかけて文字を読みやすくする */
.top-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); 
}

.top-area .container {
    position: relative; /* フィルターより上に表示 */
    z-index: 1;
    width: 100%;
}

/* 説明文ブロック（左下に配置） */
.intro-text-block {
    background: rgba(0, 0, 0, 0.6); /* 半透明の黒背景 */
    padding: 30px;
    max-width: 600px; /* 幅を制限 */
}

.intro-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #fff;
}

.intro-desc {
    font-size: 14px;
    line-height: 1.8;
    color: #fff;
}

/* --- Case Study Section --- */
.cases {
    padding: 60px 0 80px;
    background: linear-gradient(135deg, #fff 0%, #f0f5fa 100%);
}

.section-title {
    text-align: center;
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 50px;
    font-weight: bold;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
    width: 100%;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.product-card {
    border: 1px solid #e0e0e0;
    padding: 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 51, 102, 0.15);
}

.product-title {
    text-align: center;
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.product-image-area {
    width: 100%;
    height: 200px;
    background-color: #fff;
    margin-bottom: 15px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.product-image-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.product-image-area:hover img {
    transform: scale(1.05);
}

/* クリック可能な表示用オーバーレイ */
.product-image-area::after {
    content: '🔍 クリックで拡大';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.product-image-area:hover::after {
    opacity: 1;
}

.product-desc {
    font-size: 13px;
    line-height: 1.6;
    color: #444;
}

/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-image {
    width: 100%;
    height: auto;
    display: block;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #666;
}

/* --- Footer --- */
.footer {
    background: #4a90e2;
    padding: 60px 0 20px;
    text-align: center;
}

.footer-message {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #fff;
}

.footer-contact-info {
    font-size: 14px;
    margin-bottom: 40px;
    line-height: 1.8;
    color: #fff;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-email {
    display: block;
    margin-bottom: 10px;
}

.contact-email a {
    color: #fff;
}

.contact-mail-icon {
    display: inline-block;
    color: #fff;
    transition: transform 0.3s, filter 0.3s;
    flex-shrink: 0;
}

.contact-mail-icon:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.contact-mail-icon svg {
    width: 40px;
    height: 40px;
    stroke: currentColor;
}

.contact-tel {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    display: inline;
    margin-bottom: 0;
}

.contact-hours {
    font-size: 20px;
    color: #fff;
    display: block;
    margin-top: 0;
    text-align: center;
    font-weight: bold;
}

.copyright {
    font-size: 14px;
    color: #fff;
    margin-top: 40px;
    font-weight: bold;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .header-nav {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #4a90e2;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s;
        z-index: 999;
    }

    .header-nav.active {
        max-height: 300px;
    }

    .header-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 20px;
    }

    .header-nav a {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .header-nav a:last-child {
        border-bottom: none;
    }

    .main-copy-title {
        font-size: 24px;
    }

    .intro-text-block {
        max-width: 100%;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 20px;
    }

    .contact-method {
        flex-direction: column;
        gap: 10px;
    }

    .contact-tel {
        font-size: 16px;
    }

    .contact-hours {
        font-size: 14px;
    }

    .footer-message {
        font-size: 14px;
    }

    .copyright {
        font-size: 12px;
    }
}
