/* =========================================
   全体の基本設定
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 500;
    min-height: 100vh;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

h1 {
    margin-top: 2%;
    margin-left: 6%;
}

p {
    margin: 1% 6%;
    overflow-wrap: break-word;
}

.under {
    background: linear-gradient(transparent 70%, #6ab6f8 40%);
}

/* ヘッダー全体 */
header {
    background-color: black;
    color: white;
    padding: 1% 1%;
    width: 100%;
    padding-right: 3%;
}

.header h1 {
    margin: auto;
}

/* ロゴとナビゲーションを横並びにする */
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ヘッダーのロゴ画像のサイズ (HTMLから移行) */
.header-logo img {
    width: 30%;
}

/* ナビゲーションメニューを横並びにする */
nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    font-family: 'Orbitron', sans-serif;
}

/* ナビゲーションのリンク */
nav ul li a {
    color: white;
    text-decoration: none;
    margin-right: 2%;
}

/* ヒーロー画像 */
.hero-image {
    position: relative;
    margin: 0;
    padding: 0;
}

.hero-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* ========================================
   ヒーロータイトルのアニメーション
   ======================================== */

/* タイトルを画像の中央に配置 */
.hero-image .title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 30px));

    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;

    font-size: 30px;
    font-weight: bold;
    color: white;
    text-align: center;
}

/* h1の初期設定 */
.hero-image .title h1 {
    margin: 0;
}

/* 表示されたとき */
.hero-image .title.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%);
}

/* 動きを減らす設定の利用者にはアニメーションを無効化 */
@media (prefers-reduced-motion: reduce) {
    .hero-image .title {
        opacity: 1;
        transform: translate(-50%, -50%);
        transition: none;
    }
}

/* 色を変えたい部分 */
.highlight {
    color: #008cff;
}

.line {
    width: 97%;
    height: 2px;
    background-color: #000;
    margin: 2% auto 0;
}

/* 通常時 */
a {
    color: #ffffff;
    text-decoration: none;
}

/* クリックしている間 */
a:active {
    color: #ff0000;
}

/* YouTube動画を中央寄せ */
.responsive-video {
    position: relative;
    width: calc(100% - 20px);
    max-width: 80%; /* PCでの最大幅を制限 */
    aspect-ratio: 16 / 9;
    margin: 10px auto;
    border-radius: 12px; /* 角を丸くする */
    overflow: hidden; /* 動画のはみ出しを隠す */
}

/* 動画本体を親要素いっぱいに表示 */
.responsive-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    border: 0;
    width: 100%;
    height: 100%;
}

/* Googleマップを中央に配置 */
.access iframe {
    display: block;
    margin: 2% auto;
    width: 100%;
    height: 450px;
    max-width: 80%;
}

/* カード全体 */
.basic-card_wrap {
    width: 100%;
    max-width: 90%;
    margin: 40px auto;
    padding: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 64px;
    background: #004078;
    /* 画像と文章を横並び */
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 32px;
    align-items: center;
}

/* カード画像 */
.basic-card_image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 32px;
}

/* 右側のタイトル */
.basic-card_title {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.5;
}

/* 右側の説明文 */
.basic-card_text {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.8;
}

.underline {
    text-decoration: underline;
    color: white;
    text-decoration-thickness: auto;
}

/* Activityのボタンを中央に横並びで配置 */
.activity-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 30px auto;
    flex-wrap: wrap;
}

/* ボタンのデザイン */
.activity-button {
    display: inline-block;
    width: 200px;
    padding: 15px 20px;
    background-color: #004078;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    border-radius: 30px;
    transition: background-color 0.3s;
}

/* クリックしたとき */
.activity-button:active {
    background-color: #003050;
}

.activity-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.65);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 表示状態 */
.activity-modal.active {
    display: flex;
}

/* カード本体 */
.activity-modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* カードタイトル */
.activity-modal-content h2 {
    margin-bottom: 20px;
    color: #004078;
}

/* カード本文 */
.activity-modal-content p {
    margin: 0 0 25px;
    line-height: 1.8;
}

/* ×ボタン */
.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    border: none;
    background: none;
    color: #333;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover {
    color: #008cff;
}

/* カード内リンク */
.activity-modal-content a {
    display: inline-block;
    padding: 10px 25px;
    background-color: #004078;
    color: #ffffff;
    border-radius: 25px;
    text-decoration: none;
}

.activity-modal-content a:hover {
    background-color: #2c567b;
}

