/* ================================================
   gglife攻略サイト用カスタムCSS　v27
   子テーマフォルダに「gglife-style.css」として保存
   ================================================ */

/* ====================================
   1. 基本設定・リセット
   ==================================== */
.gg-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ====================================
   2. カスタムヘッダー（投稿ページのみ表示）
   ==================================== */
.gg-custom-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 9999;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* body全体にヘッダー分の余白を追加（管理画面除外） */
body:not(.wp-admin):not(.customize-partial-edit-shortcuts-hidden) {
    padding-top: 70px !important;
}

/* モバイルでのヘッダー余白調整 */
@media (max-width: 767px) {
    body:not(.wp-admin):not(.customize-partial-edit-shortcuts-hidden) {
        padding-top: 80px !important; /* モバイルでは少し多めの余白 */
    }
}

.gg-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-family: "Noto Sans JP", Arial, sans-serif;
}

/* モバイルでのヘッダー構造変更 */
@media (max-width: 767px) {
    .gg-header-content {
        flex-direction: column;
        gap: 10px; /* 通常のモバイルでの見やすい行間 */
        align-items: stretch;
        text-align: center;
    }
    
    .gg-search-box {
        order: 2; /* 検索ボックスを2番目に */
        margin: 0;
        max-width: none;
    }
    
    .gg-nav {
        order: 3; /* ナビゲーションを3番目に */
    }
    
    .gg-nav ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px; /* 見やすい間隔 */
    }
}

.gg-logo {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

.gg-search-box {
    flex: 1;
    max-width: 400px;
    margin: 0 30px;
}

.gg-search-box input[type="search"] {
    width: 100%;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background-color: #f5f5f5;
    outline: none;
}

.gg-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.gg-nav a {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
    transition: color 0.2s;
}

.gg-nav a:hover {
    color: #2c3e50;
    background-color: #f0f0f0;
}

/* モバイルS～L（320px～425px）用ヘッダー調整 */
@media (max-width: 425px) {
    body:not(.wp-admin):not(.customize-partial-edit-shortcuts-hidden) {
        padding-top: 160px !important; /* さらに大幅に余白を増加（80px→160px、80px増加） */
    }
    
    .gg-header-content {
        padding: 8px 0; /* ヘッダーの上下余白を見やすく戻す */
        flex-direction: column;
        gap: 8px; /* 3行の間隔を見やすく戻す */
    }
    
    .gg-logo {
        font-size: 22px; /* ロゴサイズを見やすく */
        line-height: 1.2; /* 行の高さを見やすく戻す */
        margin: 0;
    }
    
    .gg-search-box {
        margin: 0;
        max-width: none;
    }
    
    .gg-search-box input[type="search"] {
        padding: 6px 12px; /* 検索ボックスを見やすく戻す */
        font-size: 14px;
        line-height: 1.3; /* 検索ボックス内を見やすく戻す */
    }
    
    .gg-nav ul {
        gap: 12px; /* ナビゲーション間隔を見やすく戻す */
        margin: 0;
        padding: 0;
    }
    
    .gg-nav a {
        font-size: 13px; /* ナビゲーションを見やすく戻す */
        padding: 4px 8px; /* ナビゲーションの余白を見やすく戻す */
        line-height: 1.3; /* ナビゲーション項目を見やすく戻す */
    }
}

/* モバイルS（320px）用の最小ヘッダー */
@media (max-width: 320px) {
    body:not(.wp-admin):not(.customize-partial-edit-shortcuts-hidden) {
        padding-top: 180px !important; /* さらに大幅に余白を増加（90px→180px、90px増加） */
    }
    
    .gg-header-content {
        padding: 6px 0; /* 見やすい上下余白 */
        gap: 6px; /* 3行の間隔を見やすく */
    }
    
    .gg-logo {
        font-size: 20px; /* ロゴサイズを見やすく */
        line-height: 1.2;
        margin: 0;
    }
    
    .gg-search-box {
        margin: 0;
    }
    
    .gg-search-box input[type="search"] {
        padding: 5px 10px; /* 見やすいパディング */
        font-size: 13px;
        line-height: 1.3;
    }
    
    .gg-nav ul {
        gap: 10px; /* 見やすいナビゲーション間隔 */
        margin: 0;
        padding: 0;
    }
    
    .gg-nav a {
        font-size: 12px; /* 見やすいフォントサイズ */
        padding: 3px 6px; /* 見やすい余白 */
        line-height: 1.3;
    }
}

/* ====================================
   3. トップページ - メインコンテンツ
   ==================================== */
.gg-main-content {
    display: grid;
    grid-template-columns: 1fr 300px; /* デフォルト：2カラム（モバイル・タブレット共通） */
    gap: 20px;
    padding: 20px 0;
    font-family: "Noto Sans JP", Arial, sans-serif;
}

.gg-left-ads {
    display: none; /* モバイル・タブレットでは非表示 */
}

.gg-center-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ====================================
   4. ヒーローセクション
   ==================================== */
.gg-hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 25px;
}

