@charset "UTF-8";

/* ==========================================================================
   1. 変数定義 (Variables)
   ========================================================================== */
:root {
    /* --- ライトモード (Default) --- */
    --base-color: #FFFFFF;
    --background-color: #f4f6f9;
    --text-color: #333333;
    --accent-color: #007bff;
    --border-color: #e0e0e0;
    --footer-bg-color: #2c3e50;
    --header-bg-scrolled: rgba(255, 255, 255, 0.85);
    
    /* 重要なお知らせ等のカラー */
    --notice-bg: #fffbe6;
    --notice-border: #ffe58f;
    --notice-accent: #faad14;
}

/* --- ダークモード (Dark Mode) --- */
body.dark-mode {
    --base-color: #1f1f1f;
    --background-color: #121212;
    --text-color: #e0e0e0;
    --border-color: #333333;
    --accent-color: #4da3ff;
    --footer-bg-color: #000000;
    --header-bg-scrolled: rgba(31, 31, 31, 0.85);
    
    --notice-bg: #332b00;
    --notice-border: #665c00;
}

/* ==========================================================================
   2. 基本設定 (Base & Reset)
   ========================================================================== */
* { box-sizing: border-box; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Noto Sans JP', sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    padding-top: 82px; /* ヘッダーの高さ分 */
    overflow-x: hidden; /* 横スクロール防止 */
}

a { color: var(--accent-color); text-decoration: none; transition: 0.2s; }
a:hover { text-decoration: underline; }

