/* 全体設定・リセット */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 共通配色設定 */
:root {
    --blue: #0080FF;
    --yellow: #FFFF00;
    --red: #FF4040;
    --gray: #404040;

    --blue_dark: #004080;
    --yellow_dark: #808000;
    --red_dark: #802020;
    --gray_dark: #202020;

    --primary-color: var(--gray);
    --primary-dark: var(--gray_dark);
    --text-light: #ffffff;
}

/* 最背面背景の設定 */
html {
    height: 100%;
    background-image: url('../img/heyaribo_cmy.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
    background-attachment: fixed;
    overflow: hidden;
    overscroll-behavior: none; /* 画面全体のバウンドを防止 */
}

body {
    font-family: "source-han-sans-japanese", sans-serif;
    font-weight: 900;
    font-style: normal;
    color: var(--gray_dark);
    height: 100%;
    background: transparent;
    overflow: hidden;
    overscroll-behavior: none; /* 画面全体のバウンドを防止 */
}

/* --- 高速プログレスバー付きロード画面設定 --- */
.font-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.font-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-container {
    text-align: center;
    width: 300px;
}

.progress-bar-container {
    width: 100%;
    height: 16px;
    background-color: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 12px;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background-image: url('../img/heyaribo_cmy.jpg');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: left center;
    border-radius: 8px;
    will-change: width;
}

.progress-text {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--gray_dark);
}

/* 読み込み完了まで非表示 */
html.wf-loading .site-wrapper,
html:not(.wf-active) .site-wrapper {
    visibility: hidden;
    opacity: 0;
}

/* 画面の外側1%枠固定コンテナ（10pxを下限に設定） */
.site-wrapper {
    position: fixed;
    /* 1vwをベースにしつつ、10pxより小さくならないよう max() で制御 */
    top: max(1vw, 10px);
    bottom: max(1vw, 10px);
    left: max(1vw, 10px);
    right: max(1vw, 10px);
    width: calc(100vw - max(2vw, 20px));  /* 左右の枠線を引いた幅 */
    height: calc(100vh - max(2vw, 20px)); /* 上下の枠線を引いた高さ */
    height: calc(100dvh - max(2vw, 20px)); /* スマホのアドレスバー表示を考慮した動的な高さ */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease;
}

/* ヘッダー設定 */
.main-header {
    height: 10vh;
    min-height: 60px;
    background-color: var(--primary-color);
    width: 100%;
    flex-shrink: 0;
    position: relative;
    z-index: 1100;
}

.header-container {
    height: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    position: relative;
    height: 100%;
    text-decoration: none;
}

.header-icon {
    height: 12vh;
    min-height: 84px;
    width: auto;
    object-fit: contain;
    position: absolute;
    top: 1vh;
    left: 0;
    z-index: 1150;
    filter: drop-shadow(3px 0 0 var(--gray))
            drop-shadow(-3px 0 0 var(--gray))
            drop-shadow(0 3px 0 var(--gray))
            drop-shadow(0 -3px 0 var(--gray))
            drop-shadow(3px 3px 0 var(--gray))
            drop-shadow(-3px 3px 0 var(--gray))
            drop-shadow(3px -3px 0 var(--gray))
            drop-shadow(-3px -3px 0 var(--gray));
}

.logo {
    color: var(--text-light);
    font-size: 1.6rem;
    padding-left: calc(12vh + 20px);
}

/* ハンバーガーボタン */
.menu-trigger {
    background: none;
    border: none;
    width: 34px;
    height: 26px;
    position: relative;
    cursor: pointer;
    z-index: 1200;
}

.menu-trigger span {
    display: block;
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--text-light);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-trigger span:nth-child(1) { top: 0; }
.menu-trigger span:nth-child(2) { top: 11px; }
.menu-trigger span:nth-child(3) { bottom: 0; }

.menu-trigger.active span:nth-child(1) {
    transform: translateY(11px) rotate(-45deg);
}
.menu-trigger.active span:nth-child(2) {
    opacity: 0;
}
.menu-trigger.active span:nth-child(3) {
    transform: translateY(-12px) rotate(45deg);
}

/* ナビゲーションメニュー */
.nav-menu {
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--primary-dark);
    opacity: 0.98;
    transition: right 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
}

.nav-menu.active {
    right: 0;
}

.nav-menu ul {
    list-style: none;
    text-align: center;
    width: 100%;
}

.nav-menu ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 2.0rem;
    font-weight: bold;
    display: block;
    padding: 25px 0; /* 上下に余白を作り、クリック可能な領域を広げる */
    transition: background-color 0.2s ease;
}

.nav-menu ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1); /* ホバー時にわずかに明るくする */
}

/* フッター */
.main-footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    text-align: center;
    padding: 30px;
    font-size: 1.1rem;
}

/* ==========================================================================
   共通ユーティリティクラス
   ========================================================================== */

/* CMY画像ホバーエフェクト（ボタン等用） */
.hover-cmy {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
    z-index: 1;
}
.hover-cmy::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('../img/heyaribo_cmy.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}
.hover-cmy:hover {
    transform: translateY(-3px);
}
.hover-cmy:hover::before {
    opacity: 0.2; /* 不透明度の一元管理 */
}

/* ==========================================================================
   共通コンポーネント（複数ページで使われるUI）
   ========================================================================== */

/* 共通ベースエリア */
.scroll-content-wrapper {
    background-color: #ffffff;
    position: relative;
    z-index: 10;
}

/* 下層ページ用タイトルヘッダー（Contact, Members等） */
.page-title-header {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}
.page-title-header::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: calc(100% + 1920px);
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('../img/bg.jpg');
    background-repeat: repeat-x;
    background-position: left center;
    background-size: auto 100%;
    z-index: -1;
    animation: scrollBg 30s linear infinite;
    pointer-events: none;
}
.page-title-header h1 { font-size: 3rem; margin-bottom: 10px; }
.page-title-header p { font-size: 1.2rem; opacity: 0.8; }

/* 共通アクションボタン（黒ベース） */
.btn-black {
    display: inline-block;
    background-color: #000000;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 900;
    padding: 15px 50px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    text-decoration: none;
}

/* SNSブランドカラー一元管理 */
.youtube-btn, .youtube-icon { background-color: #FF0000; }
.twitter-btn, .twitter-icon { background-color: #000000; }
.website-icon { background-color: #6c757d; }

/* ==========================================================================
   メインコンテンツ・スクロールバー共通設定
   ========================================================================== */
.main-content {
    flex: 1;
    display: block;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;}
.main-content::-webkit-scrollbar {
    width: 14px;
}
.main-content::-webkit-scrollbar-track {
    background-color: rgba(255, 255, 255, 0.9); /* 要素全体に背景を指定 */
}
.main-content::-webkit-scrollbar-thumb {
    background-color: var(--gray_dark);
    background-clip: padding-box;
    border: 3px solid transparent;
    border-radius: 7px;
}