/* ==============================================
   HEADER.CSS - ヘッダー関連スタイル
   ============================================== */

/* メインヘッダー */
.header {
    padding: 0;
    background: rgba(255, 255, 255, 1) !important;
    backdrop-filter: blur(10px) !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1002; /* 詳細モーダル（z-index: 1000）より上に配置 */
    height: 60px; /* 60pxに設定 */
}

.header-content {
    width: 100%; /* 500px → 100%に変更 */
    margin: 0; /* auto削除で左右マージンなし */
    height: 60px; /* ヘッダーと同じ高さ */
    display: flex;
    justify-content: space-between;
    align-items: center; /* 垂直中央配置 */
    gap: 1rem; /* 2rem → 1remに縮小してスペース効率化 */
    padding: 0 1rem; /* 2rem → 1remに縮小 */
    box-sizing: border-box;
}

/* ロゴ */
.logo-link {
    display: inline-block;
    text-decoration: none;
    flex-shrink: 0; /* ロゴサイズを固定 */
    height: 100%; /* 親の高さに合わせる */
    display: flex;
    align-items: center; /* ロゴを垂直中央配置 */
}

.logo {
    height: 50px; /* 60px → 50pxに縮小 */
    width: 80px; /* 60px → 50pxに縮小 */
    max-width: 80px;
    object-fit: contain;
    transition: opacity 0.3s ease;
    flex-shrink: 0; /* サイズ固定を確実にする */
}

.logo-link:hover .logo {
    opacity: 0.8;
}

/* ナビゲーション */
.nav {
    display: flex;
    gap: 1rem; /* 1.5rem → 1remに縮小 */
    flex-wrap: nowrap; /* wrap → nowrapに変更して折り返し防止 */
    align-items: center; /* ナビゲーションアイテムを垂直中央配置 */
    height: 100%; /* 親の高さに合わせる */
    flex-shrink: 1; /* 必要に応じて縮小可能 */
}

/* 1024px以上で通常ナビゲーションを表示、ハンバーガーメニューを非表示 */
@media (min-width: 1024px) {
    .header .nav {
        display: flex !important; /* 通常ナビゲーションを表示 - 詳細度を上げて確実に適用 */
    }
    
    .header .hamburger-menu {
        display: none !important; /* ハンバーガーメニューを非表示 - 詳細度を上げて確実に適用 */
    }
}

.nav a {
    font-family: 'Sawarabi Gothic', sans-serif;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 300;
    font-size: 14px; 
    transition: color 0.3s ease;
    white-space: nowrap; /* テキストの折り返しを防ぐ */
    display: flex;
    align-items: center; /* テキストを垂直中央配置 */
    height: 100%; /* 親の高さに合わせる */
    padding: 0 0.5rem; /* パディング追加 */
}

.nav a:hover {
    color: #48CAE4; /* アクアブルー */
}

/* ソーシャルアイコン（デスクトップでは非表示） */
.social-icons {
    display: none;
}

/* ハンバーガーメニュー */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10001;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.hamburger-menu:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.hamburger-menu:active {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
}

.hamburger-line {
    width: 30px;
    height: 3px;
    background-color: #2c3e50;
    transition: all 0.3s ease;
    transform-origin: center;
    border-radius: 2px;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    opacity: 0;
    transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    opacity: 0;
    transform: translateY(-8px) rotate(-45deg);
}

/* ==============================================
   レスポンシブ対応 - モバイル・タブレット
   ============================================== */

/* 1023px以下 - モバイル・タブレット対応 */
@media (max-width: 1023px) {
    .layout-container {
        margin-top: 60px; /* ヘッダー高さに合わせて調整 */
    }

    .header-content {
        width: 100%;
        max-width: none; /* 幅制限を解除 */
        padding: 0 1rem;
        justify-content: space-between; /* ロゴを左端、ハンバーガーメニューを右端に配置 */
    }

    .nav {
        display: none !important; /* モバイルではナビゲーションを非表示 */
    }

    /* モバイル用ナビゲーション - 詳細度を上げる */
    .header .nav.active {
        display: flex !important;
        position: fixed !important;
        top: 60px !important; /* ヘッダー高さに合わせて調整 */
        left: 0 !important; /* 50% → 0に変更 */
        transform: none !important; /* translateX(-50%) → noneに変更 */
        width: 100% !important; /* 100%に変更 */
        max-width: none !important; /* 500px制限を削除 */
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        flex-direction: column !important;
        padding: 1.5rem !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
        border-radius: 0 0 15px 15px !important;
        z-index: 1 !important;
        gap: 0 !important;
        animation: slideDown 0.3s ease-out !important;
        opacity: 1 !important;
        visibility: visible !important;
        height: calc(100vh - 60px) !important; /* ← 追加：ヘッダー分を引いた全高 */
        overflow-y: hidden !important; /* ← autoからhiddenに変更 */
    }

    /* モバイル時のナビアイテム */
    .header .nav.active .nav-item {
        width: 100%;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        margin-bottom: 0.3rem;
        display: block;
    }

    .header .nav.active .nav-item:last-child {
        margin-bottom: 0;
    }

    .header .nav.active .nav-link-main {
        width: 100%;
        padding: 1.2rem 1rem;
        font-size: 20px;
        text-align: center;
        border: none;
        height: auto;
        color: #2c3e50;
        text-decoration: none;
        display: block;
        transition: all 0.3s ease;
        font-weight: 400;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .header .nav.active .nav-link-main:hover {
        background: rgba(72, 202, 228, 0.1);
        color: #48CAE4;
        transform: translateX(5px);
    }

    .header .nav.active .nav-item:last-child .nav-link-main {
        border-bottom: none;
    }

    /* お問い合わせは強調表示 */
    .header .nav.active .nav-contact .nav-link-main {
        width: 100%;
        padding: 1.2rem 1rem;
        background: rgba(72, 202, 228, 0.15);
        border-radius: 8px;
        text-align: center;
        font-weight: 500;
        color: #48CAE4;
        border: 1px solid rgba(72, 202, 228, 0.3);
        margin-top: 0.5rem;
    }

    .header .nav.active .nav-contact .nav-link-main:hover {
        background: rgba(72, 202, 228, 0.25);
        transform: translateX(5px);
        border-color: rgba(72, 202, 228, 0.5);
    }

    .header .nav.active .social-icons {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-top: 1.5rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(44, 62, 80, 0.1);
    }

    .header .nav.active .social-icon {
        color: #2c3e50;
        transition: color 0.3s ease;
    }

    .header .nav.active .social-icon:hover {
        color: #48CAE4;
    }

    .header .hamburger-menu {
        display: flex !important; /* ハンバーガーメニューを表示 */
        width: 30px !important;
        height: 21px !important; /* 3px×3 + 6px×2 = 21px */
        padding: 0 !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    .header .hamburger-line {
        width: 30px !important;
        height: 3px !important;
    }
}

/* slideDownアニメーション */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 300px;
        transform: translateY(0);
    }
} 