/* ======================== CSS 開始 (最終調整版 8 + 動画微調整) ======================== */

/* カラーパレット定義 */
:root {
    --primary-color: #2980b9; /* 青系（メイン） */
    --secondary-color: #34495e; /* ダークグレー（サブ、背景など） */
    --accent-color: #f39c12; /* アクセントカラー（例：ボタン、強調） */
    --text-color: #333333; /* 本文色 */
    --light-text-color: #555555; /* 薄い本文色 */
    --background-light: #f8f8f8; /* 明るい背景 */
    --background-gradient-start: #f0f4f8; /* 背景グラデーション開始 */
    --background-gradient-end: #e0e6ec; /* 背景グラデーション終了 */
    --white: #ffffff;
    --light-gray: #e9ecef; /* カード背景など */
    --border-color: #dee2e6;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.15);
}

/* 基本スタイル */
body {
    display: flex; /* サイドバーとメインコンテンツを横並びにする */
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, var(--background-gradient-start) 0%, var(--background-gradient-end) 100%); /* グラデーション背景 */
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.7; /* 行間を広げ読みやすく */
    scroll-behavior: smooth;
    /* テキスト選択の無効化 */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
    
    /* 横スクロールを無効化 */
    overflow-x: hidden;
}
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 25px; /* 左右の余白を少し広げる */
}

/* 左サイドバーのスタイル */
.sidebar {
    width: 280px;
    background-color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 3px 0 8px var(--shadow-light);
    padding-top: 30px;
    background-image: radial-gradient(circle at 10% 10%, rgba(200, 200, 200, 0.1) 5%, transparent 20%),
                      radial-gradient(circle at 90% 90%, rgba(200, 200, 200, 0.08) 8%, transparent 25%);
    background-size: 200px 200px, 150px 150px;
    z-index: 1001; /* ハンバーガーアイコンより上 */
    transition: transform 0.3s ease-out; /* スライドイン/アウト用 */
    display: flex;
    flex-direction: column;
    align-items: center; /* ロゴを中央に配置 */
}
/* サイドバーロゴと会社名 */
.sidebar-logo {
    width: 80%; /* ロゴの幅を調整 */
    max-width: 150px; /* PCでのロゴの最大幅 */
    margin-bottom: 30px; 
    padding-bottom: 25px; 
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--light-gray);
    aspect-ratio: 1 / 1; 
    max-height: 150px; 
}
.sidebar-logo img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px; 
    object-fit: contain; 
    -webkit-user-drag: none; 
    user-select: none; 
}
.sidebar-logo h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2em; 
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
    padding: 0;
    line-height: 1.2;
}
.sidebar-nav {
    flex-grow: 1; 
    width: 100%;
}
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav li a {
    display: block;
    padding: 18px 30px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 1.0em; 
    font-weight: 500;
    position: relative;
    overflow: hidden;
}
.sidebar-nav li a:hover {
    background-color: var(--light-gray);
    transform: translateX(8px);
}
.sidebar-nav li.active a {
    background-color: var(--light-gray);
    font-weight: 700;
    color: var(--primary-color);
}
.sidebar-nav li a i {
    margin-right: 10px;
    font-size: 1em; 
    color: var(--primary-color);
    display: inline-flex; 
    justify-content: center; 
    align-items: center; 
    width: 1.2em; 
    height: 1.2em; 
}

/* ハンバーガーメニューアイコン */
.hamburger-menu {
    display: none; 
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1002; 
    background-color: var(--primary-color);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 3px 8px var(--shadow-medium);
    transition: background-color 0.3s ease;
}
.hamburger-menu:hover {
    background-color: #2471a3;
}
.hamburger-menu .bar {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    border-radius: 2px;
    position: relative;
    transition: all 0.3s ease-in-out;
}
.hamburger-menu .bar::before,
.hamburger-menu .bar::after {
    content: '';
    width: 25px;
    height: 3px;
    background-color: var(--white);
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: all 0.3s ease-in-out;
}
.hamburger-menu .bar::before {
    transform: translateY(-8px);
}
.hamburger-menu .bar::after {
    transform: translateY(8px);
}
.hamburger-menu.open .bar {
    transform: translateX(-50px);
    background-color: transparent;
}
.hamburger-menu.open .bar::before {
    transform: rotate(45deg) translate(35px, -35px);
}
.hamburger-menu.open .bar::after {
    transform: rotate(-45deg) translate(35px, 35px);
}

