/* common.css */

body {
    margin: 0;
    font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: auto;
}

.header {
    background: #004c97;
    color: #fff;
    padding: 15px 0;
}

.company-string {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
}
.logo img { height:48px; display:block }

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

.nav {
    margin-left: auto;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 24px;
    margin: 0;
    padding: 0;
}

/* ナビゲーションリンクの基本 */
.nav a {
    position: relative;
    display: inline-block;
    padding: 4px 0;
    color: #fff;
    text-decoration: none;
    transition: color 0.25s ease;
}

/* 下線アニメーション */
.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0%;
    height: 2px;
    background-color: #fff; /* コーポレートカラーに合わせる */
    opacity: 0.8;
    transition: width 0.25s ease;
}

.nav a.active {
    color: #f5d98c;
}

.nav a:hover {
    color: #f0c87a;
}

/* active（現在ページ）は常に下線を表示 */
.nav a.active::after {
    width: 100%;
}

/* hover 時に下線がスッと伸びる */
.nav a:hover::after {
    width: 100%;
}

.hero {
    background: url('../img/hero.jpg') center/cover no-repeat;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.hero-content {
    text-align: center;
}

.section {
    padding: 60px 0;
}

.cards {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.card {
    background: #f5f5f5;
    padding: 30px;
    width: 30%;
    border-radius: 8px;
    text-align: center;
}

.footer {
    background: #eee;
    padding: 20px 0;
    text-align: center;
}

.page-header {
    background: #f0f0f0;
    padding: 40px 0;
    text-align: center;
}

/* ハンバーガーボタン（スマホのみ表示） */
.hamburger {
    display: none;
    width: 28px;
    height: 22px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.hamburger span {
    display: block;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 開いたときのアニメーション */
.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);
}

/* ハンバーガーメニュー */
@media (max-width: 768px) {

    /* ハンバーガー表示 */
    .hamburger {
        display: flex;
    }

    /* PCメニューを隠す（最重要） */
    .nav ul {
        display: none; /* ← これが最優先 */
        position: fixed;
        top: 0;
        right: 0;
        width: auto;
        max-width: 70%;
        height: 100vh;
        background-color: #004c97;
        flex-direction: column;
        padding: 80px 20px;
        gap: 20px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1100;
    }

    /* ハンバーガーで開いたとき */
    .nav ul.show {
        display: flex;
        transform: translateX(0);
    }

    /* メニュー項目 */
    .nav ul li {
        text-align: right;
        padding: 10px 20px;
    }

    .nav a {
        color: #ffffff;
        font-size: 16px;
    }

    /* active 強調 */
    .nav a.active {
        color: #eac56f;
        font-weight: 600;
    }

    /* オーバーレイ */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 1000;
    }

    .overlay.show {
        opacity: 1;
        pointer-events: auto;
    }
}

/* スクロールでヘッダー縮小 */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: #004c97;
    transition: all 0.3s ease;
    z-index: 1000;
}

.header.shrink {
    padding: 5px 0;
}

.header .company-string {
    font-size: 24px;
    transition: font-size 0.3s ease;
}

.header.shrink .company-string {
    font-size: 20px;
}

/* スマホメニュー（右からスライド） */
@media (max-width: 768px) {

    .nav ul {
        position: fixed;
        top: 0;
        right: 0;
        width: auto;
        max-width: 70%;
        height: 100vh;
        background-color: #004c97;
        flex-direction: column;
        padding: 80px 20px;
        gap: 20px;
        transform: translateX(100%);
        transition: right 0.3s ease;
        z-index: 1100;
    }

    .nav ul.show {
        transform: translateX(0); /* スライドイン */
    }

    /* オーバーレイ（背景半透明） */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 1000;
    }

    .overlay.show {
        opacity: 1;
        pointer-events: auto;
    }
}