img, video, iframe {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* レスポンシブ改行制御 */
.br-pc { display: inline; }
.br-mobile { display: none; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   3. レイアウト構造 (Layout)
   ========================================================================== */
/* メインコンテンツとサイドバーの分割 */
.content-grid {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 30px;
}

.main-column { flex: 2.5; min-width: 0; }
.sidebar-column { flex: 1; min-width: 0; }

/* 制作物・メンバー一覧などのグリッド表示（PC横並び・スマホ縦並び） */
.grid-container,
.member-grid,
.illust-grid {
    display: grid;
    /* 幅280px以上の要素を画面幅に合わせて自動で横に並べる */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

/* ==========================================================================
   4. ヘッダー & ナビゲーション (Header)
   ========================================================================== */
.site-header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    background-color: var(--base-color);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.has-scrolled {
    background-color: var(--header-bg-scrolled);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.site-branding { display: flex; align-items: center; }
.site-logo img { height: 50px; margin-right: 15px; }
.site-title { font-size: 1.5em; font-weight: bold; margin: 0; }
.site-description { font-size: 0.8em; color: #777; margin: 0; }

/* ナビゲーションメニュー */
.main-navigation { position: relative; display: flex; align-items: center; gap: 10px; }

.menu-toggle {
    display: block; border: 1px solid var(--border-color); background: transparent;
    color: var(--text-color); font-size: 0.9em; font-weight: bold;
    padding: 8px 15px; border-radius: 6px; cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.menu-toggle:hover, .menu-toggle.is-active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.menu-container {
    display: block; position: absolute; top: calc(100% + 10px); right: 0;
    width: 200px; background-color: var(--base-color); border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); padding: 10px 0;
    opacity: 0; transform: translateY(10px); visibility: hidden;
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    border: 1px solid var(--border-color);
}
.menu-container.is-open { opacity: 1; transform: translateY(0); visibility: visible; }
.menu-container a { display: block; padding: 12px 20px; color: var(--text-color); }
.menu-container a:hover { background-color: rgba(128,128,128,0.1); text-decoration: none; }

/* ダークモード切替ボタン */
.theme-btn {
    background: transparent; border: 1px solid transparent; cursor: pointer;
    font-size: 1.4rem; padding: 4px 8px; border-radius: 8px;
    transition: background-color 0.3s, transform 0.2s; line-height: 1;
}
.theme-btn:hover { background-color: rgba(128,128,128,0.1); transform: scale(1.1); }

/* ==========================================================================
   5. メインビジュアル (Hero Section)
   ========================================================================== */
.hero-fullscreen {
    position: relative; width: 100%; border-radius: 8px; overflow: hidden;
    aspect-ratio: 1900 / 690;
    display: flex; align-items: center; justify-content: center;
    color: #fff; text-align: center;
}
.hero-background-image {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 1; transition: opacity 0.3s;
}
.hero-controls-mobile { display: none; } /* PCでは非表示 */

/* ==========================================================================
   6. UIコンポーネント (Components)
   ========================================================================== */
/* カード基本スタイル */
.card, .sidebar-widget {
    background-color: var(--base-color); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 24px; box-shadow: 0 2px 5px rgba(0,0,0,0.04);
    margin-bottom: 30px;
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.8s, transform 0.8s, box-shadow 0.3s;
}
.card.is-visible, .sidebar-widget.is-visible { opacity: 1; transform: translateY(0); }
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }

.card h2 { margin-top: 0; font-size: 1.5rem; margin-bottom: 1rem; border-bottom: none; }
.page-title { margin-top: 0; font-size: 1.75rem; font-weight: 700; border-bottom: 2px solid var(--accent-color); padding-bottom: 10px; margin-bottom: 30px; }

/* ボタン */
.btn {
    display: inline-block; padding: 12px 28px; border-radius: 8px;
    font-weight: bold; text-align: center; border: 2px solid var(--accent-color);
    color: var(--accent-color); background-color: transparent;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary { background-color: var(--accent-color); color: #fff; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); text-decoration: none; }
.button-container { text-align: center; margin-top: 20px; }

/* お知らせボックス */
.notice-box {
    background-color: var(--notice-bg);
    border: 1px solid var(--notice-border);
    border-left: 5px solid var(--notice-accent);
}

/* LINE風カード */
.line-card { background-color: #fff; border-radius: 8px; overflow: hidden; border: 1px solid #e0e0e0; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.line-card-header { background-color: #06c755; color: #fff; padding: 10px; text-align: center; }
.line-card-title { font-weight: bold; margin: 0; font-size: 1rem; }
.line-card-members { font-size: 0.8rem; opacity: 0.9; }
.line-card-body { padding: 15px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.line-qr { width: 120px; height: 120px; object-fit: contain; border: 1px solid #eee; border-radius: 4px; }
.line-btn {
    background-color: #06c755; color: #fff; padding: 10px 20px;
    border-radius: 20px; font-weight: bold; width: 100%; display: block; text-align: center;
}
.line-btn:hover { background-color: #05b64d; text-decoration: none; }

/* YouTube埋め込みコンテナ (16:9維持) */
.youtube-container {
    position: relative; width: 100%; padding-bottom: 56.25%; height: 0;
    overflow: hidden; border-radius: 8px; margin-bottom: 10px;
}
.youtube-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* 汎用埋め込みフレーム (Hugging Face等) */
.embed-iframe {
    width: 100%; height: 400px; border: 1px solid var(--border-color);
    border-radius: 4px; margin-top: 10px; background-color: #f9f9f9;
}

/* ==========================================================================
   7. ニュースセクション (News)
   ========================================================================== */
.news-section { margin: 40px 0 60px; }
.news-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; }
.section-title { margin: 0; font-size: 1.5rem; font-weight: bold; }
.news-more-link { font-size: 0.9rem; color: var(--accent-color); }

.news-list { list-style: none; padding: 0; margin: 0; }
.news-item {
    display: flex; flex-wrap: wrap; align-items: baseline;
    padding: 12px 0; border-bottom: 1px solid rgba(128,128,128,0.2);
    transition: background-color 0.2s;
}
.news-item:hover { background-color: rgba(128,128,128,0.05); }
.news-date { font-family: monospace; color: #666; margin-right: 15px; font-size: 0.95rem; }
.news-category {
    display: inline-block; padding: 2px 8px; font-size: 0.75rem;
    border-radius: 4px; margin-right: 15px; color: #fff; font-weight: bold;
    background-color: #666;
}
.cat-UPDATE { background-color: #007bff; }
.cat-INFO { background-color: #28a745; }
.cat-MAINTENANCE { background-color: #dc3545; }
.news-link { color: var(--text-color); font-weight: 500; flex: 1; }

/* ==========================================================================
   8. ギャラリー & スライダー (Gallery)
   ========================================================================== */
.gallery-section { width: 100%; padding: 30px 0; margin-top: 50px; }
.gallery-slider { width: 100%; overflow: hidden; aspect-ratio: 1900 / 690; }
.gallery-track { display: flex; height: 100%; transition: transform 0.5s ease-in-out; }
.gallery-item { flex: 0 0 100%; min-width: 100%; height: 100%; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.gallery-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-color); }
.gallery-dots { display: flex; gap: 8px; }
.gallery-dot { width: 30px; height: 4px; background-color: var(--border-color); border: none; cursor: pointer; transition: 0.3s; }
.gallery-dot.active { background-color: var(--accent-color); }
.gallery-timer { width: 100%; height: 4px; background-color: var(--border-color); margin-top: 10px; border-radius: 2px; overflow: hidden; }
.gallery-timer-bar { width: 0%; height: 100%; background-color: var(--accent-color); }
.gallery-timer-bar.is-animating { animation: progressBarAnimation 5s linear forwards; }
@keyframes progressBarAnimation { from { width: 0%; } to { width: 100%; } }

/* イラストギャラリー（一覧） */
.illust-item {
    display: block; border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: transform 0.2s;
    aspect-ratio: 16 / 9;
}
.illust-item:hover { transform: scale(1.05); opacity: 0.9; }
.illust-item img { width: 100%; height: 100%; object-fit: cover; }

/* ライトボックス */
.lightbox-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9); display: flex; align-items: center; justify-content: center;
    z-index: 9999; opacity: 0; transition: opacity 0.3s ease; padding: 20px;
}
.lightbox-content { max-width: 90%; max-height: 90%; box-shadow: 0 0 20px rgba(0,0,0,0.5); border-radius: 4px; object-fit: contain; }
.lightbox-close {
    position: absolute; top: 20px; right: 20px; width: 50px; height: 50px;
    background-color: rgba(255, 255, 255, 0.2); border-radius: 50%; color: #fff;
    font-size: 30px; text-align: center; line-height: 50px; cursor: pointer;
    z-index: 10000; transition: background-color 0.2s;
}
.lightbox-close:hover { background-color: rgba(255, 255, 255, 0.5); }

/* ==========================================================================
   9. メンバー・クリエイター詳細 (Members & Creators)
   ========================================================================== */
/* メンバーカード */
.member-card, .grid-item {
    background: var(--base-color); border: 1px solid var(--border-color);
    border-radius: 8px; overflow: hidden; display: block; color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.member-card:hover, .grid-item:hover { transform: translateY(-5px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.member-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background-color: #eee; }
.member-info, .grid-item-content { padding: 15px; }
.member-name, .grid-item-content h3 { font-size: 1.2rem; font-weight: bold; margin: 0 0 5px 0; }
.member-position, .grid-item-content p { font-size: 0.9rem; color: #666; margin: 0; }

/* ページネーション */
.pagination-container { display: flex; justify-content: center; gap: 10px; margin: 40px 0; flex-wrap: wrap; }
.pagination-container a, .page-btn {
    display: block; padding: 8px 15px; border: 1px solid var(--border-color);
    background-color: var(--base-color); color: var(--accent-color);
    border-radius: 6px; font-weight: bold; transition: 0.2s;
}
.pagination-container a:hover, .pagination-container a.active, .page-btn:hover, .page-btn.active {
    background-color: var(--accent-color); color: #fff; border-color: var(--accent-color);
}

/* クリエイター詳細・プロフィール */
.creator-profile-layout, .profile-layout { display: flex; gap: 30px; align-items: flex-start; }
.creator-img-area, .profile-image-column { flex: 0 0 300px; }
.creator-img, .profile-img-large { width: 100%; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.creator-text-area, .profile-details-column { flex: 1; }
.creator-text-area h3 { font-size: 1.8rem; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-top: 0; margin-bottom: 10px; text-align: left; }
.creator-text-area #p-position { font-size: 1rem; font-weight: bold; color: #666; margin-bottom: 15px; text-align: left; }
.creator-text-area .text-pre-line { font-size: 1rem; line-height: 1.6; text-align: left; white-space: pre-line; }

/* Zenn風テックカード */
.tech-link-card {
    display: flex; align-items: center; gap: 15px; background-color: #f4f9ff;
    border: 1px solid #d0e3ff; border-radius: 8px; padding: 15px; margin: 20px 0;
    color: #333; transition: transform 0.2s, box-shadow 0.2s;
}
.tech-link-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); text-decoration: none; }
.tech-icon { font-size: 1.5rem; }
.tech-arrow { margin-left: auto; color: #007bff; font-weight: bold; }
body.dark-mode .tech-link-card { background-color: var(--base-color); border-color: var(--border-color); color: var(--text-color); }
body.dark-mode .tech-link-card:hover { background-color: rgba(255, 255, 255, 0.05); }

/* ==========================================================================
   10. フッター (Footer)
   ========================================================================== */
.site-footer {
    background-color: var(--footer-bg-color); color: #fff;
    padding: 30px 0; text-align: center;
}

.footer-links {
    margin-bottom: 20px;
    display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; /* 横並び設定 */
}
.footer-links a { color: #fff; }

.footer-social-icons { display: flex; justify-content: center; gap: 24px; margin-bottom: 20px; }
.footer-social-icons img { height: 40px; width: auto; opacity: 0.9; transition: 0.2s; }
.footer-social-icons img:hover { opacity: 1; transform: scale(1.1); }
.sitemap-icon img { height: 14px; opacity: 0.6; }

/* ==========================================================================
   11. レスポンシブ設定 (Mobile Settings)
   ========================================================================== */
@media (max-width: 768px) {
    html { font-size: 15px; }
    body { padding-top: 72px; }
    
    .br-pc { display: none; }
    .br-mobile { display: inline; }
    
    /* レイアウト変更 */
    .content-grid { display: flex; flex-direction: column; }
    .main-column { order: 1; }
    .sidebar-column { order: 2; }
    
    /* ヒーローエリア */
    .gallery-section { display: none; }
    .hero-fullscreen { aspect-ratio: 1 / 1.1; display: block; }
    .hero-fullscreen > .hero-background-image { display: none; }
    .hero-controls-mobile { display: block; padding: 20px 0; }
    .hero-dots { display: flex; justify-content: center; gap: 12px; }
    .hero-dot { width: 12px; height: 12px; border-radius: 50%; background-color: #ccc; border: none; }
    .hero-dot.active { background-color: var(--accent-color); }
    .hero-track-mobile { display: flex; height: 100%; transition: transform 0.5s; }
    .hero-slide-mobile { flex: 0 0 100%; width: 100%; }
    .hero-slide-mobile img { width: 100%; height: 100%; object-fit: contain; }

    /* プロフィールなど */
    .creator-profile-layout, .profile-layout { flex-direction: column; align-items: center; }
    .creator-img-area, .profile-image-column { width: 100%; max-width: 400px; margin-bottom: 20px; }
    
    /* ヘッダー */
    .site-logo img { height: 32px; margin-right: 10px; }
    .site-title { font-size: 1.1rem; }
    .menu-toggle { font-size: 0.8rem; padding: 6px 10px; }
}

@media (min-width: 769px) {
    /* PC版サイドバー追従 */
    .sidebar-column {
        position: sticky; top: 100px; height: fit-content; align-self: start;
    }
}

/* ==========================================================================
   12. ダークモード文字色パッチ (Color Patch)
   ========================================================================== */
/* 特定の箇所の文字色がダークモードで見えなくなるのを防ぐ */
body.dark-mode .site-description,
body.dark-mode .member-position,
body.dark-mode .creator-text-area #p-position,
body.dark-mode #p-position,
body.dark-mode .news-date,
body.dark-mode .grid-item-content p,
body.dark-mode .tech-text span {
    color: #cccccc !important;
}
body.dark-mode .embed-iframe { background-color: var(--base-color); border-color: var(--border-color); }
body.dark-mode .menu-container { background-color: var(--base-color); border: 1px solid var(--border-color); }

/* ==========================================================================
   15. サーバー情報ページ・技術スタック (Server Info & Tech Stack)
   ========================================================================== */
/* PC表示：横並び設定 */
.tech-layout {
    display: flex;
    align-items: center;
    gap: 30px;
}

.tech-logo-column {
    flex: 0 0 200px; /* ロゴエリアの幅を200pxに固定 */
    text-align: center;
    flex-shrink: 0;
}

.tech-description-column {
    flex: 1; /* 残りのスペースを説明文で埋める */
}

/* 画像サイズの調整 */
.tech-logo-column img {
    width: 100%;
    max-width: 150px; /* ロゴが巨大にならないように制限 */
    height: auto;
}

/* GitHubロゴなどは少し小さく表示 */
.tech-logo-column img[src*="github"] {
    width: 80px;
}

/* ダークモード時のGitHubロゴ反転（白くする） */
body.dark-mode .tech-logo-column img[src*="github"] {
    filter: invert(1);
    opacity: 0.9;
}

/* --- スマホ対応（768px以下） --- */
@media (max-width: 768px) {
    .tech-layout {
        flex-direction: column; /* 縦並びに変更 */
        text-align: center;     /* 全体を中央寄せ */
    }
    
    .tech-logo-column {
        width: 100%;
        margin-bottom: 15px; /* ロゴの下に隙間を開ける */
        flex: none;
    }

    .tech-description-column {
        width: 100%;
        text-align: left; /* 説明文は読みやすく左寄せに戻す */
    }
}