.gg-hero-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
}

.gg-hero-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

/* ====================================
   5. セクション共通スタイル
   ==================================== */
.gg-section {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.gg-section-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gg-section-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.gg-more-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.gg-more-link:hover {
    color: #2c3e50;
}

/* ====================================
   6. 注目のゲーム
   ==================================== */
.gg-featured-games {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    padding: 20px;
}

.gg-game-card {
    display: flex;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.gg-game-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.gg-game-image {
    width: 60px;
    height: 60px;
    background-color: #e9ecef;
    border-radius: 8px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    overflow: hidden;
}

.gg-game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.gg-game-info h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.gg-game-info p {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
    line-height: 1.4;
}

.gg-game-tags {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.gg-tag {
    background-color: #f0f0f0;
    color: #666;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    white-space: nowrap;
}

/* ====================================
   7. 最新攻略記事
   ==================================== */
.gg-latest-articles {
    padding: 15px 20px;
}

.gg-article-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.gg-article-item:last-child {
    border-bottom: none;
}

.gg-article-item:hover {
    background-color: #fafafa;
    margin: 12px -10px;
    padding: 12px 10px;
    border-radius: 5px;
    text-decoration: none;
    color: inherit;
}

.gg-article-image {
    width: 80px;
    height: 60px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin-right: 15px;
    flex-shrink: 0;
    overflow: hidden;
}

.gg-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.gg-article-content h4 {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
    line-height: 1.4;
}

.gg-article-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 10px;
}

/* ====================================
   8. 右サイドバー
   ==================================== */
.gg-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gg-sidebar-section {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.gg-sidebar-header {
    background-color: #2c3e50;
    color: white;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: bold;
    margin: 0;
}

.gg-sidebar-content {
    padding: 15px;
}

.gg-ranking-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.gg-ranking-item:last-child {
    border-bottom: none;
}

.gg-rank-number {
    width: 25px;
    height: 25px;
    background-color: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-right: 10px;
    color: #666;
    flex-shrink: 0;
}

.gg-rank-number.gg-top3 {
    background-color: #ffd700;
    color: white;
}

.gg-ranking-game {
    font-size: 13px;
    color: #2c3e50;
    text-decoration: none;
    line-height: 1.3;
}

.gg-ranking-game:hover {
    color: #667eea;
    text-decoration: none;
}

/* ====================================
   9. 広告スペース
   ==================================== */
.gg-ad-space {
    height: 250px;
    background-color: #f8f9fa;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    border-radius: 8px;
}

.gg-ad-vertical {
    height: 600px;
    writing-mode: vertical-lr;
}

/* ====================================
   10. カスタムフッター（投稿ページのみ表示）
   ==================================== */
.gg-custom-footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    font-family: "Noto Sans JP", Arial, sans-serif;
    clear: both;
    position: relative;
    z-index: 10;
}

/* フッターがコンテンツと重ならないように余白を追加 */
.gg-main-content {
    margin-bottom: 50px;
}

.gg-footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.gg-footer-section h4 {
    margin-bottom: 15px;
    color: #ecf0f1;
}

.gg-footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gg-footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    line-height: 1.8;
    font-size: 14px;
}

.gg-footer-section a:hover {
    color: white;
    text-decoration: none;
}

.gg-footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 20px;
    color: #bdc3c7;
    font-size: 14px;
}