/* 部室前画像 */
.image-position img {
    width: 100%;
    max-width: 45%;
    height: auto;
    margin: 0 auto;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

/* フッター */
footer {
    background-color: black;
    color: white;
    padding: 1% 1%;
    padding-right: 3%;
    margin-top: 10%;
}

/* ロゴとナビゲーションを横並びにする */
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-link {
    text-align: left;
    margin-top: 1%;
    color: #FFFFFF;
    font-size: 1.5em;
}

.footer-sns {
    text-align: left;
    color: #FFFFFF;
    font-size: 1em;
}

.footer-text {
    text-align: center;
    margin-top: 3%;
    font-size: 0.5em;
}

/* フッターのロゴ画像のサイズ (HTMLから移行) */
.footer-logo img {
    width: 30%;
}

/* フッターのメニューの文字サイズ */
.footer-nav a {
    font-size: 16px; /* PC用のサイズ */
    text-decoration: none;
    color: white;
}

/* =========================================
   PC以上 (幅1024px以上) のスタイル
   ========================================= */
@media screen and (min-width: 1024px) {
    /* PC版のみactivity-textにおいて自動改行OFF */
    .activity-text {
        white-space: nowrap;
    }

    /* マウスを乗せたとき */
    nav ul li a:hover {
        color: #d2e6fd;
    }

    /* マウスを乗せたとき */
    a:hover {
        color: #ff6600;
    }

    /* マウスを乗せたとき */
    .activity-button:hover {
        background-color: #2c567b;
        color: #ffffff;
    }
}

/* =========================================
   スマホ用 (画面幅640px以下) のスタイル
   ========================================= */
@media (max-width: 640px) {
    /* ヘッダーのロゴ画像のサイズ */
    .header-logo img {
        width: 60%;
        text-align: center;
    }

    /* ヘッダーのメニューの文字サイズ */
    .header-nav a {
        font-size: 12px; /* スマホ用のサイズ */
    }

    .header-inner {
        flex-direction: column;
        gap: 20%;
    }

    /* 機体説明のカード全体 */
    .basic-card_wrap {
        margin: 15px auto;
        /* 画像と文章を縦並びにする */
        grid-template-columns: 1fr;
        /* スマホでは余白を少し小さく */
        padding: 15px;
        /* 角丸も少し小さく */
        border-radius: 40px;
        /* 画像と文章の間隔 */
        gap: 24px;
    }

    /* タイトル */
    .basic-card_title {
        font-size: 18px;
        padding: 0 24px;
    }

    /* 説明文 */
    .basic-card_text {
        font-size: 16px;
    }

    /* フッターのロゴ画像のサイズ */
    .footer-logo img {
        width: 60%;
        text-align: center;
    }

    /* フッターのメニューの文字サイズ */
    .footer-nav a {
        font-size: 12px; /* スマホ用のサイズ */
    }

    .footer-inner {
        flex-direction: column;
        gap: 20%;
    }

    .footer-link {
        font-size: 1em;
        margin: 12px 24px;
    }

    /* フッターのSNSリンクの文字サイズ */
    .footer-sns {
        text-align: left;
        color: #FFFFFF;
        font-size: 12px;
    }

    /* 部室前の画像の調整 */
    .image-position img {
        max-width: 80%;
    }

    /* =========================================
       文字の大きさの調整
       ========================================= */
    /* aboutのテキストのレイアウト */
    #about {
        font-size: 100%;
        padding: 0 12px;
    }

    .about p {
        font-size: 14px;
        padding: 0 12px;
    }

    /* projectのテキストのレイアウト */
    #project {
        font-size: 100%;
        padding: 0 12px;
    }

    .project p {
        font-size: 14px;
        padding: 0 12px;
    }

    /* activityのテキストのレイアウト */
    #activity {
        font-size: 100%;
        padding: 0 12px;
    }

    .activity p {
        font-size: 14px;
        padding: 0 12px;
    }

    /* accessのテキストのレイアウト */
    #access {
        font-size: 100%;
        padding: 0 12px;
    }

    .access p {
        font-size: 14px;
        padding: 0 12px;
    }
}

/* ========================================
   スクロール時のふわっと表示アニメーション
   ======================================== */
/* 表示される前の状態 */
.about,
.project,
.activity,
.access {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.7s ease,
        transform 0.7s ease;
}

/* 画面内に入ったとき */
.about.is-visible,
.project.is-visible,
.activity.is-visible,
.access.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 動きを減らす設定の利用者にはアニメーションを無効化 */
@media (prefers-reduced-motion: reduce) {
    .about,
    .project,
    .activity,
    .access {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* カードを含むセクションの transform の影響を防ぐ */
.about.is-visible,
.project.is-visible,
.activity.is-visible,
.access.is-visible {
    transform: none;
}


/* スマホ版：ヒーロータイトルの調整 */
@media screen and (max-width: 640px) {
    .hero-image .title {
        width: 100%;
        padding: 0 10px;
        font-size: 22px;
        text-align: center;
    }

    .hero-image .title h1 {
        margin: 0;
        margin-left: 0;
        font-size: 1em;
        line-height: 1.4;
    }
}

/* ナビゲーションを押したときのスムーズスクロール */
html {
    scroll-behavior: smooth;
}

/* 移動先がヘッダーに隠れないように調整（必要に応じて変更） */
#about,
#project,
#activity,
#access {
    scroll-margin-top: 20px;
}