/* メインコンテンツ領域のスタイル */
.main-content {
    margin-left: 280px; 
    flex-grow: 1;
    padding-bottom: 50px; 
}

.main-content .container {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 25px;
}

/* ヒーローセクション（動画背景用） */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh; /* ビューポートの高さに合わせてセクションの高さを設定 */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px; /* 下のセクションとの間隔 */
}
.hero-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0,0,0,1);
    background-color: rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    text-align: center;
    padding: 15px 25px;
}
.hero-content p {
    font-size: 2.5em; /* フォントサイズを大きく変更 */
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    letter-spacing: 0.5px;
    color: var(--white);
}

/* サーバー動画を背景として表示するスタイル */
video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 1;
    transform: translate(-50%, -50%);
    overflow: hidden;
    pointer-events: none;
}

/* セクション共通スタイル */
section {
    background-color: var(--white);
    margin-bottom: 25px;
    padding: 50px;
    border-radius: 10px;
    box-shadow: 0 6px 15px var(--shadow-light);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    border-top: 4px solid var(--primary-color);
}
section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

section h2 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-color);
    font-size: 2.0em; 
    border-bottom: 4px solid var(--accent-color);
    padding-bottom: 12px; 
    margin-bottom: 30px; 
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    justify-content: center; 
}
section h2 i {
    margin-right: 8px; 
    color: var(--accent-color);
    font-size: 0.7em; 
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.2em; 
    height: 1.2em; 
}
section h3 {
    color: var(--secondary-color);
    font-size: 1.4em; 
    margin-top: 30px; 
    margin-bottom: 18px; 
    font-weight: 600;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
    display: flex;
    align-items: center; 
}
section h3 i {
    margin-right: 8px;
    color: var(--accent-color);
    font-size: 0.7em; 
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.2em; 
    height: 1.2em; 
}
section p {
    margin-bottom: 16px; 
    font-size: 1.0em; 
    line-height: 1.8;
    color: var(--light-text-color);
}
section ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px; 
}
section ul li {
    background-color: var(--light-gray);
    margin-bottom: 8px; 
    padding: 10px 18px; 
    border-radius: 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px var(--shadow-light);
    font-size: 0.9em; 
    transition: background-color 0.3s ease, transform 0.2s ease;
}
section ul li:hover {
    background-color: #dce0e4;
    transform: translateX(5px);
}
section ul li i {
    margin-right: 8px; 
    color: var(--primary-color);
    font-size: 0.7em; 
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.2em; 
    height: 1.2em; 
}
section ul li strong {
    color: var(--secondary-color);
    font-weight: 600;
}
section .sns-links li {
    display: flex;
    align-items: center;
    margin-bottom: 12px; 
    padding: 0;
    background-color: transparent;
    box-shadow: none;
}
section .sns-links li span { 
    margin-left: 8px; 
    color: var(--text-color);
    word-break: break-all;
    font-size: 0.9em; 
}
section .sns-links a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    word-break: break-all;
    display: flex;
    align-items: center;
    margin-top: 0;
    transition: color 0.3s ease;
}
section .sns-links a i {
    margin-right: 8px; 
    font-size: 1.0em; 
    color: var(--accent-color);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.2em; 
    height: 1.2em; 
}
section .sns-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* お知らせセクションの画像 */
#news .card-img {
    height: 120px; 
}
#news .card a {
    text-decoration: none;
    color: inherit; 
    display: block; 
}

section::after {
    content: '';
    display: block;
    width: 80%;
    height: 1px; 
    background: linear-gradient(to right, transparent 0%, var(--border-color) 20%, var(--border-color) 80%, transparent 100%);
    margin: 30px auto 0; 
    opacity: 0.3; 
}
section:last-of-type::after {
    display: none;
}