/* ====================================
   11. レスポンシブデザイン
   ==================================== */

/* PC用（1024px以上）- 3カラムレイアウト */
@media (min-width: 1024px) {
    .gg-main-content {
        grid-template-columns: 200px 1fr 300px; /* 3カラム：左広告 + メイン + 右サイドバー */
    }
    
    .gg-left-ads {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
}

/* タブレット用（768px〜1023px）- 2カラムレイアウト */
@media (min-width: 768px) and (max-width: 1023px) {
    .gg-main-content {
        grid-template-columns: 1fr 300px; /* 2カラム：メイン + 右サイドバー */
    }
    
    .gg-left-ads {
        display: none;
    }
    
    /* タブレットでも2カラム維持 */
    .gg-sidebar {
        display: flex;
        flex-direction: column;
    }
}

/* モバイル用（767px以下）- 2カラムレイアウト（縦並び時も横並び維持） */
@media (max-width: 767px) {
    .gg-main-content {
        grid-template-columns: 1fr 240px !important; /* モバイルも強制的に2カラムを維持 */
        gap: 12px !important;
    }
    
    .gg-left-ads {
        display: none;
    }
    
    .gg-header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .gg-search-box {
        margin: 0;
        max-width: none;
    }
    
    .gg-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .gg-nav a {
        font-size: 14px;
        padding: 4px 8px;
    }
    
    .gg-featured-games {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px;
    }
    
    .gg-hero-title {
        font-size: 24px;
    }
    
    .gg-hero-section {
        padding: 25px 15px;
        margin-bottom: 20px;
    }
    
    .gg-game-card {
        padding: 10px;
        flex-direction: row; /* モバイルでも横並びを維持 */
    }
    
    .gg-game-image {
        width: 45px;
        height: 45px;
        margin-right: 10px;
        flex-shrink: 0;
    }
    
    .gg-game-info h3 {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    .gg-game-info p {
        font-size: 11px;
        margin-bottom: 3px;
    }
    
    .gg-tag {
        font-size: 9px;
        padding: 1px 6px;
    }
    
    .gg-section-title {
        font-size: 16px;
    }
    
    .gg-section-header {
        padding: 12px 15px;
    }
    
    .gg-article-item {
        padding: 8px 0;
        flex-direction: row; /* 記事アイテムも横並び維持 */
    }
    
    .gg-article-image {
        width: 60px;
        height: 45px;
        margin-right: 10px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .gg-article-content h4 {
        font-size: 12px;
        line-height: 1.3;
    }
    
    .gg-article-meta {
        font-size: 10px;
    }
    
    .gg-latest-articles {
        padding: 12px 15px;
    }
    
    /* サイドバーのフォントサイズを調整 */
    .gg-sidebar {
        gap: 15px;
    }
    
    .gg-sidebar-header {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .gg-sidebar-content {
        padding: 10px;
    }
    
    .gg-ranking-item {
        padding: 6px 0;
    }
    
    .gg-ranking-game {
        font-size: 10px;
        line-height: 1.2;
    }
    
    .gg-rank-number {
        width: 18px;
        height: 18px;
        font-size: 9px;
        margin-right: 6px;
    }
    
    .gg-ad-space {
        height: 150px;
        font-size: 11px;
    }
}

/* 超小画面用（400px以下）- 1カラムに変更 */
@media (max-width: 400px) {
    .gg-main-content {
        grid-template-columns: 1fr !important; /* 超小画面のみ1カラム */
        display: flex !important; /* Gridからflexに変更して順序制御 */
        flex-direction: column !important;
    }
    
    /* 表示順序の制御：注目のゲーム→最新攻略記事→人気ゲームランキング→最新更新 */
    .gg-center-column {
        order: 1; /* メインコンテンツを最初に */
    }
    
    .gg-sidebar {
        order: 2; /* サイドバーを後に */
    }
    
    .gg-hero-section {
        padding: 15px 8px;
        margin-top: 10px;
    }
    
    .gg-hero-title {
        font-size: 16px;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .gg-hero-subtitle {
        font-size: 11px;
        line-height: 1.4;
    }
}

/* モバイルS～M（320px～375px）用の表示順序とヘッダー調整 */
@media (max-width: 375px) {
    /* ヒーローセクションの調整（十分な余白があるので通常マージン） */
    .gg-hero-section {
        margin-top: 10px !important; /* 通常のマージンを復活 */
        padding: 15px 8px !important; /* 通常のパディング */
    }
    
    .gg-hero-title {
        font-size: 16px !important; /* 少し大きめに戻す */
        line-height: 1.2 !important;
        margin-bottom: 8px !important;
    }
    
    .gg-hero-subtitle {
        font-size: 12px !important; /* 読みやすいサイズに戻す */
        line-height: 1.3 !important;
    }
}

/* モバイルS（320px）用の最小画面対応 */
@media (max-width: 320px) {
    /* ヒーローセクションの調整（十分な余白があるので通常マージン） */
    .gg-hero-section {
        margin-top: 8px !important; /* 通常のマージンを復活 */
        padding: 12px 6px !important; /* 通常のパディング */
    }
    
    .gg-hero-title {
        font-size: 15px !important; /* 読みやすいサイズに戻す */
        line-height: 1.2 !important;
        margin-bottom: 6px !important;
    }
    
    .gg-hero-subtitle {
        font-size: 11px !important; /* 読みやすいサイズに戻す */
        line-height: 1.3 !important;
    }
    
    /* その他の要素も読みやすいサイズに戻す */
    .gg-section-title {
        font-size: 15px !important;
    }
    
    .gg-game-info h3 {
        font-size: 12px !important;
    }
    
    .gg-game-info p {
        font-size: 10px !important;
    }
}

/* ====================================
   12. トップへ戻るボタンと簡易メニュー
   ==================================== */

/* 右下固定ボタンエリア */
.gg-fixed-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* トップへ戻るボタン */
.gg-scroll-top {
    width: 50px;
    height: 50px;
    background-color: #2c3e50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.gg-scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.gg-scroll-top:hover {
    background-color: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* 簡易メニューボタン */
.gg-menu-button {
    width: 50px;
    height: 50px;
    background-color: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.gg-menu-button:hover {
    background-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* 簡易メニュー */
.gg-quick-menu {
    position: absolute;
    bottom: 65px;
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 10px 0;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.gg-quick-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gg-quick-menu::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.gg-quick-menu-item {
    display: block;
    padding: 8px 15px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.gg-quick-menu-item:hover {
    background-color: #f8f9fa;
    color: #2c3e50;
    text-decoration: none;
}

/* モバイル用ボタンサイズ調整 */
@media (max-width: 767px) {
    .gg-fixed-buttons {
        bottom: 15px;
        right: 15px;
    }
    
    .gg-scroll-top,
    .gg-menu-button {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .gg-quick-menu {
        min-width: 140px;
        bottom: 60px;
    }
    
    .gg-quick-menu-item {
        padding: 6px 12px;
        font-size: 13px;
    }
}
.gg-text-center {
    text-align: center;
}

.gg-mt-20 {
    margin-top: 20px;
}

.gg-mb-20 {
    margin-bottom: 20px;
}

.gg-p-20 {
    padding: 20px;
}

/* ローディング表示用 */
.gg-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.gg-loading::after {
    content: "読み込み中...";
}

/* エラー表示用 */
.gg-error {
    text-align: center;
    padding: 20px;
    color: #d63384;
    background-color: #f8d7da;
    border-radius: 5px;
    margin: 10px 0;
}

/* ====================================
   14. アニメーション
   ==================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gg-fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ====================================
   15. 管理画面用スタイル（編集しやすくするため）
   ==================================== */
.post-php .gg-meta-box {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.post-php .gg-meta-box label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.post-php .gg-meta-box input,
.post-php .gg-meta-box textarea,
.post-php .gg-meta-box select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-bottom: 10px;
}