/* =========================
   基本設定
========================= */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "DotGothic16", sans-serif;
    background: #ffffff;
    color: #222222;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* コンタクトページだけ背景をグレーにする */
body.page-contact {
    background: #f2f2f2;
}

main {
    flex: 1;
    margin-bottom: 30px;
    padding-top: 50px;
}

/* ボタンは標準ではフォントを引き継がないので、ドット文字に合わせる */
button {
    font-family: inherit;
}

section {
    scroll-margin-top: 100px;
}


/* =========================
   固定ヘッダー
========================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;

    height: 90px;
    padding: 0 30px;

    /* 左：ロゴ・ワールド ／ 右：メニューボタン */
    display: flex;
    align-items: center;
    gap: 28px;

    background: #b4b4b4;
    border-bottom: 2px solid #131313;
}

/* ロゴ */
.logo {
    flex-shrink: 0;
}

/* ロゴ右横の「ワールド」リンク */
.header-link {
    font-size: 26px;
    color: #222;
    text-decoration: none;
    white-space: nowrap;
}

.header-link:hover {
    text-decoration: underline;
}

.logo img {
    display: block;
    max-height: 80px;
    width: auto;
}

/* メニューボタン（三本線） */
.menu-button {
    flex-shrink: 0;
    margin: 0 0 0 auto; /* 右端に寄せる */

    width: 40px;
    height: 40px;
    padding: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;

    border: none;
    background: transparent;
    cursor: pointer;
}

.menu-button span {
    display: block;
    width: 32px;
    height: 3px;
    background: #ffffff;
}


/* =========================
   サイドメニュー
========================= */

/* 右側から出てくるメニュー */
.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10000;

    width: 300px;
    height: 100vh;
    padding-top: 90px;

    background: #ffffff;
    border-left: 1px solid #ddd;

    transform: translateX(100%);
    transition: transform 0.3s ease;
}

/* 開いた状態 */
.side-menu.open {
    transform: translateX(0);
}

.close-button {
    position: absolute;
    top: 20px;
    right: 25px;

    width: 40px;
    height: 40px;
    padding: 0;

    border: none;
    background: transparent;

    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    color: #222;

    cursor: pointer;
}

/* メニュー項目 */
.side-menu a {
    display: block;
    padding: 20px 30px;

    color: #222;
    text-decoration: none;

    border-bottom: 1px solid #eee;
}

.side-menu a:hover {
    background: #f5f5f5;
}


/* =========================
   ヒーロー（ページ上部の画像）
========================= */

.hero {
    position: relative;

    min-height: 40vh;
    padding: 80px 30px;
    margin: 0 0 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: url("../images/hero.webp") center / cover no-repeat;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(
        to bottom,
        rgba(114, 113, 113, 0.3) 0%,
        rgba(114, 113, 113, 0.2) 75%,
        rgba(255, 255, 255, 0.4) 90%,
        rgba(255, 255, 255, 1) 100%
    );
}

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

.hero h1 {
    margin: 0;

    font-size: clamp(10px, 10vw, 120px);
    font-weight: 700;
    letter-spacing: 10px;
    color: white;
}


/* =========================
   セクション
========================= */

.section {
    max-width: 85%;
    min-height: 20px;
    margin: 0 auto;
    padding: 40px 30px;
}

/* 内容が変わる境目（2つ目以降のセクションの上）に薄い横線 */
.section + .section {
    border-top: 1px solid #e0e0e0;
}

.section h2 {
    margin: 0 0 30px;
    font-size: 45px;
}

.section h3,
.section-text {
    margin: 0 0 20px;
    font-size: 30px;
    font-weight: 300;
}

/* セクション内のリンクボタン（最新情報を見る / フォームにアクセス） */
.section-link {
    /* PC では中央ぞろえ */
    display: block;
    width: fit-content;
    min-width: 400px;
    margin: 10px auto 20px;
    padding: 20px 56px;

    font-size: 26px;
    font-weight: 700;
    text-align: center;
    color: #009999;
    text-decoration: none;

    background: #ffffff;
    border: 3px solid #009999;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);

    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.section-link:hover {
    background: #e8f6f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.section-link:active {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.section-link:focus-visible {
    outline: 3px solid #222;
    outline-offset: 3px;
}

/* ダウンロード先が未設定のときのボタン（押せない） */
.section-link.is-pending {
    color: #999;
    border-color: #bbb;
    box-shadow: none;
    cursor: default;
}

.section-link.is-pending:hover {
    background: #ffffff;
}

/* ボタンを横に並べる（ワールドMapを見る ／ ワールドダウンロード） */
.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin: 10px 0 20px;
}

.button-row .section-link {
    min-width: 300px;
    margin: 0;
}


/* 説明文（ダウンロードページなど、情報量の多い文章） */
.section-body {
    font-size: 20px;
    line-height: 1.8;
}

.section-body ul,
.section-body ol {
    margin: 0 0 16px;
    padding-left: 1.5em;
}

.section-body p {
    margin: 0 0 16px;
}

.section-body a {
    color: #009999;
}

.section-body code {
    font-family: inherit;
    padding: 0 4px;
    background: #f2f2f2;
}


/* リンク（SNSアイコン） */
.social-links {
    display: flex;
    gap: 30px;
}

.social-icon {
    width: 160px;
    height: 160px;
}


/* 年表 */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.timeline-item {
    display: flex;
    gap: 20px;
    margin: 0 0 10px;

    font-size: 30px;
    font-weight: 300;
}

