/* ==========================================
   共通変数設定 (CSS Variables)
   ========================================== */
:root {
    --main-color: #1a2a40;      /* メインカラー：濃紺 */
    --accent-color: #f39c12;    /* アクセントカラー：オレンジ */
    --text-color: #333;         /* 基本文字色 */
    --light-bg: #f8f9fa;        /* 薄い背景色 */
    --white: #ffffff;           /* 純白 */
    --header-height: 70px;      /* ヘッダーの高さ */
}

/* ==========================================
   ベーススタイル
   ========================================== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* ==========================================
   ヘッダー・ナビゲーション
   ========================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: var(--header-height);
    width: 100%;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 2px solid #eee;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    z-index: 1100; /* ロゴは常に手前に */
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--main-color);
}

.header-logo-svg {
    height: 40px;
    width: auto;
    display: block;
}

/* PC用メニュー項目 */
nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 25px;
}

nav a {
    text-decoration: none;
    color: var(--main-color);
    font-weight: bold;
    transition: color 0.3s;
    font-size: 0.95rem;
}

nav a:hover {
    color: var(--accent-color);
}

/* ハンバーガーメニューボタン（基本定義）*/
.menu-btn {
    display: none; /* デフォルトは非表示 */
    background: transparent !important; /* オレンジ色が残らないよう透明固定 */
    border: none;
    outline: none;
    cursor: pointer;
    z-index: 2000; /* メニュー画面(1050)より手前に配置して✕を表示させる */
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.menu-btn span {
    display: block;
    background: var(--main-color); /* 通常時は濃紺 */
    transition: 0.3s;
}

/* ==========================================
   メインビジュアル (スライダー)
   ========================================== */
.hero-slider {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
    background-color: #000;
}

.slider-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    text-align: center;
    color: #fff;
    z-index: 10;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* ==========================================
   コンテンツセクション
   ========================================== */
section { padding: 5rem 10%; }

h2 {
    text-align: center;
    color: var(--main-color);
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 4rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-color);
}

/* お知らせリスト */
.news-list {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.news-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.news-date { font-size: 0.9rem; color: #666; margin-right: 20px; }
.news-category {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--main-color);
    color: var(--white);
    margin-right: 15px;
}
.news-title { text-decoration: none; color: var(--text-color); font-weight: 500; }

/* グリッド・カード */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--white);
    border: 1px solid #eee;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.card:hover { transform: translateY(-10px); }

.card h3 {
    color: var(--main-color);
    font-size: 1.3rem;
    border-left: 5px solid var(--accent-color);
    padding-left: 15px;
    margin-bottom: 1.2rem;
}

/* FAQ */
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { margin-bottom: 1.5rem; background: #fff; padding: 20px; border-radius: 8px; }

/* FAQアコーディオンのスタイル追加 */
.faq-item {
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
    padding: 12px 50px 12px 20px; /* 上下を 20px → 12px に、左を 20px に調整 */
    margin-bottom: 0.8rem;        /* アイテム間の隙間も少し詰めました */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* 質問の見出し（h3）の余白をリセット */
.faq-item h3 {
    margin: 0;
    font-size: 1.05rem;           /* 文字サイズをわずかに小さくして一行に収まりやすく */
    line-height: 1.4;             /* 行間を詰める */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;                 /* もし枠線があれば除去 */
    padding-left: 0;              /* アイテム側のpaddingで制御するため0に */
}

/* ＋アイコンの位置調整 */
.faq-item h3::after {
    content: '+';
    position: absolute;
    right: 20px;                  /* 右端からの位置を固定 */
    top: 50%;
    transform: translateY(-50%);  /* 上下中央揃え */
    font-size: 1.4rem;
    color: var(--accent-color);
    transition: transform 0.3s;
}

/* 開いた時の挙動（✕印への回転） */
.faq-item.active h3::after {
    transform: translateY(-50%) rotate(45deg);
}

/* 回答部分（閉じている時は完全に高さをゼロに） */
.faq-item p {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;                    /* 閉じている時はマージンもゼロ */
    padding: 0;                   /* 閉じている時はパディングもゼロ */
    transition: all 0.3s ease-out;
    font-size: 0.95rem;
    color: #555;
}

/* 開いた時の回答部分の余白 */
.faq-item.active p {
    max-height: 500px;
    opacity: 1;
    margin-top: 10px;             /* 質問との間に少しだけ隙間を作る */
    padding-bottom: 5px;
}

/* 会社概要テーブル */
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 1.2rem; border-bottom: 1px solid #eee; }
table th { background: var(--main-color); color: var(--white); width: 25%; text-align: left; }

/* お問い合わせフォーム */
.contact-box { background: var(--white); padding: 2rem; max-width: 700px; margin: 0 auto; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
input, textarea { width: 100%; padding: 1rem; margin-bottom: 1rem; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; }
button { background: var(--accent-color); color: var(--white); border: none; padding: 1rem; font-weight: bold; cursor: pointer; width: 100%; border-radius: 6px; }
button:disabled { background: #ccc !important; cursor: not-allowed; }

/* 確認画面用スタイル */
.confirm-item {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.confirm-item label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    font-weight: bold;
    margin-bottom: 5px;
}

.confirm-item p {
    margin: 0;
    color: var(--main-color);
    word-break: break-all;
}

#back-to-input:hover {
    background: #bbb !important;
}

/* フッター */
footer { background: var(--main-color); color: var(--white); text-align: center; padding: 40px 20px; margin-top: 60px; }
footer a { text-decoration: none; }

/* ==========================================
   スマートフォン・タブレット用 (768px以下)
   ========================================== */
@media (max-width: 768px) {
    .menu-btn {
        display: block;
        width: 44px;
        height: 44px;
        position: relative;
        padding: 0;
    }

    .menu-btn span {
        position: absolute;
        left: 10px;
        width: 24px;
        height: 2px;
        margin: 0;
    }

    .menu-btn span:nth-child(1) { top: 14px; }
    .menu-btn span:nth-child(2) { top: 22px; }
    .menu-btn span:nth-child(3) { top: 30px; }

    /* メニュー展開時の✕印の設定 */
    .menu-btn.open span {
        background: var(--white); /* 背景の濃紺に合わせて白に変更 */
    }

    .menu-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-btn.open span:nth-child(2) { opacity: 0; }
    .menu-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* スマホメニュー本体 */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--main-color); /* オレンジが残らないよう濃紺で統一 */
        transition: 0.4s;
        padding-top: 100px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        z-index: 1050; /* ボタン(2000)より背面、コンテンツより前面 */
    }

    nav.open { right: 0; }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    nav a { color: var(--white); font-size: 1.2rem; }

    /* レスポンシブ各パーツの調整 */
    section { padding: 3rem 5%; }
    .grid { grid-template-columns: 1fr; }
    .news-item { flex-direction: column; align-items: flex-start; gap: 5px; }
    table th, table td { display: block; width: 100%; border: none; }
    table th { padding-bottom: 0; background: none; color: var(--main-color); border-left: 4px solid var(--accent-color); padding-left: 10px; }
}