/* ボタンのスタイル */
.button {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 10px 25px; 
    font-size: 0.9em; 
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15); 
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none; 
    display: inline-block; 
}
.button i {
    margin-right: 5px;
    font-size: 0.9em;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.2em; 
    height: 1.2em; 
}
.button:hover {
    background-color: #e67e22;
    transform: translateY(-2px) scale(1.005); 
    box-shadow: 0 5px 10px rgba(0,0,0,0.25); 
}
.text-center {
    text-align: center;
}

/* カード形式のスタイル */
.card-grid {
    gap: 15px; 
    margin-top: 25px; 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
}
.card {
    border-radius: 8px; 
    box-shadow: 0 2px 6px var(--shadow-light); 
    transition: transform 0.3s ease, box-shadow 0.3s ease, scale 0.3s ease; 
    overflow: hidden;
    border: 1px solid var(--light-gray);
    position: relative;
}
.card a {
    text-decoration: none; /* YouTubeカードのリンクのアンダーラインを削除 */
    color: inherit;
}
.card:hover {
    transform: translateY(-3px) scale(1.01); 
    box-shadow: 0 6px 12px var(--shadow-medium); 
}
.card-img {
    height: 120px; 
    background-color: var(--light-gray);
    overflow: hidden; 
}
.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease-out; 
}
.card:hover .card-img img {
    transform: scale(1.05); 
}
.card-content {
    padding: 12px; 
}
.card-content h3 {
    font-size: 1.1em; 
    margin-top: 0;
    margin-bottom: 6px; 
    color: var(--primary-color);
    border-left: none;
    padding-left: 0;
    font-weight: 600;
}
.card-content h3 i {
    margin-right: 6px; 
    color: var(--primary-color);
    font-size: 0.7em; 
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.2em; 
    height: 1.2em; 
}
.card-content p {
    font-size: 0.85em; 
    color: var(--light-text-color);
    margin-bottom: 0;
}
.card iframe {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9; /* 動画の縦横比を16:9に固定 */
    display: block;
    pointer-events: none;
}
.video-container {
    position: relative;
    overflow: hidden;
}
.video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white; /* 文字色は白色のまま */
    padding: 10px;
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ======================== iOS風ダイアログのスタイル ======================== */