.timeline-item h3 {
    width: 300px;
}

.timeline-item p {
    width: 500px;
    margin: 0;
    text-align: left;
}


/* =========================
   フッター
========================= */

.footer {
    padding: 20px;

    text-align: center;
    font-size: 14px;
    color: #000000;

    background-color: #e8e1fa;
    border-top: 1px solid #363636;
}

.footer a {
    color: inherit;
    text-decoration: none;
}


/* =========================
   最新情報（News）
========================= */

#postList {
    max-width: 100%;
    margin: 0 auto;
}

.news-post {
    padding: 20px;
    margin-bottom: 20px;

    background-color: #fff;
    border: 1px solid #ddd;

    box-sizing: border-box;
}

.news-post time {
    display: block;
    margin-bottom: 8px;

    font-size: 18px;
    color: #07853b;
}

.news-post p {
    margin: 0;

    font-size: 18px;
    line-height: 1.7;
}

.news-post a {
    color: #000000;
    text-decoration: none;
}

.news-post a:hover {
    text-decoration: underline;
}

.news-post span {
    display: block;
    margin-top: 15px;

    font-size: 14px;
    color: #666;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.reaction-buttons {
    display: flex;
    gap: 4px;
}

.reaction-button {
    padding: 4px 6px;

    border: none;
    border-radius: 10px;
    background: #ffffff;

    font-size: 10px;

    cursor: pointer;
}

.reaction-button:hover {
    opacity: 0.7;
}

.post-stats {
    margin-top: 15px;

    font-size: 14px;
    color: #666;
}


/* =========================
   コンタクト（Googleフォーム）
========================= */

.contact-form {
    width: 100%;
    height: 950px;
    margin: 80px auto 0;
    overflow: hidden;
}

.contact-form iframe {
    width: 100%;
    height: 100%;
    border: none;
}


/* =========================
   ワールドMap（BlueMap）
========================= */

/* 地図をヘッダーの下の画面いっぱいに表示（ページ自体はスクロールさせない） */
body.page-world {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.page-world main {
    display: flex;
    margin-bottom: 0;
    padding-top: 0; /* 地図は画面の一番上から。ヘッダーは上に重ねる */
}

/* ワールドではヘッダーを半透明・少し小さめにして地図を見やすく */
.page-world .header {
    height: 64px;
    background: rgba(180, 180, 180, 0.55);
    border-bottom-color: rgba(19, 19, 19, 0.35);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.page-world .logo img {
    max-height: 56px;
}

.world-frame {
    flex: 1;
    display: block;
    width: 100%;
    border: none;
}

/* 画面には表示せず、読み上げソフトにだけ伝える */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}


/* =========================
   PC：全体を中央ぞろえ
   （文章や年表はかたまりごと中央に置き、中身は左ぞろえのまま）
========================= */

@media (min-width: 601px) {

    .section h2 {
        text-align: center;
    }

    /* 文章：読みやすい幅にして中央へ（中身は左ぞろえ） */
    .section-text {
        width: fit-content;
        max-width: min(100%, 30em);
        margin: 0 auto 20px;
    }

    .social-links {
        justify-content: center;
    }

    /* 年表：かたまりごと中央へ（日付・出来事の列は左ぞろえ） */
    .timeline {
        width: fit-content;
        max-width: 100%;
        margin: 0 auto;
    }

    .timeline-item h3 {
        width: 200px;
    }

    /* 説明文：かたまりごと中央へ（中身は左ぞろえ） */
    .section-body {
        width: fit-content;
        max-width: min(100%, 40em);
        margin: 0 auto;
    }
}


/* =========================
   スマートフォン
========================= */

@media (max-width: 600px) {

    /* 「ワールドを見る」が狭い画面でも収まるように詰める */
    .header {
        padding: 0 16px;
        gap: 12px;
    }

    .logo img {
        max-height: 64px;
    }

    .header-link {
        font-size: 16px;
    }

    .page-world .header {
        height: 56px;
    }

    .page-world .logo img {
        max-height: 48px;
    }

    .hero {
        min-height: 25vh;
    }

    .section {
        max-width: 90%;
        padding: 10px 20px;
    }

    /* 境目の線と見出しがくっつかないように */
    .section + .section {
        padding-top: 25px;
    }

    .section h2 {
        margin: 0 0 25px;
        font-size: 30px;
    }

    .section h3,
    .section-text {
        font-size: 20px;
    }

    .social-links {
        gap: 15px;
    }

    .social-icon {
        width: 100px;
        height: 100px;
        margin-bottom: 20px;
    }

    .timeline {
        gap: 0;
    }

    .timeline-item {
        font-size: clamp(8px, 4vw, 120px);
    }

    .timeline-item h3 {
        width: 170px;
    }

    .timeline-item p {
        width: 300px;
    }

    /* スマホでは左寄せのまま */
    .section-link {
        display: inline-block;
        min-width: 0;
        margin: 0 0 20px;
        padding: 14px 32px;
        font-size: 18px;
        border-width: 2px;
    }

    /* 横に入りきらなければ縦に並ぶ */
    .button-row {
        justify-content: flex-start;
        gap: 12px;
    }

    .button-row .section-link {
        min-width: 0;
    }

    .section-body {
        font-size: 16px;
    }

    .news-post time {
        font-size: 16px;
    }

    .reaction-button {
        font-size: 9px;
        white-space: nowrap;
    }
}