.custom-alert-overlay {
    display: none; /* 初期状態では非表示 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* 背景を少し暗くする */
    backdrop-filter: blur(8px); /* 背景をぼかす*/
    -webkit-backdrop-filter: blur(8px); /* Safari対応*/
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* 最前面に表示 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.custom-alert-overlay.active {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.custom-alert-content {
    background-color: rgba(255, 255, 255, 0.9); /* 半透明の白*/
    border-radius: 14px; /* 角丸を大きくする*/
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 270px; /* iPhoneのアラート幅に近づける*/
    width: 90%; /* モバイル対応 */
    text-align: center;
    overflow: hidden; /* ボーダー上部の丸みを維持 */
    transform: scale(1.1); /* 登場アニメーション用 */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* バウンドするようなイージング*/
}

.custom-alert-overlay.active .custom-alert-content {
    transform: scale(1);
}

.custom-alert-content h3 {
    font-family: 'Noto Sans JP', sans-serif; /* デフォルトフォントに戻す */
    font-size: 17px; /* iOSのアラートタイトルサイズ*/
    font-weight: 600; /* Semi-bold */
    color: #000;
    margin-top: 20px; /* 上部の余白 */
    margin-bottom: 5px; /* メッセージとの間隔 */
    padding: 0 16px; /* 左右のパディング */
    line-height: 1.3;
    /* h3のデフォルトスタイルを上書き */
    border-bottom: none;
    border-left: none;
    padding-bottom: 0;
    display: block; /* Flexboxを解除 */
}
.custom-alert-content h3 i { /* h3のアイコンを非表示 */
    display: none;
}

.custom-alert-content p {
    font-family: 'Noto Sans JP', sans-serif; /* デフォルトフォントに戻す */
    font-size: 13px; /* iOSのアラートメッセージサイズ*/
    color: #000;
    margin-bottom: 20px; /* ボタンとの間隔 */
    padding: 0 16px; /* 左右のパディング */
    line-height: 1.3;
}

.custom-alert-content .close-alert-btn {
    width: 100%;
    padding: 11px 0; /* ボタンの高さ*/
    background-color: transparent;
    color: #007aff; /* iOSの青色*/
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1); /* ボタン上部の区切り線*/
    font-size: 17px; /* iOSのボタンフォントサイズ*/
    font-weight: 400; /* Regular */
    cursor: pointer;
    -webkit-appearance: none; /* Safariでのボタンのデフォルトスタイルをリセット */
    appearance: none;
    border-radius: 0 0 14px 14px; /* 下部の角丸のみ適用*/
    transition: background-color 0.2s ease, color 0.2s ease;
}

.custom-alert-content .close-alert-btn:hover {
    background-color: rgba(0, 0, 0, 0.05); /* ホバー時の背景色 */
}

/* ======================== レスポンシブデザイン ======================== */
@media (min-width: 993px) { 
    .hamburger-menu {
        display: none; 
    }
    .sidebar {
        transform: translateX(0); 
    }
    .main-content {
        margin-left: 280px; 
        padding-top: 0; 
    }
}

@media (max-width: 992px) { 
    body {
        flex-direction: column;
    }
    .sidebar {
        position: fixed;
        width: 250px; 
        height: 100vh;
        top: 0;
        left: 0;
        transform: translateX(-100%); 
        box-shadow: 0 0 15px var(--shadow-medium);
        align-items: flex-start; 
    }
    .sidebar.open {
        transform: translateX(0); 
    }
    .sidebar-logo {
        width: 70%; 
        max-width: 100px; 
        padding: 15px 10px;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        aspect-ratio: 1 / 1;
        max-height: 100px;
        margin-bottom: 60px; 
        padding-bottom: 35px; 
    }
    .sidebar-logo h1 { 
        font-size: 1.0em; 
    }
    .sidebar-nav {
        width: 100%;
    }
    .sidebar-nav ul {
        display: block; 
    }
    .sidebar-nav li {
        margin: 0;
    }
    .sidebar-nav li a {
        padding: 12px 20px; 
        font-size: 0.95em; 
    }

    .main-content {
        margin-left: 0; 
        padding-top: 70px; 
    }

    .hamburger-menu {
        display: flex; 
    }

    .hero-content p {
        font-size: 1.5em; /* モバイル時のフォントサイズを大きく変更 */
        padding: 8px 15px; 
    }
    section {
        padding: 25px; 
        margin-bottom: 15px; 
    }
    section h2 {
        font-family: 'Montserrat', sans-serif; 
        font-size: 1.8em; 
        margin-bottom: 20px; 
    }
    section h3 {
        font-size: 1.3em; 
        margin-top: 20px; 
    }
    section p {
        font-size: 1em; 
    }
    .container {
        padding: 0 15px;
    }
    .card-grid {
        margin-top: 25px; 
        gap: 15px; 
    }
    .card-content {
        padding: 12px; 
    }
    .card-content h3 {
        font-size: 1.1em; 
        margin-bottom: 5px; 
    }
    .card-content p {
        font-size: 0.85em; 
    }
    .button {
        padding: 10px 20px; 
        font-size: 0.9em; 
    }
}

/* YouTubeカード */
#youtube-list .card {
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease;
    
    /* 修正ポイント：1本でも巨大化しないように幅を固定 */
    width: 100%;
    max-width: 300px; /* 子会社の1枚あたりのサイズ感 */
}

/* 1本だけの時に左に寄せる設定 */
#youtube-list.card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* 左寄せ */
    gap: 20px;
}
#youtube-list .card:hover {
    transform: translateY(-3px) scale(1.01);
}

#youtube-list .video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #000;
}

#youtube-list iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    pointer-events: none; /* クリックを親のリンクに透過させる */
}

#youtube-list .video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 子会社の透過度を再現 */
    color: #ffffff;
    padding: 10px;
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
}

/* --- マウスポインター設定 --- */
body {
    cursor: none; /* 標準マウスを非表示 */
}

#custom-cursor-primary {
    position: fixed;
    top: -20px;
    left: -20px;
    width: 8px;
    height: 8px;
    background-color: #6da6e3; /* ご指定の水色 */
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transition: background-color 0.2s ease, opacity 0.3s ease;
    transform: translate(-50%, -50%);
}

/* リンク等に重なった際に標準の指マークを出すための設定 */
a, button, .interactive {
    cursor: pointer;
}